/docs/reference/Doxyfile
/docs/reference/doxygen.log
/docs/reference/doxygen*.db
-/docs/reference/glibmm-2.4.devhelp2
-/docs/reference/glibmm-2.4.tag
+/docs/reference/glibmm-*.devhelp2
+/docs/reference/glibmm-*.tag
/docs/reference/html/
# examples/
/examples/settings/gschemas.compiled
/examples/thread/dispatcher
/examples/thread/dispatcher2
-/examples/thread/thread
-/examples/thread/threadpool
# gio/
/gio/giomm-*.pc
/glib/glibmm/shell.h
/glib/glibmm/spawn.cc
/glib/glibmm/spawn.h
-/glib/glibmm/thread.cc
-/glib/glibmm/thread.h
-/glib/glibmm/threads.cc
-/glib/glibmm/threads.h
/glib/glibmm/timezone.cc
/glib/glibmm/timezone.h
/glib/glibmm/unicode.cc
/glib/glibmm/uriutils.h
/glib/glibmm/value_basictypes.cc
/glib/glibmm/value_basictypes.h
-/glib/glibmm/valuearray.cc
-/glib/glibmm/valuearray.h
/glib/glibmm/variant.cc
/glib/glibmm/variant.h
/glib/glibmm/variant_basictypes.cc
!if "$(VALID_CFGSET)" == "TRUE"
-# We need Visual Studio 2015 or later
-!if $(VSVER) < 14
+# We need Visual Studio 2017 or later
+!if $(VSVER) < 15
VALID_MSC = FALSE
!else
VALID_MSC = TRUE
!endif
+!if $(VCVERSION) < 1915
+!message Some tests may fail to build for Visual Studio 2017 15.7 or earlier!
+!endif
+
!if "$(VALID_MSC)" == "TRUE"
# Include the Makefile portion to convert the source and header lists
!else # "$(VALID_MSC)" == "TRUE"
all:
- @echo You need Visual Studio 2015 or later.
+ @echo You need Visual Studio 2017 or later.
!endif # "$(VALID_MSC)" == "TRUE"
# For building the glibmm tests
$(CFG)\$(PLAT)\test-glibmm_base64.exe: ..\tests\glibmm_base64\main.cc $(GLIBMM_LIB)
-$(CFG)\$(PLAT)\test-glibmm_bool_arrayhandle.exe: ..\tests\glibmm_bool_arrayhandle\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_bool_vector.exe: ..\tests\glibmm_bool_vector\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_btree.exe: ..\tests\glibmm_btree\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_buildfilename.exe: ..\tests\glibmm_buildfilename\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_ustring_format.exe: ..\tests\glibmm_ustring_format\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_ustring_make_valid.exe: ..\tests\glibmm_ustring_make_valid\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_value.exe: ..\tests\glibmm_value\main.cc $(GLIBMM_LIB)
-$(CFG)\$(PLAT)\test-glibmm_valuearray.exe: ..\tests\glibmm_valuearray\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_variant.exe: ..\tests\glibmm_variant\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_base64.exe \
-$(CFG)\$(PLAT)\test-glibmm_bool_arrayhandle.exe \
$(CFG)\$(PLAT)\test-glibmm_bool_vector.exe \
$(CFG)\$(PLAT)\test-glibmm_btree.exe \
$(CFG)\$(PLAT)\test-glibmm_buildfilename.exe \
$(CFG)\$(PLAT)\test-glibmm_ustring_format.exe \
$(CFG)\$(PLAT)\test-glibmm_ustring_make_valid.exe \
$(CFG)\$(PLAT)\test-glibmm_value.exe \
-$(CFG)\$(PLAT)\test-glibmm_valuearray.exe \
$(CFG)\$(PLAT)\test-glibmm_variant.exe:
@if not exist $(CFG)\$(PLAT)\glibmm-tests $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\glibmm-tests
$(CXX) $(GLIBMM_EX_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\glibmm-tests\ $** /link $(LDFLAGS) $(GLIBMM_EX_LIBS) /out:$@
$(CFG)\$(PLAT)\test-giomm_stream_vfuncs.exe: ..\tests\giomm_stream_vfuncs\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_tls_client.exe: ..\tests\giomm_tls_client\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_interface_implementation.exe: ..\tests\glibmm_interface_implementation\main.cc $(GIOMM_LIB)
-$(CFG)\$(PLAT)\test-glibmm_null_containerhandle.exe: ..\tests\glibmm_null_containerhandle\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_null_vectorutils.exe: ..\tests\glibmm_null_vectorutils\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_vector.exe: ..\tests\glibmm_vector\main.cc $(GIOMM_LIB)
-$(CFG)\$(PLAT)\test-glibmm_weakref.exe: ..\tests\glibmm_weakref\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-giomm_asyncresult_sourceobject.exe \
$(CFG)\$(PLAT)\test-giomm_ioerror.exe \
$(CFG)\$(PLAT)\test-giomm_stream_vfuncs.exe \
$(CFG)\$(PLAT)\test-giomm_tls_client.exe \
$(CFG)\$(PLAT)\test-glibmm_interface_implementation.exe \
-$(CFG)\$(PLAT)\test-glibmm_null_containerhandle.exe \
$(CFG)\$(PLAT)\test-glibmm_null_vectorutils.exe \
-$(CFG)\$(PLAT)\test-glibmm_vector.exe \
-$(CFG)\$(PLAT)\test-glibmm_weakref.exe:
+$(CFG)\$(PLAT)\test-glibmm_vector.exe:
@if not exist $(CFG)\$(PLAT)\giomm-tests $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\giomm-tests
$(CXX) $(GIOMM_EX_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\giomm-tests\ $** /link $(LDFLAGS) $(GIOMM_EX_LIBS) /out:$@
GLIB_API_VERSION = 2.0
GLIBMM_MAJOR_VERSION = 2
-GLIBMM_MINOR_VERSION = 4
+GLIBMM_MINOR_VERSION = 58
-LIBSIGC_MAJOR_VERSION = 2
+LIBSIGC_MAJOR_VERSION = 3
LIBSIGC_MINOR_VERSION = 0
!if "$(CFG)" == "debug" || "$(CFG)" == "Debug"
GLIBMM_BASE_CFLAGS = \
/I..\glib /I.\glibmm \
- /wd4530 /EHsc \
+ /wd4530 /std:c++17 \
/FImsvc_recommended_pragmas.h
GIOMM_BASE_CFLAGS = /I..\gio /I.\giomm $(GLIBMM_BASE_CFLAGS)
GLIBMM_EX_CFLAGS = $(GLIBMM_BASE_CFLAGS) $(GLIBMM_EXTRA_INCLUDES)
GIOMM_EX_CFLAGS = $(GIOMM_BASE_CFLAGS) $(GLIBMM_EXTRA_INCLUDES)
-# We build glibmm-vc$(PDBVER)0-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll or
-# glibmm-vc$(PDBVER)0-d-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll at least
-# giomm-vc$(PDBVER)0-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll or
-# giomm-vc$(PDBVER)0-d-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll at least
+# We build glibmm-vc$(VSVER)0-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll or
+# glibmm-vc$(VSVER)0-d-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll at least
+# giomm-vc$(VSVER)0-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll or
+# giomm-vc$(VSVER)0-d-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll at least
-LIBSIGC_LIBNAME = sigc-vc$(PDBVER)0$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
+LIBSIGC_LIBNAME = sigc-vc$(VSVER)0$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
LIBSIGC_DLL = $(LIBSIGC_LIBNAME).dll
LIBSIGC_LIB = $(LIBSIGC_LIBNAME).lib
-GLIBMM_LIBNAME = glibmm-vc$(PDBVER)0$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
+GLIBMM_LIBNAME = glibmm-vc$(VSVER)0$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
GLIBMM_DLL = $(CFG)\$(PLAT)\$(GLIBMM_LIBNAME).dll
GLIBMM_LIB = $(CFG)\$(PLAT)\$(GLIBMM_LIBNAME).lib
-GIOMM_LIBNAME = giomm-vc$(PDBVER)0$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
+GIOMM_LIBNAME = giomm-vc$(VSVER)0$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
GIOMM_DLL = $(CFG)\$(PLAT)\$(GIOMM_LIBNAME).dll
GIOMM_LIB = $(CFG)\$(PLAT)\$(GIOMM_LIBNAME).lib
@echo object files and binaries for the specified configuration.
@echo.
@echo An 'install' target is supported to copy the build (DLLs, utility programs,
- @echo LIBs, along with the header files) to appropriate locations under ^$(PREFIX).
+ @echo LIBs, along with the introspection files if applicable) to appropriate
+ @echo locations under ^$(PREFIX).
@echo.
@echo A 'tests' target is supported to build the test programs.
@echo ======
-2.58.1 (stable):
-
-gmmproc:
-* _WRAP_ENUM and _WRAP_GERROR: Add gtype_func parameter
- (Kjell Ahlstedt)
-* docextract_to_xml.py: Add --exclude-file option.
- (Kjell Ahlstedt)
-
-Documentation:
-* README: Add installation instructions
- (Tapasweni Pathak) Merge request !10
-* Don’t use @retval on out args, use @param[out]
- (Daniel Boles) Merge request !6
-
-
-2.58.0 (stable):
-
-This release is identical to 2.56.1.
-
-
-2.56.1 (stable):
+2.59.1: (unstable):
+Distro packagers should probably not package this yet.
Glib:
* ustring: Fix wchar conversion on macOS with libc++
* Avoid compiler warnings from function pointer conversions
(Kjell Ahlstedt) Issue libsigcplusplus#1 (sharkcz)
(Kjell Ahlstedt) Issue libsigcplusplus#8 (db0451)
+* ustring: Simplify format() using C++17 fold expression.
+ (Daniel Boles) Merge request !4
Gio:
+* Application: Add set_option_context_parameter_string(),
+ set_option_context_summary(), set_option_context_description().
+ (Kjell Ahlstedt)
+* DesktopAppInfo: Add get_locale_string()
+ (Kjell Ahlstedt)
* SocketClient: Take copy in RefPtrs for signal args
(Daniel Boles) Issue #28 (Jens Mühlenhoff)
+* Make SignalProxy_async_callback() available to e.g. gtkmm
+ (Kjell Ahlstedt)
+
+gmmproc:
+* _WRAP_METHOD: Accept ":" in slot_callback parameter
+ (Kjell Ahlstedt)
Build:
+* Require C++17.
+ (Murray Cumming)
* Require glib-2.0 >= 2.55.1
(Kjell Ahlstedt) Issue #29 (Mart Raudsepp)
* Replace the Visual Studio project files with MSVC NMake project files
- (Chun-wei Fan) Merge request !5
+ (Chun-wei Fan) Merge request !2
+* Change the ABI to glibmm-2.60
+ (Kjell Ahlstedt)
+Documentation:
+* Use libsigc++-3.0.tag for libsigc++ documentation
+ (Kjell Ahlstedt)
-2.56.0 (stable):
-Glib:
-* Threads::Private: Fix gobj().
- (Kjell Ahlstedt) Bug #791711 (octoploid)
-* TimeoutSource: Use monotonic time consistently.
- (Kjell Ahlstedt) Bug #792524 (Dainis Jonitis)
-* Add RefPtr::get().
- (Kjell Ahlstedt) Bug #495762 (Hubert Figuiere)
+2.57.1: (unstable):
+Distro packagers should probably not package this yet.
Gio:
-* TlsClientConnection: Deprecate set/get/property_use_ssl3().
- (Kjell Ahlstedt)
-* DataInputStream: Deprecate read_until().
- (Kjell Ahlstedt)
-* Application: Add property_resource_base_path_string().
- This is a replacement for property_resource_base_path() which can't be
- fixed without breaking ABI.
- (Kjell Ahlstedt) Bug #787496 (Daniel Boles)
-* Application: Add three set_option_context_*() methods.
- (Kjell Ahlstedt)
-* DesktopAppInfo: Add get_locale_string().
+* DataOutputStream::put_string(): Don't pass std:string by value
(Kjell Ahlstedt)
-Documentation:
-* Slightly elaborate Glib::Variant<Variant> docs.
- (Daniel Boles) Bug #778219
-
-tests:
-* glibmm_variant: Don't use C++14 features when a C++11 compiler is used.
- (Kjell Ahlstedt, Jonathan Wakely) Bug #787648 (Armin K.)
-* glibmm_interface_move test: Avoid unused function warnings.
- (Murray Cumming)
-
gmmproc:
-* _WRAP_METHOD: Accept optional list of exceptions in errthrow.
- (Kjell Ahlstedt) Bug #787979 (Daniel Boles)
-* _WRAP_METHOD: Suppress the @return section in generated documentation
- if return type is void.
- (Kjell Ahlstedt) Bug #787978 (Daniel Boles)
-* Add _MEMBER_SET_STR macro, setter for strings.
+* Add _MEMBER_SET_STR() macro
(Pavlo Solntsev) Bug #793778
+Build:
+* Change the ABI to glibmm-2.58
+ (Kjell Ahlstedt)
-2.54.1 (stable):
-
-Glib:
-* Variant: Don't use std::index_sequence from C++14.
- (Kjell Ahlstedt, Jonathan Wakely) Bug #787648 (Armin K.)
-
-Documentation:
-* Note that Gio::Application::property_resource_base_path() shall not
- be used. It has a bug that's hard to fix without breaking ABI.
- (Kjell Ahlstedt) Bug #787496 (Daniel Boles)
-
-gmmproc:
-* Convert all property documentation to C++.
- (Kjell Ahlstedt) Bug #787698 (Daniel Boles)
-2.54.0 (stable):
+2.55.2: (unstable):
+Distro packagers should probably not package this yet.
Glib:
-* Added DBusObjectPathString and DBusSignatureString, for Variants with D-Bus object paths or D-Bus signatures,
- and add Variant specializations for Variant<Glib::DBusObjectPathString>,
- Variant<Glib::DBusSignatureString> and Variant<std::vector<Glib::DBusObjectPathString>>.
- (Kjell Ahlstedt) Bug #785700
-* Variant: Add template specialization for std::tuple.
- (Alexander Rössler) Bug #777791
+* IOCondition: Add an IO_ prefix to the enumerator names
+ (Kjell Ahlstedt)
+* TimeoutSource: Use monotonic time consistently
+ (Kjell Ahlstedt) Bug #792524 (Dainis Jonitis)
+* Source: Remove get_current_time().
+ (Kjell Ahlstedt)
+* KeyFile, OptionContext, Regex: Add exception specs to errthrow.
+ (Kjell Ahlstedt)
+* ustring:
+ - Replace 8×format() with 1 variadic template.
+ - Replace 9×compose() with 1 variadic template.
+ - Use std::initializer_list instead of pointer + size
+ (Daniel Boles) Bug #784211
+* VariantBase:
+ - Add operator==() and operator!=().
+ (Kjell Ahlstedt) Bug #789330 (Daniel Boles)
+ - cast_dynamic(): Remove noexcept(false).
+ (Kjell Ahlstedt)
-Gio:
-* ActionGroup: Add optional action_name parameters to some signals.
+Glib::Gio:
+* AppInfo: Update the name of the AppLaunchContext parameters
+ (Kjell Ahlstedt)
+* Action: Add exception specs to errthrow.
+ (Kjell Ahlstedt)
+* Application: Fix property_resource_base_path()'s type
+ (Kjell Ahlstedt)
+* Credentials, et al.: Add exception specs to errthrow.
+ (Kjell Ahlstedt)
+* DataInputStream:
+ - Remove read_until*().
+ - Fix the documentation of read_line_utf8().
(Kjell Ahlstedt)
-* Settings: Add optional key parameter to the writable_changed signal.
+* InetSocketAddress, ProxyAddress: No guint16 in _WRAP_PROPERTY().
+ (Kjell Ahlstedt)
+* Settings: set_int() and friends shall return bool.
+ (Kjell Ahlstedt) Bug #784211
+* TlsClientConnection: Remove get/set/property_use_ssl3().
(Kjell Ahlstedt)
gmmproc:
-* Write signal flags to generated documentation
- (Kjell Ahlstedt) Bug #785895 (Daniel Boles)
-* Write default values of properties to generated documentation
+* Warn if parameter lists are not compatible
+ (Kjell Ahlstedt)
+* _WRAP_METHOD: Accept optional list of exceptions in errthrow
+ (Kjell Ahlstedt)
+* _WRAP_METHOD_DOCS_ONLY: Optionally suppress @return section.
+ (Kjell Ahlstedt) Bug #787978
+* docextract_to_xml.py: Add --exclude-file option.
+ (Kjell Ahlstedt)
+* Suppress the @return section if return type is void.
+ (Kjell Ahlstedt)
+* generate_extra_defs.cc:
+ - Write signal flags to .defs files.
+ - Write default values of properties to .defs files.
+ - Write default values of properties to generated documentation.
(Kjell Ahlstedt) Bug #785895 (Daniel Boles)
* Warn for unmatched deprecations in signals and properties.
(Kjell Ahlstedt)
-* Accept curly braces in default values in _WRAP macros.
- (Kjell Ahlstedt) Bug #783216 comment #13 (Daniel Boles)
-* Fix _WRAP_ENUM for enumerators with apostrophes.
+
+Documentation:
+* Glib::ObjectBase: Don't mention GtkObject in comments.
(Kjell Ahlstedt)
-* Add new elements types for the docs_override:
- substitute_type_name and substitute_enumerator_name.
- (Kjell Ahlstedt) Bug #86864
+* Glib::Variant: Hide namespace Glib::detail from Doxygen
+ (Kjell Ahlstedt) Bug #787698 (Daniel Boles)
+* Glib::Variant: Slightly elaborate Variant<Variant> docs.
+ (Daniel Boles) Bug #778219 (Daniel Boles)
-2.52.1 (stable):
+2.55.1: (unstable):
+Distro packagers should probably not package this yet.
+
+Glib:
+* Object: Value_Pointer class should take only one template argument.
+ (Marcin Kolny)
+* Variant: Improved support for D-Bus object paths and signatures.
+ (Kjell Ahlstedt) Bug #785700 (Johannes Dohmen)
+* Glib::Value_Flags<>: static_cast to correct type.
+ (Kjell Ahlstedt)
Gio:
-* TlsDatabase: Fix memory leak in a vfunc.
+* Derive all interfaces directly from Glib::Interface
+ (Kjell Ahltedt) Bug #776537
+* Application: OptionType: Make this an enum class.
+ (Kjell Ahlstedt)
+* BufferedInputStream, BufferedOutputStream, DataOutputStream:
+ Implement Seekable.
+* CharsetConverter: Implement the Gio::Initable interface.
+ and call Initable::init() from CharsetConverter's constructor.
+ (Kjell Ahlstedt) Bug #776537
+* Add FileDescriptorBased interface and make GUnixInputStream and
+ GUnixOutputStream implement it.
+* MemoryInputStream, UnixInputStream: Implement PollableInputStream.
+ (Kjell Ahlstedt)
+* MemoryOutputStream, UnixOutputStream: Implement PollableOutputStream.
+ (Kjell Ahlstedt)
+* TlsDatabase: create_certificate_handle_vfunc():
+ Fix memory leak, and correctly return nulltpr.
(Kjell Ahlstedt) Bug #783360
-Documentation:
-* Update docs of get_*_name().
- (Daniel Boles)
+gmmproc:
+* Accept curly braces in default values in _WRAP macros
+ (Khell Ahlstedt) Bug #783216 comment 13
+* Don't accept unpaired double quotes.
+ (Khell Ahlstedt)
+* gmmproc: Fix _WRAP_ENUM for enumerators with apostrophes.
+ (Khell Ahlstedt)
+* gmmproc, _WRAP_ENUM: Add optional CONV_TO_INT parameter.
+ (Khell Ahlstedt)
Build:
-* MacOS: Really correct build without gdesktopinfo.
+* Change the ABI to glibmm-2.56.
+ (Murray Cumming)
+* Really exclude DesktopAppInfo from wrap_init.cc on MacOS.
(Kjell Ahlstedt) Bug #781947
-2.52.0 (stable):
+Documentation:
+* miscutils: Update docs of get_*_name() from GLib.
+ (Daniel Boles)
+* Fix documentation of enum Glib::IOCondition.
+ (Khell Ahlstedt)
+
+
+2.53.2 (unstable):
+Distro packagers should probably not package this yet.
+
+Glib:
+* ConstructParams: Do not increment allocation size twice
+ (Daniel Elstner)
Gio:
-* UnixSocketAddress::create(): Remove the default value for the type
- parameter to avoid ambiguity.
+* ActionMap: Really fix add_action_with_parameter().
+ (Daniel Boles) Bug 774444#c31
+* UnixSocketAddress::create(): Remove a default value to avoid ambiguity.
(Kjell Ahlstedt) Bug #782592
Gio::DBus
* Proxy: Wrap call() and call_sync() methods.
(Vyacheslav Yurkov) Bug #781818
+gmmproc:
+* Use of static_cast<> instead of C-style casts.
+ (Murray Cumming)
+
+Build:
+* Fix the build on MacOS, where glib doesn't have gdesktopinfo.
+ (John Ralls) Bug #781947
+* Really use desktopappinfo.hg to fix the build.
+ (Murray Cumming)
+
Documentation:
-* RefPtr: Clarify comment about undefined behaviour.
+* Glib, Gio: Update documentation of in-class enums.
+ (Kjell Ahlstedt)
+* ActionMap: Improve add_action_with_parameter docs
(Daniel Boles)
-2.51.7 (unstable):
+
+2.53.1.1 (unstable):
Glib:
-* SettingsSchemaKey: Add missing value/range methods.
- (Daniel Boles) Bug #774903
-* Variant: Replace throw(std::bad_cast) with noexcept(false),
- to fix the build with C++17.
- See https://bugzilla.redhat.com/show_bug.cgi?id=1438766
+* Use C++11 enum classes instead of old-style enums, and put many enums
+ inside relevant class declarations:
+ - Glib::NodeTree: Move enums into class.
+ - Glib::BindingFlags is now Glib::Binding::Flags.
+ - Glib::KeyfileFlags is now Glib::Keyfile::Flags.
+ - Glib::ModuleFlags is now Glib::Module::Flags.
+ - Glib::ChecksumType is now Glib::Checksum::Type.
+ - Glib::Regex: Move enums inside class.
+ - Glib::Resource: Move enums into class.
+ (Murray Cumming, Kjell Ahlstedt)
+* RefPtr: Make this an alias for std::shared_ptr<> instead.
+ - Use std::dynamic_pointer_cast<>() instead of RefPtr<>::cast_dynamic().
+ - Use std::static_pointer_cast<>() instead of RefPtr<>::cast_static().
+ - Use std::const_pointer_cast<>() instead of RefPtr<>::cast_const().
+ - When creating RefPtr directly, instead of using create() methods,
+ use Glib::make_refptr_for_instance() so the std::shared_ptr<> has the
+ necessary Deleter.
+ (Murray Cumming) Bug #755037
+* Remove Glib::WeakRef. Use std::weak_ref<> instead.
+ (Murray Cumming) Bug #755037
+* Object: Use g_object_new_with_properties() instead of (deprecated)
+ g_object_newv() and (deprecated) GParameter.
+ (Murray Cumming)
+* IOChannel: Avoid creating a RefPtr to this.
+ (Murray Cumming) Bug #755037
+* SignalProxy:
+ connect(): Signals with non-void return values now have no default value
+ for the "after" parameter, forcing application developers to think about
+ whether they should connect before or after already-connected signal
+ handlers, and default signal handlers. This is awkward but necessary.
+ Just provide "true" to get the previous behaviour, or use connect_notify().
+ connect_notify(): Signals with void return values have no connect_notify(),
+ because it is not useful with those signals.
+ (Kjell Ahlstedt) Bug #126213.
+
+Gio:
+* Use C++11 enum classes instead of old-style enums, and put many enums
+ inside relevant class declarations:
+ - Gio::Drive: Move enums into class.
+ - Gio::TlsDatabase: Move enums into class.
+ - Gio::UnixSocketAddressType is now Gio::UnixSocketAddress::Type.
+ - Gio::Mount: Move enums into class.
+ - Gio::TlsPasswordFlags is now Gio::TlsPassword::Flags.
+ - Gio::IOStreamSpliceFlags is now Gio::IOStream::SpliceFlags.
+ - Gio::SettingsBindFlags is now Gio::Settings::BindFlags.
+ - Gio::ResolverRecordType is now Gio::Resolver::RecordType.
+ - Gio::Socket: Move enums into class.
+ - Gio::File: Move some flags enums into the class.
+ - Gio::OutputStreamSpliceFlags is now Gio::OuputStream::SpliceFlags.
+ - Gio::CredentialsType is now Gio::Credentials::Type.
+ - Gio::NotificationPriority is now Gio::Notification::Priority.
+ - Gio::FileMonitorEvent is now Gio::FileMonitor::Event.
+ - Gio::FileAttributeInfoFlags is now Gio::FileAttributeInfo::Flags.
+ - Gio::EmblemOrigin is now Gio::Emblem::Origin.
+ - Gio::Converter: Put enums inside class.
+ - Gio::ConverterFlags is now Gio::Converter::Flags.
+ - Gio::ConverterResult is now Gio::Converter::Result.
+ - Gio::AppInfoCreateFlags is now Gio::AppInfo::CreateFlags.
+ - Gio::ApplicationFlags is now Gio::Application::Flags.
+ (Murray Cumming, Kjell Ahlstedt)
+* Remove duplicate ErrorEnum declaration.
+ (Kjell Ahlstedt)
+* ConstructParams:
+ - Remove (hopefully really unnecessary) copy constructor.
+ - C++11: =delete the operator=, instead of making it private.
+ (Murray Cumming)
+* Value:
+ - Remove the CType alias, which should be unnecessary.
+ - value_custom: Replace a template parameter with C++11 type traits.
+ - Value<RefPtr<T>>: Only use this specialization if T has get_base_type().
+ (Murray Cumming) Bug #755037
+* Variant:
+ - operator bool(): Simplify to avoid clang++ warnings.
+ - C++11: Variant: Replace throw(std::bad_cast) with noexcept(false).
+ See https://bugzilla.redhat.com/show_bug.cgi?id=1438766
(Murray Cumming)
-* VariantType: Deprecate first() and next(). Add get_item_types()
- (Kjell Ahlstedt) Bug #775741
+* Socket: Avoid creating a RefPtr to this.
+ (Murray Cumming) Bug #755037
+
+Gio:DBus:
+* Use C++11 enum classes instead of old-style enums, and put many enums
+ inside relevant class declarations:
+ - Gio::DBus::InterfaceSkeletonFlags is now Gio::DBus::InterfaceSkeleton::Flags.
+ - Gio::DBus::ServerFlags is now Gio::DBus::Server::Flags.
+ (Murray Cumming, Kjell Ahlstedt)
+
+gmmproc:
+* _WRAP_ENUM(): Generate C++ enum classes instead of enums, and let the enums
+ be inside class declarations.
+ (Kjell Ahlstedt) Bug #86864
+
+Build
+* Windows: Visual Studio builds: Update ABI version
+ (Chun-wei Fan)
+
+
+2.53.1 (unstable):
+
+Glib:
+* OptionGroup:
+ - Don't allow copy or move.
+ - Remove the OptionGroup& parameter in on_pre_parse(), on_post_parse() and
+ on_error().
+ (Kjell Ahlstedt)
+* IOChannel, StreamIOChannel: Remove deprecated parts.
+ (Kjell Ahlstedt)
+* ustring: Add make_valid().
+ (Krzysztof Piecuch) Bug #780075
+* Remove (unused) Sequence and sequence().
+ (Murray Cumming)
+* Remove ListHandle, SListHandle, ArrayHandle, SArrayHandle, and
+ StringArrayHandle, replacing them with std::vector in API.
+ (Murray Cumming)
+
+gmmproc:
+* _WRAP_METHOD(): Some more use of auto in generated code.
+ (Murray Cumming)
+
+Build:
+* Change the ABI to glibmm-2.54.
+ (Murray Cumming)
+* Add some #include directives.
+ (Kjell Ahlstedt)
+* Visual Studio: Require Visual Studio 2017 and update the glibmm project.
+ (Chu-wei Fan)
+
+
+2.51.5
Gio:
-* ActionMap: Add add_action_with_parameter() that takes a parameter type,
- and deprecated the existing method, because it cannot work.
- (Daniel Boles) Bug #774444
+* Application: get_default(): Correct the reference counting.
+ (KJell Ahlstedt) Bug #779936 (James Legg)
+* Add PropertyAction.
+ (Kjell Ahlstedt)
+
+Glib:
+* Remove Glib::unconst() because it is unused and unnecessary.
+ (Kjell Ahlstedt)
+* Variant: Add template specialization for std::tuple,
+ and a test.
+ (Alexander Rössler, Kjell Ahlstedt) Bug #777791
+
+
+2.51.2 (unstable):
+Distro packagers should probably not package this yet.
+
+Glib:
+* Object construction: Add custom class init and instance init functions
+ An extra class init function is useful in Gtk::WidgetCustomDraw and
+ Gtk::WidgetCustomSnapshot.
+ (Kjell Ahlstedt) Bug #775348
+
+Gio:
+* Action: #include <glibmm/variant.h>, for convenience.
+ (Daniel Boles) Bug #777953
* SimpleAction: Make set_state() public.
(Daniel Boles) Bug #777953
-Build:
-* MacOS: Correct build without gdesktopinfo.
- (John Ralls) Bug #781947
-* Glib::Object: Suppress deprecation warning for g_object_newv() with glib 2.54.
+Documentation:
+* Glib::Variant: Explain how to create "maybe" type.
+ (Daniel Boles) Bug #778219
+
+
+2.51.1.2 (unstable):
+Distro packagers should probably not package this yet.
+
+Glib:
+* Remove some deprecated API
(Kjell Ahlstedt)
+* Variant: Remove the string specializations of cast_dynamic.
+ (Kjell Ahlstedt)
+* Glib::VariantType: Add get_item_types(), removing first() and
+ next().
+ (Kjell Ahlstedt) Bug #775741
-2.51.6 (unstable):
+Gio:
+* init(): Set the global locale.
+ (Kjell Ahlstedt) Bug #661588
+* ActionBase: get_state_hint_variant() now returns VariantContainerBase.
+ (Kjell Ahlstedt)
+* ActionMap: add_action_with_parameter(): Register the parameter type,
+ to make this work.
+ (Daniel Boles) Bug #774444
+* ActionResult: Add is_tagged_vfunc().
+ (Kjell Ahlstedt)
+* Glib::Dispatcher: Implement the pimpl idiom
+ (Kjell Ahlstedt) Bug #651942
+* File, FileInfo, FileIOStream, FileOutputStream: Use Glib::ustring for
+ (UTF-8) file attributes of string type.
+ (Kjell Ahlstedt) Bug #615950
+* NetworkMonitor: Derive from Gio::Initable.
+ (Kjell Ahlstedt)
+* RemoteActionGroup: Rename some vfuncs to add _full().
+ (Murray Cumming)
-This is version 2.51.6 of glibmm-2.24. Ignore versions 2.51.1 to 2.51.5 of
-unstable glibmm-2.52. Unstable glibmm-2.52 is now unstable glibmm-2.54,
-leaving the 2.51/52 version numbers again for use by stable glibmm-2.52.
+Documentation:
+* ActionMap:
+ - ActivateSlot: Mention add_action_bool().
+ - ActivateWithParameterSlot: Be more specific.
+ (Daniel Boles) Bug #774444
+
+Build:
+* Update the Visual Studio project files.
+ (Chun-wei Fan)
+* Some minor cppcheck fixes.
+ (Murray Cumming)
+
+
+2.51.1.1 (unstable):
+
+General:
+* Remove no_default_handler in some _WRAP_SIGNAL()s
+ This allows application developers to simply override
+ the default on_*() signal handlers for these signals too,
+ as they can already with most other signals.
+ If you are using, for instance, the -Wsuggest-override
+ compiler option, watch out for new compiler warnings suggesting
+ that your existing signal handler should now be marked with the
+ override keyword - that means you should do so but you should
+ also stop connecting the signal handler in your code.
+ (Kjell Ahlstedt)
+* Build: examples/Makefile.am: Re-insert the dispatcher examples
+ (Kjell Ahlstedt)
Glib:
-* Dispatcher:
- - autodeduce the type of the fd field.
- (Marcin Kolny) Bug #772074
- - Don't cast a HANDLE to an int on Windows.
+* Dispatcher: Don't cast a HANDLE to an int on Windows.
(Kjell Ahlstedt) Bug #772074
-* ustring: Add cbegin() and cend().
- (Murray Cumming)
+* ObjectBase:
+ - Remove connect_property_changed_with_return()
+ and let connect_property_changed() return a sigc::connection.
+ (Kjell Ahlstedt)
+ - Use std::forward_list for interface class pointers.
+ (Kjell Ahlstedt)
+ - Replace extra_object_base_data map by instance data.
+ (Kjell Ahlstedt)
+* ObjectBase: overload get_property().
+ (Marcin Kolny)
+* Main, IOSource: autodeduce type of fd field.
+ (Marcin Kolny) Bug #770274
+* Settings: Add property_settings_schema(), and update
+ signal_changed().
+ (Kjell Ahlstedt)
+* Settings: Make set_enum() + set_flags() usable
+ (djb) Bug #774647
+* SettingsSchemaKey: Add missing value/range methods
+ (Daniel Boles) Bug #774903
+* SignalProxyNormal: Remove connect_() and connect_notify_(),
+ adding connect_impl().
+ (Kjell Ahlstedt)
+* Rename SignalProxyDetailed to SignalProxyDetailedBase, and
+ SignalProxyDetailedAnyType to SignalProxyDetailed.
+ Remove SignalProxyDetailed# aliases (# = 0..6).
+ (Kjell Ahlstedt)
+* Source: Replace extra_source_data by instance data.
+ (Kjell Ahlstedt) Bug #561885
Gio:
-* Action: Include variant.h in the heaer.
- (Daniel Boles) Bug #777953
-* Application: get_default(): Correct the reference counting.
- (Kjell Ahlstedt) Bug #779936
-* Settings:
- - Really add set_enum() and set_flags().
- (djb) Bug #774647
- - Writable-change-event signal: Correct the type of the key parameter.
- (Marcin Kolny) Bug #773977
-* SettingsSchemaSource: get_default(): Correct the refcounting.
- (Marcin Kolny) Bug #774593
+* ActionMap::add_action_vfunc(): Const correction.
+ (Murray Cumming)
+* Application: Add dbus_register/unregister_vfunc.
+ (Ritesh Khadgaray, Kjell Ahlstedt) Bug #762191
+* Menu: insert/prepend/add_item(): Const correction.
+ (Murray Cumming)
+* MenuAttributeIter: get_value(): Const correction.
+ (Murray Cumming)
+* MenuModel: get_item_atribute(): const correction.
+ (Murray Cumming)
+* RemoteActionGroup: Derive from Gio::ActionGroup.
+ (Murray Cumming)
-Gio::DBus:
+Gio::Dbus:
* Proxy: Fix memory leak in get_cached_property_names().
(Kjell Ahlstedt) Bug #775210
+* Proxy: Derive from (and implement) Gio::DBus::Interface.
+ (Murray Cumming)
-Documentation:
-* Glib::Variant: Improve documentation of maybe types.
- (Daniel Boles) Bug #778219
-* Gio::ActionMap: Clarify doc of ActivateWithParameterSlot
- (Daniel Boles)
+
+2.51.1 (unstable):
+
+This is the first release of the glibmm-2.52 API/ABI.
+It installs in parallel with the gtkmm-2.4 API/ABI, of which
+the most recent version is glibmm 2.50. We know that is a bit
+confusing. We are taking the opportunity to do this glibmm ABI
+break while GTK+ (and therefore gtkmm) is also doing an ABI
+break. But we cannot call this glibmm-3.0 because there is no
+glib 3.0.
Build:
-* Visual Studio builds: "Install" the .pdb files
- (Chun-wei Fan)
+* Require C++14.
+ (Murray Cumming)
+* Use libsigc++-3.0 instead of libsigc++-2.0.
+ https://www.murrayc.com/permalink/2016/03/07/libsigc-3-0-very-variadic/
+ (Murray Cumming)
+* Remove lots of deprecated API.
+ (Kjell Ahlstedt)
+
+Gio:
+* BufferedInputStream, InputStream, OutputStream: Add vfuncs,
+ allowing implementation in C++.
+ (Krzysztof Kosiński, Kjell Ahlstedt) Bug #572471
+* SettingsSchemaSource::get_default(): Correct the reference count.
+ (Marcin Kolny) Bug #774593
+* Settings: Fix type of 'key' parameter of writable-change-event signal
+ (Marcin Kolny) Bug #773977
+
+Glib:
+* ustring: Add cbegin() and cend().
2.50.0:
* Remove DocsParser::non_object_method_name()
(Kjell Ahlstedt)
* swap() implementations: Use std::swap().
- (Murray Cumming <murrayc@murrayc.com>
+ (Murray Cumming)
Documentation:
* Gio::SocketService: Update the class documentation
This is glibmm, a C++ API for parts of glib that are useful for C++.
See http://www.gtkmm.org
-Installation Procedure
-----------------------
-
-$ tar xf glibmm-@GLIBMM_VERSION@.tar.gz
-$ cd glibmm-@GLIBMM_VERSION@
-$ ./configure --prefix=/some_directory
-$ make
-$ make install
-Building glibmm on Win32
-===========================
-
-Currently, both the mingw (native win32) gcc compiler and MS Visual
-Studio 2015 and later are supported. glibmm can be built with
-mingw32-gcc using the gnu autotools (automake, autoconf, libtool).
-As explicitly stated in the gtk+ for win32 distribution
-(http://www.gimp.org/win32/), the gcc compiler provided by the cygwin
-distribution should not be used to build glib/glibmm libraries and/or
-applications (see the README.win32 that comes with the gtk+ DLLs).
-This MIGHT cause conflicts between the cygwin and msvcrt runtime
-environments.
-
-1. Mingw
-
-The mingw distribution which has been tested with this release is the
-following :
-
-* MinGW-4.1 as the base distribution.
-
-The bare mingw distribution does not provide the necessary tools (sh, perl, m4
-, autoconf, automake, ..) to run the provided configure script "as is". One
-(currently non supported) solution is to use mingw in conjunction with msys,
-which is readily available on the mingw website (http://www.mingw.org/).
-
-The preferred method is to combine the cygwin distribution (for the unix tools
-that were mentioned above) with mingw by making sure that the mingw
-tools (gcc, ld, dlltool, ..) are called first.
-
-First, make sure that you have working distribution of the native port
-of both libsigc++-2.10.x and glib-2.0 on win32 (see
-http://www.gimp.org/win32). If you can't compile a simple glib example
-using gcc and `pkg-config --cflags --libs`, you should not even think
-about trying to compile glibmm, let alone using precompiled libglibmm
-DLLs to port your glibmm application !
-
-The configure script can then be called using (as an example) the
-following options
-
-./configure --prefix=/target --build=i386-pc-mingw32 --disable-static
-
-then
-
-make
-make check
-make install
-
-2. MS Visual Studio 2015
-
-In a Visual Studio command prompt, navigate to the MSVC_NMake directory.
-Run 'nmake /f Makefile.vc CFG=[release|debug]' to build the glibmm and
-giomm DLLs, along with their example programs. If a prefix other than
-$(srcroot)\..\vs$(VSVER)\$(Platform) is desired, pass in PREFIX=$(your_prefix)
-in the NMake command line. In order to build the giomm settings example
-program, the glib-compile-schemas needs to reside in $(PREFIX)\bin, or
-it must be specified via passing in GLIB_COMPILE_SCHEMAS.
-
-Note that $(VSVER) refers to 14 for Visual Studio 2015 and 15 for Visual
-Studio 2017.
-
-A 'tests' target will build the test programs for glibmm and giomm, an
-'install' target is provided to copy the built DLLs and LIBs, along with
-with the public headers to appropriate subdirs of $(PREFIX). A 'clean'
-target is also provided to remove all the built files.
-
-3. Glibmm methods and signals not available on win32
-
-All glibmm methods and signals are available on win32.
-
+Building glibmm on Win32\r
+===========================\r
+\r
+Currently, both the mingw (native win32) gcc compiler and MS Visual\r
+Studio 2017 and later are supported. glibmm can be built with\r
+mingw32-gcc using the gnu autotools (automake, autoconf, libtool).\r
+As explicitly stated in the gtk+ for win32 distribution\r
+(http://www.gimp.org/win32/), the gcc compiler provided by the cygwin\r
+distribution should not be used to build glib/glibmm libraries and/or\r
+applications (see the README.win32 that comes with the gtk+ DLLs).\r
+This MIGHT cause conflicts between the cygwin and msvcrt runtime\r
+environments.\r
+\r
+1. Mingw\r
+\r
+The mingw distribution which has been tested with this release is the\r
+following :\r
+\r
+* MinGW-4.1 as the base distribution.\r
+\r
+The bare mingw distribution does not provide the necessary tools (sh, perl, m4\r
+, autoconf, automake, ..) to run the provided configure script "as is". One\r
+(currently non supported) solution is to use mingw in conjunction with msys,\r
+which is readily available on the mingw website (http://www.mingw.org/).\r
+\r
+The preferred method is to combine the cygwin distribution (for the unix tools\r
+that were mentioned above) with mingw by making sure that the mingw\r
+tools (gcc, ld, dlltool, ..) are called first.\r
+\r
+First, make sure that you have working distribution of the native port\r
+of both libsigc++-3.0.x and glib-2.0 on win32 (see\r
+http://www.gimp.org/win32). If you can't compile a simple glib example\r
+using gcc and `pkg-config --cflags --libs`, you should not even think\r
+about trying to compile glibmm, let alone using precompiled libglibmm\r
+DLLs to port your glibmm application !\r
+\r
+The configure script can then be called using (as an example) the\r
+following options\r
+\r
+./configure --prefix=/target --build=i386-pc-mingw32 --disable-static\r
+\r
+then\r
+\r
+make\r
+make check\r
+make install\r
+\r
+2. MS Visual Studio 2017\r
+\r
+In a Visual Studio command prompt, navigate to the MSVC_NMake directory.\r
+Run 'nmake /f Makefile.vc CFG=[release|debug]' to build the glibmm and\r
+giomm DLLs, along with their example programs. If a prefix other than\r
+$(srcroot)\..\vs15\$(Platform) is desired, pass in PREFIX=$(your_prefix)\r
+in the NMake command line. In order to build the giomm settings example\r
+program, the glib-compile-schemas needs to reside in $(PREFIX)\bin, or\r
+it must be specified via passing in GLIB_COMPILE_SCHEMAS.\r
+\r
+A 'tests' target will build the test programs for glibmm and giomm, an\r
+'install' target is provided to copy the built DLLs and LIBs, along with\r
+with the public headers to appropriate subdirs of $(PREFIX). A 'clean'\r
+target is also provided to remove all the built files.\r
+\r
+3. Glibmm methods and signals not available on win32\r
+\r
+All glibmm methods and signals are available on win32.\r
+\r
## 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.58.1],
+AC_INIT([glibmm], [2.59.1],
[https://gitlab.gnome.org/GNOME/glibmm/issues],
[glibmm], [http://www.gtkmm.org/])
AC_PREREQ([2.59])
AM_MAINTAINER_MODE
AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
-MM_PREREQ([0.9.10])
-MM_INIT_MODULE([glibmm-2.4])
-MM_INIT_MODULE([giomm-2.4])
+MM_PREREQ([0.9.12])
+MM_INIT_MODULE([glibmm-2.60])
+MM_INIT_MODULE([giomm-2.60])
# Copy the mm-common .pl scripts into docs/,
# and use them from there,
AC_SUBST([LIBGLIBMM_SO_VERSION], [4:0:3])
AC_PROG_CXX
-MM_AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
+MM_AX_CXX_COMPILE_STDCXX([17], [noext],[mandatory])
AC_DISABLE_STATIC
LT_INIT([win32-dll])
glibreq='2.0 >= 2.55.1'
-GLIBMM_MODULES="sigc++-2.0 >= 2.9.1 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
+GLIBMM_MODULES="sigc++-3.0 >= 2.99.5 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
test "x$glibmm_host_windows" = xyes || GIOMM_MODULES="$GIOMM_MODULES gio-unix-$glibreq"
MM_ARG_ENABLE_DOCUMENTATION
MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
-MM_ARG_WITH_TAGFILE_DOC([libsigc++-2.0.tag], [sigc++-2.0])
+MM_ARG_WITH_TAGFILE_DOC([libsigc++-3.0.tag], [sigc++-3.0])
# Check whether --enable-debug-refcounting was given.
GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING
web_host = gtkmm.org
-web_path_gtkmm = /home/murrayc/gtkmm.org/docs/glibmm-2.4/
-#web_path_gtkmm = /home/groups/g/gt/gtkmm/htdocs/docs/glibmm-2.4/
+web_path_gtkmm = /home/murrayc/gtkmm.org/docs/glibmm-2.60/
+#web_path_gtkmm = /home/groups/g/gt/gtkmm/htdocs/docs/glibmm-2.60/
web_path_docs = $(web_path_gtkmm)docs/
rsync_args = -vz --rsh ssh
-gtkmm_docdir = $(datadir)/doc/glibmm-2.4/docs
+gtkmm_docdir = $(datadir)/doc/glibmm-2.60/docs
options/example \
properties/example \
regex/example \
- settings/settings \
- thread/dispatcher \
- thread/dispatcher2 \
- thread/thread \
- thread/threadpool
+ settings/settings \
+ thread/dispatcher \
+ thread/dispatcher2
glibmm_includes = -I$(top_builddir)/glib $(if $(srcdir:.=),-I$(top_srcdir)/glib)
giomm_includes = -I$(top_builddir)/gio $(if $(srcdir:.=),-I$(top_srcdir)/gio)
LDADD = $(GLIBMM_LIBS) $(local_libglibmm)
giomm_ldadd = $(GIOMM_LIBS) $(local_libglibmm) $(local_libgiomm)
-thread_ldadd = $(GLIBMM_LIBS) $(local_libglibmm)
child_watch_child_watch_SOURCES = child_watch/main.cc
iochannel_stream_example_SOURCES = \
regex_example_SOURCES = regex/main.cc
thread_dispatcher_SOURCES = thread/dispatcher.cc
-thread_dispatcher_LDADD = $(thread_ldadd)
thread_dispatcher2_SOURCES = thread/dispatcher2.cc
-thread_dispatcher2_LDADD = $(thread_ldadd)
-thread_thread_SOURCES = thread/thread.cc
-thread_thread_LDADD = $(thread_ldadd)
-thread_threadpool_SOURCES = thread/threadpool.cc
-thread_threadpool_LDADD = $(thread_ldadd)
# giomm examples
dbus_session_bus_service_SOURCES = dbus/session_bus_service.cc
class ChildWatch : public sigc::trackable
{
public:
- ChildWatch(const Glib::RefPtr<Glib::MainLoop>& mainLoop) : m_mainLoop(mainLoop) {}
+ explicit ChildWatch(const Glib::RefPtr<Glib::MainLoop>& mainLoop) : m_mainLoop(mainLoop) {}
void on_child_exited(GPid pid, int status);
void run(); // fork a child and call signal_child_watch
loop = Glib::MainLoop::create();
// Get the user session bus connection.
- auto connection = Gio::DBus::Connection::get_sync(Gio::DBus::BUS_TYPE_SESSION);
+ auto connection = Gio::DBus::Connection::get_sync(Gio::DBus::BusType::SESSION);
// Check for an unavailable connection.
if (!connection)
std::cout << "Client connected." << std::endl
<< "Peer credentials: " << credentials_str << std::endl
<< "Negotiated capabilities: unix-fd-passing="
- << (connection->get_capabilities() & Gio::DBus::CAPABILITY_FLAGS_UNIX_FD_PASSING)
+ << ((connection->get_capabilities() & Gio::DBus::CapabilityFlags::UNIX_FD_PASSING)
+ == Gio::DBus::CapabilityFlags::UNIX_FD_PASSING)
<< std::endl;
// If there is already an active connection, do not accept this new one.
std::cout << "Server is listening at: " << server->get_client_address() << "." << std::endl;
- server->signal_new_connection().connect(sigc::ptr_fun(&on_server_new_connection));
+ server->signal_new_connection().connect(sigc::ptr_fun(&on_server_new_connection), false);
// Keep the server running until the process is killed:
auto loop = Glib::MainLoop::create();
return 1;
}
- const auto id = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION, "org.glibmm.DBusExample",
+ const auto id = Gio::DBus::own_name(Gio::DBus::BusType::SESSION, "org.glibmm.DBusExample",
sigc::ptr_fun(&on_bus_acquired), sigc::ptr_fun(&on_name_acquired),
sigc::ptr_fun(&on_name_lost));
bool
MyCallback(Glib::IOCondition io_condition)
{
- if ((io_condition & Glib::IO_IN) == 0)
+ if ((io_condition & Glib::IOCondition::IO_IN) != Glib::IOCondition::IO_IN)
{
std::cerr << "Invalid fifo response" << std::endl;
}
}
input_stream.attach(read_fd);
- input_stream.connect(sigc::ptr_fun(MyCallback), Glib::IO_IN);
+ input_stream.connect(sigc::ptr_fun(MyCallback), Glib::IOCondition::IO_IN);
// and last but not least - run the application main loop
mainloop->run();
static void
print_resolved_addresses(
- const Glib::ustring& name, const std::list<Glib::RefPtr<Gio::InetAddress>>& addresses)
+ const Glib::ustring& name, const std::vector<Glib::RefPtr<Gio::InetAddress>>& addresses)
{
std::lock_guard<std::mutex> lock_guard(response_mutex);
std::cout << Glib::ustring::compose("Name: %1\n", name);
}
static void
-print_resolved_service(const Glib::ustring& service, const std::list<Gio::SrvTarget>& targets)
+print_resolved_service(const Glib::ustring& service, const std::vector<Gio::SrvTarget>& targets)
{
std::lock_guard<std::mutex> lock_guard(response_mutex);
std::cout << Glib::ustring::compose("Service: %1\n", service);
}
else
{
- std::list<Glib::RefPtr<Gio::InetAddress>> addresses;
-
try
{
- addresses = resolver->lookup_by_name(arg, cancellable);
+ const auto addresses = resolver->lookup_by_name(arg, cancellable);
print_resolved_addresses(arg, addresses);
}
catch (const Gio::ResolverError& err)
print_connectable_sockaddr(Glib::RefPtr<Gio::SocketAddress> sockaddr)
{
Glib::ustring phys;
- auto isa = Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic(sockaddr);
+ auto isa = std::dynamic_pointer_cast<Gio::InetSocketAddress>(sockaddr);
if (!isa)
{
signal(SIGINT, interrupted);
chan = Glib::IOChannel::create_from_fd(cancel_fds[0]);
- const auto source = chan->create_watch(Glib::IO_IN);
+ const auto source = chan->create_watch(Glib::IOCondition::IO_IN);
watch_conn = source->connect(sigc::bind(sigc::ptr_fun(async_cancel), cancellable));
#endif
Glib::ustring str, res;
int port;
- auto isockaddr = Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic(address);
+ auto isockaddr = std::dynamic_pointer_cast<Gio::InetSocketAddress>(address);
if (!isockaddr)
return Glib::ustring();
inet_address = isockaddr->get_address();
class JoinAndDelete
{
public:
- void operator()(std::thread* thread)
+ void operator()(std::thread* thread) const
{
stop_thread = true;
cond_thread.notify_all();
Glib::RefPtr<Gio::Socket> socket;
Glib::RefPtr<Gio::SocketAddress> src_address;
Glib::RefPtr<Gio::SocketAddress> address;
- Gio::SocketType socket_type;
+ Gio::Socket::Type socket_type;
Gio::SocketFamily socket_family;
Glib::RefPtr<Gio::Cancellable> cancellable;
Glib::RefPtr<Gio::SocketAddressEnumerator> enumerator;
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;
+ socket_type = use_udp ? Gio::Socket::Type::DATAGRAM : Gio::Socket::Type::STREAM;
+ socket_family = use_ipv6 ? Gio::SocketFamily::IPV6 : Gio::SocketFamily::IPV4;
try
{
- socket = Gio::Socket::create(socket_family, socket_type, Gio::SOCKET_PROTOCOL_DEFAULT);
+ socket = Gio::Socket::create(socket_family, socket_type, Gio::Socket::Protocol::DEFAULT);
}
catch (const Gio::Error& error)
{
buffer[to_send] = '\0';
while (to_send > 0)
{
- ensure_condition(socket, "send", cancellable, Glib::IO_OUT);
+ ensure_condition(socket, "send", cancellable, Glib::IOCondition::IO_OUT);
try
{
if (use_udp)
to_send -= size;
}
- ensure_condition(socket, "receive", cancellable, Glib::IO_IN);
+ ensure_condition(socket, "receive", cancellable, Glib::IOCondition::IO_IN);
try
{
if (use_udp)
Glib::ustring
socket_address_to_string(const Glib::RefPtr<Gio::SocketAddress>& address)
{
- auto isockaddr = Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic(address);
+ auto isockaddr = std::dynamic_pointer_cast<Gio::InetSocketAddress>(address);
if (!isockaddr)
return Glib::ustring();
class JoinAndDelete
{
public:
- void operator()(std::thread* thread)
+ void operator()(std::thread* thread) const
{
stop_thread = true;
cond_thread.notify_all();
loop = Glib::MainLoop::create();
- 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;
+ auto socket_type = use_udp ? Gio::Socket::Type::DATAGRAM : Gio::Socket::Type::STREAM;
+ auto socket_family = use_ipv6 ? Gio::SocketFamily::IPV6 : Gio::SocketFamily::IPV4;
try
{
- socket = Gio::Socket::create(socket_family, socket_type, Gio::SOCKET_PROTOCOL_DEFAULT);
+ socket = Gio::Socket::create(socket_family, socket_type, Gio::Socket::Protocol::DEFAULT);
}
catch (const Gio::Error& error)
{
std::cout << Glib::ustring::compose("listening on port %1...\n", port);
- ensure_condition(socket, "accept", cancellable, Glib::IO_IN);
+ ensure_condition(socket, "accept", cancellable, Glib::IOCondition::IO_IN);
try
{
new_socket = socket->accept(cancellable);
gchar buffer[4096] = {};
gssize size;
- ensure_condition(recv_socket, "receive", cancellable, Glib::IO_IN);
+ ensure_condition(recv_socket, "receive", cancellable, Glib::IOCondition::IO_IN);
try
{
if (use_udp)
while (to_send > 0)
{
- ensure_condition(recv_socket, "send", cancellable, Glib::IO_OUT);
+ ensure_condition(recv_socket, "send", cancellable, Glib::IOCondition::IO_OUT);
try
{
if (use_udp)
ExampleOptionGroup();
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_pre_parse(Glib::OptionContext& context) override;
+ bool on_post_parse(Glib::OptionContext& context) override;
+ void on_error(Glib::OptionContext& context, const Glib::Error& error) override;
bool on_option_arg_string(
const Glib::ustring& option_name, const Glib::ustring& value, bool has_value);
entry6.set_long_name("x-string");
entry6.set_short_name('x');
entry6.set_description("A string with custom parsing");
- entry6.set_flags(Glib::OptionEntry::FLAG_OPTIONAL_ARG);
+ entry6.set_flags(Glib::OptionEntry::Flags::OPTIONAL_ARG);
m_arg_x_string = "not specified";
add_entry(entry6, sigc::mem_fun(*this, &ExampleOptionGroup::on_option_arg_string));
entry7.set_long_name("x-filename");
entry7.set_short_name('X');
entry7.set_description("A filename with custom parsing");
- entry7.set_flags(Glib::OptionEntry::FLAG_OPTIONAL_ARG);
+ entry7.set_flags(Glib::OptionEntry::Flags::OPTIONAL_ARG);
m_arg_x_filename = "not specified";
add_entry_filename(entry7, sigc::mem_fun(*this, &ExampleOptionGroup::on_option_arg_filename));
}
bool
-ExampleOptionGroup::on_pre_parse(Glib::OptionContext& /* context */, Glib::OptionGroup& /* group */)
+ExampleOptionGroup::on_pre_parse(Glib::OptionContext& /* context */)
{
// This is called before the m_arg_* instances are given their values.
// You do not need to override this method. This is just here to show you how,
bool
ExampleOptionGroup::on_post_parse(
- Glib::OptionContext& /* context */, Glib::OptionGroup& /* group */)
+ Glib::OptionContext& /* context */)
{
// This is called after the m_arg_* instances are given their values.
// You do not need to override this method. This is just here to show you how,
}
void
-ExampleOptionGroup::on_error(Glib::OptionContext& /* context */, Glib::OptionGroup& /* group */)
+ExampleOptionGroup::on_error(Glib::OptionContext& /* context */, const Glib::Error& /* error */)
{
std::cout << "on_error called" << std::endl;
}
+++ /dev/null
-
-#include <condition_variable>
-#include <iostream>
-#include <memory>
-#include <mutex>
-#include <queue>
-#include <thread>
-#if defined(_MSC_VER) && (_MSC_VER < 1900)
-/* For using noexcept on Visual Studio 2013 */
-#include <glibmmconfig.h>
-#endif
-#include <glibmm/init.h>
-#include <glibmm/random.h>
-#include <glibmm/timer.h>
-
-namespace
-{
-
-class MessageQueue
-{
-public:
- MessageQueue();
- ~MessageQueue();
-
- void producer();
- void consumer();
-
-private:
- std::mutex mutex_;
- std::condition_variable cond_push_;
- std::condition_variable cond_pop_;
- std::queue<int> queue_;
-};
-
-MessageQueue::MessageQueue()
-{
-}
-
-MessageQueue::~MessageQueue()
-{
-}
-
-void
-MessageQueue::producer()
-{
- Glib::Rand rand(1234);
-
- for (auto i = 0; i < 200; ++i)
- {
- {
- std::unique_lock<std::mutex> lock(mutex_);
-
- cond_pop_.wait(lock, [this]() -> bool { return queue_.size() < 64; });
-
- queue_.push(i);
- std::cout << '*';
- std::cout.flush();
-
- // We unlock before notifying, because that is what the documentation suggests:
- // http://en.cppreference.com/w/cpp/thread/condition_variable
- lock.unlock();
- cond_push_.notify_one();
- }
-
- if (rand.get_bool())
- continue;
-
- Glib::usleep(rand.get_int_range(0, 100000));
- }
-}
-
-void
-MessageQueue::consumer()
-{
- Glib::Rand rand(4567);
-
- for (;;)
- {
- {
- std::unique_lock<std::mutex> lock(mutex_);
-
- cond_push_.wait(lock, [this]() -> bool { return !queue_.empty(); });
-
- const int i = queue_.front();
- queue_.pop();
- std::cout << "\x08 \x08";
- std::cout.flush();
-
- // We unlock before notifying, because that is what the documentation suggests:
- // http://en.cppreference.com/w/cpp/thread/condition_variable
- lock.unlock();
- cond_pop_.notify_one();
-
- if (i >= 199)
- break;
- }
-
- if (rand.get_bool())
- continue;
-
- Glib::usleep(rand.get_int_range(10000, 200000));
- }
-}
-}
-
-int
-main(int, char**)
-{
- Glib::init();
-
- MessageQueue queue;
-
- // TODO: Use std::make_unique() when we use C++14:
- const auto producer =
- std::unique_ptr<std::thread>(new std::thread(&MessageQueue::producer, &queue));
-
- const auto consumer =
- std::unique_ptr<std::thread>(new std::thread(&MessageQueue::consumer, &queue));
-
- producer->join();
- consumer->join();
-
- std::cout << std::endl;
-
- return 0;
-}
+++ /dev/null
-
-#include <iostream>
-#include <mutex>
-#include <thread>
-
-// TODO: Remove this example sometime. Glib::ThreadPool is deprecated.
-// TODO: Maybe use std::async() instead?
-#undef GLIBMM_DISABLE_DEPRECATED
-
-#include <glibmmconfig.h>
-
-#ifdef GLIBMM_DISABLE_DEPRECATED
-int
-main(int, char**)
-{
- // If glibmm is configured with --disable-deprecated-api,
- // GLIBMM_DISABLE_DEPRECATED is defined in glibmmconfig.h.
- std::cout << "Glib::ThreadPool not available because deprecated API has been disabled."
- << std::endl;
- return 77; // Tell automake's test harness to skip this test.
-}
-
-#else
-
-#include <glibmm/random.h>
-#include <glibmm/threadpool.h>
-#include <glibmm/timer.h>
-
-namespace
-{
-
-std::mutex mutex;
-
-void
-print_char(char c)
-{
- Glib::Rand rand;
-
- for (auto i = 0; i < 100; ++i)
- {
- {
- std::lock_guard<std::mutex> lock(mutex);
- std::cout << c;
- std::cout.flush();
- }
- Glib::usleep(rand.get_int_range(10000, 100000));
- }
-}
-
-} // anonymous namespace
-
-int
-main(int, char**)
-{
- Glib::ThreadPool pool(10);
-
- for (auto c = 'a'; c <= 'z'; ++c)
- {
- pool.push(sigc::bind(sigc::ptr_fun(&print_char), c));
- }
-
- pool.shutdown();
-
- std::cout << std::endl;
-
- return 0;
-}
-#endif // GLIBMM_DISABLE_DEPRECATED
#include <giomm/file.h>
#include <giomm/fileattributeinfo.h>
#include <giomm/fileattributeinfolist.h>
+#ifndef G_OS_WIN32
+#include <giomm/filedescriptorbased.h>
+#endif
#include <giomm/fileenumerator.h>
#include <giomm/fileicon.h>
#include <giomm/fileinfo.h>
#include <giomm/permission.h>
#include <giomm/pollableinputstream.h>
#include <giomm/pollableoutputstream.h>
+#include <giomm/propertyaction.h>
#include <giomm/proxy.h>
#include <giomm/proxyaddress.h>
#include <giomm/proxyresolver.h>
include $(top_srcdir)/build/compile-binding.am
-dist_noinst_HEADERS = slot_async.h
-
local_includes = -I$(top_builddir)/glib $(if $(srcdir:.=),-I$(top_srcdir)/glib)
local_cppflags = $(binding_includes) $(local_includes) $(binding_cppflags) -DGIOMM_BUILD=1
*/
#include <giomm/contenttype.h>
+#include <glibmm/vectorutils.h>
#include <gio/gio.h>
namespace Gio
return Glib::convert_return_gchar_ptr_to_ustring(cresult);
}
-Glib::StringArrayHandle
+std::vector<Glib::ustring>
content_type_guess_for_tree(const Glib::RefPtr<const File>& root)
{
- return Glib::StringArrayHandle(
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(
g_content_type_guess_for_tree(const_cast<GFile*>(root->gobj())), Glib::OWNERSHIP_DEEP);
}
-Glib::ListHandle<Glib::ustring>
+std::vector<Glib::ustring>
content_types_get_registered()
{
- return Glib::ListHandle<Glib::ustring>(g_content_types_get_registered(), Glib::OWNERSHIP_DEEP);
+ return Glib::ListHandler<Glib::ustring>::list_to_vector(g_content_types_get_registered(), Glib::OWNERSHIP_DEEP);
}
} // namespace Gio
#define _GIOMM_CONTENTTYPE_H
#include <glibmm/ustring.h>
-#include <glibmm/listhandle.h>
#include <giomm/icon.h>
#include <giomm/file.h>
#include <string>
*
* @newin{2,18}
*/
-Glib::StringArrayHandle content_type_guess_for_tree(const Glib::RefPtr<const File>& root);
+std::vector<Glib::ustring> content_type_guess_for_tree(const Glib::RefPtr<const File>& root);
/**
* Gets a list of strings containing all the registered content types
*
* @return List of the registered content types.
*/
-Glib::ListHandle<Glib::ustring> content_types_get_registered();
+std::vector<Glib::ustring> content_types_get_registered();
/** @} group giommContentType */
giomm_files_built_h = $(giomm_files_used_hg:.hg=.h)
giomm_files_extra_cc = contenttype.cc init.cc slot_async.cc socketsource.cc
-giomm_files_extra_h = contenttype.h init.h socketsource.h wrap_init.h
+giomm_files_extra_h = contenttype.h init.h slot_async.h socketsource.h wrap_init.h
giomm_files_extra_ph =
giomm_files_all_h = $(giomm_files_hg:.hg=.h) $(giomm_files_extra_h)
include $(top_srcdir)/gio/giomm/filelist.am
-# Taken out from $(top_srcdir)/gio/giomm/filelist.am
giomm_files_built_ph = $(patsubst %.hg,private/%_p.h,$(giomm_files_used_hg))
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "slot_async.h"
#include <glibmm/exceptionhandler.h>
#include <giomm/asyncresult.h>
+#include <giomm/slot_async.h>
namespace Gio
{
+#ifndef _GIOMM_SLOT_ASYNC_H
+#define _GIOMM_SLOT_ASYNC_H
+
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
*/
#include <gio/gio.h>
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
namespace Gio
{
+/** Callback function, used in combination with Gio::SlotAsyncReady.
+ *
+ * Example:
+ * @code
+ * _WRAP_METHOD(void acquire_async(const SlotAsyncReady& slot{callback},
+ * const Glib::RefPtr<Cancellable>& cancellable{.?}), g_permission_acquire_async,
+ * slot_name slot, slot_callback SignalProxy_async_callback)
+ * @endcode
+ */
void SignalProxy_async_callback(GObject*, GAsyncResult* res, void* data);
} // namespace Gio
+
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
+#endif /* _GIOMM_SLOT_ASYNC_H */
try
{
// Recreate the specific slot from the generic slot node.
- return (*static_cast<sigc::slot<bool, Glib::IOCondition>*>(slot))((Glib::IOCondition)condition);
+ return (*static_cast<sigc::slot<bool(Glib::IOCondition)>*>(slot))((Glib::IOCondition)condition);
}
catch (...)
{
}
sigc::connection
-SignalSocket::connect(const sigc::slot<bool, Glib::IOCondition>& slot,
+SignalSocket::connect(const sigc::slot<bool(Glib::IOCondition)>& slot,
const Glib::RefPtr<Socket>& socket, Glib::IOCondition condition,
const Glib::RefPtr<Cancellable>& cancellable, int priority)
{
SocketSource::create(const Glib::RefPtr<Socket>& socket, Glib::IOCondition condition,
const Glib::RefPtr<Cancellable>& cancellable)
{
- return Glib::RefPtr<SocketSource>(new SocketSource(socket, condition, cancellable));
+ return Glib::make_refptr_for_instance<SocketSource>(new SocketSource(socket, condition, cancellable));
+}
+
+// static
+Glib::RefPtr<SocketSource>
+SocketSource::create(GSocket* socket, Glib::IOCondition condition,
+ const Glib::RefPtr<Cancellable>& cancellable)
+{
+ return Glib::make_refptr_for_instance<SocketSource>(new SocketSource(socket, condition, cancellable));
}
SocketSource::SocketSource(const Glib::RefPtr<Socket>& socket, Glib::IOCondition condition,
{
}
+SocketSource::SocketSource(GSocket* socket, Glib::IOCondition condition,
+ const Glib::RefPtr<Cancellable>& cancellable)
+: IOSource(
+ g_socket_create_source(socket, (GIOCondition)condition, Glib::unwrap(cancellable)),
+ Glib::function_pointer_cast<GSourceFunc>(&giomm_socketsource_callback))
+{
+}
+
SocketSource::~SocketSource() noexcept
{
}
#include <giomm/cancellable.h>
#include <sigc++/sigc++.h>
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+using GSocket = struct _GSocket;
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
namespace Gio
{
class Socket;
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- sigc::connection connect(const sigc::slot<bool, Glib::IOCondition>& slot,
+ sigc::connection connect(const sigc::slot<bool(Glib::IOCondition)>& slot,
const Glib::RefPtr<Socket>& socket, Glib::IOCondition condition,
const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>(),
int priority = Glib::PRIORITY_DEFAULT);
Glib::IOCondition condition,
const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
+
protected:
SocketSource(const Glib::RefPtr<Socket>& socket, Glib::IOCondition condition,
const Glib::RefPtr<Cancellable>& cancellable);
~SocketSource() noexcept override;
+
+private:
+ friend Socket;
+
+ // This is just to avoid the need for Gio::Socket to create a RefPtr<> to itself.
+ static Glib::RefPtr<SocketSource> create(GSocket* socket,
+ Glib::IOCondition condition,
+ const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
+
+ // This is just to avoid the need for Gio::Socket to create a RefPtr<> to itself.
+ SocketSource(GSocket* socket, Glib::IOCondition condition,
+ const Glib::RefPtr<Cancellable>& cancellable);
};
} // namespace Gio
template <typename T_Value>
void get_state_hint(T_Value& value) const;
- //TODO: When we can break ABI, Return a Glib::VariantContainerBase,
- // as we already do for ActionGroup::get_action_state_hint(),
- // because that is what this returns (to specify a range).
- _WRAP_METHOD(Glib::VariantBase get_state_hint_variant() const, g_action_get_state_hint)
+ _WRAP_METHOD(Glib::VariantContainerBase get_state_hint_variant() const, g_action_get_state_hint)
_WRAP_METHOD(bool get_enabled() const, g_action_get_enabled)
_WRAP_METHOD(void change_state_variant(const Glib::VariantBase& value), g_action_change_state)
- _WRAP_METHOD(void change_state(const Glib::VariantBase& value), g_action_change_state, deprecated "Use the templated method instead, passing a normal C++ type.")
-
/** Queries the current state of the action.
*
* If the action is not stateful then a null Variant will be returned. If the
_WRAP_METHOD(void activate_variant(const Glib::VariantBase& parameter), g_action_activate)
- _WRAP_METHOD(void activate(const Glib::VariantBase& parameter), g_action_activate, deprecated "Use the templated method instead, passing a normal C++ type.")
-
_WRAP_METHOD(static bool name_is_valid(const Glib::ustring& action_name), g_action_name_is_valid )
/** Parses a detailed action name into its separate name and target components.
static void parse_detailed_name(const Glib::ustring& detailed_name, Glib::ustring& action_name, T_Value& target_value);
_WRAP_METHOD(static void parse_detailed_name_variant(const Glib::ustring& detailed_name,
- Glib::ustring& action_name{>>}, Glib::VariantBase& target_value{>>}), g_action_parse_detailed_name, errthrow "Glib::VariantParseError", errthrow)
+ Glib::ustring& action_name{>>}, Glib::VariantBase& target_value{>>}), g_action_parse_detailed_name, errthrow "Glib::VariantParseError")
/** Formats a detailed action name from the action's action_name and @a target_value.
*
_WRAP_METHOD(Glib::VariantType get_action_parameter_type(const Glib::ustring& action_name) const, g_action_group_get_action_parameter_type)
_WRAP_METHOD(Glib::VariantType get_action_state_type(const Glib::ustring& action_name) const, g_action_group_get_action_state_type)
-
- _WRAP_METHOD(Glib::VariantContainerBase get_action_state_hint(const Glib::ustring& action_name) const, g_action_group_get_action_state_hint, deprecated "Use the get_action_state() method that takes an output parameter instead.")
-
//TODO: How do we check for a nullptr Variant?
/**
* Requests a hint about the valid range of values for the state of the
_WRAP_METHOD(Glib::VariantContainerBase get_action_state_hint_variant(const Glib::ustring& action_name) const, g_action_group_get_action_state_hint)
-
- _WRAP_METHOD(Glib::VariantBase get_action_state(const Glib::ustring& action_name) const, g_action_group_get_action_state, deprecated "Use the get_action_state() method that takes an output parameter instead.")
-
//TODO: How do we check for a nullptr Variant?
/** Queries the current state of the named action within the action group.
*
//TODO: Add templated method, renaming this to action_state_changed_variant).
_WRAP_METHOD(void action_state_changed (const Glib::ustring& action_name, const Glib::VariantBase& state), g_action_group_action_state_changed)
- //TODO: Remove two_signal_methods when we can break ABI.
- _WRAP_SIGNAL(void action_added(const Glib::ustring& action_name), "action-added", detail_name action_name, two_signal_methods)
- _WRAP_SIGNAL(void action_enabled_changed(const Glib::ustring& action_name, bool enabled), "action-enabled-changed", detail_name action_name, two_signal_methods)
- _WRAP_SIGNAL(void action_removed(const Glib::ustring& action_name), "action-removed", detail_name action_name, two_signal_methods)
+ _WRAP_SIGNAL(void action_added(const Glib::ustring& action_name), "action-added", detail_name action_name)
+ _WRAP_SIGNAL(void action_enabled_changed(const Glib::ustring& action_name, bool enabled), "action-enabled-changed", detail_name action_name)
+ _WRAP_SIGNAL(void action_removed(const Glib::ustring& action_name), "action-removed", detail_name action_name)
#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
- _WRAP_SIGNAL(void action_state_changed(const Glib::ustring& action_name, const Glib::VariantBase& value), "action-state-changed", detail_name action_name, two_signal_methods)
+ _WRAP_SIGNAL(void action_state_changed(const Glib::ustring& action_name, const Glib::VariantBase& value), "action-state-changed", detail_name action_name)
_WRAP_VFUNC(bool has_action(const Glib::ustring& name) const, "has_action")
return action;
}
-_DEPRECATE_IFDEF_START
-Glib::RefPtr<SimpleAction>
-ActionMap::add_action_with_parameter(
- const Glib::ustring& name, const ActivateWithParameterSlot& slot)
-{
- auto action = add_action(name);
- action->signal_activate().connect(slot);
- return action;
-}
-_DEPRECATE_IFDEF_END
-
Glib::RefPtr<SimpleAction>
ActionMap::add_action_with_parameter(
const Glib::ustring& name, const Glib::VariantType& parameter_type, const ActivateWithParameterSlot& slot)
on_action_radio_string(
const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithStringParameterSlot& slot)
{
- // TODO: This syntax is odd:
- const auto variantDerived = parameter.cast_dynamic<Glib::Variant<Glib::ustring>>(parameter);
+ const auto variantDerived = Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring>>(parameter);
const auto str = variantDerived.get();
slot(str);
}
on_action_radio_int(
const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithIntParameterSlot& slot)
{
- // TODO: This syntax is odd:
- const auto variantDerived = parameter.cast_dynamic<Glib::Variant<int>>(parameter);
+ const auto variantDerived = Glib::VariantBase::cast_dynamic<Glib::Variant<int>>(parameter);
const auto str = variantDerived.get();
slot(str);
}
class Action;
-//TODO: Instead derive from ActionGroup, when we can break ABI,
-//because the GActionMap interface requires the GActionGroup interface.
-//LoadableIcon does a similar thing correctly, for instance.
-
/** ActionMap - Interface for action containers.
* The ActionMap interface is implemented by ActionGroup implementations that
* operate by containing a number of named Action instances, such as
_WRAP_METHOD(Glib::RefPtr<Action> lookup_action(const Glib::ustring& action_name), g_action_map_lookup_action, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Action> lookup_action(const Glib::ustring& action_name) const, g_action_map_lookup_action, constversion, refreturn)
+
/** A convenience method for creating a SimpleAction instance
* and adding it to the ActionMap.
*
* For instance,
* void on_slot_activated();
*/
- using ActivateSlot = sigc::slot<void>;
+ using ActivateSlot = sigc::slot<void()>;
/** A convenience method for creating a SimpleAction instance
* and adding it to the ActionMap.
* For instance,
* void on_slot_activated(const Glib::VariantBase& parameter);
*/
- using ActivateWithParameterSlot = sigc::slot<void, const Glib::VariantBase&>;
-
-_DEPRECATE_IFDEF_START
- /** A convenience method for creating a SimpleAction instance
- * and adding it to the ActionMap.
- *
- * @param name The name of the Action.
- * @param slot The callback method to be called when the action is activated.
- * @return The Action.
- *
- * @deprecated This overload does not work as it does not set a parameter
- * type on the Action, so activating it with a parameter cannot work. Use the
- * other add_action_with_parameter() overload, which takes a parameter type.
- */
- Glib::RefPtr<SimpleAction> add_action_with_parameter(const Glib::ustring& name, const ActivateWithParameterSlot& slot);
-_DEPRECATE_IFDEF_END
+ using ActivateWithParameterSlot = sigc::slot<void(const Glib::VariantBase&)>;
/** A convenience method for creating a SimpleAction instance, which when
* activated will call a slot receiving a given type of parameter, and adding
* For instance,
* void on_slot_activated(const Glib::ustring& parameter);
*/
- using ActivateWithStringParameterSlot = sigc::slot<void, const Glib::ustring&>;
+ using ActivateWithStringParameterSlot = sigc::slot<void(const Glib::ustring&)>;
//TODO: Docs: Add hints about how to specify the various possible states in the GtkBuilder XML.
/** A convenience method for creating a string-based radio SimpleAction instance
* For instance,
* void on_slot_activated(int parameter);
*/
- using ActivateWithIntParameterSlot = sigc::slot<void, int>;
-
+ using ActivateWithIntParameterSlot = sigc::slot<void(int)>;
+
//TODO: Docs: Add hints about how to specify the various possible states in the GtkBuilder XML.
/** A convenience method for creating an integer-based radio SimpleAction instance
* and adding it to the ActionMap.
#m4 _CONVERSION(`Glib::RefPtr<Action>', `GAction*', `Glib::unwrap($3)')
_WRAP_VFUNC(Glib::RefPtr<Action> lookup_action(const Glib::ustring& name) const, "lookup_action", refreturn)
- //TODO: Change this to use const & when we can break ABI.
- // ( Changing it causes a symbol lookup error when trying to run already-built applications. )
-#m4 _CONVERSION(`GAction*', `Glib::RefPtr<Action>', `Glib::wrap($3, true)')
- _WRAP_VFUNC(void add_action(Glib::RefPtr<Action> action) const, "add_action")
+#m4 _CONVERSION(`GAction*', `const Glib::RefPtr<Action>&', `Glib::wrap($3, true)')
+ _WRAP_VFUNC(void add_action(const Glib::RefPtr<Action>& action) const, "add_action")
+
_WRAP_VFUNC(void remove_action(const Glib::ustring& name), "remove_action")
};
*/
#include <giomm/file.h>
-#include <glibmm/listhandle.h>
#include <glibmm/vectorutils.h>
#include "slot_async.h"
#include <gio/gio.h>
Glib::RefPtr<AppInfo>
AppInfo::create_from_commandline(
- const std::string& commandline, const std::string& application_name, AppInfoCreateFlags flags)
+ const std::string& commandline, const std::string& application_name, CreateFlags flags)
{
GAppInfo* capp_info = nullptr;
GError* gerror = nullptr;
bool
AppInfo::launch(
- const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<AppLaunchContext>& context)
+ const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<AppLaunchContext>& launch_context)
{
std::vector<Glib::RefPtr<Gio::File>> vec = { file };
GError* gerror = nullptr;
const bool retvalue = g_app_info_launch(gobj(),
Glib::ListHandler<Glib::RefPtr<Gio::File>>::vector_to_list(vec).data(),
- Glib::unwrap(context), &(gerror));
+ Glib::unwrap(launch_context), &(gerror));
if (gerror)
::Glib::Error::throw_exception(gerror);
}
bool
-AppInfo::launch_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& context)
+AppInfo::launch_uri(const std::string& uri, const Glib::RefPtr<AppLaunchContext>& launch_context)
{
std::vector<std::string> vec = { uri };
GError* gerror = nullptr;
const bool retvalue =
g_app_info_launch_uris(gobj(), Glib::ListHandler<std::string>::vector_to_list(vec).data(),
- Glib::unwrap(context), &(gerror));
+ Glib::unwrap(launch_context), &(gerror));
if (gerror)
::Glib::Error::throw_exception(gerror);
#include <string>
#include <glibmm/interface.h>
-#include <glibmm/listhandle.h>
-#include <glibmm/arrayhandle.h>
#include <glibmm/object.h>
//#include <giomm/file.h>
#include <giomm/icon.h>
namespace Gio
{
-_WRAP_ENUM(AppInfoCreateFlags, GAppInfoCreateFlags, NO_GTYPE)
class File;
_CLASS_INTERFACE(AppInfo, GAppInfo, G_APP_INFO, GAppInfoIface)
public:
+ _WRAP_ENUM(CreateFlags, GAppInfoCreateFlags, NO_GTYPE)
+
static Glib::RefPtr<AppInfo> create_from_commandline(const std::string& commandline,
const std::string& application_name,
- AppInfoCreateFlags flags);
+ CreateFlags flags);
/** Creates a duplicate of this AppInfo.
* @return A duplicate of this AppInfo.
_WRAP_METHOD(bool supports_uris() const, g_app_info_supports_uris)
_WRAP_METHOD(bool supports_files() const, g_app_info_supports_files)
-#m4 _CONVERSION(`const Glib::ListHandle<std::string>&',`GList*',`$3.data()')
- _WRAP_METHOD(bool launch_uris(const Glib::ListHandle<std::string>& uris,
- GAppLaunchContext* context),
- g_app_info_launch_uris,
- errthrow, deprecated "Use the method that takes an AppLaunchContext")
+ #m4 _CONVERSION(`const std::vector<std::string>&',`GList*',`Glib::ListHandler<std::string>::vector_to_list($3).data()')
//TODO: I think we use Glib::ustring elsewhere for URIs:
- _WRAP_METHOD(bool launch_uris(const Glib::ListHandle<std::string>& uris,
+ _WRAP_METHOD(bool launch_uris(const std::vector<std::string>& uris,
const Glib::RefPtr<AppLaunchContext>& context{?}),
g_app_info_launch_uris,
errthrow)
g_app_info_remove_supports_type,
errthrow)
-#m4 _CONVERSION(`const char**', `Glib::StringArrayHandle', `Glib::StringArrayHandle($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(Glib::StringArrayHandle get_supported_types() const, g_app_info_get_supported_types)
+#m4 _CONVERSION(`const char**', `std::vector<Glib::ustring>', `Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_supported_types() const, g_app_info_get_supported_types)
_WRAP_METHOD(bool set_as_last_used_for_type(const std::string& content_type), g_app_info_set_as_last_used_for_type, errthrow)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle<Glib::RefPtr<AppInfo> >',`Glib::ListHandle<Glib::RefPtr<AppInfo> >($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(static Glib::ListHandle<Glib::RefPtr<AppInfo> > get_all(), g_app_info_get_all)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<AppInfo>>',`Glib::ListHandler<Glib::RefPtr<AppInfo>>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(static std::vector<Glib::RefPtr<AppInfo>> get_all(), g_app_info_get_all)
- _WRAP_METHOD(static Glib::ListHandle<Glib::RefPtr<AppInfo> > get_all_for_type(const std::string& content_type), g_app_info_get_all_for_type)
+ _WRAP_METHOD(static std::vector<Glib::RefPtr<AppInfo>> get_all_for_type(const std::string& content_type), g_app_info_get_all_for_type)
_WRAP_METHOD(static Glib::RefPtr<AppInfo> get_default_for_type(const std::string& content_type, bool must_support_uris = true), g_app_info_get_default_for_type)
_WRAP_METHOD(static Glib::RefPtr<AppInfo> get_default_for_uri_scheme(const std::string& uri_scheme), g_app_info_get_default_for_uri_scheme)
_WRAP_METHOD(static void reset_type_associations(const std::string& content_type), g_app_info_reset_type_associations)
//_WRAP_VFUNC(std::string get_description() const, "get_description")
//_WRAP_VFUNC(std::string get_executable() const, "get_executable")
//_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, "get_icon")
-//#m4 _CONVERSION(`const Glib::ListHandle<std::string>&',`GList*',`$3.data()')
-//#m4 _CONVERSION(`GList*',`const Glib::ListHandle<std::string>&',`Glib::ListHandle<std::string>($3, Glib::OWNERSHIP_NONE)')
//_WRAP_VFUNC(bool launch(const std::vector<Gio::File>& filenames, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch")
//_WRAP_VFUNC(bool supports_uris() const, "supports_uris")
//_WRAP_VFUNC(bool supports_files() const, "supports_files")
- //_WRAP_VFUNC(bool launch_uris(const Glib::ListHandle<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch_uris")
+ //_WRAP_VFUNC(bool launch_uris(const std::vector<std::string>& uris, const Glib::RefPtr<AppLaunchContext>& context, GError** error), "launch_uris")
//_WRAP_VFUNC(bool should_show() const, "should_show")
//_WRAP_VFUNC(bool set_as_default_for_type(const std::string& content_type, GError** error), "set_as_default_for_type")
//_WRAP_VFUNC(bool set_as_default_for_extension(const std::string& extension, GError** error), "set_as_default_for_extension")
#include <string>
#include <glibmm/interface.h>
-#include <glibmm/listhandle.h>
#include <glibmm/object.h>
//#include <giomm/file.h>
#include <giomm/icon.h>
#m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> get_environment() const, g_app_launch_context_get_environment)
-#m4 _CONVERSION(`const Glib::ListHandle<std::string>&',`GList*',`$3.data()')
- _WRAP_METHOD(std::string get_display(const Glib::RefPtr<AppInfo>& info, const Glib::ListHandle< Glib::RefPtr<Gio::File> >& files),
+#m4 _CONVERSION(`const std::vector<std::string>&',`GList*',`Glib::ListHandler<std::string>::vector_to_list$3.data()')
+ _WRAP_METHOD(std::string get_display(const Glib::RefPtr<AppInfo>& info, const std::vector<Glib::RefPtr<Gio::File>>& files),
g_app_launch_context_get_display)
- _WRAP_METHOD(std::string get_startup_notify_id(const Glib::RefPtr<AppInfo>& info, const Glib::ListHandle< Glib::RefPtr<Gio::File> >& files),
+ _WRAP_METHOD(std::string get_startup_notify_id(const Glib::RefPtr<AppInfo>& info, const std::vector<Glib::RefPtr<Gio::File>>& files),
g_app_launch_context_get_startup_notify_id)
_WRAP_METHOD(void launch_failed(const std::string& startup_notify_id),
g_app_launch_context_launch_failed)
#include <giomm/init.h>
#include <cstring> // std::memset()
#include <map>
+#include <mutex>
#include <vector>
-namespace // anonymous
-{
-// TODO: At the next ABI break, implement the pimpl idiom. Then we need not use
-// a GQuark for ExtraApplicationData, which should be renamed to
-// struct Gio::Application::Impl.
-// These are new data members that can't be added to Gio::Application now,
-// because it would break ABI.
-struct ExtraApplicationData
-{
- std::vector<gchar*> option_entry_strings;
-
- ~ExtraApplicationData()
- {
- for (auto str : option_entry_strings)
- {
- g_free(str);
- }
- }
-};
+using Flags = Gio::Application::Flags;
-GQuark quark_extra_application_data =
- g_quark_from_static_string("glibmm__Gio::Application::quark_extra_application_data");
-
-void
-Application_delete_extra_application_data(gpointer data)
+namespace // anonymous
{
- ExtraApplicationData* extra_application_data = static_cast<ExtraApplicationData*>(data);
- delete extra_application_data;
-}
static void
Application_signal_open_callback(
GApplication* self, GFile** files, gint n_files, const gchar* hint, void* data)
{
- using SlotType = sigc::slot<void, const Gio::Application::type_vec_files&, const Glib::ustring&>;
+ using SlotType = sigc::slot<void(const Gio::Application::type_vec_files&, const Glib::ustring&)>;
Gio::Application::type_vec_files vec_files(n_files);
for (int i = 0; i < n_files; ++i)
GApplication* self, GFile** files, gint n_files, const gchar* hint, void* data)
{
using namespace Gio;
- using SlotType = sigc::slot<void, const Application::type_vec_files&, const Glib::ustring&>;
+ using SlotType = sigc::slot<void(const Application::type_vec_files&, const Glib::ustring&)>;
Application::type_vec_files vec_files(n_files);
for (int i = 0; i < n_files; i++)
class OptionArgCallbackData
{
public:
- explicit OptionArgCallbackData(const Gio::Application* application, gchar short_name,
+ explicit OptionArgCallbackData(const Gio::Application* application,
+ const Glib::ustring& long_name, gchar short_name,
+ const Glib::ustring& description, const Glib::ustring& arg_description,
const Glib::OptionGroup::SlotOptionArgString& slot)
- : application_(application),
+ :
+ application_(application),
+ long_name_(g_strdup(long_name.c_str())), // must not be nullptr
short_name_(short_name),
+ description_(g_strdup(Glib::c_str_or_nullptr(description))),
+ arg_description_(g_strdup(Glib::c_str_or_nullptr(arg_description))),
slot_string_(new Glib::OptionGroup::SlotOptionArgString(slot)),
slot_filename_(nullptr)
{
}
- explicit OptionArgCallbackData(const Gio::Application* application, gchar short_name,
+ explicit OptionArgCallbackData(const Gio::Application* application,
+ const Glib::ustring& long_name, gchar short_name,
+ const Glib::ustring& description, const Glib::ustring& arg_description,
const Glib::OptionGroup::SlotOptionArgFilename& slot)
- : application_(application),
+ :
+ application_(application),
+ long_name_(g_strdup(long_name.c_str())), // must not be nullptr
short_name_(short_name),
+ description_(g_strdup(Glib::c_str_or_nullptr(description))),
+ arg_description_(g_strdup(Glib::c_str_or_nullptr(arg_description))),
slot_string_(nullptr),
slot_filename_(new Glib::OptionGroup::SlotOptionArgFilename(slot))
{
}
const Gio::Application* get_application() const { return application_; }
+ const gchar* get_long_name() const { return long_name_; }
gchar get_short_name() const { return short_name_; }
+ const gchar* get_description() const { return description_; }
+ const gchar* get_arg_description() const { return arg_description_; }
bool is_filename_option() const { return slot_filename_ != nullptr; }
const Glib::OptionGroup::SlotOptionArgString* get_slot_string() const { return slot_string_; }
~OptionArgCallbackData()
{
+ g_free(long_name_);
+ g_free(description_);
+ g_free(arg_description_);
delete slot_string_;
delete slot_filename_;
// Don't delete application_. It's not owned by this class.
private:
const Gio::Application* application_;
+ gchar* long_name_;
gchar short_name_;
+ gchar* description_;
+ gchar* arg_description_;
// One of these slot pointers is nullptr and the other one points to a slot.
Glib::OptionGroup::SlotOptionArgString* slot_string_;
Glib::OptionGroup::SlotOptionArgFilename* slot_filename_;
// Not copyable
- OptionArgCallbackData(const OptionArgCallbackData&);
- OptionArgCallbackData& operator=(const OptionArgCallbackData&);
-};
+ OptionArgCallbackData(const OptionArgCallbackData&) = delete;
+ OptionArgCallbackData& operator=(const OptionArgCallbackData&) = delete;
+
+}; // end class OptionArgCallbackData
using OptionArgCallbackDataMap = std::map<Glib::ustring, OptionArgCallbackData*>;
OptionArgCallbackDataMap option_arg_callback_data;
return application_class_.init();
}
-Application::Application(const Glib::ustring& application_id, ApplicationFlags flags)
+Application::Application(const Glib::ustring& application_id, Flags flags)
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
+ // GApplication complains about "" but allows nullptr, so we avoid passing "".
Glib::ObjectBase(nullptr),
- Glib::Object(Glib::ConstructParams(custom_class_init(), "application_id",
- Glib::c_str_or_nullptr(application_id), "flags", ((GApplicationFlags)(flags)), nullptr))
+ Glib::Object(Glib::ConstructParams(custom_class_init(),
+ "application_id", Glib::c_str_or_nullptr(application_id),
+ "flags", static_cast<GApplicationFlags>(flags), nullptr))
{
}
(*base->open)(self, files, n_files, hint);
}
-Glib::SignalProxy<void, const Application::type_vec_files&, const Glib::ustring&>
+Glib::SignalProxy<void(const Application::type_vec_files&, const Glib::ustring&)>
Application::signal_open()
{
- return Glib::SignalProxy<void, const Application::type_vec_files&, const Glib::ustring&>(
+ return Glib::SignalProxy<void(const Application::type_vec_files&, const Glib::ustring&)>(
this, &Application_signal_open_info);
}
void
Application::add_main_option_entry(OptionType arg_type, const Glib::ustring& long_name,
gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description,
- int flags)
+ Glib::OptionEntry::Flags flags)
{
- add_main_option_entry_private(
- (GOptionArg)arg_type, long_name, short_name, description, arg_description, flags);
+ // g_application_add_main_option() saves copies of the strings.
+ // No need to keep copies in Gio::Application.
+ g_application_add_main_option(gobj(), long_name.c_str(), short_name,
+ static_cast<GOptionFlags>(flags), static_cast<GOptionArg>(arg_type),
+ description.c_str(), Glib::c_str_or_nullptr(arg_description));
}
void
Application::add_main_option_entry(const Glib::OptionGroup::SlotOptionArgString& slot,
const Glib::ustring& long_name, gchar short_name, const Glib::ustring& description,
- const Glib::ustring& arg_description, int flags)
+ const Glib::ustring& arg_description, Glib::OptionEntry::Flags flags)
{
+ OptionArgCallbackData* callback_data = nullptr;
{
std::lock_guard<std::mutex> lock(option_arg_callback_data_mutex);
OptionArgCallbackDataMap::iterator iterFind = option_arg_callback_data.find(long_name);
if (iterFind != option_arg_callback_data.end())
return; // Ignore duplicates
- auto callback_data = new OptionArgCallbackData(this, short_name, slot);
+ callback_data = new OptionArgCallbackData(
+ this, long_name, short_name, description, arg_description, slot);
option_arg_callback_data[long_name] = callback_data;
} // option_arg_callback_data_mutex.unlock()
- add_main_option_entry_private(G_OPTION_ARG_CALLBACK, long_name, short_name, description,
- arg_description, flags & ~Glib::OptionEntry::FLAG_FILENAME);
+ add_main_option_entry_private(callback_data->get_long_name(), short_name,
+ callback_data->get_description(), callback_data->get_arg_description(),
+ flags & ~Glib::OptionEntry::Flags::FILENAME);
}
void
Application::add_main_option_entry_filename(const Glib::OptionGroup::SlotOptionArgFilename& slot,
const Glib::ustring& long_name, gchar short_name, const Glib::ustring& description,
- const Glib::ustring& arg_description, int flags)
+ const Glib::ustring& arg_description, Glib::OptionEntry::Flags flags)
{
+ OptionArgCallbackData* callback_data = nullptr;
{
std::lock_guard<std::mutex> lock(option_arg_callback_data_mutex);
OptionArgCallbackDataMap::iterator iterFind = option_arg_callback_data.find(long_name);
if (iterFind != option_arg_callback_data.end())
return; // Ignore duplicates
- auto callback_data = new OptionArgCallbackData(this, short_name, slot);
+ callback_data = new OptionArgCallbackData(
+ this, long_name, short_name, description, arg_description, slot);
option_arg_callback_data[long_name] = callback_data;
} // option_arg_callback_data_mutex.unlock()
- add_main_option_entry_private(G_OPTION_ARG_CALLBACK, long_name, short_name, description,
- arg_description, flags | Glib::OptionEntry::FLAG_FILENAME);
+ add_main_option_entry_private(callback_data->get_long_name(), short_name,
+ callback_data->get_description(), callback_data->get_arg_description(),
+ flags | Glib::OptionEntry::Flags::FILENAME);
}
void
-Application::add_main_option_entry_private(GOptionArg arg, const Glib::ustring& long_name,
- gchar short_name, const Glib::ustring& description, const Glib::ustring& arg_description,
- int flags)
+Application::add_main_option_entry_private(const gchar* long_name,
+ gchar short_name, const gchar* description,
+ const gchar* arg_description, Glib::OptionEntry::Flags flags)
{
+ // g_application_add_main_option() can't be used for options with
+ // a callback slot, because GOptionEntry.arg_data must be non-null.
+
// Create a temporary array, just so we can give the correct thing to
// g_application_add_main_option_entries():
GOptionEntry array[2];
// g_application_add_main_option_entries() does not take its own copy
// of the strings. We must keep them alive, and keep pointers to them,
// so we can delete them when the Application instance is deleted.
-
- // GOptionEntry.long_name must be set, even if it's an empty string.
- gchar* lname = g_strdup(long_name.c_str());
- gchar* desc = description.empty() ? nullptr : g_strdup(description.c_str());
- gchar* arg_desc = arg_description.empty() ? nullptr : g_strdup(arg_description.c_str());
-
- ExtraApplicationData* extra_application_data =
- static_cast<ExtraApplicationData*>(g_object_get_qdata(gobject_, quark_extra_application_data));
- if (!extra_application_data)
- {
- extra_application_data = new ExtraApplicationData();
- g_object_set_qdata_full(gobject_, quark_extra_application_data, extra_application_data,
- Application_delete_extra_application_data);
- }
-
- extra_application_data->option_entry_strings.emplace_back(lname);
- if (desc)
- extra_application_data->option_entry_strings.emplace_back(desc);
- if (arg_desc)
- extra_application_data->option_entry_strings.emplace_back(arg_desc);
+ // This is handled in OptionArgCallbackData.
// Fill in array[0].
- array[0].arg = arg;
- array[0].long_name = lname;
+ array[0].arg = G_OPTION_ARG_CALLBACK;
+ array[0].long_name = long_name;
array[0].short_name = short_name;
- array[0].description = desc;
- array[0].arg_description = arg_desc;
- array[0].flags = flags;
-
- if (arg == G_OPTION_ARG_CALLBACK)
- {
- // GoptionEntry.arg_data is a function pointer, cast to void*.
- // See Glib::OptionGroup::CppOptionEntry::allocate_c_arg() for a discussion
- // of this hack.
- union {
- void* dp;
- GOptionArgFunc fp;
- } u;
- u.fp = &Application_option_arg_callback;
- array[0].arg_data = u.dp;
- }
- 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 = nullptr;
+ array[0].description = description;
+ array[0].arg_description = arg_description;
+ array[0].flags = static_cast<int>(flags);
+
+ // GoptionEntry.arg_data is a function pointer, cast to void*.
+ // See Glib::OptionGroup::CppOptionEntry::allocate_c_arg() for a discussion
+ // of this hack.
+ union {
+ void* dp;
+ GOptionArgFunc fp;
+ } u;
+ u.fp = &Application_option_arg_callback;
+ array[0].arg_data = u.dp;
g_application_add_main_option_entries(gobj(), array);
}
g_application_set_resource_base_path(gobj(), nullptr /* see the C docs. */);
}
-Glib::PropertyProxy< std::string > Application::property_resource_base_path_string()
-{
- return Glib::PropertyProxy< std::string >(this, "resource-base-path");
-}
-
-Glib::PropertyProxy_ReadOnly< std::string > Application::property_resource_base_path_string() const
-{
- return Glib::PropertyProxy_ReadOnly< std::string >(this, "resource-base-path");
-}
-
} // namespace Gio
namespace Gio
{
-_WRAP_ENUM(ApplicationFlags, GApplicationFlags, NO_GTYPE)
/** Application - Core application class.
* An Application is the foundation of an application, unique for a given
_IMPLEMENTS_INTERFACE(ActionGroup)
_IMPLEMENTS_INTERFACE(ActionMap)
+public:
+ _WRAP_ENUM(Flags, GApplicationFlags, NO_GTYPE, s#^FLAGS_##)
+
protected:
/** Constructs an application instance.
* If no application ID is given then some features (most notably application uniqueness) will be disabled.
* @param application_id The application ID.
* @param flags The application flags.
*/
- explicit Application(const Glib::ustring& application_id = Glib::ustring(), ApplicationFlags flags = APPLICATION_FLAGS_NONE);
+ explicit Application(const Glib::ustring& application_id = Glib::ustring(), Flags flags = Flags::NONE);
_IGNORE(g_application_new)
public:
_CUSTOM_DTOR()
+ // Application::OptionType wraps GOptionArg, but _WRAP_ENUM can't be used here.
+ // GOptionArg is defined in glib_enums.defs, not in gio_enums.defs.
/** The OptionType enum values determine the expected type of a command line option.
* If an option expects an extra argument, it can be specified in several ways;
* with a short option: "-x arg", with a long option: "--name arg" or combined
- * in a single argument: "--name=arg". All option types except OPTION_TYPE_BOOL
- * expect an extra argument. OPTION_TYPE_STRING_VECTOR and
- * OPTION_TYPE_FILENAME_VECTOR accept more than one extra argument.
+ * in a single argument: "--name=arg". All option types except OptionType::BOOL
+ * expect an extra argument. OptionType::STRING_VECTOR and
+ * OptionType::FILENAME_VECTOR accept more than one extra argument.
*
* The descriptions of the enum values show what type of Glib::Variant<>
* is stored in a Glib::VariantDict.
*
* @ingroup glibmmEnums
*/
- enum OptionType
+ enum class OptionType
{
- OPTION_TYPE_BOOL, ///< bool
- OPTION_TYPE_STRING, ///< Glib::ustring
- OPTION_TYPE_INT, ///< gint32
- //OPTION_TYPE_CALLBACK,
- OPTION_TYPE_FILENAME = OPTION_TYPE_INT+2, ///< std::string
- OPTION_TYPE_STRING_VECTOR, ///< std::vector<Glib::ustring>
- OPTION_TYPE_FILENAME_VECTOR, ///< std::vector<std::string>
- OPTION_TYPE_DOUBLE, ///< double
- OPTION_TYPE_INT64 ///< gint64
+ BOOL, ///< bool
+ STRING, ///< Glib::ustring
+ INT, ///< gint32
+ // CALLBACK,
+ FILENAME = INT+2, ///< std::string
+ STRING_VECTOR, ///< std::vector<Glib::ustring>
+ FILENAME_VECTOR, ///< std::vector<std::string>
+ DOUBLE, ///< double
+ INT64 ///< gint64
};
/** Creates an application instance.
* @param application_id The application ID.
* @param flags The application flags.
*/
- _WRAP_CREATE(const Glib::ustring& application_id = Glib::ustring(), ApplicationFlags flags = APPLICATION_FLAGS_NONE)
+ _WRAP_CREATE(const Glib::ustring& application_id = Glib::ustring(), Flags flags = Flags::NONE)
_WRAP_METHOD(static bool id_is_valid(const Glib::ustring& application_id), g_application_id_is_valid)
_WRAP_METHOD(guint get_inactivity_timeout() const, g_application_get_inactivity_timeout)
_WRAP_METHOD(void set_inactivity_timeout(guint inactivity_timeout), g_application_set_inactivity_timeout)
- _WRAP_METHOD(ApplicationFlags get_flags() const, g_application_get_flags)
- _WRAP_METHOD(void set_flags(ApplicationFlags flags), g_application_set_flags)
+ _WRAP_METHOD(Flags get_flags() const, g_application_get_flags)
+ _WRAP_METHOD(void set_flags(Flags flags), g_application_set_flags)
_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")
*/
void unset_resource_base_path();
- _WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& action_group), g_application_set_action_group,
- deprecated "Use the Gio::ActionMap interface instead.")
+ _IGNORE(g_application_set_action_group)
//Note: We would like 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
* Unlike OptionGroup + OptionContext, Application packs the arguments
* into a Glib::VariantDict which is passed to the
* signal_handle_local_options() handler, where it can be
- * inspected and modified. If Gio::APPLICATION_HANDLES_COMMAND_LINE is
+ * inspected and modified. If Gio::Application::Flags::HANDLES_COMMAND_LINE is
* set, then the resulting dictionary is sent to the primary instance,
* where Gio::ApplicationCommandLine::get_options_dict() will return it.
* This "packing" is done according to the type of the argument --
* on the local side. Calling this function "opts in" to the new
* behaviour, and in particular, means that unrecognised options will be
* treated as errors. Unrecognised options have never been ignored when
- * Gio::APPLICATION_HANDLES_COMMAND_LINE is unset.
+ * Gio::Application::Flags::HANDLES_COMMAND_LINE is unset.
*
* If signal_handle_local_options() needs to see the list of
* filenames, then the use of G_OPTION_REMAINING as @a long_name is recommended.
* @param description The description for the option in `--help` output.
* @param arg_description The placeholder to use for the extra argument parsed
* by the option in `--help` output.
- * @param flags Flags from Glib::OptionEntry::Flags. Do not set FLAG_FILENAME.
+ * @param flags Flags from Glib::OptionEntry::Flags. Do not set OptionEntry::Flags::FILENAME.
* Character encoding is chosen with @a arg_type.
*/
void add_main_option_entry(OptionType arg_type, const Glib::ustring& long_name,
gchar short_name = '\0', const Glib::ustring& description = Glib::ustring(),
- const Glib::ustring& arg_description = Glib::ustring(), int flags = 0);
- _IGNORE(g_application_add_main_option_entries)
-
- //g_application_add_main_option() seems to be just a new convenience function,
- //TODO: Use it for some of our add_main_option_entry(without slot) implementation.
- _IGNORE(g_application_add_main_option)
+ const Glib::ustring& arg_description = Glib::ustring(),
+ Glib::OptionEntry::Flags flags = Glib::OptionEntry::Flags::NONE);
+ _IGNORE(g_application_add_main_option_entries, g_application_add_main_option)
/** Adds a main option entry to be handled by the Application.
*
* @newin{2,42}
*
* @see add_main_option_entry(OptionType, const Glib::ustring&,
- * gchar, const Glib::ustring&, const Glib::ustring&, int)
+ * gchar, const Glib::ustring&, const Glib::ustring&, Glib::OptionEntry::Flags)
*/
void add_main_option_entry(const Glib::OptionGroup::SlotOptionArgString& slot,
const Glib::ustring& long_name,
gchar short_name = '\0', const Glib::ustring& description = Glib::ustring(),
- const Glib::ustring& arg_description = Glib::ustring(), int flags = 0);
+ const Glib::ustring& arg_description = Glib::ustring(),
+ Glib::OptionEntry::Flags flags = Glib::OptionEntry::Flags::NONE);
/** Adds a main option entry to be handled by the Application.
*
* @newin{2,42}
*
* @see add_main_option_entry(OptionType, const Glib::ustring&,
- * gchar, const Glib::ustring&, const Glib::ustring&, int)
+ * gchar, const Glib::ustring&, const Glib::ustring&, Glib::OptionEntry::Flags)
*/
void add_main_option_entry_filename(const Glib::OptionGroup::SlotOptionArgFilename& slot,
const Glib::ustring& long_name,
gchar short_name = '\0', const Glib::ustring& description = Glib::ustring(),
- const Glib::ustring& arg_description = Glib::ustring(), int flags = 0);
+ const Glib::ustring& arg_description = Glib::ustring(),
+ Glib::OptionEntry::Flags flags = Glib::OptionEntry::Flags::NONE);
// _WRAP_METHOD(void add_option_group(Glib::OptionGroup& group), g_application_add_option_group)
// add_option_group() is probably not very useful. If implemented, it must probably
* opening files (eg: "view" vs "edit", etc).
*
* The application must be registered before calling this method
- * and it must have the APPLICATION_HANDLES_OPEN flag set.
+ * and it must have the Application::Flags::HANDLES_OPEN flag set.
*
* @param files The files to open. This must be non-empty.
* @param hint A hint.
* opening files (eg: "view" vs "edit", etc).
*
* The application must be registered before calling this method
- * and it must have the APPLICATION_HANDLES_OPEN flag set.
+ * and it must have the Application::Flags::HANDLES_OPEN flag set.
*
* @param file The file to open. This must be non-empty.
* @param hint A hint.
// _WRAP_METHOD(void bind_busy_property(const Glib::RefPtr<Glib::ObjectBase>& object, const Glib::ustring& property), g_application_bind_busy_property)
// _WRAP_METHOD(void unbind_busy_property(const Glib::RefPtr<Glib::ObjectBase>& object, const Glib::ustring& property), g_application_unbind_busy_property)
- _WRAP_PROPERTY("action-group", Glib::RefPtr<ActionGroup>, deprecated "Use the Gio::ActionMap interface instead.")
+ _IGNORE_PROPERTY("action-group")
_WRAP_PROPERTY("application-id", Glib::ustring)
- _WRAP_PROPERTY("flags", ApplicationFlags)
+ _WRAP_PROPERTY("flags", Flags)
_WRAP_PROPERTY("inactivity-timeout", guint)
_WRAP_PROPERTY("is-registered", bool)
_WRAP_PROPERTY("is-remote", bool)
-
- //TODO: Change bool to std::string when we can break API/ABI.
- _WRAP_PROPERTY("resource-base-path", bool, newin "2,44",
- deprecated "This method has the wrong return type. Will be fixed at the next ABI break. Use property_resource_base_path_string() instead.")
-
- /** The base resource path for the application.
- *
- * @newin{2,56}
- *
- * Default value: ""
- *
- * @return A PropertyProxy that allows you to get or set the value of the property,
- * or receive notification when the value of the property changes.
- */
- Glib::PropertyProxy< std::string > property_resource_base_path_string();
-
- /** The base resource path for the application.
- *
- * @newin{2,56}
- *
- * Default value: ""
- *
- * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
- * or receive notification when the value of the property changes.
- */
- Glib::PropertyProxy_ReadOnly< std::string > property_resource_base_path_string() const;
-
+ _WRAP_PROPERTY("resource-base-path", std::string, newin "2,44")
_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)')
-
_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 shutdown(), "shutdown", newin "2,46")
_WRAP_SIGNAL(void activate(), "activate")
//We wrap the open signal without _WRAP_SIGNAL(), because we need to change its parameters.
//See bug https://bugzilla.gnome.org/show_bug.cgi?id=637457
- Glib::SignalProxy< void, const type_vec_files&, const Glib::ustring& > signal_open();
+ Glib::SignalProxy<void(const type_vec_files&, const Glib::ustring&)> signal_open();
_IGNORE_SIGNAL(open)
#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?
//options must be non-const. The handler is meant to modify it. See the description
//of add_main_option_entry(OptionType, ...).
#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)
+#m4 _CONVERSION(`const Glib::RefPtr<Glib::VariantDict>&',`GVariantDict*',__CONVERT_REFPTR_TO_P)
+ _WRAP_SIGNAL(int handle_local_options(const Glib::RefPtr<Glib::VariantDict>& options), "handle-local-options")
protected:
virtual void on_open(const type_vec_files& files, const Glib::ustring& hint);
_WRAP_VFUNC(bool local_command_line(char**& arguments, int& exit_status), local_command_line)
#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3,true)')
-
_WRAP_VFUNC(void before_emit(const Glib::VariantBase& platform_data), "before_emit")
_WRAP_VFUNC(void after_emit(const Glib::VariantBase& platform_data), "after_emit")
_WRAP_VFUNC(void quit_mainloop(), "quit_mainloop")
_WRAP_VFUNC(void run_mainloop(), "run_mainloop")
+#m4 _CONVERSION(`GDBusConnection*', `const Glib::RefPtr<DBus::connection>&', `Glib::wrap($3, true)')
+#m4 _CONVERSION(`const Glib::RefPtr<DBus::Connection>&',`GDBusConnection*',__CONVERT_REFPTR_TO_P)
+ _WRAP_VFUNC(bool dbus_register(const Glib::RefPtr<DBus::Connection>& connection, const Glib::ustring& object_path), "dbus_register", errthrow)
+ _WRAP_VFUNC(void dbus_unregister(const Glib::RefPtr<DBus::Connection>& connection, const Glib::ustring& object_path), "dbus_unregister")
private:
- /** This is just a way to call Glib::init() (which calls g_type_init()) before
- * calling application_class_.init(), so that
- * g_application_get_type() will always succeed.
- * See https://bugzilla.gnome.org/show_bug.cgi?id=639925
+ /** This is just a way to call Glib::init() before calling a Glib::Object ctor,
+ * so that glibmm's GQuarks are created before they are used.
*/
const Glib::Class& custom_class_init();
- // Code, common to the public add_main_option_entry*() methods.
- void add_main_option_entry_private(GOptionArg arg, const Glib::ustring& long_name,
- gchar short_name, const Glib::ustring& description,
- const Glib::ustring& arg_description, int flags);
+ // Code, common to the public add_main_option_entry*() methods with a callback slot.
+ void add_main_option_entry_private(const gchar* long_name, gchar short_name,
+ const gchar* description, const gchar* arg_description,
+ Glib::OptionEntry::Flags flags);
};
} // namespace Gio
{
auto cobj = g_async_result_get_source_object(gobj());
auto cppobj = Glib::wrap_auto(cobj); // ObjectBase::_get_current_wrapper(cobj);
- return Glib::RefPtr<Glib::ObjectBase>(
+ return Glib::make_refptr_for_instance<Glib::ObjectBase>(
cppobj); // g_async_result_get_source_object() gives us a ref, unusually.
// TODO: For some reason this fails: Glib::wrap(cobj);
}
*
* @newin{2,16}
*/
-using SlotAsyncReady = sigc::slot<void, Glib::RefPtr<AsyncResult>&>;
+using SlotAsyncReady = sigc::slot<void(Glib::RefPtr<AsyncResult>&)>;
/** Provides a base class for implementing asynchronous function results.
* Asynchronous operations are broken up into two separate operations which are chained together by a SlotAsyncReady.
public:
_IGNORE(g_async_result_get_user_data)
-
- //Note that this returns a reference, unlike most GTK+ get_*() functions,
- //so we don't need to use refreturn.
- _WRAP_METHOD(Glib::RefPtr<Glib::Object> get_source_object(),
- g_async_result_get_source_object, deprecated "Use get_source_object_base()")
- _WRAP_METHOD(Glib::RefPtr<const Glib::Object> get_source_object() const,
- g_async_result_get_source_object, constversion, deprecated "Use get_source_object_base()")
+ _IGNORE(g_async_result_get_source_object)
//Note that this returns a reference, unlike most GTK+ get_*() functions,
//so we don't need to use refreturn.
_WRAP_METHOD(bool is_tagged(gpointer source_tag) const, g_async_result_is_tagged)
-
- // TODO: For some reason, the compiler cannot find an unwrap() for ObjectBase.
+ // The compiler cannot find an unwrap() for ObjectBase, because
+ // ObjectBase::BaseObjectType is not declared.
//#m4 _CONVERSION(`Glib::RefPtr<Glib::ObjectBase>',`GObject*',__CONVERT_REFPTR_TO_P)
#m4 _CONVERSION(`Glib::RefPtr<Glib::ObjectBase>',`GObject*',`unwrap_objectbase_custom($3)')
- _WRAP_VFUNC(Glib::RefPtr<Glib::ObjectBase> get_source_object(),
- "get_source_object")
-
- //TODO: is_tagged() vfunc when we can break ABI.
+ _WRAP_VFUNC(Glib::RefPtr<Glib::ObjectBase> get_source_object(), "get_source_object")
+ _WRAP_VFUNC(bool is_tagged(gpointer source_tag), "is_tagged")
};
} // namespace Gio
-
Glib::RefPtr<BufferedInputStream>
BufferedInputStream::create_sized(const Glib::RefPtr<InputStream>& base_stream, gsize buffer_size)
{
- return Glib::RefPtr<Gio::BufferedInputStream>(new BufferedInputStream(base_stream, buffer_size));
+ return Glib::make_refptr_for_instance<Gio::BufferedInputStream>(new BufferedInputStream(base_stream, buffer_size));
}
void
*/
#include <giomm/filterinputstream.h>
+#include <giomm/seekable.h>
#include <glibmm/object.h>
_DEFS(giomm,gio)
*
* @newin{2,16}
*/
-class BufferedInputStream : public Gio::FilterInputStream
+class BufferedInputStream : public Gio::FilterInputStream, public Gio::Seekable
{
_CLASS_GOBJECT(BufferedInputStream, GBufferedInputStream, G_BUFFERED_INPUT_STREAM, Gio::FilterInputStream, GFilterInputStream)
+ _IMPLEMENTS_INTERFACE(Seekable)
+
protected:
_WRAP_CTOR(BufferedInputStream(const Glib::RefPtr<InputStream>& base_stream), g_buffered_input_stream_new)
_WRAP_PROPERTY("buffer-size", guint)
protected:
- //TODO: When we can break ABI, add vfunc. See https://bugzilla.gnome.org/show_bug.cgi?id=572471
#m4 _CONVERSION(`GCancellable*', `const Glib::RefPtr<Cancellable>&', `Glib::wrap($3, true)')
- //_WRAP_VFUNC(gssize fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable), fill, errthrow, err_return_value -1)
+ _WRAP_VFUNC(gssize fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable), fill, errthrow, err_return_value -1)
};
} // namespace Gio
Glib::RefPtr<BufferedOutputStream>
BufferedOutputStream::create_sized(const Glib::RefPtr<OutputStream>& base_stream, gsize size)
{
- return Glib::RefPtr<Gio::BufferedOutputStream>(new BufferedOutputStream(base_stream, size));
+ return Glib::make_refptr_for_instance<Gio::BufferedOutputStream>(new BufferedOutputStream(base_stream, size));
}
} // namespace Gio
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2008 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
*/
#include <giomm/filteroutputstream.h>
+#include <giomm/seekable.h>
#include <glibmm/object.h>
_DEFS(giomm,gio)
*
* @newin{2,16}
*/
-class BufferedOutputStream : public Gio::FilterOutputStream
+class BufferedOutputStream : public Gio::FilterOutputStream, public Gio::Seekable
{
_CLASS_GOBJECT(BufferedOutputStream, GBufferedOutputStream, G_BUFFERED_OUTPUT_STREAM, Gio::FilterOutputStream, GFilterOutputStream)
+ _IMPLEMENTS_INTERFACE(Seekable)
+
protected:
_WRAP_CTOR(BufferedOutputStream(const Glib::RefPtr<OutputStream>& base_stream), g_buffered_output_stream_new)
_CTOR_DEFAULT
public:
- using SlotCancelledCallback = sigc::slot<void>;
+ using SlotCancelledCallback = sigc::slot<void()>;
_WRAP_CREATE()
const Glib::ustring& to_charset, const Glib::ustring& from_charset)
: _CONSTRUCT("to-charset", to_charset.c_str(), "from-charset", from_charset.c_str())
{
+ init();
}
} // namespace Gio
#include <glibmm/object.h>
#include <giomm/converter.h>
+#include <giomm/initable.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
* CharsetConverter is an implementation of Converter based on GIConv.
* @newin{2,34}
*/
-class CharsetConverter : public Glib::Object, public Converter
+class CharsetConverter
+: public Glib::Object, public Converter, public Initable
{
_CLASS_GOBJECT(CharsetConverter, GCharsetConverter, G_CHARSET_CONVERTER, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(Converter)
+ _IMPLEMENTS_INTERFACE(Initable)
protected:
- // Handwritten to ignore the final GError** parameter in the *_new()
- // function.
+ // Handwritten to ignore the final GError** parameter in the *_new() function.
+ // But it can throw, due to its call to Initable::init().
explicit CharsetConverter(const Glib::ustring& to_charset, const Glib::ustring& from_charset);
_IGNORE(g_charset_converter_new)
*
* @param to_charset Destination charset.
* @param from_charset Source charset.
- * @return A new CharsetConverter, or <tt>0</tt> on error.
+ * @return A new CharsetConverter, or <tt>nullptr</tt> on error.
+ * @throw Gio::Error
*/
_WRAP_CREATE(const Glib::ustring& to_charset, const Glib::ustring& from_charset)
#include <gio/gio.h>
+using Flags = Gio::Converter::Flags;
+using Result = Gio::Converter::Result;
+
namespace Gio
{
namespace Gio
{
-_WRAP_ENUM(ConverterResult, GConverterResult)
-_WRAP_ENUM(ConverterFlags, GConverterFlags)
/** Converter - Data conversion interface.
* Converter is implemented by objects that convert binary data in various
_CLASS_INTERFACE(Converter, GConverter, G_CONVERTER, GConverterIface)
public:
- _WRAP_METHOD(ConverterResult convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, ConverterFlags flags, gsize& bytes_read, gsize& bytes_written), g_converter_convert, errthrow)
+ _WRAP_ENUM(Result, GConverterResult)
+ _WRAP_ENUM(Flags, GConverterFlags)
+
+ _WRAP_METHOD(Result convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, Flags flags, gsize& bytes_read, gsize& bytes_written), g_converter_convert, errthrow)
_WRAP_METHOD(void reset(), g_converter_reset)
#m4 _CONVERSION(`gsize*',`gsize&',`*($3)')
- _WRAP_VFUNC(ConverterResult convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, ConverterFlags flags, gsize& bytes_read, gsize& bytes_written), "convert", errthrow)
+ _WRAP_VFUNC(Result convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, Flags flags, gsize& bytes_read, gsize& bytes_written), "convert", errthrow)
_WRAP_VFUNC(void reset(), "reset")
};
namespace Gio
{
-_WRAP_ENUM(CredentialsType, GCredentialsType, NO_GTYPE)
/** An object containing credentials.
* The Credentials type is a reference-counted wrapper for native credentials.
_IGNORE(g_credentials_new)
public:
+ _WRAP_ENUM(Type, GCredentialsType, NO_GTYPE)
+
_WRAP_CREATE()
_WRAP_METHOD(Glib::ustring to_string() const, g_credentials_to_string)
- _WRAP_METHOD(gpointer get_native(CredentialsType native_type), g_credentials_get_native)
- _WRAP_METHOD(void set_native(CredentialsType native_type, gpointer native), g_credentials_set_native)
- _WRAP_METHOD(bool is_same_user(const Glib::RefPtr<const Credentials>& other_credentials), g_credentials_is_same_user, errthrow)
+ _WRAP_METHOD(gpointer get_native(Type native_type), g_credentials_get_native)
+ _WRAP_METHOD(void set_native(Type native_type, gpointer native), g_credentials_set_native)
+ _WRAP_METHOD(bool is_same_user(const Glib::RefPtr<const Credentials>& other_credentials), g_credentials_is_same_user, errthrow "Gio::Error")
- _WRAP_METHOD(uid_t get_unix_user(), g_credentials_get_unix_user, errthrow, ifdef G_OS_UNIX)
- _WRAP_METHOD(bool set_unix_user(uid_t uid), g_credentials_set_unix_user, errthrow, ifdef G_OS_UNIX)
+ _WRAP_METHOD(uid_t get_unix_user(), g_credentials_get_unix_user, errthrow "Gio::Error", ifdef G_OS_UNIX)
+ _WRAP_METHOD(bool set_unix_user(uid_t uid), g_credentials_set_unix_user, errthrow "Gio::Error", ifdef G_OS_UNIX)
- _WRAP_METHOD(pid_t get_unix_pid() const, g_credentials_get_unix_pid, errthrow, ifdef G_OS_UNIX)
+ _WRAP_METHOD(pid_t get_unix_pid() const, g_credentials_get_unix_pid, errthrow "Gio::Error", ifdef G_OS_UNIX)
};
return retval;
}
-_DEPRECATE_IFDEF_START
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-bool
-DataInputStream::read_until(
- std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable)
-{
- GError* gerror = nullptr;
- char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(),
- nullptr, // pass nullptr since we can easily determine the length from the returned std::string
- Glib::unwrap(cancellable), &gerror);
- if (gerror)
- ::Glib::Error::throw_exception(gerror);
- if (c_str)
- {
- data = c_str;
- g_free(c_str);
- return true;
- }
- // end of stream reached, return failure status
- return false;
-}
-
-/** non-cancellable version of read_until()
- */
-bool
-DataInputStream::read_until(std::string& data, const std::string& stop_chars)
-{
- GError* gerror = nullptr;
- char* c_str = g_data_input_stream_read_until(gobj(), stop_chars.c_str(),
- nullptr, // pass nullptr since we can easily determine the length from the returned std::string
- nullptr, &gerror);
- if (gerror)
- ::Glib::Error::throw_exception(gerror);
- if (c_str)
- {
- data = c_str;
- g_free(c_str);
- return true;
- }
- // end of stream reached, return failure status
- return false;
-}
-
-void
-DataInputStream::read_until_async(const std::string& stop_chars, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
-{
- // Create a copy of the slot.
- // A pointer to it will be passed through the callback's data parameter
- // and deleted in the callback.
- auto slot_copy = new SlotAsyncReady(slot);
-
- g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(), io_priority,
- Glib::unwrap(cancellable), &SignalProxy_async_callback, slot_copy);
-}
-
-bool
-DataInputStream::read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data)
-{
- GError* gerror = nullptr;
- gsize size = 0;
- gchar* buffer =
- g_data_input_stream_read_until_finish(gobj(), Glib::unwrap(result), &size, &(gerror));
- if (gerror)
- ::Glib::Error::throw_exception(gerror);
-
- bool retval = false;
- if (buffer && size)
- {
- retval = (buffer != nullptr);
- data = std::string(buffer, size);
- g_free(buffer);
- }
-
- return retval;
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-_DEPRECATE_IFDEF_END
-
bool
DataInputStream::read_upto(
std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable)
*/
_WRAP_METHOD(void read_line_finish_utf8(const Glib::RefPtr<AsyncResult>& result{.}, std::string& data{OUT}, gsize& length{.?}), g_data_input_stream_read_line_finish_utf8, errthrow)
-_DEPRECATE_IFDEF_START
- /** Reads a string from the data input stream, up to the first
- * occurrence of any of the stop characters.
- *
- * Note that, in contrast to read_until_async(),
- * this function consumes the stop character that it finds.
- *
- * Don't use this function in new code. Its functionality is
- * inconsistent with read_until_async(). Use
- * read_upto() instead, but note that that method
- * does not consume the stop character.
- *
- * @param[out] data A string to fill with the read data.
- * @param stop_chars Characters to terminate the read.
- * @param cancellable A cancellable object.
- * @result true if the read succeeded without error.
- *
- * @deprecated Use read_upto() instead, which has more consistent behaviour regarding the stop character.
- */
- bool read_until(std::string& data, const std::string& stop_chars, const Glib::RefPtr<Cancellable>& cancellable);
- _IGNORE(g_data_input_stream_read_until)
-
- /** A non-cancellable version of read_until().
- *
- * Note that, in contrast to read_until_async(),
- * this function consumes the stop character that it finds.
- *
- * Don't use this function in new code. Its functionality is
- * inconsistent with read_until_async(). Use
- * read_upto() instead, but note that that method
- * does not consume the stop character.
- *
- * @param[out] data A string to fill with the read data.
- * @param stop_chars Characters to terminate the read.
- * @result true if the read succeeded without error.
- *
- * @deprecated Use read_upto() instead, which has more consistent behaviour regarding the stop character.
- */
- bool read_until(std::string& data, const std::string& stop_chars);
-
- /** The asynchronous version of read_until(). It is
- * an error to have two outstanding calls to this function.
- *
- * Note that, in contrast to read_until(),
- * this function does not consume the stop character that it finds. You
- * must read it for yourself.
- *
- * Don't use this function in new code. Its functionality is
- * inconsistent with read_until(). Use read_upto_async() instead.
- *
- * @param stop_chars Characters to terminate the read.
- * @param slot The slot to call when the request is satisfied.
- * @param cancellable A cancellable object.
- * @param io_priority The I/O priority of the request.
- *
- * @deprecated Use read_upto_async() instead, which has more consistent behaviour regarding the stop character.
- */
- void read_until_async(const std::string& stop_chars, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority = Glib::PRIORITY_DEFAULT);
- _IGNORE(g_data_input_stream_read_until_async)
-
- /** Finish an asynchronous call started by read_until_async().
- *
- * @param result The AsyncResult that was provided to the callback slot.
- * @param[out] data A string to fill with the read data.
- * @result true if the read succeeded without error.
- *
- * @deprecated Use read_upto_finish() instead, which has more consistent behaviour regarding the stop character.
- */
- bool read_until_finish(const Glib::RefPtr<AsyncResult>& result, std::string& data);
- _IGNORE(g_data_input_stream_read_until_finish)
-_DEPRECATE_IFDEF_END
-
/** Reads a string from the data input stream, up to the first
* occurrence of any of the stop characters.
*
- * In contrast to read_until(), this method
- * does <em>not</em> consume the stop character. You have
- * to use read_byte() to get it before calling
- * read_upto() again.
+ * This method does <em>not</em> consume the stop character. You have
+ * to use read_byte() to get it before calling %read_upto() again.
*
* @param[out] data A string to fill with the read data.
* @param stop_chars Characters to terminate the read.
/** The asynchronous version of read_upto(). It is
* an error to have two outstanding calls to this function.
*
- * In contrast to read_until(), this method
- * does <em>not</em> consume the stop character. You have
- * to use read_byte() to get it before calling
- * read_upto() again.
+ * This method does <em>not</em> consume the stop character. You have
+ * to use read_byte() to get it before calling %read_upto_async() again.
*
* @param stop_chars Characters to terminate the read.
* @param slot The slot to call when the request is satisfied.
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <giomm/bufferedoutputstream.h>
+#include <giomm/filteroutputstream.h>
+#include <giomm/seekable.h>
#include <giomm/enums.h>
_DEFS(giomm,gio)
-_PINCLUDE(giomm/private/bufferedoutputstream_p.h)
+_PINCLUDE(giomm/private/filteroutputstream_p.h)
namespace Gio
{
/**
- * An implementation of BufferedOutputStream that allows for high-level data
+ * An implementation of FilterOutputStream that allows for high-level data
* manipulation of arbitrary data (including binary operations).
*
* @ingroup Streams
*
* @newin{2,16}
*/
-class DataOutputStream : public Gio::BufferedOutputStream
+class DataOutputStream : public Gio::FilterOutputStream, public Gio::Seekable
{
- _CLASS_GOBJECT(DataOutputStream, GDataOutputStream, G_DATA_OUTPUT_STREAM, Gio::BufferedOutputStream, GBufferedOutputStream)
+ _CLASS_GOBJECT(DataOutputStream, GDataOutputStream, G_DATA_OUTPUT_STREAM, Gio::FilterOutputStream, GFilterOutputStream)
+ _IMPLEMENTS_INTERFACE(Seekable)
protected:
_WRAP_CTOR(DataOutputStream(const Glib::RefPtr<OutputStream>& base_stream), g_data_output_stream_new)
_WRAP_METHOD(bool put_uint64(guint64 data, const Glib::RefPtr<Cancellable>& cancellable{?}), g_data_output_stream_put_uint64, errthrow)
- _WRAP_METHOD(bool put_string(std::string str, const Glib::RefPtr<Cancellable>& cancellable{?}), g_data_output_stream_put_string, errthrow)
+ _WRAP_METHOD(bool put_string(const std::string& str, const Glib::RefPtr<Cancellable>& cancellable{?}), g_data_output_stream_put_string, errthrow)
_WRAP_PROPERTY("byte-order", DataStreamByteOrder)
};
} // namespace Gio
-
* @newin{2,32}
*/
class ActionGroup
-: public Glib::Object, public ::Gio::ActionGroup, public RemoteActionGroup
+: public Glib::Object, public Gio::ActionGroup, public Gio::RemoteActionGroup
{
_CLASS_GOBJECT(ActionGroup, GDBusActionGroup, G_DBUS_ACTION_GROUP, Glib::Object, GObject)
- _IMPLEMENTS_INTERFACE(::Gio::ActionGroup)
- _IMPLEMENTS_INTERFACE(RemoteActionGroup)
+ _IMPLEMENTS_INTERFACE(Gio::ActionGroup)
+ _IMPLEMENTS_INTERFACE(Gio::RemoteActionGroup)
protected:
_CTOR_DEFAULT
const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(stream, guid, observer, cancellable, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(stream, guid, observer, cancellable, flags));
}
// static
Connection::create_sync(const Glib::RefPtr<IOStream>& stream, const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(stream, guid, cancellable, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(stream, guid, cancellable, flags));
}
// static
Connection::create_sync(const Glib::RefPtr<IOStream>& stream, const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer, ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(stream, guid, observer, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(stream, guid, observer, flags));
}
// static
Connection::create_sync(
const Glib::RefPtr<IOStream>& stream, const std::string& guid, ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(stream, guid, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(stream, guid, flags));
}
// static
const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable,
ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(address, observer, cancellable, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(address, observer, cancellable, flags));
}
// static
Connection::create_for_address_sync(
const std::string& address, const Glib::RefPtr<Cancellable>& cancellable, ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(address, cancellable, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(address, cancellable, flags));
}
// static
Connection::create_for_address_sync(
const std::string& address, const Glib::RefPtr<AuthObserver>& observer, ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(address, observer, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(address, observer, flags));
}
// static
Glib::RefPtr<Connection>
Connection::create_for_address_sync(const std::string& address, ConnectionFlags flags)
{
- return Glib::RefPtr<Connection>(new Connection(address, flags));
+ return Glib::make_refptr_for_instance<Connection>(new Connection(address, flags));
}
// static
{
_WRAP_ENUM(BusType, GBusType)
-_WRAP_ENUM(CallFlags, GDBusCallFlags, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(ConnectionFlags, GDBusConnectionFlags, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(SendMessageFlags, GDBusSendMessageFlags, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(SignalFlags, GDBusSignalFlags, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(SubtreeFlags, GDBusSubtreeFlags, s#^DBUS_##, NO_GTYPE)
+_WRAP_ENUM(CallFlags, GDBusCallFlags, NO_GTYPE)
+_WRAP_ENUM(ConnectionFlags, GDBusConnectionFlags, NO_GTYPE)
+_WRAP_ENUM(SendMessageFlags, GDBusSendMessageFlags, NO_GTYPE)
+_WRAP_ENUM(SignalFlags, GDBusSignalFlags, NO_GTYPE)
+_WRAP_ENUM(SubtreeFlags, GDBusSubtreeFlags, NO_GTYPE)
_GMMPROC_EXTRA_NAMESPACE(DBus)
* Glib::ustring& signal_name, const Glib::VariantContainerBase& parameters);.
* @endcode
*/
- using SlotSignal = sigc::slot<void, const Glib::RefPtr<Connection>&,
+ using SlotSignal = sigc::slot<void(const Glib::RefPtr<Connection>&,
const Glib::ustring&, const Glib::ustring&, const Glib::ustring&,
- const Glib::ustring&, const Glib::VariantContainerBase&>;
+ const Glib::ustring&, const Glib::VariantContainerBase&)>;
/** Signature for slot used in add_filter().
* For example,
* drop a message can simply return <tt>0</tt>. And filter function may
* modify a message by copying it and return the copy.
*/
- using SlotMessageFilter = sigc::slot<Glib::RefPtr<Message>,
+ using SlotMessageFilter = sigc::slot<Glib::RefPtr<Message>(
const Glib::RefPtr<Connection>&,
- const Glib::RefPtr<Message>&, bool>;
+ const Glib::RefPtr<Message>&, bool)>;
/** Asynchronously connects to the message bus specified by @a bus_type.
*
*/
static void get(BusType bus_type, const SlotAsyncReady& slot);
- _WRAP_METHOD_DOCS_ONLY( g_bus_get_finish, errthrow)
- /// @throw Glib::Error.
_WRAP_METHOD(static Glib::RefPtr<Connection> get_finish(const Glib::RefPtr<AsyncResult>& res), g_bus_get_finish, errthrow)
_WRAP_METHOD(static Glib::RefPtr<Connection> get_sync(BusType bus_type, const Glib::RefPtr<Cancellable>& cancellable{?}), g_bus_get_sync, errthrow)
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
_WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new)
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create().
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create().
static void create(const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const SlotAsyncReady& slot,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_finish)
- /// @throw Glib::Error.
_WRAP_METHOD(static Glib::RefPtr<Connection> create_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_new_finish, errthrow)
_WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address)
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
_WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address)
static void create_for_address(const std::string& address,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create_for_address().
static void create_for_address(const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const SlotAsyncReady& slot,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create_for_address().
static void create_for_address(const std::string& address,
const SlotAsyncReady& slot,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_finish)
- /// @throw Glib::Error.
_WRAP_METHOD(static Glib::RefPtr<Connection> create_for_address_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_new_for_address_finish, errthrow)
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_sync)
- /// @throw Glib::Error.
+ _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_sync, errthrow)
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_sync)
- /// @throw Glib::Error.
+ _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_sync, errthrow)
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Connection> create_sync(
const Glib::RefPtr<IOStream>& stream,
const std::string& guid,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_sync)
- /// @throw Glib::Error.
+ _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_sync, errthrow)
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_sync)
- /// @throw Glib::Error.
+ _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_sync, errthrow)
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
const Glib::RefPtr<Cancellable>& cancellable,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create_for_address_sync().
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
const Glib::RefPtr<AuthObserver>& observer,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/// Non-cancellable version of create_for_address_sync().
static Glib::RefPtr<Connection> create_for_address_sync(
const std::string& address,
- ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE);
+ ConnectionFlags flags = Gio::DBus::ConnectionFlags::NONE);
/** Closes the connection. Note that this never causes the process to exit
* (this might only happen if the other end of a shared message bus
/// A send_message() without an "out_serial" parameter.
bool send_message(const Glib::RefPtr<Message>& message,
- SendMessageFlags flags = Gio::DBus::SEND_MESSAGE_FLAGS_NONE);
+ SendMessageFlags flags = Gio::DBus::SendMessageFlags::NONE);
/** Asynchronously sends message to the peer represented by the connection.
*
- * Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
+ * Unless flags contain the Gio::DBus::SendMessageFlags::PRESERVE_SERIAL
* flag, the serial number will be assigned by the connection and set on
* message via Gio::DBus::Message::set_serial().
*
* send_message_with_reply_sync() for the synchronous version.
*
* Note that message must be unlocked, unless flags contain the
- * Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
+ * Gio::DBus::SendMessageFlags::PRESERVE_SERIAL flag.
*
* See the C API docs for examples.
*
int timeout_msec,
const SlotAsyncReady& slot);
- _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_send_message_with_reply_finish)
- /// @throw Glib::Error.
_WRAP_METHOD(Glib::RefPtr<Message> send_message_with_reply_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_send_message_with_reply_finish, errthrow)
/** Synchronously sends @a message to the peer represented by the connection
* reached. See send_message_with_reply() for the asynchronous version of
* this method.
*
- * Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
+ * Unless flags contain the Gio::DBus::SendMessageFlags::PRESERVE_SERIAL
* flag, the serial number will be assigned by the connection and set on
* message via Gio::DBus::Message::set_serial().
*
* See the C API docs for examples.
*
* Note that message must be unlocked, unless flags contain the
- * Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
+ * Gio::DBus::SendMessageFlags::PRESERVE_SERIAL flag.
*
* @param message A Message.
* @param cancellable A Cancellable.
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
- CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
_IGNORE(g_dbus_connection_call)
const SlotAsyncReady& slot,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
- CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
/** Finishes an operation started with call().
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
- CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
_IGNORE(g_dbus_connection_call_sync)
const Glib::VariantContainerBase& parameters,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
- CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
#ifdef G_OS_UNIX
const Glib::RefPtr<UnixFDList>& fd_list,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
- CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
_IGNORE(g_dbus_connection_call_with_unix_fd_list)
const Glib::RefPtr<UnixFDList>& fd_list,
const Glib::ustring& bus_name = Glib::ustring(),
int timeout_msec = -1,
- CallFlags flags = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type = Glib::VariantType());
#endif // G_OS_UNIX
Glib::RefPtr<UnixFDList>& out_fd_list{.>>},
const Glib::ustring& bus_name{.NULL} = Glib::ustring(),
int timeout_msec{.} = -1,
- CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE,
+ CallFlags flags{.} = Gio::DBus::CallFlags::NONE,
const Glib::VariantType& reply_type{.} = Glib::VariantType()
),
g_dbus_connection_call_with_unix_fd_list_sync, errthrow, ifdef G_OS_UNIX
const Glib::ustring& member = Glib::ustring(),
const Glib::ustring& object_path = Glib::ustring(),
const Glib::ustring& arg0 = Glib::ustring(),
- SignalFlags flags = Gio::DBus::SIGNAL_FLAGS_NONE);
+ SignalFlags flags = Gio::DBus::SignalFlags::NONE);
_IGNORE(g_dbus_connection_signal_subscribe)
_WRAP_METHOD(void signal_unsubscribe(guint subscription_id), g_dbus_connection_signal_unsubscribe)
*
* When handling remote calls into any node in the subtree, first the
* enumerate slot is used to check if the node exists. If the node
- * exists or the Gio::DBus::SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag
+ * exists or the Gio::DBus::SubtreeFlags::DISPATCH_TO_UNENUMERATED_NODES flag
* is set the introspection slot is used to check if the node supports the
* requested method. If so, the dispatch function is used to determine where
* to dispatch the call. The collected InterfaceVTable will be used to
*/
guint register_subtree(const Glib::ustring& object_path,
const SubtreeVTable& vtable,
- SubtreeFlags flags = Gio::DBus::SUBTREE_FLAGS_NONE);
+ SubtreeFlags flags = Gio::DBus::SubtreeFlags::NONE);
_IGNORE(g_dbus_connection_register_subtree)
_WRAP_METHOD(bool unregister_subtree(guint registration_id), g_dbus_connection_unregister_subtree)
_GMMPROC_EXTRA_NAMESPACE(DBus)
-//TODO: Have Proxy derive from this interface when there is an ABI break.
-
/** Interface - Base type for D-Bus interfaces.
* The Interface type is the base type for D-Bus interfaces both on the service
* side (see InterfaceSkeleton) and client side (see Proxy).
#include <giomm/dbusconnection.h>
#include <giomm/dbusintrospection.h>
#include <giomm/dbusmethodinvocation.h>
+
+using Flags = Gio::DBus::InterfaceSkeleton::Flags;
namespace DBus
{
-_WRAP_ENUM(InterfaceSkeletonFlags, GDBusInterfaceSkeletonFlags, NO_GTYPE)
-
class InterfaceInfo;
class Connection;
class MethodInvocation;
_IMPLEMENTS_INTERFACE(Interface)
public:
+ _WRAP_ENUM(Flags, GDBusInterfaceSkeletonFlags, NO_GTYPE)
+
_WRAP_METHOD(void flush(), g_dbus_interface_skeleton_flush)
_WRAP_METHOD(Glib::RefPtr<InterfaceInfo> get_info(), g_dbus_interface_skeleton_get_info)
_WRAP_METHOD(Glib::ustring get_object_path() const, g_dbus_interface_skeleton_get_object_path)
- _WRAP_METHOD(InterfaceSkeletonFlags get_flags() const, g_dbus_interface_skeleton_get_flags)
- _WRAP_METHOD(void set_flags(InterfaceSkeletonFlags flags), g_dbus_interface_skeleton_set_flags)
+ _WRAP_METHOD(Flags get_flags() const, g_dbus_interface_skeleton_get_flags)
+ _WRAP_METHOD(void set_flags(Flags flags), g_dbus_interface_skeleton_set_flags)
- _WRAP_PROPERTY("g-flags", InterfaceSkeletonFlags)
+ _WRAP_PROPERTY("g-flags", Flags)
#m4 _CONVERSION(`GDBusMethodInvocation*',`const Glib::RefPtr<MethodInvocation>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(bool authorize_method(const Glib::RefPtr<MethodInvocation>& invocation), "g_authorize_method")
* @endcode
*/
using SlotInterfaceMethodCall = sigc::slot<
- void,
+ void(
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::VariantContainerBase&,
- const Glib::RefPtr<MethodInvocation>&
+ const Glib::RefPtr<MethodInvocation>&)
>;
/** The type for a slot which handles getting a property for a D-Bus
* @throw Glib::Error.
*/
using SlotInterfaceGetProperty = sigc::slot<
- void,
+ void(
Glib::VariantBase&,
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
- const Glib::ustring&
+ const Glib::ustring&)
>;
/** The type for a slot which handles setting a property for a D-Bus
* @throw Glib::Error.
*/
using SlotInterfaceSetProperty = sigc::slot<
- bool,
+ bool(
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
- const Glib::VariantBase&
+ const Glib::VariantBase&)
>;
/** Constructs a new InterfaceVTable using the specified slots.
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <glibmm/refptr.h>
#include <gio/gio.h>
-#include <glibmm/arrayhandle.h>
+#include <vector>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
namespace DBus
{
-_WRAP_ENUM(PropertyInfoFlags, GDBusPropertyInfoFlags, s#^DBUS_##, NO_GTYPE)
+_WRAP_ENUM(PropertyInfoFlags, GDBusPropertyInfoFlags, NO_GTYPE)
/** Stores information about an annotation.
*
_IGNORE(g_dbus_annotation_info_ref, g_dbus_annotation_info_unref)
public:
-#m4 _CONVERSION(`const Glib::ArrayHandle< Glib::RefPtr<AnnotationInfo> >&', `GDBusAnnotationInfo**', `const_cast<GDBusAnnotationInfo**>($3.data())')
- _WRAP_METHOD(static Glib::ustring info_lookup(const Glib::ArrayHandle< Glib::RefPtr<AnnotationInfo> >& annotations, const Glib::ustring& name), g_dbus_annotation_info_lookup)
+#m4 _CONVERSION(`const std::vector<Glib::RefPtr<AnnotationInfo>>&', `GDBusAnnotationInfo**',`Glib::ArrayHandler<Glib::RefPtr<AnnotationInfo>>::vector_to_array($3).data()')
+ _WRAP_METHOD(static Glib::ustring info_lookup(const std::vector<Glib::RefPtr<AnnotationInfo>>& annotations, const Glib::ustring& name), g_dbus_annotation_info_lookup)
};
/** ArgInfo - Stores information about an argument for a method or a
_IGNORE(g_dbus_node_info_ref, g_dbus_node_info_unref)
public:
- _WRAP_METHOD_DOCS_ONLY(g_dbus_node_info_new_for_xml)
- /// @throw Glib::Error.
- _WRAP_METHOD(static Glib::RefPtr<NodeInfo> create_for_xml(const Glib::ustring& xml_data), g_dbus_node_info_new_for_xml, errthrow)
+ _WRAP_METHOD(static Glib::RefPtr<NodeInfo> create_for_xml(const Glib::ustring& xml_data), g_dbus_node_info_new_for_xml, errthrow "Glib::MarkupError")
_WRAP_METHOD(Glib::RefPtr<InterfaceInfo> lookup_interface(const Glib::ustring& name), g_dbus_node_info_lookup_interface, refreturn)
_WRAP_METHOD(Glib::RefPtr<const InterfaceInfo> lookup_interface(const Glib::ustring& name) const, g_dbus_node_info_lookup_interface, constversion, refreturn)
namespace DBus
{
-_WRAP_ENUM(MessageType, GDBusMessageType, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(MessageFlags, GDBusMessageFlags, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(MessageHeaderField, GDBusMessageHeaderField, s#^DBUS_##, NO_GTYPE)
-_WRAP_ENUM(CapabilityFlags, GDBusCapabilityFlags, s#^DBUS_##, NO_GTYPE)
+_WRAP_ENUM(MessageType, GDBusMessageType, NO_GTYPE)
+_WRAP_ENUM(MessageFlags, GDBusMessageFlags, NO_GTYPE)
+_WRAP_ENUM(MessageHeaderField, GDBusMessageHeaderField, NO_GTYPE)
+_WRAP_ENUM(CapabilityFlags, GDBusCapabilityFlags, NO_GTYPE)
_GMMPROC_EXTRA_NAMESPACE(DBus)
// Ignore variable argument functions.
_IGNORE(g_dbus_message_new_method_error, g_dbus_message_new_method_error_valist)
- _WRAP_METHOD(static Glib::RefPtr<Message> create_from_blob(const guchar* blob, gsize blob_len, CapabilityFlags capabilities = CAPABILITY_FLAGS_NONE), g_dbus_message_new_from_blob, errthrow)
+ _WRAP_METHOD(static Glib::RefPtr<Message> create_from_blob(const guchar* blob, gsize blob_len, CapabilityFlags capabilities = CapabilityFlags::NONE), g_dbus_message_new_from_blob, errthrow "Gio::Error")
_WRAP_METHOD(Glib::ustring print(guint indent), g_dbus_message_print)
_WRAP_METHOD(bool get_locked() const, g_dbus_message_get_locked)
_WRAP_METHOD(void lock() ,g_dbus_message_lock)
- _WRAP_METHOD(Glib::RefPtr<Message> copy() const, g_dbus_message_copy, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<Message> copy() const, g_dbus_message_copy, errthrow "Gio::Error")
_WRAP_METHOD(MessageType get_message_type() const, g_dbus_message_get_message_type)
_WRAP_METHOD(void set_message_type(MessageType type), g_dbus_message_set_message_type)
- //gmmproc can't handle the character literals, and this won't be expanded in future,
- //so we just wrap it by hand.
- enum ByteOrder
- {
- BYTE_ORDER_BIG_ENDIAN = 'B',
- BYTE_ORDER_LITTLE_ENDIAN = 'l'
- };
-
- #m4 _CONVERSION(`ByteOrder',`GDBusMessageByteOrder',`(GDBusMessageByteOrder)($3)')
- #m4 _CONVERSION(`GDBusMessageByteOrder',`ByteOrder',`(ByteOrder)($3)')
+ // BIG_ENDIAN and LITTLE_ENDIAN are defined as preprocessor macros somewhere.
+ _WRAP_ENUM(ByteOrder, GDBusMessageByteOrder, NO_GTYPE, s#ENDIAN$#ENDIAN_ORDER#)
_WRAP_METHOD(ByteOrder get_byte_order() const, g_dbus_message_get_byte_order)
_WRAP_METHOD(void set_byte_order(ByteOrder byte_order), g_dbus_message_set_byte_order)
_WRAP_METHOD(void set_header(MessageHeaderField header_field, const Glib::VariantBase& value), g_dbus_message_set_header)
- #m4 _CONVERSION(`guchar*',`Glib::ArrayHandle<guchar>',`Glib::ArrayHandle<guchar>($3)')
- _WRAP_METHOD(Glib::ArrayHandle<guchar> get_header_fields() const, g_dbus_message_get_header_fields)
+ #m4 _CONVERSION(`guchar*',`std::vector<guchar>',`Glib::ArrayHandler<guchar>::array_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<guchar> get_header_fields() const, g_dbus_message_get_header_fields)
_WRAP_METHOD(Glib::ustring get_destination() const, g_dbus_message_get_destination)
_WRAP_METHOD(void set_destination(const Glib::ustring& value), g_dbus_message_set_destination)
_WRAP_METHOD(Glib::ustring get_arg0() const, g_dbus_message_get_arg0)
- _WRAP_METHOD(static gssize bytes_needed(const guchar* blob, gsize blob_len), g_dbus_message_bytes_needed, errthrow)
+ _WRAP_METHOD(static gssize bytes_needed(const guchar* blob, gsize blob_len), g_dbus_message_bytes_needed, errthrow "Gio::Error")
- _WRAP_METHOD(guchar* to_blob(gsize& out_size, CapabilityFlags capabilities = CAPABILITY_FLAGS_NONE), g_dbus_message_to_blob, errthrow)
+ _WRAP_METHOD(guchar* to_blob(gsize& out_size, CapabilityFlags capabilities = CapabilityFlags::NONE), g_dbus_message_to_blob, errthrow "Gio::Error")
_WRAP_METHOD(void to_exception(), g_dbus_message_to_gerror, errthrow)
-// -*- 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
namespace DBus
{
-_WRAP_ENUM(BusNameOwnerFlags, GBusNameOwnerFlags, s#^DBUS_##)
+_WRAP_ENUM(BusNameOwnerFlags, GBusNameOwnerFlags)
/** For example,
* void on_bus_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connection,
* @newin{2,28}
* @ingroup DBus
*/
-using SlotBusAcquired = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>;
+using SlotBusAcquired = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)>;
/** For example,
* void on_name_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connection,
* const Glib::ustring& name);
* @ingroup DBus
*/
-using SlotNameAcquired = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>;
+using SlotNameAcquired = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)>;
/** For example,
* void on_name_lost(const Glib::RefPtr<Gio::DBus::Connection>& connection,
* const Glib::ustring& name);
* @ingroup DBus
*/
-using SlotNameLost = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>;
+using SlotNameLost = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)>;
//TODO: See https://bugzilla.gnome.org/show_bug.cgi?id=646427 about the apparent uselessness of SlotNameAcquired.
//TODO: Add example from C API in class docs.
const SlotBusAcquired& bus_acquired_slot = SlotBusAcquired(),
const SlotNameAcquired& name_acquired_slot = SlotNameAcquired(),
const SlotNameLost& name_lost_slot = SlotNameLost(),
- BusNameOwnerFlags flags = Gio::DBus::BUS_NAME_OWNER_FLAGS_NONE
+ BusNameOwnerFlags flags = Gio::DBus::BusNameOwnerFlags::NONE
);
_IGNORE(g_bus_own_name)
const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
ProxyFlags flags)
{
- return Glib::RefPtr<Proxy>(
+ return Glib::make_refptr_for_instance<Proxy>(
new Proxy(connection, name, object_path, interface_name, cancellable, info, flags));
}
const Glib::ustring& object_path, const Glib::ustring& interface_name,
const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
{
- return Glib::RefPtr<Proxy>(new Proxy(connection, name, object_path, interface_name, info, flags));
+ return Glib::make_refptr_for_instance<Proxy>(new Proxy(connection, name, object_path, interface_name, info, flags));
}
void
const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<InterfaceInfo>& info,
ProxyFlags flags)
{
- return Glib::RefPtr<Proxy>(
+ return Glib::make_refptr_for_instance<Proxy>(
new Proxy(bus_type, name, object_path, interface_name, cancellable, info, flags));
}
const Glib::ustring& object_path, const Glib::ustring& interface_name,
const Glib::RefPtr<InterfaceInfo>& info, ProxyFlags flags)
{
- return Glib::RefPtr<Proxy>(new Proxy(bus_type, name, object_path, interface_name, info, flags));
+ return Glib::make_refptr_for_instance<Proxy>(new Proxy(bus_type, name, object_path, interface_name, info, flags));
}
void
#include <glibmm/object.h>
#include <giomm/asyncresult.h>
#include <giomm/dbusintrospection.h>
+#include <giomm/dbusinterface.h>
#include <giomm/initable.h>
#include <giomm/asyncinitable.h>
#include <giomm/dbusconnection.h>
//The GMMPROC_EXTRA_NAMESPACE() macro is a hint to generate_wrap_init.pl to put it in the DBus sub-namespace
_GMMPROC_EXTRA_NAMESPACE(DBus)
-_WRAP_ENUM(ProxyFlags, GDBusProxyFlags, s#^DBUS_##, NO_GTYPE)
+_WRAP_ENUM(ProxyFlags, GDBusProxyFlags, NO_GTYPE)
/** A client-side proxy.
* This is a base class used for proxies to access a D-Bus interface on
class Proxy
: public Glib::Object,
public Initable,
- public AsyncInitable
+ public AsyncInitable,
+ public Interface
{
_CLASS_GOBJECT(Proxy, GDBusProxy, G_DBUS_PROXY, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(Initable)
_IMPLEMENTS_INTERFACE(AsyncInitable)
+ _IMPLEMENTS_INTERFACE(DBus::Interface)
protected:
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(const Glib::RefPtr<Connection>& connection,
const Glib::ustring& name,
const Glib::ustring& interface_name,
const SlotAsyncReady& slot,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(const Glib::RefPtr<Connection>& connection,
const Glib::ustring& name,
const Glib::ustring& interface_name,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(const Glib::RefPtr<Connection>& connection,
const Glib::ustring& name,
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(BusType bus_type,
const Glib::ustring& name,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(BusType bus_type,
const Glib::ustring& name,
const Glib::ustring& interface_name,
const SlotAsyncReady& slot,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(BusType bus_type,
const Glib::ustring& name,
const Glib::ustring& interface_name,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
Proxy(BusType bus_type,
const Glib::ustring& name,
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
public:
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
/// Non-cancellable version of create().
static void create(const Glib::RefPtr<Connection>& connection,
const Glib::ustring& interface_name,
const SlotAsyncReady& slot,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
_WRAP_METHOD_DOCS_ONLY(g_dbus_proxy_new_finish)
/// @throw Glib::Error.
const Glib::ustring& interface_name,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Proxy>
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
_WRAP_METHOD_DOCS_ONLY(g_dbus_proxy_new_for_bus)
static void create_for_bus(BusType bus_type,
const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
/// Non-cancellable version of create_for_bus().
static void create_for_bus(BusType bus_type,
const Glib::ustring& interface_name,
const SlotAsyncReady& slot,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
_WRAP_METHOD_DOCS_ONLY(g_dbus_proxy_new_for_bus_finish)
/// @throw Glib::Error.
const Glib::ustring& interface_name,
const Glib::RefPtr<Cancellable>& cancellable,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
/// Non-cancellable version of create_for_bus_sync().
static Glib::RefPtr<Proxy>
const Glib::ustring& object_path,
const Glib::ustring& interface_name,
const Glib::RefPtr<InterfaceInfo>& info = Glib::RefPtr<InterfaceInfo>(),
- ProxyFlags flags = PROXY_FLAGS_NONE);
+ ProxyFlags flags = ProxyFlags::NONE);
_WRAP_METHOD(ProxyFlags get_flags() const, g_dbus_proxy_get_flags)
_WRAP_METHOD(void set_cached_property(const Glib::ustring& property_name, const Glib::VariantBase& value), g_dbus_proxy_set_cached_property)
-#m4 _CONVERSION(`gchar**', `Glib::StringArrayHandle', `Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle get_cached_property_names() const, g_dbus_proxy_get_cached_property_names)
+#m4 _CONVERSION(`gchar**', `std::vector<Glib::ustring>', `Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_cached_property_names() const, g_dbus_proxy_get_cached_property_names)
_WRAP_METHOD(void set_interface_info(const Glib::RefPtr<InterfaceInfo>& info), g_dbus_proxy_set_interface_info)
_WRAP_METHOD(Glib::RefPtr<InterfaceInfo> get_interface_info(), g_dbus_proxy_get_interface_info)
const Glib::RefPtr<Cancellable>& cancellable{.?},
const Glib::VariantContainerBase& parameters{.} = Glib::VariantContainerBase(),
int timeout_msec{.} = -1,
- CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE
+ CallFlags flags{.} = Gio::DBus::CallFlags::NONE
),
g_dbus_proxy_call, slot_name slot, slot_callback SignalProxy_async_callback
)
const Glib::RefPtr<Cancellable>& cancellable{.?},
const Glib::VariantContainerBase& parameters{.} = Glib::VariantContainerBase(),
int timeout_msec{.} = -1,
- CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE
+ CallFlags flags{.} = Gio::DBus::CallFlags::NONE
),
g_dbus_proxy_call_sync, errthrow
)
const Glib::RefPtr<Cancellable>& cancellable{.?},
const Glib::RefPtr<UnixFDList>& fd_list{.},
int timeout_msec{.} = -1,
- CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE
+ CallFlags flags{.} = Gio::DBus::CallFlags::NONE
),
g_dbus_proxy_call_with_unix_fd_list, ifdef G_OS_UNIX,
slot_name slot, slot_callback SignalProxy_async_callback
const Glib::RefPtr<UnixFDList>& fd_list{.},
Glib::RefPtr<UnixFDList>& out_fd_list{.>>},
int timeout_msec{.} = -1,
- CallFlags flags{.} = Gio::DBus::CALL_FLAGS_NONE
+ CallFlags flags{.} = Gio::DBus::CallFlags::NONE
),
g_dbus_proxy_call_with_unix_fd_list_sync, errthrow, ifdef G_OS_UNIX
)
#include <giomm/dbusconnection.h>
#include <giomm/dbusauthobserver.h>
+using Flags = Gio::DBus::Server::Flags;
+
namespace Gio
{
Server::Server(const std::string& address, const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable,
- ServerFlags flags)
+ Flags flags)
: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags",
static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid),
"authentication-observer", Glib::unwrap(observer))
}
Server::Server(const std::string& address, const std::string& guid,
- const Glib::RefPtr<Cancellable>& cancellable, ServerFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, Flags flags)
: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags",
static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid),
"authentication-observer", static_cast<GDBusAuthObserver*>(nullptr))
}
Server::Server(const std::string& address, const std::string& guid,
- const Glib::RefPtr<AuthObserver>& observer, ServerFlags flags)
+ const Glib::RefPtr<AuthObserver>& observer, Flags flags)
: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags",
static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid),
"authentication-observer", Glib::unwrap(observer))
init();
}
-Server::Server(const std::string& address, const std::string& guid, ServerFlags flags)
+Server::Server(const std::string& address, const std::string& guid, Flags flags)
: _CONSTRUCT("address", Glib::c_str_or_nullptr(address), "flags",
static_cast<GDBusServerFlags>(flags), "guid", Glib::c_str_or_nullptr(guid),
"authentication-observer", static_cast<GDBusAuthObserver*>(nullptr))
Glib::RefPtr<Server>
Server::create_sync(const std::string& address, const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable,
- ServerFlags flags)
+ Flags flags)
{
- return Glib::RefPtr<Server>(new Server(address, guid, observer, cancellable, flags));
+ return Glib::make_refptr_for_instance<Server>(new Server(address, guid, observer, cancellable, flags));
}
Glib::RefPtr<Server>
Server::create_sync(const std::string& address, const std::string& guid,
- const Glib::RefPtr<Cancellable>& cancellable, ServerFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, Flags flags)
{
- return Glib::RefPtr<Server>(new Server(address, guid, cancellable, flags));
+ return Glib::make_refptr_for_instance<Server>(new Server(address, guid, cancellable, flags));
}
Glib::RefPtr<Server>
Server::create_sync(const std::string& address, const std::string& guid,
- const Glib::RefPtr<AuthObserver>& observer, ServerFlags flags)
+ const Glib::RefPtr<AuthObserver>& observer, Flags flags)
{
- return Glib::RefPtr<Server>(new Server(address, guid, observer, flags));
+ return Glib::make_refptr_for_instance<Server>(new Server(address, guid, observer, flags));
}
Glib::RefPtr<Server>
-Server::create_sync(const std::string& address, const std::string& guid, ServerFlags flags)
+Server::create_sync(const std::string& address, const std::string& guid, Flags flags)
{
- return Glib::RefPtr<Server>(new Server(address, guid, flags));
+ return Glib::make_refptr_for_instance<Server>(new Server(address, guid, flags));
}
} // namespace DBus
-// -*- 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
namespace DBus
{
-_WRAP_ENUM(ServerFlags, GDBusServerFlags, s#^DBUS_##, NO_GTYPE)
-
_GMMPROC_EXTRA_NAMESPACE(DBus)
//TODO: Add example from the C API in class docs.
_CLASS_GOBJECT(Server, GDBusServer, G_DBUS_SERVER, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(Initable)
-protected:
+public:
+ _WRAP_ENUM(Flags, GDBusServerFlags, NO_GTYPE)
+protected:
Server(const std::string& address,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
- ServerFlags flags);
+ Flags flags);
Server(const std::string& address,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
- ServerFlags flags);
+ Flags flags);
Server(const std::string& address,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
- ServerFlags flags);
+ Flags flags);
Server(const std::string& address,
const std::string& guid,
- ServerFlags flags);
+ Flags flags);
public:
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
const Glib::RefPtr<Cancellable>& cancellable,
- ServerFlags flags = Gio::DBus::SERVER_FLAGS_NONE);
+ Flags flags = Gio::DBus::Server::Flags::NONE);
_WRAP_METHOD_DOCS_ONLY(g_dbus_server_new_sync)
/// @throw Glib::Error.
static Glib::RefPtr<Server> create_sync(const std::string& address,
const std::string& guid,
const Glib::RefPtr<Cancellable>& cancellable,
- ServerFlags flags = Gio::DBus::SERVER_FLAGS_NONE);
+ Flags flags = Gio::DBus::Server::Flags::NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Server> create_sync(const std::string& address,
const std::string& guid,
const Glib::RefPtr<AuthObserver>& observer,
- ServerFlags flags = Gio::DBus::SERVER_FLAGS_NONE);
+ Flags flags = Gio::DBus::Server::Flags::NONE);
/// Non-cancellable version of create_sync().
static Glib::RefPtr<Server> create_sync(const std::string& address,
const std::string& guid,
- ServerFlags flags = Gio::DBus::SERVER_FLAGS_NONE);
+ Flags flags = Gio::DBus::Server::Flags::NONE);
_WRAP_METHOD(void start(), g_dbus_server_start)
_WRAP_METHOD(void stop(), g_dbus_server_stop)
_WRAP_METHOD(bool is_active() const, g_dbus_server_is_active)
_WRAP_METHOD(std::string get_guid() const, g_dbus_server_get_guid)
- _WRAP_METHOD(ServerFlags get_flags() const, g_dbus_server_get_flags)
+ _WRAP_METHOD(Flags get_flags() const, g_dbus_server_get_flags)
_WRAP_METHOD(std::string get_client_address() const, g_dbus_server_get_client_address)
_WRAP_PROPERTY("active", bool)
_WRAP_PROPERTY("address", std::string)
_WRAP_PROPERTY("authentication-observer", Glib::RefPtr<AuthObserver>)
_WRAP_PROPERTY("client-address", std::string)
- _WRAP_PROPERTY("flags", ServerFlags)
+ _WRAP_PROPERTY("flags", Flags)
_WRAP_PROPERTY("guid", std::string)
#m4 _CONVERSION(`GDBusConnection*', `const Glib::RefPtr<Connection>&', `Glib::wrap($3, true)')
* @endcode
*/
using SlotSubtreeEnumerate = sigc::slot<
- std::vector<Glib::ustring>,
+ std::vector<Glib::ustring>(
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
- const Glib::ustring&
+ const Glib::ustring&)
>;
/** The type for a slot which handles introspecting a child node.
* @endcode
*/
using SlotSubtreeIntrospect = sigc::slot<
- std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >,
+ std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >(
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
- const Glib::ustring&
+ const Glib::ustring&)
>;
/** The type for a slot which handles dispatching a remote call on a child
* @endcode
*/
using SlotSubtreeDispatch = sigc::slot<
- const InterfaceVTable*,
+ const InterfaceVTable*(
const Glib::RefPtr<Connection>&,
const Glib::ustring&,
const Glib::ustring&,
const Glib::ustring&,
- const Glib::ustring&
+ const Glib::ustring&)
>;
/** Constructs a new SubtreeVTable using specified slots.
-// -*- 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
namespace DBus
{
-_WRAP_ENUM(BusNameWatcherFlags, GBusNameWatcherFlags, s#^DBUS_##, NO_GTYPE)
+_WRAP_ENUM(BusNameWatcherFlags, GBusNameWatcherFlags, NO_GTYPE)
/** For example,
* void on_name_appeared(const Glib::RefPtr<Gio::DBus::Connection>& connection,
* const Glib::ustring& name, const Glib::ustring& name_owner);
* @ingroup DBus
*/
-using SlotNameAppeared = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring, const Glib::ustring&>;
+using SlotNameAppeared = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring, const Glib::ustring&)>;
/** For example,
* void on_name_vanished(const Glib::RefPtr<Gio::DBus::Connection>& connection,
* const Glib::ustring& name);
* @ingroup DBus
*/
-using SlotNameVanished = sigc::slot<void, const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring>;
+using SlotNameVanished = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)>;
//TODO: Add example from C API in class docs?
/** Starts watching @a name on the bus specified by @a bus_type and calls
const Glib::ustring& name,
const SlotNameAppeared& name_appeared_slot = SlotNameAppeared(),
const SlotNameVanished& name_vanished_slot = SlotNameVanished(),
- BusNameWatcherFlags flags = Gio::DBus::BUS_NAME_WATCHER_FLAGS_NONE
+ BusNameWatcherFlags flags = Gio::DBus::BusNameWatcherFlags::NONE
);
_IGNORE(g_bus_watch_name)
const Glib::ustring& name,
const SlotNameAppeared& name_appeared_slot = SlotNameAppeared(),
const SlotNameVanished& name_vanished_slot = SlotNameVanished(),
- BusNameWatcherFlags flags = Gio::DBus::BUS_NAME_WATCHER_FLAGS_NONE
+ BusNameWatcherFlags flags = Gio::DBus::BusNameWatcherFlags::NONE
);
_IGNORE(g_bus_watch_name_on_connection)
_WRAP_METHOD(std::string get_filename() const, g_desktop_app_info_get_filename)
_WRAP_METHOD(bool is_hidden() const, g_desktop_app_info_get_is_hidden)
- _WRAP_METHOD(static void set_desktop_env(const std::string& desktop_env), g_desktop_app_info_set_desktop_env,
- deprecated "Do not use this API. Since 2.42 the value of the `XDG_CURRENT_DESKTOP` environment variable will be used.")
+
+ _IGNORE(g_desktop_app_info_set_desktop_env)
#m4 _CONVERSION(`const char* const*', `std::vector<Glib::ustring>', `Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
_WRAP_METHOD(std::vector<Glib::ustring> get_keywords() const, g_desktop_app_info_get_keywords)
#include <glibmm/exceptionhandler.h>
#include "slot_async.h"
+using StartStopType = Gio::Drive::StartStopType;
+
namespace Gio
{
void
Drive::eject(
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Drive::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
+Drive::eject(const SlotAsyncReady& slot, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- MountUnmountFlags flags)
+ Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags),
Glib::unwrap(mount_operation),
}
void
-Drive::eject(MountUnmountFlags flags)
+Drive::eject(Mount::UnmountFlags flags)
{
g_drive_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags),
nullptr, // mount_operation
void
Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation,
- const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, MountUnmountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- MountUnmountFlags flags)
+ Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Drive::start(const Glib::RefPtr<MountOperation>& mount_operation,
- const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, DriveStartFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, StartFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Drive::start(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- DriveStartFlags flags)
+ StartFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/listhandle.h>
#include <giomm/mount.h>
#include <giomm/icon.h>
//#include <giomm/volume.h>
namespace Gio
{
-_WRAP_ENUM(DriveStartFlags, GDriveStartFlags)
-_WRAP_ENUM(DriveStartStopType, GDriveStartStopType)
-
/** Virtual File System drive management.
*
* This represent a piece of hardware connected to the machine. It's generally only created for removable hardware or hardware with removable media.
_CLASS_INTERFACE(Drive, GDrive, G_DRIVE, GDriveIface)
public:
+ _WRAP_ENUM(StartFlags, GDriveStartFlags)
+ _WRAP_ENUM(StartStopType, GDriveStartStopType)
+
_WRAP_METHOD(Glib::ustring get_name() const, g_drive_get_name)
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_drive_get_icon, refreturn)
_WRAP_METHOD(bool has_volumes() const, g_drive_has_volumes)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Volume> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Volume> > get_volumes(), g_drive_get_volumes)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Volume>>',`Glib::ListHandler<Glib::RefPtr<Volume>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Volume>> get_volumes(), g_drive_get_volumes)
_WRAP_METHOD(bool is_media_removable() const, g_drive_is_media_removable)
_WRAP_METHOD(bool is_removable() const, g_drive_is_removable)
* @param flags Flags affecting the unmount if required for eject.
* @param cancellable A cancellable object which can be used to cancel the eject.
*/
- void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Ejects the drive.
* @param slot A callback which will be called when the eject is completed.
* @param flags Flags affecting the unmount if required for eject.
*/
- void eject(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject(const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Ejects the drive.
* @param flags Flags affecting the unmount if required for eject.
*/
- void eject(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject(Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
_IGNORE(g_drive_eject)
_IGNORE(g_drive_eject_with_operation)
_WRAP_METHOD(std::string get_identifier(const std::string& kind) const, g_drive_get_identifier)
- #m4 _CONVERSION(`char**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle enumerate_identifiers() const, g_drive_enumerate_identifiers)
+ #m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> enumerate_identifiers() const, g_drive_enumerate_identifiers)
/** @newin{2,22} */
- void start(const Glib::RefPtr<MountOperation>& mount_operation, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, DriveStartFlags flags = DRIVE_START_NONE);
+ void start(const Glib::RefPtr<MountOperation>& mount_operation, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, StartFlags flags = StartFlags::NONE);
/** @newin{2,22} */
- void start(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, DriveStartFlags flags = DRIVE_START_NONE);
+ void start(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, StartFlags flags = StartFlags::NONE);
_IGNORE(g_drive_start)
_WRAP_METHOD(bool start_finish(const Glib::RefPtr<AsyncResult>& result), g_drive_start_finish, errthrow)
/** @newin{2,22} */
_WRAP_METHOD(bool can_start_degraded() const, g_drive_can_start_degraded)
/** @newin{2,22} */
- void stop(const Glib::RefPtr<MountOperation>& mount_operation, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void stop(const Glib::RefPtr<MountOperation>& mount_operation, const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** @newin{2,22} */
- void stop(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void stop(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
_IGNORE(g_drive_stop)
_WRAP_METHOD(bool stop_finish(const Glib::RefPtr<AsyncResult>& result), g_drive_stop_finish, errthrow)
/** @newin{2,22} */
_WRAP_METHOD(bool can_stop() const, g_drive_can_stop)
- _WRAP_METHOD(DriveStartStopType get_start_stop_type() const, g_drive_get_start_stop_type)
+ _WRAP_METHOD(StartStopType get_start_stop_type() const, g_drive_get_start_stop_type)
_WRAP_METHOD(Glib::ustring get_sort_key() const, g_drive_get_sort_key)
- /** @newin{2,20}
- */
- _WRAP_SIGNAL(void changed(), changed, no_default_handler)
-
- /** @newin{2,20}
- */
- _WRAP_SIGNAL(void disconnected(), disconnected, no_default_handler)
-
- /** @newin{2,20}
- */
- _WRAP_SIGNAL(void eject_button(), eject_button, no_default_handler)
- _WRAP_SIGNAL(void stop_button(), stop_button, no_default_handler)
+ _WRAP_SIGNAL(void changed(), changed, newin "2,20")
+ _WRAP_SIGNAL(void disconnected(), disconnected, newin "2,20")
+ _WRAP_SIGNAL(void eject_button(), eject_button, newin "2,20")
+ _WRAP_SIGNAL(void stop_button(), stop_button)
//_WRAP_VFUNC(Glib::ustring get_name() const, get_name)
//Careful of ref-counting: //_WRAP_VFUNC(Glib::RefPtr<Icon> get_icon() const, get_icon)
#include <gio/gio.h>
+using Origin = Gio::Emblem::Origin;
+
namespace Gio
{
namespace Gio
{
-_WRAP_ENUM(EmblemOrigin, GEmblemOrigin, NO_GTYPE)
-
/** An object for emblems
*
* Emblem is an implementation of GIcon that supports having an emblem, which
_CLASS_GOBJECT(Emblem, GEmblem, G_EMBLEM, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(Icon)
+public:
+ _WRAP_ENUM(Origin, GEmblemOrigin, NO_GTYPE)
+
protected:
/** Creates a new emblem for @a icon.
* @param icon A Gio::Icon containing the icon.
/** Creates a new emblem for @a icon.
* @param icon A Gio::Icon containing the icon.
- * @param origin An EmblemOrigin value defining the emblem's origin
+ * @param origin An Origin value defining the emblem's origin
*/
- _WRAP_CTOR(Emblem(const Glib::RefPtr<Icon>& icon, EmblemOrigin origin), g_emblem_new_with_origin)
+ _WRAP_CTOR(Emblem(const Glib::RefPtr<Icon>& icon, Origin origin), g_emblem_new_with_origin)
public:
/** Creates a new emblem for @a icon.
/** Creates a new emblem for @a icon.
* @param icon A Gio::Icon containing the icon.
- * @param origin An EmblemOrigin value defining the emblem's origin
+ * @param origin An Origin value defining the emblem's origin
*/
- _WRAP_CREATE(const Glib::RefPtr<Icon>& icon, EmblemOrigin origin)
+ _WRAP_CREATE(const Glib::RefPtr<Icon>& icon, Origin origin)
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_emblem_get_icon)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_icon() const, g_emblem_get_icon, constversion)
- _WRAP_METHOD(EmblemOrigin get_origin() const, g_emblem_get_origin)
+ _WRAP_METHOD(Origin get_origin() const, g_emblem_get_origin)
};
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/listhandle.h>
#include <glibmm/object.h>
#include <giomm/icon.h>
#include <giomm/emblem.h>
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_emblemed_icon_get_icon)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_icon() const, g_emblemed_icon_get_icon, constversion)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle<Glib::RefPtr<Emblem> >',`$2($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD(Glib::ListHandle<Glib::RefPtr<Emblem> > get_emblems(), g_emblemed_icon_get_emblems)
-
-//TODO: #m4 _CONVERSION(`GList*',`Glib::ListHandle<Glib::RefPtr<const Emblem> >',`$2($3, Glib::OWNERSHIP_NONE)')
-// _WRAP_METHOD(Glib::ListHandle<Glib::RefPtr<const Emblem> > get_emblems() const, g_emblemed_icon_get_emblems, constversion)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Emblem>>',`Glib::ListHandler<Glib::RefPtr<Emblem>>::list_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Emblem>> get_emblems(), g_emblemed_icon_get_emblems)
+ dnl// Can't use the constversion parameter in _WRAP_METHOD() when a vector is returned.
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<const Emblem>>',`Glib::ListHandler<Glib::RefPtr<const Emblem>>::list_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<const Emblem>> get_emblems() const, g_emblemed_icon_get_emblems)
_WRAP_METHOD(void add_emblem(const Glib::RefPtr<Emblem>& emblem), g_emblemed_icon_add_emblem)
_WRAP_METHOD(void clear_emblems(), g_emblemed_icon_clear_emblems)
-// -*- 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
namespace Gio
{
-_WRAP_ENUM(DataStreamByteOrder, GDataStreamByteOrder, NO_GTYPE)
+// BIG_ENDIAN and LITTLE_ENDIAN are defined as preprocessor macros somewhere.
+_WRAP_ENUM(DataStreamByteOrder, GDataStreamByteOrder, NO_GTYPE, s#ENDIAN$#ENDIAN_ORDER#)
_WRAP_ENUM(DataStreamNewlineType, GDataStreamNewlineType, NO_GTYPE)
-_WRAP_ENUM(ErrorEnum, GIOErrorEnum, NO_GTYPE)
_WRAP_ENUM(SocketFamily, GSocketFamily)
_WRAP_ENUM(TlsAuthenticationMode, GTlsAuthenticationMode)
_WRAP_ENUM(TlsCertificateFlags, GTlsCertificateFlags)
} // namespace Gio
-
void
File::append_to_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- FileCreateFlags flags, int io_priority)
+ CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::append_to_async(const SlotAsyncReady& slot, FileCreateFlags flags, int io_priority)
+File::append_to_async(const SlotAsyncReady& slot, CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::create_file_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- FileCreateFlags flags, int io_priority)
+ CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::create_file_async(const SlotAsyncReady& slot, FileCreateFlags flags, int io_priority)
+File::create_file_async(const SlotAsyncReady& slot, CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::create_file_readwrite_async(const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags, int io_priority)
+ const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::create_file_readwrite_async(
- const SlotAsyncReady& slot, FileCreateFlags flags, int io_priority)
+ const SlotAsyncReady& slot, CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- const std::string& etag, bool make_backup, FileCreateFlags flags, int io_priority)
+ const std::string& etag, bool make_backup, CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_async(const SlotAsyncReady& slot, const std::string& etag, bool make_backup,
- FileCreateFlags flags, int io_priority)
+ CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_readwrite_async(const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup,
- FileCreateFlags flags, int io_priority)
+ CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_readwrite_async(const SlotAsyncReady& slot, const std::string& etag, bool make_backup,
- FileCreateFlags flags, int io_priority)
+ CreateFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
bool
File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot,
- const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
}
bool
-File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, FileCopyFlags flags)
+File::copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
}
bool
-File::copy(const Glib::RefPtr<File>& destination, FileCopyFlags flags)
+File::copy(const Glib::RefPtr<File>& destination, CopyFlags flags)
{
GError* gerror = nullptr;
bool res = g_file_copy(gobj(), Glib::unwrap(destination), static_cast<GFileCopyFlags>(flags),
void
File::copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress,
const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable,
- FileCopyFlags flags, int io_priority)
+ CopyFlags flags, int io_priority)
{
// Create a new pair which will hold copies of passed slots.
// This will be deleted in the SignalProxy_file_copy_async_callback() callback
void
File::copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready,
- const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags, int io_priority)
+ const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags, int io_priority)
{
// Create copies of slots.
// Pointers to them will be passed through the callbacks' data parameter
void
File::copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress,
- const SlotAsyncReady& slot_ready, FileCopyFlags flags, int io_priority)
+ const SlotAsyncReady& slot_ready, CopyFlags flags, int io_priority)
{
// Create a new pair which will hold copies of passed slots.
// This will be deleted in the SignalProxy_file_copy_async_callback() callback
void
File::copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready,
- FileCopyFlags flags, int io_priority)
+ CopyFlags flags, int io_priority)
{
// Create copies of slots.
// Pointers to them will be passed through the callbacks' data parameter
bool
File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot,
- const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
}
bool
-File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, FileCopyFlags flags)
+File::move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
}
bool
-File::move(const Glib::RefPtr<File>& destination, FileCopyFlags flags)
+File::move(const Glib::RefPtr<File>& destination, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
void
File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation,
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation,
- const SlotAsyncReady& slot, MountMountFlags flags)
+ const SlotAsyncReady& slot, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::mount_mountable(const SlotAsyncReady& slot, MountMountFlags flags)
+File::mount_mountable(const SlotAsyncReady& slot, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::mount_mountable(MountMountFlags flags)
+File::mount_mountable(Mount::MountFlags flags)
{
g_file_mount_mountable(
gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, nullptr, nullptr);
void
File::unmount_mountable(
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::unmount_mountable(const SlotAsyncReady& slot, MountUnmountFlags flags)
+File::unmount_mountable(const SlotAsyncReady& slot, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::unmount_mountable(MountUnmountFlags flags)
+File::unmount_mountable(Mount::UnmountFlags flags)
{
g_file_unmount_mountable_with_operation(
gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, nullptr, nullptr, nullptr);
void
File::unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::unmount_mountable(const SlotAsyncReady& slot,
- const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::unmount_mountable(
- const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
g_file_unmount_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags),
Glib::unwrap(mount_operation), nullptr, nullptr, nullptr);
void
File::mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation,
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation,
- const SlotAsyncReady& slot, MountMountFlags flags)
+ const SlotAsyncReady& slot, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::mount_enclosing_volume(const SlotAsyncReady& slot, MountMountFlags flags)
+File::mount_enclosing_volume(const SlotAsyncReady& slot, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::mount_enclosing_volume(MountMountFlags flags)
+File::mount_enclosing_volume(Mount::MountFlags flags)
{
g_file_mount_enclosing_volume(
gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, nullptr, nullptr);
void
File::eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::eject_mountable(const SlotAsyncReady& slot,
- const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::eject_mountable(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+File::eject_mountable(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
g_file_eject_mountable_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags),
Glib::unwrap(mount_operation), nullptr, nullptr, nullptr);
void
File::eject_mountable(
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::eject_mountable(const SlotAsyncReady& slot, MountUnmountFlags flags)
+File::eject_mountable(const SlotAsyncReady& slot, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-File::eject_mountable(MountUnmountFlags flags)
+File::eject_mountable(Mount::UnmountFlags flags)
{
g_file_eject_mountable_with_operation(
gobj(), static_cast<GMountUnmountFlags>(flags), nullptr, nullptr, nullptr, nullptr);
void
File::replace_contents(const char* contents, gsize length, const std::string& etag,
std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup,
- FileCreateFlags flags)
+ CreateFlags flags)
{
GError* gerror = nullptr;
gchar* c_etag_new = nullptr;
void
File::replace_contents(const char* contents, gsize length, const std::string& etag,
- std::string& new_etag, bool make_backup, FileCreateFlags flags)
+ std::string& new_etag, bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
gchar* c_etag_new = nullptr;
void
File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag,
- const Glib::RefPtr<Cancellable>& cancellable, bool make_backup, FileCreateFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
gchar* c_etag_new = nullptr;
void
File::replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag,
- bool make_backup, FileCreateFlags flags)
+ bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
gchar* c_etag_new = nullptr;
void
File::replace_contents_async(const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable, const char* contents, gsize length,
- const std::string& etag, bool make_backup, FileCreateFlags flags)
+ const std::string& etag, bool make_backup, CreateFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_contents_async(const SlotAsyncReady& slot, const char* contents, gsize length,
- const std::string& etag, bool make_backup, FileCreateFlags flags)
+ const std::string& etag, bool make_backup, CreateFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_contents_async(const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable, const std::string& contents,
- const std::string& etag, bool make_backup, FileCreateFlags flags)
+ const std::string& etag, bool make_backup, CreateFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_contents_async(const SlotAsyncReady& slot, const std::string& contents,
- const std::string& etag, bool make_backup, FileCreateFlags flags)
+ const std::string& etag, bool make_backup, CreateFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_contents_bytes_async(const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<const Glib::Bytes>& contents,
- const std::string& etag, bool make_backup, FileCreateFlags flags)
+ const std::string& etag, bool make_backup, CreateFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::replace_contents_bytes_async(const SlotAsyncReady& slot,
const Glib::RefPtr<const Glib::Bytes>& contents, const std::string& etag, bool make_backup,
- FileCreateFlags flags)
+ CreateFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
Glib::RefPtr<FileOutputStream>
File::replace(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag,
- bool make_backup, FileCreateFlags flags)
+ bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_replace(gobj(), Glib::c_str_or_nullptr(etag),
}
Glib::RefPtr<FileOutputStream>
-File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags)
+File::replace(const std::string& etag, bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_replace(gobj(), Glib::c_str_or_nullptr(etag),
Glib::RefPtr<FileIOStream>
File::replace_readwrite(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag,
- bool make_backup, FileCreateFlags flags)
+ bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), Glib::c_str_or_nullptr(etag),
}
Glib::RefPtr<FileIOStream>
-File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags)
+File::replace_readwrite(const std::string& etag, bool make_backup, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), Glib::c_str_or_nullptr(etag),
void
File::measure_disk_usage(const Glib::RefPtr<Cancellable>& cancellable,
const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs,
- guint64& num_files, FileMeasureFlags flags)
+ guint64& num_files, MeasureFlags flags)
{
GError* gerror = nullptr;
g_file_measure_disk_usage(gobj(), ((GFileMeasureFlags)(flags)),
void
File::measure_disk_usage_async(const SlotAsyncReady& slot_ready,
const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress,
- FileMeasureFlags flags, int io_priority)
+ MeasureFlags flags, int io_priority)
{
// Create a new pair which will hold copies of passed slots.
// This will be deleted in the SignalProxy_file_measure_async_callback() callback
void
File::start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags)
+ const Glib::RefPtr<MountOperation>& start_operation, Drive::StartFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::start_mountable(const SlotAsyncReady& slot,
- const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags)
+ const Glib::RefPtr<MountOperation>& start_operation, Drive::StartFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& start_operation, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
File::stop_mountable(const SlotAsyncReady& slot,
- const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags)
+ const Glib::RefPtr<MountOperation>& start_operation, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
bool
File::copy_attributes(const Glib::RefPtr<File>& destination,
- const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
}
bool
-File::copy_attributes(const Glib::RefPtr<File>& destination, FileCopyFlags flags)
+File::copy_attributes(const Glib::RefPtr<File>& destination, CopyFlags flags)
{
GError* gerror = nullptr;
bool res;
}
Glib::RefPtr<FileOutputStream>
-File::create_file(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
+File::create_file(const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)),
}
Glib::RefPtr<FileOutputStream>
-File::create_file(FileCreateFlags flags)
+File::create_file(CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue =
}
Glib::RefPtr<FileIOStream>
-File::create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
+File::create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)),
}
Glib::RefPtr<FileIOStream>
-File::create_file_readwrite(FileCreateFlags flags)
+File::create_file_readwrite(CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue =
}
Glib::RefPtr<FileOutputStream>
-File::append_to(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
+File::append_to(const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)),
}
Glib::RefPtr<FileOutputStream>
-File::append_to(FileCreateFlags flags)
+File::append_to(CreateFlags flags)
{
GError* gerror = nullptr;
auto retvalue =
class Volume;
_WRAP_ENUM(FileQueryInfoFlags, GFileQueryInfoFlags, NO_GTYPE)
-_WRAP_ENUM(FileCreateFlags, GFileCreateFlags, NO_GTYPE)
-_WRAP_ENUM(FileCopyFlags, GFileCopyFlags, NO_GTYPE)
_WRAP_ENUM(FileMonitorFlags, GFileMonitorFlags, NO_GTYPE)
-_WRAP_ENUM(FileMeasureFlags, GFileMeasureFlags, NO_GTYPE)
/** File and directory handling.
_CLASS_INTERFACE(File, GFile, G_FILE, GFileIface)
public:
+ _WRAP_ENUM(CreateFlags, GFileCreateFlags, NO_GTYPE)
+ _WRAP_ENUM(CopyFlags, GFileCopyFlags, NO_GTYPE)
+ _WRAP_ENUM(MeasureFlags, GFileMeasureFlags, NO_GTYPE)
_IGNORE(g_file_icon_new) //g_file_icon_new is not a GFile method.
* the file doesn't already exist it is created.
*
* By default files created are generally readable by everyone,
- * but if you pass FILE_CREATE_PRIVATE in @a flags the file
+ * but if you pass CreateFlags::PRIVATE in @a flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
* If the file is a directory a Gio::Error with IS_DIRECTORY will be
* thrown. Other errors are possible too, and depend on what kind of
* filesystem the file is on.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param cancellable Optional Cancellable object.
* @return A FileOutputStream.
*/
- Glib::RefPtr<FileOutputStream> append_to(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileOutputStream> append_to(const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags = CreateFlags::NONE);
/** Gets an output stream for appending data to the file. If
* the file doesn't already exist it is created.
*
* By default files created are generally readable by everyone,
- * but if you pass FILE_CREATE_PRIVATE in @a flags the file
+ * but if you pass CreateFlags::PRIVATE in @a flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
* If the file is a directory a Gio::Error with IS_DIRECTORY will be
* thrown. Other errors are possible too, and depend on what kind of
* filesystem the file is on.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @return A FileOutputStream.
*/
- Glib::RefPtr<FileOutputStream> append_to(FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileOutputStream> append_to(CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_append_to)
//We renamed this to create_file from (g_file_create() and g_file_create_readwrite), to avoid confusion with static create() methods,
* The file must not already exist.
*
* By default files created are generally readable by everyone,
- * but if you pass FILE_CREATE_PRIVATE in @a flags the file
+ * but if you pass CreateFlags::PRIVATE in @a flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
* filesystem the file is on.
*
* @param cancellable A Cancellable object which can be used to cancel the operation.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @return A FileOutputStream for the newly created file.
*/
- Glib::RefPtr<FileOutputStream> create_file(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileOutputStream> create_file(const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags = CreateFlags::NONE);
/** Creates a new file and returns an output stream for writing to it.
* The file must not already exist.
*
* By default files created are generally readable by everyone,
- * but if you pass FILE_CREATE_PRIVATE in @a flags the file
+ * but if you pass CreateFlags::PRIVATE in @a flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
* Other errors are possible too, and depend on what kind of
* filesystem the file is on.
*
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @return A FileOutputStream for the newly created file.
*/
- Glib::RefPtr<FileOutputStream> create_file(FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileOutputStream> create_file(CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_create)
/** Creates a new file and returns a stream for reading and writing to it.
* The file must not already exist.
*
* By default files created are generally readable by everyone,
- * but if you pass FILE_CREATE_PRIVATE in @a flags the file
+ * but if you pass CreateFlags::PRIVATE in @a flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
* rather than just opening for reading or writing.
*
* @param cancellable A Cancellable object which can be used to cancel the operation.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @return A FileOutputStream for the newly created file.
*/
- Glib::RefPtr<FileIOStream> create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileIOStream> create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags = CreateFlags::NONE);
/** Creates a new file and returns a stream for reading and writing to it.
* The file must not already exist.
*
* By default files created are generally readable by everyone,
- * but if you pass FILE_CREATE_PRIVATE in @a flags the file
+ * but if you pass CreateFlags::PRIVATE in @a flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
* supported, so make sure you really need to do read and write streaming,
* rather than just opening for reading or writing.
*
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @return A FileOutputStream for the newly created file.
*/
- Glib::RefPtr<FileIOStream> create_file_readwrite(FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileIOStream> create_file_readwrite(CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_create_readwrite)
* not affect an already existing copy of the file. For instance, for local files it may write to a
* temporary file and then atomically rename over the destination when the stream is closed.
*
- * By default files created are generally readable by everyone, but if you pass FILE_CREATE_PRIVATE in
+ * By default files created are generally readable by everyone, but if you pass CreateFlags::PRIVATE in
* @a flags the file will be made readable only to the current user, to the level that is supported on the
* target filesystem.
*
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param etag An optional entity tag for the current Glib::File.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @return A FileOutputStream.
*/
- Glib::RefPtr<FileOutputStream> replace(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileOutputStream> replace(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Returns an output stream for overwriting the file, possibly creating a backup copy of the file first.
* not affect an already existing copy of the file. For instance, for local files it may write to a
* temporary file and then atomically rename over the destination when the stream is closed.
*
- * By default files created are generally readable by everyone, but if you pass FILE_CREATE_PRIVATE in
+ * By default files created are generally readable by everyone, but if you pass CreateFlags::PRIVATE in
* @a flags the file will be made readable only to the current user, to the level that is supported on the
* target filesystem.
*
*
* @param etag An optional entity tag for the current Glib::File.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @return A FileOutputStream.
*/
- Glib::RefPtr<FileOutputStream> replace(const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileOutputStream> replace(const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_replace)
* When the operation is finished, @a slot will be called. You can then call append_to_finish() to get the result of the operation.
* @param slot A callback slot which will be called when the request is satisfied.
* @param cancellable A Cancellable object which can be used to cancel the operation.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @param io_priority The I/O priority of the request.
*/
- void append_to_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void append_to_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asynchronously opens the file for appending.
* For more details, see append_to() which is the synchronous version of this call.
*
* When the operation is finished, @a slot will be called. You can then call append_to_finish() to get the result of the operation.
* @param slot A callback slot which will be called when the request is satisfied.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @param io_priority The I/O priority of the request.
*/
- void append_to_async(const SlotAsyncReady& slot, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void append_to_async(const SlotAsyncReady& slot, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_append_to_async)
_WRAP_METHOD(Glib::RefPtr<FileOutputStream> append_to_finish(const Glib::RefPtr<AsyncResult>& res),
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param cancellable A Cancellable object which can be used to cancel the operation.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @param io_priority The I/O priority of the request.
*/
- void create_file_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void create_file_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asynchronously creates a new file and returns an output stream for writing to it. The file must not already exist.
* For more details, see create_file() which is the synchronous version of this call.
* When the operation is finished, @a slot will be called. You can then call create_file_finish() to get the result of the operation.
*
* @param slot A callback slot which will be called when the request is satisfied.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @param io_priority The I/O priority of the request.
*/
- void create_file_async(const SlotAsyncReady& slot, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void create_file_async(const SlotAsyncReady& slot, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_create_async)
_WRAP_METHOD(Glib::RefPtr<FileOutputStream> create_file_finish(const Glib::RefPtr<AsyncResult>& res),
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param cancellable A Cancellable object which can be used to cancel the operation.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @param io_priority The I/O priority of the request.
*
* @newin{2,24}
*/
- void create_file_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void create_file_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asynchronously creates a new file and returns a stream for reading and
* writing to it. The file must not already exist.
* When the operation is finished, @a slot will be called. You can then call create_file_readwrite_finish() to get the result of the operation.
*
* @param slot A callback slot which will be called when the request is satisfied.
- * @param flags a set of FileCreateFlags.
+ * @param flags a set of CreateFlags.
* @param io_priority The I/O priority of the request.
*
* @newin{2,24}
*/
- void create_file_readwrite_async(const SlotAsyncReady& slot, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void create_file_readwrite_async(const SlotAsyncReady& slot, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_create_readwrite_async)
_WRAP_METHOD(Glib::RefPtr<FileIOStream> create_file_readwrite_finish(const Glib::RefPtr<AsyncResult>& res),
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param etag An entity tag for the current Gio::File.
* @param make_backup true if a backup of the existing file should be made.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param io_priority The I/O priority of the request.
*/
- void replace_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void replace_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asyncronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.
* For more details, see replace() which is the synchronous version of this call.
* @param slot A callback slot which will be called when the request is satisfied.
* @param etag An entity tag for the current Gio::File.
* @param make_backup true if a backup of the existing file should be made.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param io_priority The I/O priority of the request.
*/
- void replace_async(const SlotAsyncReady& slot, const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void replace_async(const SlotAsyncReady& slot, const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_replace_async)
_WRAP_METHOD(Glib::RefPtr<FileOutputStream> replace_finish(const Glib::RefPtr<AsyncResult>& res),
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param etag An optional entity tag for the current Glib::File.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @return A FileOutputStream.
*
* @newin{2,24}
*/
- Glib::RefPtr<FileIOStream> replace_readwrite(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileIOStream> replace_readwrite(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Returns an output stream for overwriting the file in readwrite mode, possibly creating a backup copy of the file first.
*
* @param etag An optional entity tag for the current Glib::File.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @return A FileOutputStream.
*
* @newin{2,24}
*/
- Glib::RefPtr<FileIOStream> replace_readwrite(const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ Glib::RefPtr<FileIOStream> replace_readwrite(const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_replace_readwrite)
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param etag An entity tag for the current Gio::File.
* @param make_backup true if a backup of the existing file should be made.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param io_priority The I/O priority of the request.
*
* @newin{2,24}
*/
- void replace_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void replace_readwrite_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asyncronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param etag An entity tag for the current Gio::File.
* @param make_backup true if a backup of the existing file should be made.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param io_priority The I/O priority of the request.
*
* @newin{2,24}
*/
- void replace_readwrite_async(const SlotAsyncReady& slot, const std::string& etag = std::string(), bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void replace_readwrite_async(const SlotAsyncReady& slot, const std::string& etag = std::string(), bool make_backup = false, CreateFlags flags = CreateFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_replace_readwrite_async)
_WRAP_METHOD(Glib::RefPtr<FileIOStream> replace_readwrite_finish(const Glib::RefPtr<AsyncResult>& res),
*
* For symlinks, normally the information about the target of the
* symlink is returned, rather than information about the symlink itself.
- * However if you pass FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @a flags the
+ * However if you pass FileQueryInfoFlags::NOFOLLOW_SYMLINKS in @a flags the
* information about the symlink itself will be returned. Also, for symlinks
* that point to non-existing files the information about the symlink itself
* will be returned.
* @param flags: A set of FileQueryInfoFlags.
* @result a FileInfo for the file, or an empty RefPtr on error.
*/
- Glib::RefPtr<FileInfo> query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE) const;
+ Glib::RefPtr<FileInfo> query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE) const;
/** Gets the requested information about the file. The result
* is a FileInfo object that contains key-value attributes (such as the type or size
*
* For symlinks, normally the information about the target of the
* symlink is returned, rather than information about the symlink itself.
- * However if you pass FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @a flags the
+ * However if you pass FileQueryInfoFlags::NOFOLLOW_SYMLINKS in @a flags the
* information about the symlink itself will be returned. Also, for symlinks
* that point to non-existing files the information about the symlink itself
* will be returned.
* @param flags: A set of FileQueryInfoFlags.
* @result a FileInfo for the file, or an empty RefPtr on error.
*/
- Glib::RefPtr<FileInfo> query_info(const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE) const;
+ Glib::RefPtr<FileInfo> query_info(const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE) const;
_IGNORE(g_file_query_info)
*
* @newin{2,18}
*/
- FileType query_file_type(FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE) const;
+ FileType query_file_type(FileQueryInfoFlags flags = FileQueryInfoFlags::NONE) const;
/** Asynchronously gets the requested information about specified file. The result is a FileInfo object that contains key-value attributes (such as type or size for the file).
*
* @param flags A set of FileQueryInfoFlags.
* @param io_priority The I/O priority of the request.
*/
- void query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE, int io_priority = Glib::PRIORITY_DEFAULT) const;
+ void query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT) const;
/** Asynchronously gets the requested information about specified file. The result is a FileInfo object that contains key-value attributes (such as type or size for the file).
*
* @param flags A set of FileQueryInfoFlags.
* @param io_priority The I/O priority of the request.
*/
- void query_info_async(const SlotAsyncReady& slot, const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE, int io_priority = Glib::PRIORITY_DEFAULT) const;
+ void query_info_async(const SlotAsyncReady& slot, const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT) const;
_IGNORE(g_file_query_info_async)
* @param flags A set of FileQueryInfoFlags.
* @return A FileEnumerator if successful.
*/
- Glib::RefPtr<FileEnumerator> enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE);
+ Glib::RefPtr<FileEnumerator> enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE);
_IGNORE(g_file_enumerate_children)
/** Gets the requested information about the files in a directory. The result
* @param flags A set of FileQueryInfoFlags.
* @return A FileEnumerator if successful.
*/
- Glib::RefPtr<FileEnumerator> enumerate_children(const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE);
+ Glib::RefPtr<FileEnumerator> enumerate_children(const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE);
_IGNORE(g_file_enumerate_children)
* @param flags A set of FileQueryInfoFlags.
* @param io_priority The I/O priority of the request.
*/
- void enumerate_children_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void enumerate_children_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asynchronously gets the requested information about the files in a directory. The result is a GFileEnumerator object that will give out GFileInfo objects for all the files in the directory.
*
* @param flags A set of FileQueryInfoFlags.
* @param io_priority The I/O priority of the request.
*/
- void enumerate_children_async(const SlotAsyncReady& slot, const std::string& attributes = "*", FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void enumerate_children_async(const SlotAsyncReady& slot, const std::string& attributes = "*", FileQueryInfoFlags flags = FileQueryInfoFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_enumerate_children_async)
_WRAP_METHOD(Glib::RefPtr<FileEnumerator> enumerate_children_finish(const Glib::RefPtr<AsyncResult>& res),
/** A signal handler would be, for instance:
* void on_file_progress(goffset current_num_bytes, goffset total_num_bytes);
*/
- using SlotFileProgress = sigc::slot<void, goffset, goffset>;
+ using SlotFileProgress = sigc::slot<void(goffset, goffset)>;
/** Copies the file source to the location specified by destination. Can not handle recursive copies of directories.
- * If the flag FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten.
- * If the flag FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
+ * If the flag CopyFlags::OVERWRITE is specified an already existing destination file is overwritten.
+ * If the flag CopyFlags::NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
*
* 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 the source file does not exist then a Gio::Error with NOT_FOUND will be thrown, independent on the status of the destination.
*
- * If FILE_COPY_OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
+ * If CopyFlags::OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
*
* If trying to overwrite a file over a directory a Gio::Error with IS_DIRECTORY will be thrown.
* If trying to overwrite a directory with a directory a Gio::Error with WOULD_MERGE will be thrown.
*
- * If the source is a directory and the target does not exist, or FILE_COPY_OVERWRITE is specified and the target is a file,
+ * If the source is a directory and the target does not exist, or CopyFlags::OVERWRITE is specified and the target is a file,
* then a Gio::Error with WOULD_RECURSE will be thrown.
*
* If you are interested in copying the Gio::File object itself (not the on-disk file), see File::dup().
*/
- bool copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags = FILE_COPY_NONE);
+ bool copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags = CopyFlags::NONE);
/** Copies the file source to the location specified by destination. Can not handle recursive copies of directories.
- * If the flag FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten.
- * If the flag FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
+ * If the flag CopyFlags::OVERWRITE is specified an already existing destination file is overwritten.
+ * If the flag CopyFlags::NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
*
* The operation can be monitored via the @a slot callback.
*
* If the source file does not exist then a Gio::Error with NOT_FOUND will be thrown, independent on the status of the destination.
*
- * If FILE_COPY_OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
+ * If CopyFlags::OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
*
* If trying to overwrite a file over a directory a Gio::Error with IS_DIRECTORY will be thrown.
* If trying to overwrite a directory with a directory a Gio::Error with WOULD_MERGE will be thrown.
*
- * If the source is a directory and the target does not exist, or FILE_COPY_OVERWRITE is specified and the target is a file,
+ * If the source is a directory and the target does not exist, or CopyFlags::OVERWRITE is specified and the target is a file,
* then a Gio::Error with WOULD_RECURSE will be thrown.
*
* If you are interested in copying the Gio::File object itself (not the on-disk file), see File::dup().
*/
- bool copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, FileCopyFlags flags = FILE_COPY_NONE);
+ bool copy(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, CopyFlags flags = CopyFlags::NONE);
/** Copies the file source to the location specified by destination. Can not handle recursive copies of directories.
- * If the flag FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten.
- * If the flag FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
+ * If the flag CopyFlags::OVERWRITE is specified an already existing destination file is overwritten.
+ * If the flag CopyFlags::NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
*
* If the source file does not exist then a Gio::Error with NOT_FOUND will be thrown, independent on the status of the destination.
*
- * If FILE_COPY_OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
+ * If CopyFlags::OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
*
* If trying to overwrite a file over a directory a Gio::Error with IS_DIRECTORY will be thrown.
* If trying to overwrite a directory with a directory a Gio::Error with WOULD_MERGE will be thrown.
*
- * If the source is a directory and the target does not exist, or FILE_COPY_OVERWRITE is specified and the target is a file,
+ * If the source is a directory and the target does not exist, or CopyFlags::OVERWRITE is specified and the target is a file,
* then a Gio::Error with WOULD_RECURSE will be thrown.
*
* If you are interested in copying the Gio::File object itself (not the on-disk file), see File::dup().
*/
- bool copy(const Glib::RefPtr<File>& destination, FileCopyFlags flags = FILE_COPY_NONE);
+ bool copy(const Glib::RefPtr<File>& destination, CopyFlags flags = CopyFlags::NONE);
_IGNORE(g_file_copy)
/** Copies the file to the location specified by @a destination asynchronously.
* @param slot_progress The callback slot to be called with progress information
* @param slot_ready A SlotAsyncReady to call when the request is satisfied
* @param cancellable A Cancellable object which can be used to cancel the operation
- * @param flags Set of FileCopyFlags
+ * @param flags Set of CopyFlags
* @param io_priority The I/O priority of the request
*/
- void copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress, const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags = FILE_COPY_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress, const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags = CopyFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Copies the file to the location specified by @a destination asynchronously.
* For details of the behaviour, see copy().
* @param destination Destination File
* @param slot_ready A SlotAsyncReady to call when the request is satisfied
* @param cancellable A Cancellable object which can be used to cancel the operation
- * @param flags Set of FileCopyFlags
+ * @param flags Set of CopyFlags
* @param io_priority The I/O priority of the request
*/
- void copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags = FILE_COPY_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags = CopyFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Copies the file to the location specified by @a destination asynchronously.
* For details of the behaviour, see copy().
* @param destination Destination File
* @param slot_progress The callback slot to be called with progress information
* @param slot_ready A SlotAsyncReady to call when the request is satisfied
- * @param flags Set of FileCopyFlags
+ * @param flags Set of CopyFlags
* @param io_priority The I/O priority of the request
*/
- void copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress, const SlotAsyncReady& slot_ready, FileCopyFlags flags = FILE_COPY_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void copy_async(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot_progress, const SlotAsyncReady& slot_ready, CopyFlags flags = CopyFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Copies the file to the location specified by @a destination asynchronously.
* For details of the behaviour, see copy().
*
* @param destination Destination File
* @param slot_ready A SlotAsyncReady to call when the request is satisfied
- * @param flags Set of FileCopyFlags
+ * @param flags Set of CopyFlags
* @param io_priority The I/O priority of the request
*/
- void copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready, FileCopyFlags flags = FILE_COPY_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void copy_async(const Glib::RefPtr<File>& destination, const SlotAsyncReady& slot_ready, CopyFlags flags = CopyFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_copy_async)
_WRAP_METHOD(bool copy_finish(const Glib::RefPtr<AsyncResult>& res),
* used, otherwise a copy and delete fallback is used. The native implementation may support moving directories (for instance on moves inside
* the same filesystem), but the fallback code does not.
*
- * If the flag FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten.
+ * If the flag CopyFlags::OVERWRITE is specified an already existing destination file is overwritten.
*
- * If the flag FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
+ * If the flag CopyFlags::NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.
*
* 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.
*
* The operation can be monitored via the @a slot callback.
* If the source file does not exist then a Gio::Error with NOT_FOUND will be thrown, independent on the status of the destination.
*
- * If G_FILE_COPY_OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
+ * If G_CopyFlags::OVERWRITE is not specified and the target exists, then a Gio::Error with EXISTS will be thrown.
*
* If trying to overwrite a file over a directory a Gio::Error with IS_DIRECTORY will be thrown.
* If trying to overwrite a directory with a directory a Gio::Error with WOULD_MERGE will be thrown.
*
- * If the source is a directory and the target does not exist, or FILE_COPY_OVERWRITE is specified and the target is a file, then a Gio::Error with WOULD_RECURSE may be thrown (if the native move operation isn't available).
+ * If the source is a directory and the target does not exist, or CopyFlags::OVERWRITE is specified and the target is a file, then a Gio::Error with WOULD_RECURSE may be thrown (if the native move operation isn't available).
*/
- bool move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags = FILE_COPY_NONE);
+ bool move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags = CopyFlags::NONE);
- bool move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, FileCopyFlags flags = FILE_COPY_NONE);
+ bool move(const Glib::RefPtr<File>& destination, const SlotFileProgress& slot, CopyFlags flags = CopyFlags::NONE);
- bool move(const Glib::RefPtr<File>& destination, FileCopyFlags flags = FILE_COPY_NONE);
+ bool move(const Glib::RefPtr<File>& destination, CopyFlags flags = CopyFlags::NONE);
_IGNORE(g_file_move)
_WRAP_METHOD(bool make_directory(const Glib::RefPtr<Cancellable>& cancellable{?}),
* @param flags A set of FileQueryInfoFlags.
* @return <tt>true</tt> if there was any error, <tt>false</tt> otherwise.
*/
- bool set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE);
+ bool set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags = FileQueryInfoFlags::NONE);
/** Tries to set all attributes in the FileInfo on the target values,
* not stopping on the first error.
* @param flags A set of FileQueryInfoFlags.
* @return <tt>true</tt> if there was any error, <tt>false</tt> otherwise.
*/
- bool set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE);
+ bool set_attributes_from_info(const Glib::RefPtr<FileInfo>& info, FileQueryInfoFlags flags = FileQueryInfoFlags::NONE);
_IGNORE(g_file_set_attributes_from_info)
* @param flags A set of FileQueryInfoFlags.
* @param io_priority The I/O priority of the request.
*/
- void set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, FileQueryInfoFlags flags = FileQueryInfoFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Asynchronously sets the attributes of file with info.
*
* @param flags A set of FileQueryInfoFlags.
* @param io_priority The I/O priority of the request.
*/
- void set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, FileQueryInfoFlags flags = FILE_QUERY_INFO_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void set_attributes_async(const Glib::RefPtr<FileInfo>& info, const SlotAsyncReady& slot, FileQueryInfoFlags flags = FileQueryInfoFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_set_attributes_async)
_IGNORE(g_file_set_attributes_finish) // takes GFileInfo**
bool set_attributes_finish(const Glib::RefPtr<AsyncResult>& result, const Glib::RefPtr<FileInfo>& info);
- _WRAP_METHOD(bool set_attribute_string(const std::string& attribute, const std::string& value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
+ _WRAP_METHOD(bool set_attribute_string(const std::string& attribute, const Glib::ustring& value, FileQueryInfoFlags flags, const Glib::RefPtr<Cancellable>& cancellable{?}),
g_file_set_attribute_string,
errthrow)
* @param cancellable A Cancellable object.
* @param flags Flags affecting the operation.
*/
- void mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Starts a @a mount_operation, mounting the volume that contains the file.
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_enclosing_volume(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Starts a @a mount_operation, mounting the volume that contains the file.
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void mount_enclosing_volume(const SlotAsyncReady& slot, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_enclosing_volume(const SlotAsyncReady& slot, Mount::MountFlags flags = Mount::MountFlags::NONE);
_IGNORE(g_file_mount_enclosing_volume)
/** Starts a @a mount_operation, mounting the volume that contains the file.
*
* @param flags Flags affecting the operation.
*/
- void mount_enclosing_volume(MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_enclosing_volume(Mount::MountFlags flags = Mount::MountFlags::NONE);
_IGNORE(g_file_mount_enclosing_volume)
_WRAP_METHOD(bool mount_enclosing_volume_finish(const Glib::RefPtr<AsyncResult>& result),
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Mounts a file of type FILE_TYPE_MOUNTABLE. Using @a mount_operation, you can request callbacks when, for instance,
* passwords are needed during authentication.
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Mounts a file of type FILE_TYPE_MOUNTABLE without user interaction.
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void mount_mountable(const SlotAsyncReady& slot, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_mountable(const SlotAsyncReady& slot, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Mounts a file of type FILE_TYPE_MOUNTABLE without user interaction.
*
* @param flags Flags affecting the operation.
*/
- void mount_mountable(MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount_mountable(Mount::MountFlags flags = Mount::MountFlags::NONE);
_IGNORE(g_file_mount_mountable)
_WRAP_METHOD(Glib::RefPtr<File> mount_mountable_finish(const Glib::RefPtr<AsyncResult>& result),
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param flags Flags affecting the operation.
*/
- void unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Unmounts a file of type FILE_TYPE_MOUNTABLE.
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void unmount_mountable(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount_mountable(const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Unmounts a file of type FILE_TYPE_MOUNTABLE.
*
* @param flags Flags affecting the operation.
*/
- void unmount_mountable(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount_mountable(Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Unmounts a file of type FILE_TYPE_MOUNTABLE.
*
*
* @newin{2,24}
*/
- void unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Unmounts a file of type FILE_TYPE_MOUNTABLE.
*
*
* @newin{2,24}
*/
- void unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Unmounts a file of type FILE_TYPE_MOUNTABLE.
*
*
* @newin{2,24}
*/
- void unmount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount_mountable(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
_IGNORE(g_file_unmount_mountable, g_file_unmount_mountable_finish, g_file_unmount_mountable_with_operation)
* @param cancellable A Cancellable object which can be used to cancel the operation.
* @param flags Flags affecting the operation.
*/
- void eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Starts an asynchronous eject on a mountable.
*
* @param slot A callback slot which will be called when the request is satisfied.
* @param flags Flags affecting the operation.
*/
- void eject_mountable(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject_mountable(const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Starts an asynchronous eject on a mountable.
*
* @param flags Flags affecting the operation.
*/
- void eject_mountable(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject_mountable(Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Starts an asynchronous eject on a mountable.
*
*
* @newin{2,24}
*/
- void eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Starts an asynchronous eject on a mountable.
*
*
* @newin{2,24}
*/
- void eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Starts an asynchronous eject on a mountable.
*
*
* @newin{2,24}
*/
- void eject_mountable(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject_mountable(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
_IGNORE(g_file_eject_mountable, g_file_eject_mountable_finish, g_file_eject_mountable_with_operation)
* Normally only a subset of the file attributes are copied,
* those that are copies in a normal file copy operation
* (which for instance does not include e.g. mtime). However
- * if FILE_COPY_ALL_METADATA is specified in @a flags, then
+ * if CopyFlags::ALL_METADATA is specified in @a flags, then
* all the metadata that is possible to copy is copied.
*
* @param destination A File to copy attributes to.
* @param flags A set of FileMonitorFlags.
* @result true if the attributes were copied successfully, false otherwise.
*/
- bool copy_attributes(const Glib::RefPtr<File>& destination, const Glib::RefPtr<Cancellable>& cancellable, FileCopyFlags flags = FILE_COPY_NONE);
+ bool copy_attributes(const Glib::RefPtr<File>& destination, const Glib::RefPtr<Cancellable>& cancellable, CopyFlags flags = CopyFlags::NONE);
/** Copies the file attributes from @a source to @a destination.
*
* Normally only a subset of the file attributes are copied,
* those that are copies in a normal file copy operation
* (which for instance does not include e.g. mtime). However
- * if FILE_COPY_ALL_METADATA is specified in @a flags, then
+ * if CopyFlags::ALL_METADATA is specified in @a flags, then
* all the metadata that is possible to copy is copied.
*
* @param destination A File to copy attributes to.
* @param flags A set of FileMonitorFlags.
* @result true if the attributes were copied successfully, false otherwise.
*/
- bool copy_attributes(const Glib::RefPtr<File>& destination, FileCopyFlags flags = FILE_COPY_NONE);
+ bool copy_attributes(const Glib::RefPtr<File>& destination, CopyFlags flags = CopyFlags::NONE);
_IGNORE(g_file_copy_attributes)
/** Obtains a directory monitor for the given file.
* @param flags A set of FileMonitorFlags.
* @return A FileMonitor for the file.
*/
- Glib::RefPtr<FileMonitor> monitor_directory(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags = FILE_MONITOR_NONE);
+ Glib::RefPtr<FileMonitor> monitor_directory(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags = FileMonitorFlags::NONE);
/** Obtains a directory monitor for the given file.
* This may fail if directory monitoring is not supported.
* @param flags A set of FileMonitorFlags.
* @return A FileMonitor for the file.
*/
- Glib::RefPtr<FileMonitor> monitor_directory(FileMonitorFlags flags = FILE_MONITOR_NONE);
+ Glib::RefPtr<FileMonitor> monitor_directory(FileMonitorFlags flags = FileMonitorFlags::NONE);
_IGNORE(g_file_monitor_directory)
/** Obtains a file monitor for the given file. If no file notification
* @param flags A set of FileMonitorFlags.
* @return A FileMonitor for the file.
*/
- Glib::RefPtr<FileMonitor> monitor_file(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags = FILE_MONITOR_NONE);
+ Glib::RefPtr<FileMonitor> monitor_file(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags = FileMonitorFlags::NONE);
/** Obtains a file monitor for the given file. If no file notification
* mechanism exists, then regular polling of the file is used.
* @param flags A set of FileMonitorFlags.
* @return A FileMonitor for the file.
*/
- Glib::RefPtr<FileMonitor> monitor_file(FileMonitorFlags flags = FILE_MONITOR_NONE);
+ Glib::RefPtr<FileMonitor> monitor_file(FileMonitorFlags flags = FileMonitorFlags::NONE);
_IGNORE(g_file_monitor_file)
*
* @newin{2,18}
*/
- Glib::RefPtr<FileMonitor> monitor(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags = FILE_MONITOR_NONE);
+ Glib::RefPtr<FileMonitor> monitor(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags = FileMonitorFlags::NONE);
/** Obtains a file monitor for the given file. If no file notification
* mechanism exists, then regular polling of the file is used.
*
* @newin{2,18}
*/
- Glib::RefPtr<FileMonitor> monitor(FileMonitorFlags flags = FILE_MONITOR_NONE);
+ Glib::RefPtr<FileMonitor> monitor(FileMonitorFlags flags = FileMonitorFlags::NONE);
_IGNORE(g_file_monitor)
*
* @newin{2,38}
*/
- using SlotFileMeasureProgress = sigc::slot<void, bool, guint64, guint64, guint64>;
+ using SlotFileMeasureProgress = sigc::slot<void(bool, guint64, guint64, guint64)>;
//We do not use the {callback} syntax with _WRAP_METHOD here, because it expects to use user_data rather than progress_data.
//We ignore the gboolean result, because we throw an exception if it is false.
* @param disk_usage The number of bytes of disk space used.
* @param num_dirs The number of directories encountered.
* @param num_files The number of non-directories encountered.
- * @param flags Set of FileMeasureFlags.
+ * @param flags Set of MeasureFlags.
*/
- void measure_disk_usage(const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs, guint64& num_files, FileMeasureFlags flags = FILE_MEASURE_NONE);
+ void measure_disk_usage(const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, guint64& disk_usage, guint64& num_dirs, guint64& num_files, MeasureFlags flags = MeasureFlags::NONE);
_IGNORE(g_file_measure_disk_usage)
/** Recursively measures the disk usage of the file.
* @param slot_ready A SlotAsyncReady to call when the request is satisfied
* @param cancellable A Cancellable object which can be used to cancel the operation
* @param slot_progress The callback slot to be called with progress information
- * @param flags Set of FileMeasureFlags
+ * @param flags Set of MeasureFlags
* @param io_priority The I/O priority of the request
*/
- void measure_disk_usage_async(const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, FileMeasureFlags flags = FILE_MEASURE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void measure_disk_usage_async(const SlotAsyncReady& slot_ready, const Glib::RefPtr<Cancellable>& cancellable, const SlotFileMeasureProgress& slot_progress, MeasureFlags flags = MeasureFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_measure_disk_usage_async)
_WRAP_METHOD(bool measure_disk_usage_finish(const Glib::RefPtr<AsyncResult>& result, guint64& disk_usage, guint64& num_dirs, guint64& num_files), g_file_measure_disk_usage_finish, errthrow)
*
* @newin{2,24}
*/
- void start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags = DRIVE_START_NONE);
+ void start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& start_operation, Drive::StartFlags flags = Drive::StartFlags::NONE);
/** Starts a file of type Mountable.
* Using @a start_operation, you can request callbacks when, for instance,
*
* @newin{2,24}
*/
- void start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& start_operation, DriveStartFlags flags = DRIVE_START_NONE);
+ void start_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& start_operation, Drive::StartFlags flags = Drive::StartFlags::NONE);
_IGNORE(g_file_start_mountable)
_WRAP_METHOD(bool start_mountable_finish(const Glib::RefPtr<AsyncResult>& result),
*
* @newin{2,24}
*/
- void stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<MountOperation>& start_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
/** Stops a file of type Mountable.
*
* @newin{2,24}
*/
- void stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& start_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void stop_mountable(const SlotAsyncReady& slot, const Glib::RefPtr<MountOperation>& start_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
_IGNORE(g_file_stop_mountable)
_WRAP_METHOD(bool stop_mountable_finish(const Glib::RefPtr<AsyncResult>& result),
/** A signal handler would be, for instance:
* bool on_read_more(const char* file_contents, goffset file_size);
*/
- using SlotReadMore = sigc::slot<bool, const char*, goffset>;
+ using SlotReadMore = sigc::slot<bool(const char*, goffset)>;
//Note that slot_read_more can be nullptr but that would not be a useful method overload, because the documentation says that it would
//then be equivalent to load_contents_async.
* @param etag The old entity tag
* for the document.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param new_etag A location to a new entity tag
* for the document.
* @param cancellable A Cancellable object.
*/
- void replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Replaces the contents of the file with @a contents of @a length bytes.
*
* @param etag The old entity tag
* for the document.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param new_etag A location to a new entity tag
* for the document.
*/
- void replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents(const char* contents, gsize length, const std::string& etag, std::string& new_etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Replaces the contents of the file with @a contents.
*
* @param etag The old entity tag
* for the document.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param new_etag A location to a new entity tag
* for the document.
* @param cancellable A Cancellable object.
*/
- void replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, const Glib::RefPtr<Cancellable>& cancellable, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Replaces the contents of the file with @a contents.
*
* @param etag The old entity tag
* for the document.
* @param make_backup <tt>true</tt> if a backup should be created.
- * @param flags A set of FileCreateFlags.
+ * @param flags A set of CreateFlags.
* @param new_etag A location to a new entity tag
* for the document.
*/
- void replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents(const std::string& contents, const std::string& etag, std::string& new_etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_replace_contents)
* @param length The length of @a contents in bytes.
* @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.
+ * @param flags A set of CreateFlags.
*/
- void replace_contents_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const char* contents, gsize length, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const char* contents, gsize length, const std::string& etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Starts an asynchronous replacement of the file with the given
* @a contents of @a length bytes. @a etag will replace the document's
* @param length The length of @a contents in bytes.
* @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.
+ * @param flags A set of CreateFlags.
*/
- void replace_contents_async(const SlotAsyncReady& slot, const char* contents, gsize length, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents_async(const SlotAsyncReady& slot, const char* contents, gsize length, const std::string& etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Starts an asynchronous replacement of the file with the given
* @a contents of @a length bytes. @a etag will replace the document's
* @param contents String 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.
+ * @param flags A set of CreateFlags.
*/
- void replace_contents_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& contents, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const std::string& contents, const std::string& etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Starts an asynchronous replacement of the file with the given
* @a contents. @a etag will replace the document's
* @param contents String 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.
+ * @param flags A set of CreateFlags.
*/
- void replace_contents_async(const SlotAsyncReady& slot, const std::string& contents, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents_async(const SlotAsyncReady& slot, const std::string& contents, const std::string& etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_replace_contents_async)
* @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.
+ * @param flags A set of CreateFlags.
*/
- void replace_contents_bytes_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<const Glib::Bytes>& contents, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents_bytes_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<const Glib::Bytes>& contents, const std::string& etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
/** Same as replace_contents_async() but takes a Gio::Bytes input instead.
*
* @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.
+ * @param flags A set of CreateFlags.
*/
- void replace_contents_bytes_async(const SlotAsyncReady& slot, const Glib::RefPtr<const Glib::Bytes>& contents, const std::string& etag, bool make_backup = false, FileCreateFlags flags = FILE_CREATE_NONE);
+ void replace_contents_bytes_async(const SlotAsyncReady& slot, const Glib::RefPtr<const Glib::Bytes>& contents, const std::string& etag, bool make_backup = false, CreateFlags flags = CreateFlags::NONE);
_IGNORE(g_file_replace_contents_async)
FileAttributeInfo::FileAttributeInfo(const GFileAttributeInfo* ginfo)
: m_name(ginfo->name ? ginfo->name : ""),
m_type(static_cast<FileAttributeType>(ginfo->type)),
- m_flags(static_cast<FileAttributeInfoFlags>(ginfo->flags))
+ m_flags(static_cast<Flags>(ginfo->flags))
{
}
return m_type;
}
-FileAttributeInfoFlags
+FileAttributeInfo::Flags
FileAttributeInfo::get_flags() const
{
return m_flags;
{
_WRAP_ENUM(FileAttributeType, GFileAttributeType)
-_WRAP_ENUM(FileAttributeInfoFlags, GFileAttributeInfoFlags)
_WRAP_ENUM(FileAttributeStatus, GFileAttributeStatus)
{
_CLASS_GENERIC(FileAttributeInfo, GFileAttributeInfo)
public:
+ _WRAP_ENUM(Flags, GFileAttributeInfoFlags)
+
explicit FileAttributeInfo(const GFileAttributeInfo* ginfo);
FileAttributeInfo(const FileAttributeInfo& other);
std::string get_name() const;
FileAttributeType get_type() const;
- FileAttributeInfoFlags get_flags() const;
+ Flags get_flags() const;
protected:
std::string m_name;
FileAttributeType m_type;
- FileAttributeInfoFlags m_flags;
+ Flags m_flags;
};
} // namespace Gio
-// -*- 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
* e.g. "standard::*" will return all of the keys in the "standard" namespace.
*
* Values are stored within the list in Gio::FileAttributeValue structures. Values can store different types, listed in the enum
- * Gio::FileAttributeType. Upon creation of a Gio::FileAttributeValue, the type will be set to Gio::FILE_ATTRIBUTE_TYPE_INVALID.
+ * Gio::FileAttributeType. Upon creation of a Gio::FileAttributeValue, the type will be set to Gio::FileAttributeType::INVALID.
*
* The list of possible attributes for a filesystem (pointed to by a Gio::File) is availible as a Gio::FileAttributeInfoList.
* This list is queryable by key names as indicated earlier.
_WRAP_METHOD(Glib::RefPtr<FileAttributeInfoList> dup() const, g_file_attribute_info_list_dup)
- _WRAP_METHOD(void add(const std::string& name, FileAttributeType type, FileAttributeInfoFlags flags = FILE_ATTRIBUTE_INFO_NONE), g_file_attribute_info_list_add)
+ _WRAP_METHOD(void add(const std::string& name, FileAttributeType type, FileAttributeInfo::Flags flags = FileAttributeInfo::Flags::NONE), g_file_attribute_info_list_add)
};
} // namespace Gio
-/* sarray.cc
- *
- * Copyright (C) 2002 The gtkmm Development Team
+/* Copyright (C) 2017 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
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/sarray.h>
+#include <gio/gio.h>
+#include <gio/gfiledescriptorbased.h>
--- /dev/null
+/* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/interface.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+typedef struct _GFileDescriptorBasedIface GFileDescriptorBasedIface;
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
+namespace Gio
+{
+
+/** Interface for file descriptor based IO.
+ *
+ * %FileDescriptorBased is implemented by streams (implementations of
+ * Gio::InputStream or Gio::OutputStream) that are based on file descriptors.
+ *
+ * @ingroup Streams
+ *
+ * @newin{2,58}
+ */
+class FileDescriptorBased : public Glib::Interface
+{
+ _CLASS_INTERFACE(FileDescriptorBased, GFileDescriptorBased, G_FILE_DESCRIPTOR_BASED, GFileDescriptorBasedIface)
+ _GTKMMPROC_WIN32_NO_WRAP
+
+public:
+ _WRAP_METHOD(int get_fd() const, g_file_descriptor_based_get_fd, newin "2,58")
+
+protected:
+ _WRAP_VFUNC(int get_fd() const, "get_fd")
+};
+
+} // namespace Gio
*/
#include <glibmm/object.h>
-#include <glibmm/arrayhandle.h>
-#include <glibmm/listhandle.h>
#include <glibmm/priorities.h>
#include <giomm/asyncresult.h>
#include <giomm/cancellable.h>
void next_files_async(const SlotAsyncReady& slot, int num_files = 1, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_file_enumerator_next_files_async)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<FileInfo> >', `$2(($3), Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<FileInfo> > next_files_finish(const Glib::RefPtr<AsyncResult>& result),
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<FileInfo>>', `Glib::ListHandler<Glib::RefPtr<FileInfo>>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<FileInfo>> next_files_finish(const Glib::RefPtr<AsyncResult>& result),
g_file_enumerator_next_files_finish,
errthrow)
-// -*- 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
*/
class FileIcon
: public Glib::Object,
- //Already derived by LoadableIcon: public Icon,
+ public Icon,
public LoadableIcon
{
_CLASS_GOBJECT(FileIcon, GFileIcon, G_FILE_ICON, Glib::Object, GObject)
+ _IMPLEMENTS_INTERFACE(Icon)
_IMPLEMENTS_INTERFACE(LoadableIcon)
protected:
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/arrayhandle.h>
#include <glibmm/datetime.h>
#include <glibmm/object.h>
#include <glibmm/timeval.h>
namespace Gio
{
-
-// Rename FILE_TYPE_UNKNOWN to FILE_TYPE_NOT_KNOWN because the former is a
-// define in a Windows header (winbase.h, included from windows.h).
-_WRAP_ENUM(FileType, GFileType, NO_GTYPE, s#FILE_TYPE_UNKNOWN#FILE_TYPE_NOT_KNOWN#)
-
-// Provide FILE_TYPE_UNKNOWN for backwards compatibility.
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-#ifndef FILE_TYPE_UNKNOWN
-const FileType FILE_TYPE_UNKNOWN = FILE_TYPE_NOT_KNOWN;
-#endif
-#endif
+_WRAP_ENUM(FileType, GFileType, NO_GTYPE)
//TODO: attribute strings
_WRAP_METHOD(bool has_namespace(const std::string& name_space) const, g_file_info_has_namespace)
- #m4 _CONVERSION(`char**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle list_attributes(const std::string& name_space{?}) const,
+ #m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> list_attributes(const std::string& name_space{?}) const,
g_file_info_list_attributes)
_WRAP_METHOD(FileAttributeType get_attribute_type(const std::string& attribute) const,
_WRAP_METHOD(FileAttributeStatus get_attribute_status(const std::string& attribute) const, g_file_info_get_attribute_status)
- //TODO: This should return a ustring instead: https://bugzilla.gnome.org/show_bug.cgi?id=615950#c7
- _WRAP_METHOD(std::string get_attribute_string(const std::string& attribute) const,
+ _WRAP_METHOD(Glib::ustring get_attribute_string(const std::string& attribute) const,
g_file_info_get_attribute_string)
#m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
_WRAP_METHOD(bool set_attribute_status(const std::string& attribute, FileAttributeStatus status), g_file_info_set_attribute_status)
- //TODO: This should take a ustring value instead: https://bugzilla.gnome.org/show_bug.cgi?id=615950#c7
- _WRAP_METHOD(void set_attribute_string(const std::string& attribute, const std::string& attr_value),
+ _WRAP_METHOD(void set_attribute_string(const std::string& attribute, const Glib::ustring& attr_value),
g_file_info_set_attribute_string)
#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`char**',`const_cast<char**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
_WRAP_METHOD(bool is_symlink() const, g_file_info_get_is_symlink)
_WRAP_METHOD(std::string get_name() const, g_file_info_get_name)
- //TODO: This should return a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
- _WRAP_METHOD(std::string get_display_name() const, g_file_info_get_display_name)
+ _WRAP_METHOD(Glib::ustring get_display_name() const, g_file_info_get_display_name)
- //TODO: This should return a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
- _WRAP_METHOD(std::string get_edit_name() const, g_file_info_get_edit_name)
+ _WRAP_METHOD(Glib::ustring get_edit_name() const, g_file_info_get_edit_name)
_WRAP_METHOD(Glib::RefPtr<Icon> get_icon(), g_file_info_get_icon, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_icon() const, g_file_info_get_icon, refreturn, constversion)
_WRAP_METHOD(Glib::RefPtr<Icon> get_symbolic_icon(), g_file_info_get_symbolic_icon, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Icon> get_symbolic_icon() const, g_file_info_get_symbolic_icon, refreturn, constversion)
- //TODO: This should return a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
- _WRAP_METHOD(std::string get_content_type() const, g_file_info_get_content_type)
+ _WRAP_METHOD(Glib::ustring get_content_type() const, g_file_info_get_content_type)
_WRAP_METHOD(goffset get_size() const, g_file_info_get_size)
_WRAP_METHOD(std::string get_symlink_target() const, g_file_info_get_symlink_target)
- //TODO: This should return a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
- _WRAP_METHOD(std::string get_etag() const, g_file_info_get_etag)
+ _WRAP_METHOD(Glib::ustring get_etag() const, g_file_info_get_etag)
_WRAP_METHOD(gint32 get_sort_order() const, g_file_info_get_sort_order)
_WRAP_METHOD(void set_attribute_mask(const Glib::RefPtr<FileAttributeMatcher>& mask),
_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
- _WRAP_METHOD(void set_display_name(const std::string& display_name), g_file_info_set_display_name)
+ _WRAP_METHOD(void set_display_name(const Glib::ustring& display_name), g_file_info_set_display_name)
- //TODO: This should take a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
- _WRAP_METHOD(void set_edit_name(const std::string& edit_name), g_file_info_set_edit_name)
+ _WRAP_METHOD(void set_edit_name(const Glib::ustring& edit_name), g_file_info_set_edit_name)
_WRAP_METHOD(void set_icon(const Glib::RefPtr<Icon>& icon), g_file_info_set_icon)
_WRAP_METHOD(void set_symbolic_icon(const Glib::RefPtr<Icon>& icon), g_file_info_set_symbolic_icon)
- //TODO: This should take a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
- _WRAP_METHOD(void set_content_type(const std::string& content_type), g_file_info_set_content_type)
+ _WRAP_METHOD(void set_content_type(const Glib::ustring& content_type), g_file_info_set_content_type)
_WRAP_METHOD(void set_size(goffset size), g_file_info_set_size)
-// -*- 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
_WRAP_METHOD(Glib::RefPtr<FileInfo> query_info_finish(const Glib::RefPtr<AsyncResult>& result),
g_file_io_stream_query_info_finish,
errthrow)
- _WRAP_METHOD(std::string get_etag() const, g_file_io_stream_get_etag)
+ _WRAP_METHOD(Glib::ustring get_etag() const, g_file_io_stream_get_etag)
};
permission.hg \
pollableinputstream.hg \
pollableoutputstream.hg \
+ propertyaction.hg \
proxy.hg \
proxyaddress.hg \
proxyresolver.hg \
zlibcompressor.hg
giomm_files_posix_hg = \
+ filedescriptorbased.hg \
unixconnection.hg \
unixcredentialsmessage.hg \
unixfdlist.hg \
include $(top_srcdir)/gio/src/filelist.am
-# Split out from $(top_srcdir)/gio/src/filelist.am
if HOST_WINDOWS_NATIVE
giomm_files_arch_hg =
else
#include <giomm/file.h>
#include <gio/gio.h>
+using Event = Gio::FileMonitor::Event;
+
namespace Gio
{
namespace Gio
{
-_WRAP_ENUM(FileMonitorEvent, GFileMonitorEvent, NO_GTYPE)
class File;
public:
+ _WRAP_ENUM(Event, GFileMonitorEvent, NO_GTYPE)
+
_WRAP_METHOD(bool cancel(), g_file_monitor_cancel)
_WRAP_METHOD(bool is_cancelled() const, g_file_monitor_is_cancelled)
_WRAP_METHOD(void set_rate_limit(int limit_msecs), g_file_monitor_set_rate_limit)
_IGNORE(g_file_monitor_emit_event)
#m4 _CONVERSION(`GFile*',`const Glib::RefPtr<File>&',`Glib::wrap($3, true)')
- _WRAP_SIGNAL(void changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, FileMonitorEvent event_type), "changed")
+ _WRAP_SIGNAL(void changed(const Glib::RefPtr<File>& file, const Glib::RefPtr<File>& other_file, Event event_type), "changed")
//_WRAP_VFUNC(bool cancel(), cancel);
*/
//#include <giomm/file.h>
-#include <glibmm/arrayhandle.h>
#include <glibmm/object.h>
_DEFS(giomm,gio)
_WRAP_METHOD(std::string get_completion_suffix(const std::string& initial_text) const, g_filename_completer_get_completion_suffix)
- #m4 _CONVERSION(`char**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle get_completions(const std::string& initial_text) const, g_filename_completer_get_completions)
+ #m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_completions(const std::string& initial_text) const, g_filename_completer_get_completions)
_WRAP_METHOD(void set_dirs_only(bool dirs_only = true), g_filename_completer_set_dirs_only)
_WRAP_SIGNAL(void got_completion_data(), got_completion_data)
g_file_output_stream_query_info_finish,
refreturn, errthrow)
- _WRAP_METHOD(std::string get_etag() const, g_file_output_stream_get_etag)
+ _WRAP_METHOD(Glib::ustring get_etag() const, g_file_output_stream_get_etag)
};
} // namespace Gio
<parameter_description> operation supports anonymous users.
</parameter_description>
</parameter>
+<parameter name="G_ASK_PASSWORD_TCRYPT">
+<parameter_description> operation takes TCRYPT parameters (Since: 2.58)
+</parameter_description>
+</parameter>
</parameters>
</enum>
</parameter_description>
</parameter>
<parameter name="changed_properties">
-<parameter_description> A #GVariant containing the properties that changed.
+<parameter_description> A #GVariant containing the properties that changed (type: `a{sv}`).
</parameter_description>
</parameter>
<parameter name="invalidated_properties">
</parameter_description>
</parameter>
<parameter name="changed_properties">
-<parameter_description> A #GVariant containing the properties that changed
+<parameter_description> A #GVariant containing the properties that changed (type: `a{sv}`)
</parameter_description>
</parameter>
<parameter name="invalidated_properties">
</description>
</property>
+<property name="GMountOperation:is-tcrypt-hidden-volume">
+<description>
+Whether the device to be unlocked is a TCRYPT hidden volume.
+See https://www.veracrypt.fr/en/Hidden%20Volume.html.
+
+Since: 2.58
+
+</description>
+</property>
+
+<property name="GMountOperation:is-tcrypt-system-volume">
+<description>
+Whether the device to be unlocked is a TCRYPT system volume.
+In this context, a system volume is a volume with a bootloader
+and operating system installed. This is only supported for Windows
+operating systems. For further documentation, see
+https://www.veracrypt.fr/en/System%20Encryption.html.
+
+Since: 2.58
+
+</description>
+</property>
+
<property name="GMountOperation:password">
<description>
The password that is used for authentication when carrying out
</description>
</property>
+<property name="GMountOperation:pim">
+<description>
+The VeraCrypt PIM value, when unlocking a VeraCrypt volume. See
+https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20(PIM).html.
+
+Since: 2.58
+
+</description>
+</property>
+
<property name="GMountOperation:username">
<description>
The user name that is used for authentication when carrying out
<description>
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.
+@parameter will always be of the expected type, i.e. the parameter type
+specified when the action was created. If an incorrect type is given when
+activating the action, this signal is not 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
</parameter_description>
</parameter>
<parameter name="parameter">
-<parameter_description> the parameter to the activation
+<parameter_description> the parameter to the activation, or %NULL if it has
+no parameter
</parameter_description>
</parameter>
</parameters>
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.
+@value will always be of the correct state type, i.e. the type of the
+initial state passed to g_simple_action_new_stateful(). If an incorrect
+type is given when requesting to change the state, this signal is not
+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
<description>
If %TRUE, forces 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 usually not
-SSL 3.0, because SSL 3.0 is generally disabled by the #GTlsBackend.
-#GTlsClientConnection will use the next-highest available version
-as the fallback version.
+to use. See g_tls_client_connection_set_use_ssl3().
Since: 2.28
g_tls_connection_set_require_close_notify().
</parameter_description>
</parameter>
+<parameter name="G_TLS_ERROR_INAPPROPRIATE_FALLBACK">
+<parameter_description> The TLS handshake failed
+because the client sent the fallback SCSV, indicating a protocol
+downgrade attack. Since: 2.60
+</parameter_description>
+</parameter>
</parameters>
</enum>
</description>
</property>
-<signal name="GXdpDocuments::handle-add">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</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 gxdp_documents_complete_add() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_fd">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_reuse_existing">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_persistent">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-add-full">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</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 gxdp_documents_complete_add_full() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_fds">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_flags">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-add-named">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</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 gxdp_documents_complete_add_named() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_parent_fd">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_filename">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_reuse_existing">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_persistent">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-delete">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</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 gxdp_documents_complete_delete() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-get-mount-point">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</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 gxdp_documents_complete_get_mount_point() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-grant-permissions">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</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 gxdp_documents_complete_grant_permissions() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-info">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</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 gxdp_documents_complete_info() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-list">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</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 gxdp_documents_complete_list() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-lookup">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</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 gxdp_documents_complete_lookup() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_filename">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpDocuments::handle-revoke-permissions">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</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 gxdp_documents_complete_revoke_permissions() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<property name="GXdpDocuments:version">
-<description>
-Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-Documents.version">"version"</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.
-
-</description>
-</property>
-
-<signal name="GXdpNetworkMonitor::changed">
-<description>
-On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-portal-NetworkMonitor.changed">"changed"</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-<parameter name="arg_available">
-<parameter_description> Argument.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</signal>
-
-<property name="GXdpNetworkMonitor:available">
-<description>
-Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.available">"available"</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.
-
-</description>
-</property>
-
-<property name="GXdpNetworkMonitor:connectivity">
-<description>
-Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.connectivity">"connectivity"</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.
-
-</description>
-</property>
-
-<property name="GXdpNetworkMonitor:metered">
-<description>
-Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.metered">"metered"</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.
-
-</description>
-</property>
-
-<signal name="GXdpOpenURI::handle-open-file">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</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 gxdp_open_uri_complete_open_file() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpOpenURI.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="arg_parent_window">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_fd">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_options">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<signal name="GXdpOpenURI::handle-open-uri">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</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 gxdp_open_uri_complete_open_uri() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpOpenURI.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_parent_window">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_uri">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-<parameter name="arg_options">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
-<property name="GXdpOpenURI:version">
-<description>
-Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</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.
-
-</description>
-</property>
-
-<signal name="GXdpProxyResolver::handle-lookup">
-<description>
-Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</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 gxdp_proxy_resolver_complete_lookup() 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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpProxyResolver.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_uri">
-<parameter_description> Argument passed by remote caller.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
-</return>
-</signal>
-
<property name="GZlibCompressor:file-info">
<description>
If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
</parameter_description>
</parameter>
</parameters>
-<return> the registered mime type for the given @type,
-or %NULL if unknown.
+<return> the registered mime type for the
+given @type, or %NULL if unknown; free with g_free().
</return>
</function>
dispatched anywhere else - not even the standard dispatch machinery
(that API such as g_dbus_connection_signal_subscribe() and
g_dbus_connection_send_message_with_reply() relies on) will see the
-message. Similary, if a filter consumes an outgoing message, the
+message. Similarly, if a filter consumes an outgoing message, the
message will not be sent to the other peer.
If @user_data_free_func is non-%NULL, it will be called (in the
<function name="g_dbus_connection_close_sync">
<description>
-Synchronously closees @connection. The calling thread is blocked
+Synchronously closes @connection. The calling thread is blocked
until this is done. See g_dbus_connection_close() for the
asynchronous version of this method and more details about what it
does.
</description>
<parameters>
<parameter name="blob">
-<parameter_description> A blob represent a binary D-Bus message.
+<parameter_description> A blob representing a binary D-Bus message.
</parameter_description>
</parameter>
<parameter name="blob_len">
<description>
Gets a header field on @message.
+The caller is responsible for checking the type of the returned #GVariant
+matches what is expected.
+
Since: 2.26
</description>
order that the message was in can be retrieved using
g_dbus_message_get_byte_order().
+If the @blob cannot be parsed, contains invalid fields, or contains invalid
+headers, %G_IO_ERROR_INVALID_ARGUMENT will be returned.
+
Since: 2.26
</description>
<parameters>
<parameter name="blob">
-<parameter_description> A blob represent a binary D-Bus message.
+<parameter_description> A blob representing a binary D-Bus message.
</parameter_description>
</parameter>
<parameter name="blob_len">
match rules for signals. Connect to the #GDBusProxy::g-signal signal
to handle signals from the remote object.
+If both %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES and
+%G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS are set, this constructor is
+guaranteed to complete immediately without blocking.
+
If @name is a well-known name and the
%G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START and %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION
flags aren't set and no name owner currently exists, the message bus
match rules for signals. Connect to the #GDBusProxy::g-signal signal
to handle signals from the remote object.
+If both %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES and
+%G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS are set, this constructor is
+guaranteed to return immediately without blocking.
+
If @name is a well-known name and the
%G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START and %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION
flags aren't set and no name owner currently exists, the message bus
</return>
</function>
+<function name="g_desktop_app_info_get_string_list">
+<description>
+Looks up a string list value in the keyfile backing @info.
+
+The @key is looked up in the "Desktop Entry" group.
+
+Since: 2.59.0
+
+</description>
+<parameters>
+<parameter name="info">
+<parameter_description> a #GDesktopAppInfo
+</parameter_description>
+</parameter>
+<parameter name="key">
+<parameter_description> the key to look up
+</parameter_description>
+</parameter>
+<parameter name="length">
+<parameter_description> return location for the number of returned strings, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return>
+a %NULL-terminated string array or %NULL if the specified
+key cannot be found. The array should be freed with g_strfreev().
+
+</return>
+</function>
+
<function name="g_desktop_app_info_has_key">
<description>
Returns whether @key exists in the "Desktop Entry" group
launch applications. Ordinary applications should use
g_app_info_launch_uris().
-If the application is launched via traditional UNIX fork()/exec()
-then @spawn_flags, @user_setup and @user_setup_data are used for the
-call to g_spawn_async(). Additionally, @pid_callback (with
-@pid_callback_data) will be called to inform about the PID of the
-created process.
+If the application is launched via GSpawn, then @spawn_flags, @user_setup
+and @user_setup_data are used for the call to g_spawn_async().
+Additionally, @pid_callback (with @pid_callback_data) will be called to
+inform about the PID of the created process. See g_spawn_async_with_pipes()
+for information on certain parameter conditions that can enable an
+optimized posix_spawn() codepath to be used.
If application launching occurs via some other mechanism (eg: D-Bus
activation) then @spawn_flags, @user_setup, @user_setup_data,
</return>
</function>
+<function name="g_desktop_app_info_launch_uris_as_manager_with_fds">
+<description>
+Equivalent to g_desktop_app_info_launch_uris_as_manager() but allows
+you to pass in file descriptors for the stdin, stdout and stderr streams
+of the launched process.
+
+If application launching occurs via some non-spawn mechanism (e.g. D-Bus
+activation) then @stdin_fd, @stdout_fd and @stderr_fd are ignored.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="appinfo">
+<parameter_description> a #GDesktopAppInfo
+</parameter_description>
+</parameter>
+<parameter name="uris">
+<parameter_description> List of URIs
+</parameter_description>
+</parameter>
+<parameter name="launch_context">
+<parameter_description> a #GAppLaunchContext
+</parameter_description>
+</parameter>
+<parameter name="spawn_flags">
+<parameter_description> #GSpawnFlags, used for each process
+</parameter_description>
+</parameter>
+<parameter name="user_setup">
+<parameter_description> a #GSpawnChildSetupFunc, used once
+for each process.
+</parameter_description>
+</parameter>
+<parameter name="user_setup_data">
+<parameter_description> User data for @user_setup
+</parameter_description>
+</parameter>
+<parameter name="pid_callback">
+<parameter_description> Callback for child processes
+</parameter_description>
+</parameter>
+<parameter name="pid_callback_data">
+<parameter_description> User data for @callback
+</parameter_description>
+</parameter>
+<parameter name="stdin_fd">
+<parameter_description> file descriptor to use for child's stdin, or -1
+</parameter_description>
+</parameter>
+<parameter name="stdout_fd">
+<parameter_description> file descriptor to use for child's stdout, or -1
+</parameter_description>
+</parameter>
+<parameter name="stderr_fd">
+<parameter_description> file descriptor to use for child's stderr, or -1
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> return location for a #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE on successful launch, %FALSE otherwise.
+
+</return>
+</function>
+
<function name="g_desktop_app_info_list_actions">
<description>
Returns the list of "additional application actions" supported on the
</parameter_description>
</parameter>
</parameters>
-<return> a new #GDesktopAppInfo, or %NULL if no desktop file with that id
+<return> a new #GDesktopAppInfo, or %NULL if no desktop
+file with that id exists.
</return>
</function>
<function name="g_drive_get_identifier">
<description>
-Gets the identifier of the given kind for @drive.
+Gets the identifier of the given kind for @drive. The only
+identifier currently available is
+#G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE.
</description>
</parameter>
</parameters>
<return> a newly allocated string containing the
-requested identfier, or %NULL if the #GDrive
+requested identifier, or %NULL if the #GDrive
doesn't have this kind of identifier.
</return>
</function>
the actual file or directory represented by the #GFile; see
g_file_copy() if attempting to copy a file.
+g_file_dup() is useful when a second handle is needed to the same underlying
+file, for use in a separate thread (#GFile is not thread-safe). For use
+within the same thread, use g_object_ref() to increment the existing object’s
+reference count.
+
This call does no blocking I/O.
<function name="g_file_info_set_attribute">
<description>
Sets the @attribute to contain the given value, if possible. To unset the
-attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
+attribute, use %G_FILE_ATTRIBUTE_TYPE_INVALID for @type.
</description>
<parameters>
<description>
Checks to see if a file is native to the platform.
-A native file s one expressed in the platform-native filename format,
+A native file is one expressed in the platform-native filename format,
e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
as it might be on a locally mounted remote filesystem.
native, the returned string is the result of g_file_get_uri()
(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`).
+- If @icon is a #GThemedIcon with exactly one name and no fallbacks,
+the encoding is simply the name (such as `network-server`).
Virtual: to_tokens
Since: 2.20
</parameter_description>
</parameter>
</parameters>
-<return> a #GDrive or %NULL if @mount is not associated with a volume or a drive.
+<return> a #GDrive or %NULL if @mount is not
+associated with a volume or a drive.
The returned object should be unreffed with
g_object_unref() when no longer needed.
</return>
</parameter_description>
</parameter>
</parameters>
-<return> the UUID for @mount or %NULL if no UUID can be computed.
+<return> the UUID for @mount or %NULL if no UUID
+can be computed.
The returned string should be freed with g_free()
when no longer needed.
</return>
</parameter_description>
</parameter>
</parameters>
-<return> a #GVolume or %NULL if @mount is not associated with a volume.
+<return> a #GVolume or %NULL if @mount is not
+associated with a volume.
The returned object should be unreffed with
g_object_unref() when no longer needed.
</return>
</return>
</function>
+<function name="g_mount_operation_get_is_tcrypt_hidden_volume">
+<description>
+Check to see whether the mount operation is being used
+for a TCRYPT hidden volume.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="op">
+<parameter_description> a #GMountOperation.
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if mount operation is for hidden volume.
+
+</return>
+</function>
+
+<function name="g_mount_operation_get_is_tcrypt_system_volume">
+<description>
+Check to see whether the mount operation is being used
+for a TCRYPT system volume.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="op">
+<parameter_description> a #GMountOperation.
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if mount operation is for system volume.
+
+</return>
+</function>
+
<function name="g_mount_operation_get_password">
<description>
Gets a password from the mount operation.
</return>
</function>
+<function name="g_mount_operation_get_pim">
+<description>
+Gets a PIM from the mount operation.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="op">
+<parameter_description> a #GMountOperation.
+</parameter_description>
+</parameter>
+</parameters>
+<return> The VeraCrypt PIM within @op.
+
+</return>
+</function>
+
<function name="g_mount_operation_get_username">
<description>
Get the user name from the mount operation.
<return></return>
</function>
-<function name="g_mount_operation_set_password">
+<function name="g_mount_operation_set_is_tcrypt_hidden_volume">
<description>
-Sets the mount operation's password to @password.
+Sets the mount operation to use a hidden volume if @hidden_volume is %TRUE.
+Since: 2.58
</description>
<parameters>
<parameter_description> a #GMountOperation.
</parameter_description>
</parameter>
-<parameter name="password">
-<parameter_description> password to set.
+<parameter name="hidden_volume">
+<parameter_description> boolean value.
</parameter_description>
</parameter>
</parameters>
<return></return>
</function>
-<function name="g_mount_operation_set_password_save">
+<function name="g_mount_operation_set_is_tcrypt_system_volume">
<description>
-Sets the state of saving passwords for the mount operation.
+Sets the mount operation to use a system volume if @system_volume is %TRUE.
+Since: 2.58
</description>
<parameters>
<parameter_description> a #GMountOperation.
</parameter_description>
</parameter>
-<parameter name="save">
-<parameter_description> a set of #GPasswordSave flags.
+<parameter name="system_volume">
+<parameter_description> boolean value.
</parameter_description>
</parameter>
</parameters>
<return></return>
</function>
-<function name="g_mount_operation_set_username">
+<function name="g_mount_operation_set_password">
<description>
-Sets the user name within @op to @username.
+Sets the mount operation's password to @password.
+
</description>
<parameters>
<parameter_description> a #GMountOperation.
</parameter_description>
</parameter>
-<parameter name="username">
-<parameter_description> input username.
+<parameter name="password">
+<parameter_description> password to set.
</parameter_description>
</parameter>
</parameters>
<return></return>
</function>
-<function name="g_mount_remount">
+<function name="g_mount_operation_set_password_save">
<description>
-Remounts a mount. This is an asynchronous operation, and is
-finished by calling g_mount_remount_finish() with the @mount
-and #GAsyncResults data returned in the @callback.
+Sets the state of saving passwords for the mount operation.
-Remounting is useful when some setting affecting the operation
-of the volume has been changed, as these may need a remount to
-take affect. While this is semantically equivalent with unmounting
-and then remounting not all backends might need to actually be
-unmounted.
</description>
<parameters>
-<parameter name="mount">
-<parameter_description> a #GMount.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> flags affecting the operation
-</parameter_description>
-</parameter>
-<parameter name="mount_operation">
-<parameter_description> a #GMountOperation or %NULL to avoid
-user interaction.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> optional #GCancellable object, %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> a #GAsyncReadyCallback, or %NULL.
+<parameter name="op">
+<parameter_description> a #GMountOperation.
</parameter_description>
</parameter>
-<parameter name="user_data">
-<parameter_description> user data passed to @callback.
+<parameter name="save">
+<parameter_description> a set of #GPasswordSave flags.
</parameter_description>
</parameter>
</parameters>
<return></return>
</function>
-<function name="g_mount_remount_finish">
+<function name="g_mount_operation_set_pim">
<description>
-Finishes remounting a mount. If any errors occurred during the operation,
-@error will be set to contain the errors and %FALSE will be returned.
+Sets the mount operation's PIM to @pim.
+Since: 2.58
</description>
<parameters>
-<parameter name="mount">
-<parameter_description> a #GMount.
-</parameter_description>
-</parameter>
-<parameter name="result">
-<parameter_description> a #GAsyncResult.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> a #GError location to store the error occurring, or %NULL to
-ignore.
+<parameter name="op">
+<parameter_description> a #GMountOperation.
</parameter_description>
</parameter>
-</parameters>
-<return> %TRUE if the mount was successfully remounted. %FALSE otherwise.
-</return>
-</function>
-
-<function name="g_mount_shadow">
-<description>
-Increments the shadow count on @mount. Usually used by
-#GVolumeMonitor implementations when creating a shadow mount for
-@mount, see g_mount_is_shadowed() for more information. The caller
-will need to emit the #GMount::changed signal on @mount manually.
-
-Since: 2.20
-
-</description>
-<parameters>
-<parameter name="mount">
-<parameter_description> A #GMount.
+<parameter name="pim">
+<parameter_description> an unsigned integer.
</parameter_description>
</parameter>
</parameters>
<return></return>
</function>
-<function name="g_mount_unmount">
+<function name="g_mount_operation_set_username">
<description>
-Unmounts a mount. This is an asynchronous operation, and is
-finished by calling g_mount_unmount_finish() with the @mount
-and #GAsyncResult data returned in the @callback.
-
-Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
+Sets the user name within @op to @username.
</description>
<parameters>
-<parameter name="mount">
-<parameter_description> a #GMount.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> flags affecting the operation
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> optional #GCancellable object, %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> a #GAsyncReadyCallback, or %NULL.
+<parameter name="op">
+<parameter_description> a #GMountOperation.
</parameter_description>
</parameter>
-<parameter name="user_data">
-<parameter_description> user data passed to @callback.
+<parameter name="username">
+<parameter_description> input username.
</parameter_description>
</parameter>
</parameters>
<return></return>
</function>
-<function name="g_mount_unmount_finish">
-<description>
-Finishes unmounting a mount. If any errors occurred during the operation,
-@error will be set to contain the errors and %FALSE will be returned.
-
-Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
-
-</description>
-<parameters>
-<parameter name="mount">
-<parameter_description> a #GMount.
-</parameter_description>
-</parameter>
-<parameter name="result">
-<parameter_description> a #GAsyncResult.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> a #GError location to store the error occurring, or %NULL to
-ignore.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the mount was successfully unmounted. %FALSE otherwise.
-
-</return>
-</function>
-
-<function name="g_mount_unmount_with_operation">
+<function name="g_mount_remount">
<description>
-Unmounts a mount. This is an asynchronous operation, and is
-finished by calling g_mount_unmount_with_operation_finish() with the @mount
-and #GAsyncResult data returned in the @callback.
+Remounts a mount. This is an asynchronous operation, and is
+finished by calling g_mount_remount_finish() with the @mount
+and #GAsyncResults data returned in the @callback.
-Since: 2.22
+Remounting is useful when some setting affecting the operation
+of the volume has been changed, as these may need a remount to
+take affect. While this is semantically equivalent with unmounting
+and then remounting not all backends might need to actually be
+unmounted.
+
+</description>
+<parameters>
+<parameter name="mount">
+<parameter_description> a #GMount.
+</parameter_description>
+</parameter>
+<parameter name="flags">
+<parameter_description> flags affecting the operation
+</parameter_description>
+</parameter>
+<parameter name="mount_operation">
+<parameter_description> a #GMountOperation or %NULL to avoid
+user interaction.
+</parameter_description>
+</parameter>
+<parameter name="cancellable">
+<parameter_description> optional #GCancellable object, %NULL to ignore.
+</parameter_description>
+</parameter>
+<parameter name="callback">
+<parameter_description> a #GAsyncReadyCallback, or %NULL.
+</parameter_description>
+</parameter>
+<parameter name="user_data">
+<parameter_description> user data passed to @callback.
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_mount_remount_finish">
+<description>
+Finishes remounting a mount. If any errors occurred during the operation,
+@error will be set to contain the errors and %FALSE will be returned.
+
+
+</description>
+<parameters>
+<parameter name="mount">
+<parameter_description> a #GMount.
+</parameter_description>
+</parameter>
+<parameter name="result">
+<parameter_description> a #GAsyncResult.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a #GError location to store the error occurring, or %NULL to
+ignore.
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the mount was successfully remounted. %FALSE otherwise.
+</return>
+</function>
+
+<function name="g_mount_shadow">
+<description>
+Increments the shadow count on @mount. Usually used by
+#GVolumeMonitor implementations when creating a shadow mount for
+@mount, see g_mount_is_shadowed() for more information. The caller
+will need to emit the #GMount::changed signal on @mount manually.
+
+Since: 2.20
+
+</description>
+<parameters>
+<parameter name="mount">
+<parameter_description> A #GMount.
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_mount_unmount">
+<description>
+Unmounts a mount. This is an asynchronous operation, and is
+finished by calling g_mount_unmount_finish() with the @mount
+and #GAsyncResult data returned in the @callback.
+
+Deprecated: 2.22: Use g_mount_unmount_with_operation() instead.
+
+</description>
+<parameters>
+<parameter name="mount">
+<parameter_description> a #GMount.
+</parameter_description>
+</parameter>
+<parameter name="flags">
+<parameter_description> flags affecting the operation
+</parameter_description>
+</parameter>
+<parameter name="cancellable">
+<parameter_description> optional #GCancellable object, %NULL to ignore.
+</parameter_description>
+</parameter>
+<parameter name="callback">
+<parameter_description> a #GAsyncReadyCallback, or %NULL.
+</parameter_description>
+</parameter>
+<parameter name="user_data">
+<parameter_description> user data passed to @callback.
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_mount_unmount_finish">
+<description>
+Finishes unmounting a mount. If any errors occurred during the operation,
+@error will be set to contain the errors and %FALSE will be returned.
+
+Deprecated: 2.22: Use g_mount_unmount_with_operation_finish() instead.
+
+</description>
+<parameters>
+<parameter name="mount">
+<parameter_description> a #GMount.
+</parameter_description>
+</parameter>
+<parameter name="result">
+<parameter_description> a #GAsyncResult.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a #GError location to store the error occurring, or %NULL to
+ignore.
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the mount was successfully unmounted. %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_mount_unmount_with_operation">
+<description>
+Unmounts a mount. This is an asynchronous operation, and is
+finished by calling g_mount_unmount_with_operation_finish() with the @mount
+and #GAsyncResult data returned in the @callback.
+
+Since: 2.22
</description>
<parameters>
If you want to use this resource in the global resource namespace you need
to register it with g_resources_register().
+If @filename is empty or the data in it is corrupt,
+%G_RESOURCE_ERROR_INTERNAL will be returned. If @filename doesn’t exist, or
+there is an error in reading it, an error from g_mapped_file_new() will be
+returned.
+
Since: 2.32
</description>
Otherwise this function will internally create a copy of the memory since
GLib 2.56, or in older versions fail and exit the process.
+If @data is empty or corrupt, %G_RESOURCE_ERROR_INTERNAL will be returned.
+
Since: 2.32
</description>
to call g_settings_get_child().
For GSettings objects that are lists, this value can change at any
-time and you should connect to the "children-changed" signal to watch
-for those changes. Note that there is a race condition here: you may
+time. Note that there is a race condition here: you may
request a child after listing it only for it to have been destroyed
in the meantime. For this reason, g_settings_get_child() may return
%NULL even for a child that was listed by this function.
Generally, you should set @trusted to %TRUE for files installed by the
system and to %FALSE for files in the home directory.
+In either case, an empty file or some types of corruption in the file will
+result in %G_FILE_ERROR_INVAL being returned.
+
If @parent is non-%NULL then there are two effects.
First, if g_settings_schema_source_lookup() is called with the
<description>
Creates a new action.
-The created action is stateless. See g_simple_action_new_stateful().
+The created action is stateless. See g_simple_action_new_stateful() to create
+an action that has state.
Since: 2.28
</parameter_description>
</parameter>
<parameter name="parameter_type">
-<parameter_description> the type of parameter to the activate function
+<parameter_description> the type of parameter that will be passed to
+handlers for the #GSimpleAction::activate signal, or %NULL for no parameter
</parameter_description>
</parameter>
</parameters>
<description>
Creates a new stateful action.
-@state is the initial state of the action. All future state values
-must have the same #GVariantType as the initial state.
+All future state values must have the same #GVariantType as the initial
+@state.
-If the @state GVariant is floating, it is consumed.
+If the @state #GVariant is floating, it is consumed.
Since: 2.28
</parameter_description>
</parameter>
<parameter name="parameter_type">
-<parameter_description> the type of the parameter to the activate function
+<parameter_description> the type of the parameter that will be passed to
+handlers for the #GSimpleAction::activate signal, or %NULL for no parameter
</parameter_description>
</parameter>
<parameter name="state">
<return></return>
</function>
+<function name="g_themed_icon_update_names">
+<description>
+Update the actual icon name list, based on the requested names (from
+construction, or later added with g_themed_icon_prepend_name() and
+g_themed_icon_append_name()).
+The order of the list matters, indicating priority:
+- The first requested icon is first in priority.
+- If "use-default-fallbacks" is #TRUE, then it is followed by all its
+fallbacks (starting from top to lower context levels).
+- Then next requested icons, and optionally their fallbacks, follow.
+- Finally all the style variants (symbolic or regular, opposite to whatever
+is the requested style) follow in the same order.
+
+An icon is not added twice in the list if it was previously added.
+
+For instance, if requested names are:
+[ "some-icon-symbolic", "some-other-icon" ]
+and use-default-fallbacks is TRUE, the final name list shall be:
+[ "some-icon-symbolic", "some-symbolic", "some-other-icon",
+"some-other", "some", "some-icon", "some-other-icon-symbolic",
+"some-other-symbolic" ]
+
+
+</description>
+<parameters>
+<parameter name="themed">
+<parameter_description> a #GThemedIcon.
+</parameter_description>
+</parameter>
+</parameters>
+<return> a new #GThemedIcon
+</return>
+</function>
+
<function name="g_threaded_socket_service_new">
<description>
Creates a new #GThreadedSocketService with no listeners. Listeners
</return>
</function>
+<function name="g_tls_backend_set_default_database">
+<description>
+Set the default #GTlsDatabase used to verify TLS connections
+
+Any subsequent call to g_tls_backend_get_default_database() will return
+the database set in this call. Existing databases and connections are not
+modified.
+
+Setting a %NULL default database will reset to using the system default
+database as if g_tls_backend_set_default_database() had never been called.
+
+Since: 2.60
+
+</description>
+<parameters>
+<parameter name="backend">
+<parameter_description> the #GTlsBackend
+</parameter_description>
+</parameter>
+<parameter name="database">
+<parameter_description> the #GTlsDatabase
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_tls_backend_supports_dtls">
<description>
Checks if DTLS is supported. DTLS support may not be available even if TLS
<function name="g_tls_client_connection_set_use_ssl3">
<description>
-If @use_ssl3 is %TRUE, this forces @conn to use the lowest-supported
-TLS protocol version rather than trying to properly negotiate the
-highest mutually-supported protocol version with the peer. This can
-be used when talking to broken TLS servers that exhibit protocol
-version intolerance.
+Since 2.42.1, if @use_ssl3 is %TRUE, this forces @conn to use the
+lowest-supported TLS protocol version rather than trying to properly
+negotiate the highest mutually-supported protocol version with the
+peer. Be aware that SSL 3.0 is generally disabled by the
+#GTlsBackend, so the lowest-supported protocol version is probably
+not SSL 3.0.
-Be aware that SSL 3.0 is generally disabled by the #GTlsBackend, so
-the lowest-supported protocol version is probably not SSL 3.0.
+Since 2.58, this may additionally cause an RFC 7507 fallback SCSV to
+be sent to the server, causing modern TLS servers to immediately
+terminate the connection. You should generally only use this function
+if you need to connect to broken servers that exhibit TLS protocol
+version intolerance, and when an initial attempt to connect to a
+server normally has already failed.
Since: 2.28
the beginning of the communication, you do not need to call this
function explicitly unless you want clearer error reporting.
However, you may call g_tls_connection_handshake() later on to
-renegotiate parameters (encryption methods, etc) with the client.
+rehandshake, if TLS 1.2 or older is in use. With TLS 1.3, this will
+instead perform a rekey.
#GTlsConnection::accept_certificate may be emitted during the
handshake.
<function name="g_tls_connection_set_rehandshake_mode">
<description>
-Sets how @conn behaves with respect to rehandshaking requests.
+Sets how @conn behaves with respect to rehandshaking requests, when
+TLS 1.2 or older is in use.
%G_TLS_REHANDSHAKE_NEVER means that it will never agree to
rehandshake after the initial handshake is complete. (For a client,
</return>
</function>
+<function name="g_unix_mount_get_options">
+<description>
+Gets a comma-separated list of mount options for the unix mount. For example,
+`rw,relatime,seclabel,data=ordered`.
+
+This is similar to g_unix_mount_point_get_options(), but it takes
+a #GUnixMountEntry as an argument.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mount_entry">
+<parameter_description> a #GUnixMountEntry.
+</parameter_description>
+</parameter>
+</parameters>
+<return> a string containing the options, or %NULL if not
+available.
+
+</return>
+</function>
+
+<function name="g_unix_mount_get_root_path">
+<description>
+Gets the root of the mount within the filesystem. This is useful e.g. for
+mounts created by bind operation, or btrfs subvolumes.
+
+For example, the root path is equal to "/" for mount created by
+"mount /dev/sda1 /mnt/foo" and "/bar" for
+"mount --bind /mnt/foo/bar /mnt/bar".
+
+Since: 2.60
+
+</description>
+<parameters>
+<parameter name="mount_entry">
+<parameter_description> a #GUnixMountEntry.
+</parameter_description>
+</parameter>
+</parameters>
+<return> a string containing the root, or %NULL if not supported.
+
+</return>
+</function>
+
<function name="g_unix_mount_guess_can_eject">
<description>
Guesses whether a Unix mount can be ejected.
</parameter>
</parameters>
<return> a newly allocated string containing the
-requested identfier, or %NULL if the #GVolume
+requested identifier, or %NULL if the #GVolume
doesn't have this kind of identifier
</return>
</function>
</parameter_description>
</parameter>
</parameters>
-<return> the UUID for @volume or %NULL if no UUID can be computed.
+<return> the UUID for @volume or %NULL if no UUID
+can be computed.
The returned string should be freed with g_free()
when no longer needed.
</return>
also listen for the "removed" signal on the returned object
and give up its reference when handling that signal
-Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
+Similarly, if implementing g_volume_monitor_adopt_orphan_mount(),
the implementor must take a reference to @mount and return it in
its g_volume_get_mount() implemented. Also, the implementor must
listen for the "unmounted" signal on @mount and give up its
</return>
</function>
-<function name="gxdp_documents_call_add">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</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 gxdp_documents_call_add_finish() to get the result of the operation.
-
-See gxdp_documents_call_add_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_fd">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_reuse_existing">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_persistent">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_add_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_add().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_id">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_add_full">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</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 gxdp_documents_call_add_full_finish() to get the result of the operation.
-
-See gxdp_documents_call_add_full_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_fds">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_flags">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_add_full_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_add_full().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_ids">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_extra_out">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_full().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_add_full_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_add_full() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_fds">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_flags">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_ids">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_extra_out">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_add_named">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</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 gxdp_documents_call_add_named_finish() to get the result of the operation.
-
-See gxdp_documents_call_add_named_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_parent_fd">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_filename">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_reuse_existing">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_persistent">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_add_named_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_add_named().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_id">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_add_named().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_add_named_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_add_named() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_parent_fd">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_filename">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_reuse_existing">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_persistent">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_id">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_add_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_add() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_o_path_fd">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_reuse_existing">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_persistent">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_id">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_delete">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</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 gxdp_documents_call_delete_finish() to get the result of the operation.
-
-See gxdp_documents_call_delete_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_delete_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_delete().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_delete().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_delete_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_delete() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_get_mount_point">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</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 gxdp_documents_call_get_mount_point_finish() to get the result of the operation.
-
-See gxdp_documents_call_get_mount_point_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_get_mount_point_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_get_mount_point().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_path">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_get_mount_point().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_get_mount_point_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_get_mount_point() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_path">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_grant_permissions">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</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 gxdp_documents_call_grant_permissions_finish() to get the result of the operation.
-
-See gxdp_documents_call_grant_permissions_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_grant_permissions_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_grant_permissions().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_grant_permissions().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_grant_permissions_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_grant_permissions() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_info">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</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 gxdp_documents_call_info_finish() to get the result of the operation.
-
-See gxdp_documents_call_info_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_info_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_info().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_path">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_apps">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_info().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_info_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_info() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="out_path">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_apps">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_list">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</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 gxdp_documents_call_list_finish() to get the result of the operation.
-
-See gxdp_documents_call_list_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_list_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_list().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_docs">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_list().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_list_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_list() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="out_docs">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_lookup">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</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 gxdp_documents_call_lookup_finish() to get the result of the operation.
-
-See gxdp_documents_call_lookup_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_filename">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_lookup_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_lookup().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_id">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_lookup().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_lookup_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_lookup() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_filename">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="out_doc_id">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_revoke_permissions">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</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 gxdp_documents_call_revoke_permissions_finish() to get the result of the operation.
-
-See gxdp_documents_call_revoke_permissions_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_call_revoke_permissions_finish">
-<description>
-Finishes an operation started with gxdp_documents_call_revoke_permissions().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_call_revoke_permissions().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_call_revoke_permissions_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_documents_call_revoke_permissions() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpDocumentsProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_doc_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_app_id">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_permissions">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_complete_add">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Add">Add()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="doc_id">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_add_full">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddFull">AddFull()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="doc_ids">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-<parameter name="extra_out">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_add_named">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.AddNamed">AddNamed()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="doc_id">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_delete">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Delete">Delete()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_get_mount_point">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GetMountPoint">GetMountPoint()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="path">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_grant_permissions">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.GrantPermissions">GrantPermissions()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_info">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Info">Info()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="path">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-<parameter name="apps">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_list">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.List">List()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="docs">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_lookup">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.Lookup">Lookup()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="doc_id">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_complete_revoke_permissions">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-Documents.RevokePermissions">RevokePermissions()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_get_version">
-<description>
-Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-Documents.version">"version"</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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The property value.
-</return>
-</function>
-
-<function name="gxdp_documents_interface_info">
-<description>
-Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link> D-Bus interface.
-
-
-</description>
-<parameters>
-</parameters>
-<return> A #GDBusInterfaceInfo. Do not free.
-</return>
-</function>
-
-<function name="gxdp_documents_override_properties">
-<description>
-Overrides all #GObject properties in the #GXdpDocuments interface for a concrete class.
-The properties are overridden in the order they are defined.
-
-
-</description>
-<parameters>
-<parameter name="klass">
-<parameter_description> The class structure for a #GObject<!-- -->-derived class.
-</parameter_description>
-</parameter>
-<parameter name="property_id_begin">
-<parameter_description> The property id to assign to the first overridden property.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The last property id.
-</return>
-</function>
-
-<function name="gxdp_documents_proxy_new">
-<description>
-Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</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 gxdp_documents_proxy_new_finish() to get the result of the operation.
-
-See gxdp_documents_proxy_new_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_proxy_new_finish">
-<description>
-Finishes an operation started with gxdp_documents_proxy_new().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_proxy_new().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_proxy_new_for_bus">
-<description>
-Like gxdp_documents_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 gxdp_documents_proxy_new_for_bus_finish() to get the result of the operation.
-
-See gxdp_documents_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_proxy_new_for_bus_finish">
-<description>
-Finishes an operation started with gxdp_documents_proxy_new_for_bus().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_documents_proxy_new_for_bus().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_proxy_new_for_bus_sync">
-<description>
-Like gxdp_documents_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_documents_proxy_new_for_bus() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_proxy_new_sync">
-<description>
-Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>. See g_dbus_proxy_new_sync() for more details.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_documents_proxy_new() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_documents_set_version">
-<description>
-Sets the <link linkend="gdbus-property-org-freedesktop-portal-Documents.version">"version"</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpDocuments.
-</parameter_description>
-</parameter>
-<parameter name="value">
-<parameter_description> The value to set.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_documents_skeleton_new">
-<description>
-Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-Documents.top_of_page">org.freedesktop.portal.Documents</link>.
-
-
-</description>
-<parameters>
-</parameters>
-<return> The skeleton object.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_emit_changed">
-<description>
-Emits the <link linkend="gdbus-signal-org-freedesktop-portal-NetworkMonitor.changed">"changed"</link> D-Bus signal.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-<parameter name="arg_available">
-<parameter_description> Argument to pass with the signal.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_network_monitor_get_available">
-<description>
-Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.available">"available"</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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The property value.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_get_connectivity">
-<description>
-Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.connectivity">"connectivity"</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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The property value.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_get_metered">
-<description>
-Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.metered">"metered"</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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The property value.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_interface_info">
-<description>
-Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-NetworkMonitor.top_of_page">org.freedesktop.portal.NetworkMonitor</link> D-Bus interface.
-
-
-</description>
-<parameters>
-</parameters>
-<return> A #GDBusInterfaceInfo. Do not free.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_override_properties">
-<description>
-Overrides all #GObject properties in the #GXdpNetworkMonitor interface for a concrete class.
-The properties are overridden in the order they are defined.
-
-
-</description>
-<parameters>
-<parameter name="klass">
-<parameter_description> The class structure for a #GObject<!-- -->-derived class.
-</parameter_description>
-</parameter>
-<parameter name="property_id_begin">
-<parameter_description> The property id to assign to the first overridden property.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The last property id.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_proxy_new">
-<description>
-Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-NetworkMonitor.top_of_page">org.freedesktop.portal.NetworkMonitor</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 gxdp_network_monitor_proxy_new_finish() to get the result of the operation.
-
-See gxdp_network_monitor_proxy_new_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_network_monitor_proxy_new_finish">
-<description>
-Finishes an operation started with gxdp_network_monitor_proxy_new().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_network_monitor_proxy_new().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_proxy_new_for_bus">
-<description>
-Like gxdp_network_monitor_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 gxdp_network_monitor_proxy_new_for_bus_finish() to get the result of the operation.
-
-See gxdp_network_monitor_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_network_monitor_proxy_new_for_bus_finish">
-<description>
-Finishes an operation started with gxdp_network_monitor_proxy_new_for_bus().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_network_monitor_proxy_new_for_bus().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_proxy_new_for_bus_sync">
-<description>
-Like gxdp_network_monitor_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_network_monitor_proxy_new_for_bus() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_proxy_new_sync">
-<description>
-Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-NetworkMonitor.top_of_page">org.freedesktop.portal.NetworkMonitor</link>. See g_dbus_proxy_new_sync() for more details.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_network_monitor_proxy_new() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_network_monitor_set_available">
-<description>
-Sets the <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.available">"available"</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-<parameter name="value">
-<parameter_description> The value to set.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_network_monitor_set_connectivity">
-<description>
-Sets the <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.connectivity">"connectivity"</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-<parameter name="value">
-<parameter_description> The value to set.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_network_monitor_set_metered">
-<description>
-Sets the <link linkend="gdbus-property-org-freedesktop-portal-NetworkMonitor.metered">"metered"</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpNetworkMonitor.
-</parameter_description>
-</parameter>
-<parameter name="value">
-<parameter_description> The value to set.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_network_monitor_skeleton_new">
-<description>
-Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-NetworkMonitor.top_of_page">org.freedesktop.portal.NetworkMonitor</link>.
-
-
-</description>
-<parameters>
-</parameters>
-<return> The skeleton object.
-</return>
-</function>
-
-<function name="gxdp_open_uri_call_open_file">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</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 gxdp_open_uri_call_open_file_finish() to get the result of the operation.
-
-See gxdp_open_uri_call_open_file_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpOpenURIProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_parent_window">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_fd">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_options">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_call_open_file_finish">
-<description>
-Finishes an operation started with gxdp_open_uri_call_open_file().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpOpenURIProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_handle">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_file().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_call_open_file_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_open_uri_call_open_file() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpOpenURIProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_parent_window">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_fd">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_options">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="out_handle">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="out_fd_list">
-<parameter_description> Return location for a #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_call_open_uri">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</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 gxdp_open_uri_call_open_uri_finish() to get the result of the operation.
-
-See gxdp_open_uri_call_open_uri_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpOpenURIProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_parent_window">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_uri">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_options">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_call_open_uri_finish">
-<description>
-Finishes an operation started with gxdp_open_uri_call_open_uri().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpOpenURIProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_handle">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_call_open_uri().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_call_open_uri_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_open_uri_call_open_uri() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpOpenURIProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_parent_window">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_uri">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="arg_options">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="out_handle">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_complete_open_file">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenFile">OpenFile()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpOpenURI.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="fd_list">
-<parameter_description> A #GUnixFDList or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="handle">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_complete_open_uri">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-OpenURI.OpenURI">OpenURI()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpOpenURI.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="handle">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_get_version">
-<description>
-Gets the value of the <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</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.
-
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpOpenURI.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The property value.
-</return>
-</function>
-
-<function name="gxdp_open_uri_interface_info">
-<description>
-Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link> D-Bus interface.
-
-
-</description>
-<parameters>
-</parameters>
-<return> A #GDBusInterfaceInfo. Do not free.
-</return>
-</function>
-
-<function name="gxdp_open_uri_override_properties">
-<description>
-Overrides all #GObject properties in the #GXdpOpenURI interface for a concrete class.
-The properties are overridden in the order they are defined.
-
-
-</description>
-<parameters>
-<parameter name="klass">
-<parameter_description> The class structure for a #GObject<!-- -->-derived class.
-</parameter_description>
-</parameter>
-<parameter name="property_id_begin">
-<parameter_description> The property id to assign to the first overridden property.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The last property id.
-</return>
-</function>
-
-<function name="gxdp_open_uri_proxy_new">
-<description>
-Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</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 gxdp_open_uri_proxy_new_finish() to get the result of the operation.
-
-See gxdp_open_uri_proxy_new_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_proxy_new_finish">
-<description>
-Finishes an operation started with gxdp_open_uri_proxy_new().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_proxy_new_for_bus">
-<description>
-Like gxdp_open_uri_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 gxdp_open_uri_proxy_new_for_bus_finish() to get the result of the operation.
-
-See gxdp_open_uri_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_proxy_new_for_bus_finish">
-<description>
-Finishes an operation started with gxdp_open_uri_proxy_new_for_bus().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_open_uri_proxy_new_for_bus().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_proxy_new_for_bus_sync">
-<description>
-Like gxdp_open_uri_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_open_uri_proxy_new_for_bus() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_proxy_new_sync">
-<description>
-Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>. See g_dbus_proxy_new_sync() for more details.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_open_uri_proxy_new() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_open_uri_set_version">
-<description>
-Sets the <link linkend="gdbus-property-org-freedesktop-portal-OpenURI.version">"version"</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpOpenURI.
-</parameter_description>
-</parameter>
-<parameter name="value">
-<parameter_description> The value to set.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_open_uri_skeleton_new">
-<description>
-Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-OpenURI.top_of_page">org.freedesktop.portal.OpenURI</link>.
-
-
-</description>
-<parameters>
-</parameters>
-<return> The skeleton object.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_call_lookup">
-<description>
-Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</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 gxdp_proxy_resolver_call_lookup_finish() to get the result of the operation.
-
-See gxdp_proxy_resolver_call_lookup_sync() for the synchronous, blocking version of this method.
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpProxyResolverProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_uri">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_proxy_resolver_call_lookup_finish">
-<description>
-Finishes an operation started with gxdp_proxy_resolver_call_lookup().
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpProxyResolverProxy.
-</parameter_description>
-</parameter>
-<parameter name="out_proxies">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_call_lookup().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_call_lookup_sync">
-<description>
-Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
-
-See gxdp_proxy_resolver_call_lookup() for the asynchronous version of this method.
-
-
-</description>
-<parameters>
-<parameter name="proxy">
-<parameter_description> A #GXdpProxyResolverProxy.
-</parameter_description>
-</parameter>
-<parameter name="arg_uri">
-<parameter_description> Argument to pass with the method invocation.
-</parameter_description>
-</parameter>
-<parameter name="out_proxies">
-<parameter_description> Return location for return parameter or %NULL to ignore.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL.
-</parameter_description>
-</parameter>
-</parameters>
-<return> %TRUE if the call succeded, %FALSE if @error is set.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_complete_lookup">
-<description>
-Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-portal-ProxyResolver.Lookup">Lookup()</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.
-
-</description>
-<parameters>
-<parameter name="object">
-<parameter_description> A #GXdpProxyResolver.
-</parameter_description>
-</parameter>
-<parameter name="invocation">
-<parameter_description> A #GDBusMethodInvocation.
-</parameter_description>
-</parameter>
-<parameter name="proxies">
-<parameter_description> Parameter to return.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_proxy_resolver_interface_info">
-<description>
-Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link> D-Bus interface.
-
-
-</description>
-<parameters>
-</parameters>
-<return> A #GDBusInterfaceInfo. Do not free.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_override_properties">
-<description>
-Overrides all #GObject properties in the #GXdpProxyResolver interface for a concrete class.
-The properties are overridden in the order they are defined.
-
-
-</description>
-<parameters>
-<parameter name="klass">
-<parameter_description> The class structure for a #GObject<!-- -->-derived class.
-</parameter_description>
-</parameter>
-<parameter name="property_id_begin">
-<parameter_description> The property id to assign to the first overridden property.
-</parameter_description>
-</parameter>
-</parameters>
-<return> The last property id.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_proxy_new">
-<description>
-Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</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 gxdp_proxy_resolver_proxy_new_finish() to get the result of the operation.
-
-See gxdp_proxy_resolver_proxy_new_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_proxy_resolver_proxy_new_finish">
-<description>
-Finishes an operation started with gxdp_proxy_resolver_proxy_new().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_proxy_new_for_bus">
-<description>
-Like gxdp_proxy_resolver_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 gxdp_proxy_resolver_proxy_new_for_bus_finish() to get the result of the operation.
-
-See gxdp_proxy_resolver_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="callback">
-<parameter_description> A #GAsyncReadyCallback to call when the request is satisfied.
-</parameter_description>
-</parameter>
-<parameter name="user_data">
-<parameter_description> User data to pass to @callback.
-</parameter_description>
-</parameter>
-</parameters>
-<return></return>
-</function>
-
-<function name="gxdp_proxy_resolver_proxy_new_for_bus_finish">
-<description>
-Finishes an operation started with gxdp_proxy_resolver_proxy_new_for_bus().
-
-
-</description>
-<parameters>
-<parameter name="res">
-<parameter_description> The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gxdp_proxy_resolver_proxy_new_for_bus().
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_proxy_new_for_bus_sync">
-<description>
-Like gxdp_proxy_resolver_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_proxy_resolver_proxy_new_for_bus() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="bus_type">
-<parameter_description> A #GBusType.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique).
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_proxy_new_sync">
-<description>
-Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>. See g_dbus_proxy_new_sync() for more details.
-
-The calling thread is blocked until a reply is received.
-
-See gxdp_proxy_resolver_proxy_new() for the asynchronous version of this constructor.
-
-
-</description>
-<parameters>
-<parameter name="connection">
-<parameter_description> A #GDBusConnection.
-</parameter_description>
-</parameter>
-<parameter name="flags">
-<parameter_description> Flags from the #GDBusProxyFlags enumeration.
-</parameter_description>
-</parameter>
-<parameter name="name">
-<parameter_description> A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
-</parameter_description>
-</parameter>
-<parameter name="object_path">
-<parameter_description> An object path.
-</parameter_description>
-</parameter>
-<parameter name="cancellable">
-<parameter_description> A #GCancellable or %NULL.
-</parameter_description>
-</parameter>
-<parameter name="error">
-<parameter_description> Return location for error or %NULL
-</parameter_description>
-</parameter>
-</parameters>
-<return> The constructed proxy object or %NULL if @error is set.
-</return>
-</function>
-
-<function name="gxdp_proxy_resolver_skeleton_new">
-<description>
-Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-portal-ProxyResolver.top_of_page">org.freedesktop.portal.ProxyResolver</link>.
-
-
-</description>
-<parameters>
-</parameters>
-<return> The skeleton object.
-</return>
-</function>
-
</root>
<root>
+<substitute_type_name from="GAppInfoCreateFlags" to="Gio::AppInfo::CreateFlags" />
+<substitute_type_name from="GApplicationFlags" to="Gio::Application::Flags" />
+<substitute_type_name from="GConverterFlags" to="Gio::Converter::Flags" />
+<substitute_type_name from="GConverterResult" to="Gio::Converter::Result" />
+<substitute_type_name from="GCredentialsType" to="Gio::Credentials::Type" />
+<substitute_type_name from="GDBusActionGroup" to="Gio::DBus::ActionGroup" />
+<substitute_type_name from="GDBusConnection" to="Gio::DBus::Connection" />
+<substitute_type_name from="GDBusAuthObserver" to="Gio::DBus::AuthObserver" />
+<substitute_type_name from="GDBusMessage" to="Gio::DBus::Message" />
+<substitute_type_name from="GDBusCallFlags" to="Gio::DBus::CallFlags" />
+<substitute_type_name from="GDBusInterfaceSkeletonFlags" to="Gio::DBus::InterfaceSkeleton::Flags" />
+<substitute_type_name from="GDBusProxyFlags" to="Gio::DBus::ProxyFlags" />
+<substitute_type_name from="GDBusProxy" to="Gio::DBus::Proxy" />
+<substitute_type_name from="GDBusInterfaceInfo" to="Gio::DBus::InterfaceInfo" />
+<substitute_type_name from="GDBusServer" to="Gio::DBus::Server" />
+<substitute_type_name from="GDBusServerFlags" to="Gio::DBus::Server::Flags" />
+<substitute_type_name from="GDriveStartFlags" to="Gio::Drive::StartFlags" />
+<substitute_type_name from="GDriveStartStopType" to="Gio::Drive::StartStopType" />
+<substitute_type_name from="GEmblemOrigin" to="Gio::Emblem::Origin" />
+<substitute_type_name from="GIOErrorEnum" to="Gio::Error" />
+<substitute_type_name from="GFileAttributeInfoFlags" to="Gio::FileAttributeInfo::Flags" />
+<substitute_type_name from="GFileCopyFlags" to="Gio::File::CopyFlags" />
+<substitute_type_name from="GFileCreateFlags" to="Gio::File::CreateFlags" />
+<substitute_type_name from="GFileMeasureFlags" to="Gio::File::MeasureFlags" />
+<substitute_type_name from="GFileMonitorEvent" to="Gio::FileMonitor::Event" />
+<substitute_type_name from="GIOStreamSpliceFlags" to="Gio::IOStream::SpliceFlags" />
+<substitute_type_name from="GMountMountFlags" to="Gio::Mount::MountFlags" />
+<substitute_type_name from="GMountUnmountFlags" to="Gio::Unmount::MountFlags" />
+<substitute_type_name from="GNotificationPriority" to="Gio::Notification::Priority" />
+<substitute_type_name from="GOutputStreamSpliceFlags" to="Gio::OutputStream::SpliceFlags" />
+<substitute_type_name from="GResolverRecordType" to="Gio::Resolver::RecordType" />
+<substitute_type_name from="GResourceFlags" to="Gio::Resource::Flags" />
+<substitute_type_name from="GResourceLookupFlags" to="Gio::Resource::LookupFlags" />
+<substitute_type_name from="GSettingsBindFlags" to="Gio::Settings::BindFlags" />
+<substitute_type_name from="GSocketMsgFlags" to="Gio::Socket::MsgFlags" />
+<substitute_type_name from="GSocketProtocol" to="Gio::Socket::Protocol" />
+<substitute_type_name from="GSocketType" to="Gio::Socket::Type" />
+<substitute_type_name from="GTlsDatabaseLookupFlags" to="Gio::TlsDatabase::LookupFlags" />
+<substitute_type_name from="GTlsDatabaseVerifyFlags" to="Gio::TlsDatabase::VerifyFlags" />
+<substitute_type_name from="GTlsPasswordFlags" to="Gio::TlsPassword::Flags" />
+<substitute_type_name from="GUnixSocketAddressType" to="Gio::UnixSocketAddress::Type" />
+
+<substitute_enumerator_name from_prefix="G_APPLICATION_" to_prefix="Gio::Application::Flags::" />
+<substitute_enumerator_name from="G_APPLICATION_FLAGS_NONE" to="Gio::Application::Flags::NONE" />
+<!-- GConverterFlags and GConverterResult both have prefix G_CONVERTER_. -->
+<substitute_enumerator_name from="G_CONVERTER_NO_FLAGS" to="Gio::Converter::Flags::NO_FLAGS" />
+<substitute_enumerator_name from="G_CONVERTER_INPUT_AT_END" to="Gio::Converter::Flags::INPUT_AT_END" />
+<substitute_enumerator_name from="G_CONVERTER_FLUSH" to="Gio::Converter::Flags::FLUSH" />
+<substitute_enumerator_name from_prefix="G_CONVERTER_" to_prefix="Gio::Converter::Result::" />
+
+<substitute_enumerator_name from_prefix="G_DATA_STREAM_BYTE_ORDER_" to_prefix="Gio::DataStreamByteOrder::" />
+<substitute_enumerator_name from_prefix="G_DATA_STREAM_NEWLINE_TYPE_" to_prefix="Gio::DataStreamNewlineType::" />
+<substitute_enumerator_name from_prefix="G_IO_ERROR_" to_prefix="Gio::Error::" />
+<substitute_enumerator_name from_prefix="G_DBUS_CAPABILITY_FLAGS_" to_prefix="Gio::DBus::CapabilityFlags::" />
+<substitute_enumerator_name from_prefix="G_DBUS_CONNECTION_FLAGS_" to_prefix="Gio::DBus::ConnectionFlags::" />
+<substitute_enumerator_name from_prefix="G_DBUS_SEND_MESSAGE_FLAGS_" to_prefix="Gio::DBus::SendMessageFlags::" />
+<substitute_enumerator_name from_prefix="G_DBUS_MESSAGE_TYPE_" to_prefix="Gio::DBus::MessageType::" />
+<substitute_enumerator_name from_prefix="G_DBUS_ERROR_" to_prefix="Gio::DBus::Error::" />
+<substitute_enumerator_name from_prefix="G_DBUS_MESSAGE_HEADER_FIELD_" to_prefix="Gio::DBus::MessageHeaderField::" />
+<substitute_enumerator_name from_prefix="G_DBUS_MESSAGE_FLAGS_" to_prefix="Gio::DBus::MessageFlags::" />
+<substitute_enumerator_name from_prefix="G_DBUS_PROXY_FLAGS_" to_prefix="Gio::DBus::ProxyFlags::" />
+<substitute_enumerator_name from_prefix="G_DBUS_INTERFACE_SKELETON_FLAGS_" to_prefix="Gio::DBus::InterfaceSkeleton::Flags::" />
+<substitute_enumerator_name from_prefix="G_BUS_NAME_OWNER_FLAGS_" to_prefix="Gio::DBus::BusNameOwnerFlags::" />
+<substitute_enumerator_name from_prefix="G_DBUS_SERVER_FLAGS_" to_prefix="Gio::DBus::Server::Flags::" />
+<substitute_enumerator_name from_prefix="G_FILE_MONITOR_EVENT_" to_prefix="Gio::FileMonitor::Event::" />
+<substitute_enumerator_name from_prefix="G_FILE_MONITOR_" to_prefix="Gio::FileMonitorFlags::" />
+<substitute_enumerator_name from_prefix="G_FILE_TYPE_" to_prefix="Gio::FileType::" />
+<substitute_enumerator_name from_prefix="G_NETWORK_CONNECTIVITY_" to_prefix="Gio::NetworkConnectivity::" />
+<substitute_enumerator_name from_prefix="G_PASSWORD_SAVE_" to_prefix="Gio::PasswordSave::" />
+<substitute_enumerator_name from_prefix="G_RESOLVER_RECORD_" to_prefix="Gio::Resolver::RecordType::" />
+<substitute_enumerator_name from_prefix="G_RESOURCE_ERROR_" to_prefix="Gio::ResourceError::" />
+<substitute_enumerator_name from_prefix="G_SETTINGS_BIND_" to_prefix="Gio::Settings::BindFlags::" />
+<substitute_enumerator_name from_prefix="G_SOCKET_PROTOCOL_" to_prefix="Gio::Socket::Protocol::" />
+<substitute_enumerator_name from_prefix="G_SOCKET_TYPE_" to_prefix="Gio::Socket::Type::" />
+<substitute_enumerator_name from_prefix="G_SOCKET_FAMILY_" to_prefix="Gio::SocketFamily::" />
+<substitute_enumerator_name from_prefix="G_IO_" to_prefix="Glib::IOCondition::" />
+<substitute_enumerator_name from_prefix="G_SOCKET_CLIENT_" to_prefix="Gio::SocketClientEvent::" />
+<substitute_enumerator_name from_prefix="G_TLS_AUTHENTICATION_" to_prefix="Gio::GTlsAuthenticationMode::" />
+<substitute_enumerator_name from_prefix="G_TLS_CERTIFICATE_" to_prefix="Gio::TlsCertificateFlags::" />
+<substitute_enumerator_name from_prefix="G_TLS_REHANDSHAKE_" to_prefix="Gio::TlsRehandshakeMode::" />
+<substitute_enumerator_name from_prefix="G_TLS_DATABASE_VERIFY_" to_prefix="Gio::TlsDatabaseVerifyFlags::" />
+<substitute_enumerator_name from_prefix="G_TLS_INTERACTION_" to_prefix="Gio::TlsInteractionResult::" />
+<substitute_enumerator_name from_prefix="G_TLS_ERROR_" to_prefix="Gio::TlsError::" />
+<substitute_enumerator_name from_prefix="G_TLS_PASSWORD_" to_prefix="Gio::TlsPassword::Flags::" />
+<substitute_enumerator_name from_prefix="G_ZLIB_COMPRESSOR_FORMAT_" to_prefix="Gio::ZlibCompressorFormat::" />
+<substitute_enumerator_name from_prefix="G_UNIX_SOCKET_ADDRESS_" to_prefix="Gio::UnixSocketAddress::Type::" />
<!-- These are preprocessor defines. Don't substitute. -->
<substitute_enumerator_name from="G_MAXSSIZE" to="G_MAXSSIZE" />
<substitute_enumerator_name from="G_MAXINT" to="G_MAXINT" />
<substitute_enumerator_name from="G_RESOURCE_ERROR" to="G_RESOURCE_ERROR" />
<substitute_enumerator_name from="G_RESOLVER_ERROR" to="G_RESOLVER_ERROR" />
<substitute_enumerator_name from="G_TLS_ERROR" to="G_TLS_ERROR" />
+<substitute_enumerator_name from="G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE" to="G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE" />
<substitute_enumerator_name from_prefix="G_FILE_ATTRIBUTE_" to_prefix="G_FILE_ATTRIBUTE_" />
<substitute_enumerator_name from_prefix="G_MENU_ATTRIBUTE_" to_prefix="G_MENU_ATTRIBUTE_" />
<substitute_enumerator_name from_prefix="G_MENU_LINK_" to_prefix="G_MENU_LINK_" />
'("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")
+ '("host-was-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")
;; Original typedef:
;; typedef enum {
-;; G_ASK_PASSWORD_NEED_PASSWORD = (1 << 0),
-;; G_ASK_PASSWORD_NEED_USERNAME = (1 << 1),
-;; G_ASK_PASSWORD_NEED_DOMAIN = (1 << 2),
-;; G_ASK_PASSWORD_SAVING_SUPPORTED = (1 << 3),
-;; G_ASK_PASSWORD_ANONYMOUS_SUPPORTED = (1 << 4)
+;; G_ASK_PASSWORD_NEED_PASSWORD = (1 << 0),
+;; G_ASK_PASSWORD_NEED_USERNAME = (1 << 1),
+;; G_ASK_PASSWORD_NEED_DOMAIN = (1 << 2),
+;; G_ASK_PASSWORD_SAVING_SUPPORTED = (1 << 3),
+;; G_ASK_PASSWORD_ANONYMOUS_SUPPORTED = (1 << 4),
+;; G_ASK_PASSWORD_TCRYPT = (1 << 5),
;; } GAskPasswordFlags;
(define-flags-extended AskPasswordFlags
'("need-domain" "G_ASK_PASSWORD_NEED_DOMAIN" "(1 << 2)")
'("saving-supported" "G_ASK_PASSWORD_SAVING_SUPPORTED" "(1 << 3)")
'("anonymous-supported" "G_ASK_PASSWORD_ANONYMOUS_SUPPORTED" "(1 << 4)")
+ '("tcrypt" "G_ASK_PASSWORD_TCRYPT" "(1 << 5)")
)
)
;; G_TLS_ERROR_NOT_TLS,
;; G_TLS_ERROR_HANDSHAKE,
;; G_TLS_ERROR_CERTIFICATE_REQUIRED,
-;; G_TLS_ERROR_EOF
+;; G_TLS_ERROR_EOF,
+;; G_TLS_ERROR_INAPPROPRIATE_FALLBACK
;; } GTlsError;
(define-enum-extended TlsError
'("handshake" "G_TLS_ERROR_HANDSHAKE" "4")
'("certificate-required" "G_TLS_ERROR_CERTIFICATE_REQUIRED" "5")
'("eof" "G_TLS_ERROR_EOF" "6")
+ '("inappropriate-fallback" "G_TLS_ERROR_INAPPROPRIATE_FALLBACK" "7")
)
)
'("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")
++ '("host-was-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")
(gtype-id "G_TYPE_WIN32_REGISTRY_KEY")
)
-(define-object Documents
- (in-module "GXdp")
- (c-name "GXdpDocuments")
- (gtype-id "G_TYPE_XDP_DOCUMENTS")
-)
-
-(define-object DocumentsProxy
- (in-module "GXdp")
- (parent "GDBusProxy")
- (c-name "GXdpDocumentsProxy")
- (gtype-id "G_TYPE_XDP_DOCUMENTS_PROXY")
-)
-
-(define-object DocumentsSkeleton
- (in-module "GXdp")
- (parent "GDBusInterfaceSkeleton")
- (c-name "GXdpDocumentsSkeleton")
- (gtype-id "G_TYPE_XDP_DOCUMENTS_SKELETON")
-)
-
-(define-object NetworkMonitor
- (in-module "GXdp")
- (c-name "GXdpNetworkMonitor")
- (gtype-id "G_TYPE_XDP_NETWORK_MONITOR")
-)
-
-(define-object NetworkMonitorProxy
- (in-module "GXdp")
- (parent "GDBusProxy")
- (c-name "GXdpNetworkMonitorProxy")
- (gtype-id "G_TYPE_XDP_NETWORK_MONITOR_PROXY")
-)
-
-(define-object NetworkMonitorSkeleton
- (in-module "GXdp")
- (parent "GDBusInterfaceSkeleton")
- (c-name "GXdpNetworkMonitorSkeleton")
- (gtype-id "G_TYPE_XDP_NETWORK_MONITOR_SKELETON")
-)
-
-(define-object OpenURI
- (in-module "GXdp")
- (c-name "GXdpOpenURI")
- (gtype-id "G_TYPE_XDP_OPEN_URI")
-)
-
-(define-object OpenURIProxy
- (in-module "GXdp")
- (parent "GDBusProxy")
- (c-name "GXdpOpenURIProxy")
- (gtype-id "G_TYPE_XDP_OPEN_URI_PROXY")
-)
-
-(define-object OpenURISkeleton
- (in-module "GXdp")
- (parent "GDBusInterfaceSkeleton")
- (c-name "GXdpOpenURISkeleton")
- (gtype-id "G_TYPE_XDP_OPEN_URI_SKELETON")
-)
-
-(define-object ProxyResolver
- (in-module "GXdp")
- (c-name "GXdpProxyResolver")
- (gtype-id "G_TYPE_XDP_PROXY_RESOLVER")
-)
-
-(define-object ProxyResolverProxy
- (in-module "GXdp")
- (parent "GDBusProxy")
- (c-name "GXdpProxyResolverProxy")
- (gtype-id "G_TYPE_XDP_PROXY_RESOLVER_PROXY")
-)
-
-(define-object ProxyResolverSkeleton
- (in-module "GXdp")
- (parent "GDBusInterfaceSkeleton")
- (c-name "GXdpProxyResolverSkeleton")
- (gtype-id "G_TYPE_XDP_PROXY_RESOLVER_SKELETON")
-)
-
;; Enumerations and flags ...
(define-enum AuthMechanismState
'("need-domain" "G_ASK_PASSWORD_NEED_DOMAIN")
'("saving-supported" "G_ASK_PASSWORD_SAVING_SUPPORTED")
'("anonymous-supported" "G_ASK_PASSWORD_ANONYMOUS_SUPPORTED")
+ '("tcrypt" "G_ASK_PASSWORD_TCRYPT")
)
)
'("handshake" "G_TLS_ERROR_HANDSHAKE")
'("certificate-required" "G_TLS_ERROR_CERTIFICATE_REQUIRED")
'("eof" "G_TLS_ERROR_EOF")
+ '("inappropriate-fallback" "G_TLS_ERROR_INAPPROPRIATE_FALLBACK")
)
)
-;; From gconstructor_as_data.h
-
-
-
;; From gcontenttype.h
(define-function g_content_type_equals
-;; From gdbus-daemon-generated.h
-
-
-
;; From gdbusdaemon.h
)
)
+(define-method get_string_list
+ (of-object "GDesktopAppInfo")
+ (c-name "g_desktop_app_info_get_string_list")
+ (return-type "gchar**")
+ (parameters
+ '("const-char*" "key")
+ '("gsize*" "length")
+ )
+)
+
(define-method list_actions
(of-object "GDesktopAppInfo")
(c-name "g_desktop_app_info_list_actions")
)
)
+(define-method launch_uris_as_manager_with_fds
+ (of-object "GDesktopAppInfo")
+ (c-name "g_desktop_app_info_launch_uris_as_manager_with_fds")
+ (return-type "gboolean")
+ (parameters
+ '("GList*" "uris")
+ '("GAppLaunchContext*" "launch_context")
+ '("GSpawnFlags" "spawn_flags")
+ '("GSpawnChildSetupFunc" "user_setup")
+ '("gpointer" "user_setup_data")
+ '("GDesktopAppLaunchCallback" "pid_callback")
+ '("gpointer" "pid_callback_data")
+ '("gint" "stdin_fd")
+ '("gint" "stdout_fd")
+ '("gint" "stderr_fd")
+ '("GError**" "error")
+ )
+)
+
(define-function g_desktop_app_info_search
(c-name "g_desktop_app_info_search")
(return-type "gchar***")
-;; From gioenumtypes.h
+;; From gioerror.h
-(define-function g_app_info_create_flags_get_type
- (c-name "g_app_info_create_flags_get_type")
- (return-type "GType")
+(define-function g_io_error_quark
+ (c-name "g_io_error_quark")
+ (return-type "GQuark")
)
-(define-function g_converter_flags_get_type
- (c-name "g_converter_flags_get_type")
- (return-type "GType")
+(define-function g_io_error_from_errno
+ (c-name "g_io_error_from_errno")
+ (return-type "GIOErrorEnum")
+ (parameters
+ '("gint" "err_no")
+ )
)
-(define-function g_converter_result_get_type
- (c-name "g_converter_result_get_type")
- (return-type "GType")
+(define-function g_io_error_from_win32_error
+ (c-name "g_io_error_from_win32_error")
+ (return-type "GIOErrorEnum")
+ (parameters
+ '("gint" "error_code")
+ )
)
-(define-function g_data_stream_byte_order_get_type
- (c-name "g_data_stream_byte_order_get_type")
- (return-type "GType")
-)
-(define-function g_data_stream_newline_type_get_type
- (c-name "g_data_stream_newline_type_get_type")
- (return-type "GType")
-)
-(define-function g_file_attribute_type_get_type
- (c-name "g_file_attribute_type_get_type")
- (return-type "GType")
-)
+;; From gio.h
-(define-function g_file_attribute_info_flags_get_type
- (c-name "g_file_attribute_info_flags_get_type")
- (return-type "GType")
-)
-(define-function g_file_attribute_status_get_type
- (c-name "g_file_attribute_status_get_type")
- (return-type "GType")
-)
-(define-function g_file_query_info_flags_get_type
- (c-name "g_file_query_info_flags_get_type")
- (return-type "GType")
-)
+;; From giomodule.h
-(define-function g_file_create_flags_get_type
- (c-name "g_file_create_flags_get_type")
- (return-type "GType")
+(define-function g_io_module_scope_new
+ (c-name "g_io_module_scope_new")
+ (is-constructor-of "GIoModuleScope")
+ (return-type "GIOModuleScope*")
+ (parameters
+ '("GIOModuleScopeFlags" "flags")
+ )
)
-(define-function g_file_measure_flags_get_type
- (c-name "g_file_measure_flags_get_type")
- (return-type "GType")
+(define-method free
+ (of-object "GIOModuleScope")
+ (c-name "g_io_module_scope_free")
+ (return-type "none")
)
-(define-function g_mount_mount_flags_get_type
- (c-name "g_mount_mount_flags_get_type")
- (return-type "GType")
+(define-method block
+ (of-object "GIOModuleScope")
+ (c-name "g_io_module_scope_block")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "basename")
+ )
)
-(define-function g_mount_unmount_flags_get_type
- (c-name "g_mount_unmount_flags_get_type")
+(define-function g_io_module_get_type
+ (c-name "g_io_module_get_type")
(return-type "GType")
)
-(define-function g_drive_start_flags_get_type
- (c-name "g_drive_start_flags_get_type")
- (return-type "GType")
+(define-function g_io_module_new
+ (c-name "g_io_module_new")
+ (is-constructor-of "GIoModule")
+ (return-type "GIOModule*")
+ (parameters
+ '("const-gchar*" "filename")
+ )
)
-(define-function g_drive_start_stop_type_get_type
- (c-name "g_drive_start_stop_type_get_type")
- (return-type "GType")
+(define-function g_io_modules_scan_all_in_directory
+ (c-name "g_io_modules_scan_all_in_directory")
+ (return-type "none")
+ (parameters
+ '("const-char*" "dirname")
+ )
)
-(define-function g_file_copy_flags_get_type
- (c-name "g_file_copy_flags_get_type")
- (return-type "GType")
+(define-function g_io_modules_load_all_in_directory
+ (c-name "g_io_modules_load_all_in_directory")
+ (return-type "GList*")
+ (parameters
+ '("const-gchar*" "dirname")
+ )
)
-(define-function g_file_monitor_flags_get_type
- (c-name "g_file_monitor_flags_get_type")
- (return-type "GType")
+(define-function g_io_modules_scan_all_in_directory_with_scope
+ (c-name "g_io_modules_scan_all_in_directory_with_scope")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "dirname")
+ '("GIOModuleScope*" "scope")
+ )
)
-(define-function g_file_type_get_type
- (c-name "g_file_type_get_type")
- (return-type "GType")
+(define-function g_io_modules_load_all_in_directory_with_scope
+ (c-name "g_io_modules_load_all_in_directory_with_scope")
+ (return-type "GList*")
+ (parameters
+ '("const-gchar*" "dirname")
+ '("GIOModuleScope*" "scope")
+ )
)
-(define-function g_filesystem_preview_type_get_type
- (c-name "g_filesystem_preview_type_get_type")
- (return-type "GType")
+(define-function g_io_extension_point_register
+ (c-name "g_io_extension_point_register")
+ (return-type "GIOExtensionPoint*")
+ (parameters
+ '("const-char*" "name")
+ )
)
-(define-function g_file_monitor_event_get_type
- (c-name "g_file_monitor_event_get_type")
- (return-type "GType")
+(define-function g_io_extension_point_lookup
+ (c-name "g_io_extension_point_lookup")
+ (return-type "GIOExtensionPoint*")
+ (parameters
+ '("const-char*" "name")
+ )
)
-(define-function g_io_error_enum_get_type
- (c-name "g_io_error_enum_get_type")
- (return-type "GType")
+(define-method set_required_type
+ (of-object "GIOExtensionPoint")
+ (c-name "g_io_extension_point_set_required_type")
+ (return-type "none")
+ (parameters
+ '("GType" "type")
+ )
)
-(define-function g_ask_password_flags_get_type
- (c-name "g_ask_password_flags_get_type")
+(define-method get_required_type
+ (of-object "GIOExtensionPoint")
+ (c-name "g_io_extension_point_get_required_type")
(return-type "GType")
)
-(define-function g_password_save_get_type
- (c-name "g_password_save_get_type")
- (return-type "GType")
+(define-method get_extensions
+ (of-object "GIOExtensionPoint")
+ (c-name "g_io_extension_point_get_extensions")
+ (return-type "GList*")
)
-(define-function g_mount_operation_result_get_type
- (c-name "g_mount_operation_result_get_type")
- (return-type "GType")
+(define-method get_extension_by_name
+ (of-object "GIOExtensionPoint")
+ (c-name "g_io_extension_point_get_extension_by_name")
+ (return-type "GIOExtension*")
+ (parameters
+ '("const-char*" "name")
+ )
)
-(define-function g_output_stream_splice_flags_get_type
- (c-name "g_output_stream_splice_flags_get_type")
- (return-type "GType")
+(define-function g_io_extension_point_implement
+ (c-name "g_io_extension_point_implement")
+ (return-type "GIOExtension*")
+ (parameters
+ '("const-char*" "extension_point_name")
+ '("GType" "type")
+ '("const-char*" "extension_name")
+ '("gint" "priority")
+ )
)
-(define-function g_io_stream_splice_flags_get_type
- (c-name "g_io_stream_splice_flags_get_type")
+(define-method get_type
+ (of-object "GIOExtension")
+ (c-name "g_io_extension_get_type")
(return-type "GType")
)
-(define-function g_emblem_origin_get_type
- (c-name "g_emblem_origin_get_type")
- (return-type "GType")
+(define-method get_name
+ (of-object "GIOExtension")
+ (c-name "g_io_extension_get_name")
+ (return-type "const-char*")
)
-(define-function g_resolver_error_get_type
- (c-name "g_resolver_error_get_type")
- (return-type "GType")
+(define-method get_priority
+ (of-object "GIOExtension")
+ (c-name "g_io_extension_get_priority")
+ (return-type "gint")
)
-(define-function g_resolver_record_type_get_type
- (c-name "g_resolver_record_type_get_type")
- (return-type "GType")
+(define-method ref_class
+ (of-object "GIOExtension")
+ (c-name "g_io_extension_ref_class")
+ (return-type "GTypeClass*")
)
-(define-function g_resource_error_get_type
- (c-name "g_resource_error_get_type")
- (return-type "GType")
+(define-method load
+ (of-object "GIOModule")
+ (c-name "g_io_module_load")
+ (return-type "none")
)
-(define-function g_resource_flags_get_type
- (c-name "g_resource_flags_get_type")
- (return-type "GType")
+(define-method unload
+ (of-object "GIOModule")
+ (c-name "g_io_module_unload")
+ (return-type "none")
)
-(define-function g_resource_lookup_flags_get_type
- (c-name "g_resource_lookup_flags_get_type")
- (return-type "GType")
+(define-function g_io_module_query
+ (c-name "g_io_module_query")
+ (return-type "char**")
)
-(define-function g_socket_family_get_type
- (c-name "g_socket_family_get_type")
- (return-type "GType")
-)
-(define-function g_socket_type_get_type
- (c-name "g_socket_type_get_type")
- (return-type "GType")
-)
-(define-function g_socket_msg_flags_get_type
- (c-name "g_socket_msg_flags_get_type")
- (return-type "GType")
-)
+;; From giomodule-priv.h
-(define-function g_socket_protocol_get_type
- (c-name "g_socket_protocol_get_type")
- (return-type "GType")
-)
-(define-function g_zlib_compressor_format_get_type
- (c-name "g_zlib_compressor_format_get_type")
- (return-type "GType")
-)
-(define-function g_unix_socket_address_type_get_type
- (c-name "g_unix_socket_address_type_get_type")
- (return-type "GType")
-)
+;; From gioscheduler.h
-(define-function g_bus_type_get_type
- (c-name "g_bus_type_get_type")
- (return-type "GType")
+(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_bus_name_owner_flags_get_type
- (c-name "g_bus_name_owner_flags_get_type")
- (return-type "GType")
+(define-function g_io_scheduler_cancel_all_jobs
+ (c-name "g_io_scheduler_cancel_all_jobs")
+ (return-type "none")
)
-(define-function g_bus_name_watcher_flags_get_type
- (c-name "g_bus_name_watcher_flags_get_type")
- (return-type "GType")
-)
-
-(define-function g_dbus_proxy_flags_get_type
- (c-name "g_dbus_proxy_flags_get_type")
- (return-type "GType")
-)
-
-(define-function g_dbus_error_get_type
- (c-name "g_dbus_error_get_type")
- (return-type "GType")
-)
-
-(define-function g_dbus_connection_flags_get_type
- (c-name "g_dbus_connection_flags_get_type")
- (return-type "GType")
-)
-
-(define-function g_dbus_capability_flags_get_type
- (c-name "g_dbus_capability_flags_get_type")
- (return-type "GType")
-)
-
-(define-function g_dbus_call_flags_get_type
- (c-name "g_dbus_call_flags_get_type")
- (return-type "GType")
+(define-method send_to_mainloop
+ (of-object "GIOSchedulerJob")
+ (c-name "g_io_scheduler_job_send_to_mainloop")
+ (return-type "gboolean")
+ (parameters
+ '("GSourceFunc" "func")
+ '("gpointer" "user_data")
+ '("GDestroyNotify" "notify")
+ )
)
-(define-function g_dbus_message_type_get_type
- (c-name "g_dbus_message_type_get_type")
- (return-type "GType")
+(define-method send_to_mainloop_async
+ (of-object "GIOSchedulerJob")
+ (c-name "g_io_scheduler_job_send_to_mainloop_async")
+ (return-type "none")
+ (parameters
+ '("GSourceFunc" "func")
+ '("gpointer" "user_data")
+ '("GDestroyNotify" "notify")
+ )
)
-(define-function g_dbus_message_flags_get_type
- (c-name "g_dbus_message_flags_get_type")
- (return-type "GType")
-)
-(define-function g_dbus_message_header_field_get_type
- (c-name "g_dbus_message_header_field_get_type")
- (return-type "GType")
-)
-(define-function g_dbus_property_info_flags_get_type
- (c-name "g_dbus_property_info_flags_get_type")
- (return-type "GType")
-)
+;; From giostream.h
-(define-function g_dbus_subtree_flags_get_type
- (c-name "g_dbus_subtree_flags_get_type")
+(define-function g_io_stream_get_type
+ (c-name "g_io_stream_get_type")
(return-type "GType")
)
-(define-function g_dbus_server_flags_get_type
- (c-name "g_dbus_server_flags_get_type")
- (return-type "GType")
+(define-method get_input_stream
+ (of-object "GIOStream")
+ (c-name "g_io_stream_get_input_stream")
+ (return-type "GInputStream*")
)
-(define-function g_dbus_signal_flags_get_type
- (c-name "g_dbus_signal_flags_get_type")
- (return-type "GType")
+(define-method get_output_stream
+ (of-object "GIOStream")
+ (c-name "g_io_stream_get_output_stream")
+ (return-type "GOutputStream*")
)
-(define-function g_dbus_send_message_flags_get_type
- (c-name "g_dbus_send_message_flags_get_type")
- (return-type "GType")
+(define-method splice_async
+ (of-object "GIOStream")
+ (c-name "g_io_stream_splice_async")
+ (return-type "none")
+ (parameters
+ '("GIOStream*" "stream2")
+ '("GIOStreamSpliceFlags" "flags")
+ '("int" "io_priority")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
)
-(define-function g_credentials_type_get_type
- (c-name "g_credentials_type_get_type")
- (return-type "GType")
+(define-function g_io_stream_splice_finish
+ (c-name "g_io_stream_splice_finish")
+ (return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-(define-function g_dbus_message_byte_order_get_type
- (c-name "g_dbus_message_byte_order_get_type")
- (return-type "GType")
+(define-method close
+ (of-object "GIOStream")
+ (c-name "g_io_stream_close")
+ (return-type "gboolean")
+ (parameters
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
)
-(define-function g_application_flags_get_type
- (c-name "g_application_flags_get_type")
- (return-type "GType")
+(define-method close_async
+ (of-object "GIOStream")
+ (c-name "g_io_stream_close_async")
+ (return-type "none")
+ (parameters
+ '("int" "io_priority")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
)
-(define-function g_tls_error_get_type
- (c-name "g_tls_error_get_type")
- (return-type "GType")
+(define-method close_finish
+ (of-object "GIOStream")
+ (c-name "g_io_stream_close_finish")
+ (return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-(define-function g_tls_certificate_flags_get_type
- (c-name "g_tls_certificate_flags_get_type")
- (return-type "GType")
+(define-method is_closed
+ (of-object "GIOStream")
+ (c-name "g_io_stream_is_closed")
+ (return-type "gboolean")
)
-(define-function g_tls_authentication_mode_get_type
- (c-name "g_tls_authentication_mode_get_type")
- (return-type "GType")
+(define-method has_pending
+ (of-object "GIOStream")
+ (c-name "g_io_stream_has_pending")
+ (return-type "gboolean")
)
-(define-function g_tls_rehandshake_mode_get_type
- (c-name "g_tls_rehandshake_mode_get_type")
- (return-type "GType")
+(define-method set_pending
+ (of-object "GIOStream")
+ (c-name "g_io_stream_set_pending")
+ (return-type "gboolean")
+ (parameters
+ '("GError**" "error")
+ )
)
-(define-function g_tls_password_flags_get_type
- (c-name "g_tls_password_flags_get_type")
- (return-type "GType")
+(define-method clear_pending
+ (of-object "GIOStream")
+ (c-name "g_io_stream_clear_pending")
+ (return-type "none")
)
-(define-function g_tls_interaction_result_get_type
- (c-name "g_tls_interaction_result_get_type")
- (return-type "GType")
-)
-(define-function g_dbus_interface_skeleton_flags_get_type
- (c-name "g_dbus_interface_skeleton_flags_get_type")
- (return-type "GType")
-)
-(define-function g_dbus_object_manager_client_flags_get_type
- (c-name "g_dbus_object_manager_client_flags_get_type")
- (return-type "GType")
-)
+;; From gio-tool.h
-(define-function g_tls_database_verify_flags_get_type
- (c-name "g_tls_database_verify_flags_get_type")
- (return-type "GType")
+(define-function print_error
+ (c-name "print_error")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "format")
+ )
+ (varargs #t)
)
-(define-function g_tls_database_lookup_flags_get_type
- (c-name "g_tls_database_lookup_flags_get_type")
- (return-type "GType")
+(define-function print_file_error
+ (c-name "print_file_error")
+ (return-type "none")
+ (parameters
+ '("GFile*" "file")
+ '("const-gchar*" "message")
+ )
)
-(define-function g_tls_certificate_request_flags_get_type
- (c-name "g_tls_certificate_request_flags_get_type")
- (return-type "GType")
+(define-function show_help
+ (c-name "show_help")
+ (return-type "none")
+ (parameters
+ '("GOptionContext*" "context")
+ '("const-char*" "message")
+ )
)
-(define-function g_io_module_scope_flags_get_type
- (c-name "g_io_module_scope_flags_get_type")
- (return-type "GType")
+(define-function file_type_to_string
+ (c-name "file_type_to_string")
+ (return-type "const-char*")
+ (parameters
+ '("GFileType" "type")
+ )
)
-(define-function g_socket_client_event_get_type
- (c-name "g_socket_client_event_get_type")
- (return-type "GType")
+(define-function attribute_type_to_string
+ (c-name "attribute_type_to_string")
+ (return-type "const-char*")
+ (parameters
+ '("GFileAttributeType" "type")
+ )
)
-(define-function g_socket_listener_event_get_type
- (c-name "g_socket_listener_event_get_type")
- (return-type "GType")
+(define-function attribute_type_from_string
+ (c-name "attribute_type_from_string")
+ (return-type "GFileAttributeType")
+ (parameters
+ '("const-char*" "str")
+ )
)
-(define-function g_test_dbus_flags_get_type
- (c-name "g_test_dbus_flags_get_type")
- (return-type "GType")
+(define-function attribute_flags_to_string
+ (c-name "attribute_flags_to_string")
+ (return-type "char*")
+ (parameters
+ '("GFileAttributeInfoFlags" "flags")
+ )
)
-(define-function g_subprocess_flags_get_type
- (c-name "g_subprocess_flags_get_type")
- (return-type "GType")
+(define-function file_is_dir
+ (c-name "file_is_dir")
+ (return-type "gboolean")
+ (parameters
+ '("GFile*" "file")
+ )
)
-(define-function g_notification_priority_get_type
- (c-name "g_notification_priority_get_type")
- (return-type "GType")
+(define-function handle_cat
+ (c-name "handle_cat")
+ (return-type "int")
+ (parameters
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
+ )
)
-(define-function g_network_connectivity_get_type
- (c-name "g_network_connectivity_get_type")
- (return-type "GType")
+(define-function handle_copy
+ (c-name "handle_copy")
+ (return-type "int")
+ (parameters
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
+ )
)
-(define-function g_settings_bind_flags_get_type
- (c-name "g_settings_bind_flags_get_type")
- (return-type "GType")
+(define-function handle_info
+ (c-name "handle_info")
+ (return-type "int")
+ (parameters
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
+ )
)
-
-
-;; From gioerror.h
-
-(define-function g_io_error_quark
- (c-name "g_io_error_quark")
- (return-type "GQuark")
+(define-function handle_list
+ (c-name "handle_list")
+ (return-type "int")
+ (parameters
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
+ )
)
-(define-function g_io_error_from_errno
- (c-name "g_io_error_from_errno")
- (return-type "GIOErrorEnum")
+(define-function handle_mime
+ (c-name "handle_mime")
+ (return-type "int")
(parameters
- '("gint" "err_no")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_error_from_win32_error
- (c-name "g_io_error_from_win32_error")
- (return-type "GIOErrorEnum")
+(define-function handle_mkdir
+ (c-name "handle_mkdir")
+ (return-type "int")
(parameters
- '("gint" "error_code")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-
-
-;; From gio.h
-
-
-
-;; From giomodule.h
-
-(define-function g_io_module_scope_new
- (c-name "g_io_module_scope_new")
- (is-constructor-of "GIoModuleScope")
- (return-type "GIOModuleScope*")
+(define-function handle_monitor
+ (c-name "handle_monitor")
+ (return-type "int")
(parameters
- '("GIOModuleScopeFlags" "flags")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-method free
- (of-object "GIOModuleScope")
- (c-name "g_io_module_scope_free")
- (return-type "none")
-)
-
-(define-method block
- (of-object "GIOModuleScope")
- (c-name "g_io_module_scope_block")
- (return-type "none")
+(define-function handle_mount
+ (c-name "handle_mount")
+ (return-type "int")
(parameters
- '("const-gchar*" "basename")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_module_get_type
- (c-name "g_io_module_get_type")
- (return-type "GType")
-)
-
-(define-function g_io_module_new
- (c-name "g_io_module_new")
- (is-constructor-of "GIoModule")
- (return-type "GIOModule*")
+(define-function handle_move
+ (c-name "handle_move")
+ (return-type "int")
(parameters
- '("const-gchar*" "filename")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_modules_scan_all_in_directory
- (c-name "g_io_modules_scan_all_in_directory")
- (return-type "none")
+(define-function handle_open
+ (c-name "handle_open")
+ (return-type "int")
(parameters
- '("const-char*" "dirname")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_modules_load_all_in_directory
- (c-name "g_io_modules_load_all_in_directory")
- (return-type "GList*")
+(define-function handle_rename
+ (c-name "handle_rename")
+ (return-type "int")
(parameters
- '("const-gchar*" "dirname")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_modules_scan_all_in_directory_with_scope
- (c-name "g_io_modules_scan_all_in_directory_with_scope")
- (return-type "none")
+(define-function handle_remove
+ (c-name "handle_remove")
+ (return-type "int")
(parameters
- '("const-gchar*" "dirname")
- '("GIOModuleScope*" "scope")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_modules_load_all_in_directory_with_scope
- (c-name "g_io_modules_load_all_in_directory_with_scope")
- (return-type "GList*")
+(define-function handle_save
+ (c-name "handle_save")
+ (return-type "int")
(parameters
- '("const-gchar*" "dirname")
- '("GIOModuleScope*" "scope")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_extension_point_register
- (c-name "g_io_extension_point_register")
- (return-type "GIOExtensionPoint*")
+(define-function handle_set
+ (c-name "handle_set")
+ (return-type "int")
(parameters
- '("const-char*" "name")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-function g_io_extension_point_lookup
- (c-name "g_io_extension_point_lookup")
- (return-type "GIOExtensionPoint*")
+(define-function handle_trash
+ (c-name "handle_trash")
+ (return-type "int")
(parameters
- '("const-char*" "name")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-method set_required_type
- (of-object "GIOExtensionPoint")
- (c-name "g_io_extension_point_set_required_type")
- (return-type "none")
+(define-function handle_tree
+ (c-name "handle_tree")
+ (return-type "int")
(parameters
- '("GType" "type")
+ '("int" "argc")
+ '("char*[]" "argv")
+ '("gboolean" "do_help")
)
)
-(define-method get_required_type
- (of-object "GIOExtensionPoint")
- (c-name "g_io_extension_point_get_required_type")
- (return-type "GType")
-)
-
-(define-method get_extensions
- (of-object "GIOExtensionPoint")
- (c-name "g_io_extension_point_get_extensions")
- (return-type "GList*")
-)
-(define-method get_extension_by_name
- (of-object "GIOExtensionPoint")
- (c-name "g_io_extension_point_get_extension_by_name")
- (return-type "GIOExtension*")
- (parameters
- '("const-char*" "name")
- )
-)
-(define-function g_io_extension_point_implement
- (c-name "g_io_extension_point_implement")
- (return-type "GIOExtension*")
- (parameters
- '("const-char*" "extension_point_name")
- '("GType" "type")
- '("const-char*" "extension_name")
- '("gint" "priority")
- )
-)
+;; From gio_trace.h
-(define-method get_type
- (of-object "GIOExtension")
- (c-name "g_io_extension_get_type")
- (return-type "GType")
-)
-(define-method get_name
- (of-object "GIOExtension")
- (c-name "g_io_extension_get_name")
- (return-type "const-char*")
-)
-(define-method get_priority
- (of-object "GIOExtension")
- (c-name "g_io_extension_get_priority")
- (return-type "gint")
-)
+;; From giotypes.h
-(define-method ref_class
- (of-object "GIOExtension")
- (c-name "g_io_extension_ref_class")
- (return-type "GTypeClass*")
-)
-(define-method load
- (of-object "GIOModule")
- (c-name "g_io_module_load")
- (return-type "none")
-)
-(define-method unload
- (of-object "GIOModule")
- (c-name "g_io_module_unload")
- (return-type "none")
-)
+;; From giowin32-priv.h
-(define-function g_io_module_query
- (c-name "g_io_module_query")
- (return-type "char**")
+(define-function g_win32_output_stream_new_from_fd
+ (c-name "g_win32_output_stream_new_from_fd")
+ (return-type "GOutputStream*")
+ (parameters
+ '("gint" "fd")
+ '("gboolean" "close_fd")
+ )
)
-;; From giomodule-priv.h
-
+;; From glistmodel.h
+(define-method get_item_type
+ (of-object "GListModel")
+ (c-name "g_list_model_get_item_type")
+ (return-type "GType")
+)
-;; From gioscheduler.h
+(define-method get_n_items
+ (of-object "GListModel")
+ (c-name "g_list_model_get_n_items")
+ (return-type "guint")
+)
-(define-function g_io_scheduler_push_job
- (c-name "g_io_scheduler_push_job")
- (return-type "none")
+(define-method get_item
+ (of-object "GListModel")
+ (c-name "g_list_model_get_item")
+ (return-type "gpointer")
(parameters
- '("GIOSchedulerJobFunc" "job_func")
- '("gpointer" "user_data")
- '("GDestroyNotify" "notify")
- '("gint" "io_priority")
- '("GCancellable*" "cancellable")
+ '("guint" "position")
)
)
-(define-function g_io_scheduler_cancel_all_jobs
- (c-name "g_io_scheduler_cancel_all_jobs")
- (return-type "none")
-)
-
-(define-method send_to_mainloop
- (of-object "GIOSchedulerJob")
- (c-name "g_io_scheduler_job_send_to_mainloop")
- (return-type "gboolean")
+(define-method get_object
+ (of-object "GListModel")
+ (c-name "g_list_model_get_object")
+ (return-type "GObject*")
(parameters
- '("GSourceFunc" "func")
- '("gpointer" "user_data")
- '("GDestroyNotify" "notify")
+ '("guint" "position")
)
)
-(define-method send_to_mainloop_async
- (of-object "GIOSchedulerJob")
- (c-name "g_io_scheduler_job_send_to_mainloop_async")
+(define-method items_changed
+ (of-object "GListModel")
+ (c-name "g_list_model_items_changed")
(return-type "none")
(parameters
- '("GSourceFunc" "func")
- '("gpointer" "user_data")
- '("GDestroyNotify" "notify")
+ '("guint" "position")
+ '("guint" "removed")
+ '("guint" "added")
)
)
-;; From giostream.h
+;; From gliststore.h
-(define-function g_io_stream_get_type
- (c-name "g_io_stream_get_type")
- (return-type "GType")
-)
-
-(define-method get_input_stream
- (of-object "GIOStream")
- (c-name "g_io_stream_get_input_stream")
- (return-type "GInputStream*")
-)
-
-(define-method get_output_stream
- (of-object "GIOStream")
- (c-name "g_io_stream_get_output_stream")
- (return-type "GOutputStream*")
-)
-
-(define-method splice_async
- (of-object "GIOStream")
- (c-name "g_io_stream_splice_async")
- (return-type "none")
+(define-function g_list_store_new
+ (c-name "g_list_store_new")
+ (is-constructor-of "GListStore")
+ (return-type "GListStore*")
(parameters
- '("GIOStream*" "stream2")
- '("GIOStreamSpliceFlags" "flags")
- '("int" "io_priority")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GType" "item_type")
)
)
-(define-function g_io_stream_splice_finish
- (c-name "g_io_stream_splice_finish")
- (return-type "gboolean")
+(define-method insert
+ (of-object "GListStore")
+ (c-name "g_list_store_insert")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("guint" "position")
+ '("gpointer" "item")
)
)
-(define-method close
- (of-object "GIOStream")
- (c-name "g_io_stream_close")
- (return-type "gboolean")
+(define-method insert_sorted
+ (of-object "GListStore")
+ (c-name "g_list_store_insert_sorted")
+ (return-type "guint")
(parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gpointer" "item")
+ '("GCompareDataFunc" "compare_func")
+ '("gpointer" "user_data")
)
)
-(define-method close_async
- (of-object "GIOStream")
- (c-name "g_io_stream_close_async")
+(define-method sort
+ (of-object "GListStore")
+ (c-name "g_list_store_sort")
(return-type "none")
(parameters
- '("int" "io_priority")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
+ '("GCompareDataFunc" "compare_func")
'("gpointer" "user_data")
)
)
-(define-method close_finish
- (of-object "GIOStream")
- (c-name "g_io_stream_close_finish")
- (return-type "gboolean")
+(define-method append
+ (of-object "GListStore")
+ (c-name "g_list_store_append")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gpointer" "item")
)
)
-(define-method is_closed
- (of-object "GIOStream")
- (c-name "g_io_stream_is_closed")
- (return-type "gboolean")
+(define-method remove
+ (of-object "GListStore")
+ (c-name "g_list_store_remove")
+ (return-type "none")
+ (parameters
+ '("guint" "position")
+ )
)
-(define-method has_pending
- (of-object "GIOStream")
- (c-name "g_io_stream_has_pending")
- (return-type "gboolean")
+(define-method remove_all
+ (of-object "GListStore")
+ (c-name "g_list_store_remove_all")
+ (return-type "none")
)
-(define-method set_pending
- (of-object "GIOStream")
- (c-name "g_io_stream_set_pending")
- (return-type "gboolean")
+(define-method splice
+ (of-object "GListStore")
+ (c-name "g_list_store_splice")
+ (return-type "none")
(parameters
- '("GError**" "error")
+ '("guint" "position")
+ '("guint" "n_removals")
+ '("gpointer*" "additions")
+ '("guint" "n_additions")
)
)
-(define-method clear_pending
- (of-object "GIOStream")
- (c-name "g_io_stream_clear_pending")
- (return-type "none")
-)
-
-;; From gio-tool.h
+;; From gloadableicon.h
-(define-function print_error
- (c-name "print_error")
- (return-type "none")
- (parameters
- '("const-gchar*" "format")
- )
- (varargs #t)
+(define-function g_loadable_icon_get_type
+ (c-name "g_loadable_icon_get_type")
+ (return-type "GType")
)
-(define-function print_file_error
- (c-name "print_file_error")
- (return-type "none")
+(define-method load
+ (of-object "GLoadableIcon")
+ (c-name "g_loadable_icon_load")
+ (return-type "GInputStream*")
(parameters
- '("GFile*" "file")
- '("const-gchar*" "message")
+ '("int" "size")
+ '("char**" "type")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function show_help
- (c-name "show_help")
+(define-method load_async
+ (of-object "GLoadableIcon")
+ (c-name "g_loadable_icon_load_async")
(return-type "none")
(parameters
- '("GOptionContext*" "context")
- '("const-char*" "message")
+ '("int" "size")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-function file_type_to_string
- (c-name "file_type_to_string")
- (return-type "const-char*")
+(define-method load_finish
+ (of-object "GLoadableIcon")
+ (c-name "g_loadable_icon_load_finish")
+ (return-type "GInputStream*")
(parameters
- '("GFileType" "type")
+ '("GAsyncResult*" "res")
+ '("char**" "type")
+ '("GError**" "error")
)
)
-(define-function attribute_type_to_string
- (c-name "attribute_type_to_string")
- (return-type "const-char*")
+
+
+;; From glocalfileenumerator.h
+
+
+
+;; From glocalfile.h
+
+(define-function g_local_file_is_remote
+ (c-name "g_local_file_is_remote")
+ (return-type "gboolean")
(parameters
- '("GFileAttributeType" "type")
+ '("const-gchar*" "filename")
)
)
-(define-function attribute_type_from_string
- (c-name "attribute_type_from_string")
- (return-type "GFileAttributeType")
+(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*" "str")
+ '("const-char*" "dirname")
+ '("const-char*" "basename")
)
)
-(define-function attribute_flags_to_string
- (c-name "attribute_flags_to_string")
- (return-type "char*")
- (parameters
- '("GFileAttributeInfoFlags" "flags")
- )
+
+
+;; From glocalfileinfo.h
+
+
+
+;; From glocalfileinputstream.h
+
+
+
+;; From glocalfileiostream.h
+
+
+
+;; From glocalfilemonitor.h
+
+(define-function g_local_file_monitor_get_type
+ (c-name "g_local_file_monitor_get_type")
+ (return-type "GType")
)
-(define-function file_is_dir
- (c-name "file_is_dir")
- (return-type "gboolean")
+(define-function g_local_file_monitor_new_for_path
+ (c-name "g_local_file_monitor_new_for_path")
+ (return-type "GFileMonitor*")
(parameters
- '("GFile*" "file")
+ '("const-gchar*" "pathname")
+ '("gboolean" "is_directory")
+ '("GFileMonitorFlags" "flags")
+ '("GError**" "error")
)
)
-(define-function handle_cat
- (c-name "handle_cat")
- (return-type "int")
+(define-function g_local_file_monitor_new_in_worker
+ (c-name "g_local_file_monitor_new_in_worker")
+ (return-type "GFileMonitor*")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("const-gchar*" "pathname")
+ '("gboolean" "is_directory")
+ '("GFileMonitorFlags" "flags")
+ '("GFileMonitorCallback" "callback")
+ '("gpointer" "user_data")
+ '("GError**" "error")
)
)
-(define-function handle_copy
- (c-name "handle_copy")
- (return-type "int")
+(define-method handle_event
+ (of-object "GFileMonitorSource")
+ (c-name "g_file_monitor_source_handle_event")
+ (return-type "gboolean")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("GFileMonitorEvent" "event_type")
+ '("const-gchar*" "child")
+ '("const-gchar*" "rename_to")
+ '("GFile*" "other")
+ '("gint64" "event_time")
)
)
-(define-function handle_info
- (c-name "handle_info")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
-)
-(define-function handle_list
- (c-name "handle_list")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
-)
-(define-function handle_mime
- (c-name "handle_mime")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
-)
+;; From glocalfileoutputstream.h
-(define-function handle_mkdir
- (c-name "handle_mkdir")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
-)
-(define-function handle_monitor
- (c-name "handle_monitor")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
-)
-(define-function handle_mount
- (c-name "handle_mount")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
+;; From glocalvfs.h
+
+
+
+;; From gmemoryinputstream.h
+
+(define-function g_memory_input_stream_get_type
+ (c-name "g_memory_input_stream_get_type")
+ (return-type "GType")
)
-(define-function handle_move
- (c-name "handle_move")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
+(define-function g_memory_input_stream_new
+ (c-name "g_memory_input_stream_new")
+ (is-constructor-of "GMemoryInputStream")
+ (return-type "GInputStream*")
)
-(define-function handle_open
- (c-name "handle_open")
- (return-type "int")
+(define-function g_memory_input_stream_new_from_data
+ (c-name "g_memory_input_stream_new_from_data")
+ (return-type "GInputStream*")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("const-void*" "data")
+ '("gssize" "len")
+ '("GDestroyNotify" "destroy")
)
)
-(define-function handle_rename
- (c-name "handle_rename")
- (return-type "int")
+(define-function g_memory_input_stream_new_from_bytes
+ (c-name "g_memory_input_stream_new_from_bytes")
+ (return-type "GInputStream*")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("GBytes*" "bytes")
)
)
-(define-function handle_remove
- (c-name "handle_remove")
- (return-type "int")
+(define-method add_data
+ (of-object "GMemoryInputStream")
+ (c-name "g_memory_input_stream_add_data")
+ (return-type "none")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("const-void*" "data")
+ '("gssize" "len")
+ '("GDestroyNotify" "destroy")
)
)
-(define-function handle_save
- (c-name "handle_save")
- (return-type "int")
+(define-method add_bytes
+ (of-object "GMemoryInputStream")
+ (c-name "g_memory_input_stream_add_bytes")
+ (return-type "none")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("GBytes*" "bytes")
)
)
-(define-function handle_set
- (c-name "handle_set")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
+
+
+;; From gmemoryoutputstream.h
+
+(define-function g_memory_output_stream_get_type
+ (c-name "g_memory_output_stream_get_type")
+ (return-type "GType")
)
-(define-function handle_trash
- (c-name "handle_trash")
- (return-type "int")
+(define-function g_memory_output_stream_new
+ (c-name "g_memory_output_stream_new")
+ (is-constructor-of "GMemoryOutputStream")
+ (return-type "GOutputStream*")
(parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
+ '("gpointer" "data")
+ '("gsize" "size")
+ '("GReallocFunc" "realloc_function")
+ '("GDestroyNotify" "destroy_function")
)
)
-(define-function handle_tree
- (c-name "handle_tree")
- (return-type "int")
- (parameters
- '("int" "argc")
- '("char*[]" "argv")
- '("gboolean" "do_help")
- )
+(define-function g_memory_output_stream_new_resizable
+ (c-name "g_memory_output_stream_new_resizable")
+ (return-type "GOutputStream*")
)
+(define-method get_data
+ (of-object "GMemoryOutputStream")
+ (c-name "g_memory_output_stream_get_data")
+ (return-type "gpointer")
+)
+(define-method get_size
+ (of-object "GMemoryOutputStream")
+ (c-name "g_memory_output_stream_get_size")
+ (return-type "gsize")
+)
-;; From gio_trace.h
+(define-method get_data_size
+ (of-object "GMemoryOutputStream")
+ (c-name "g_memory_output_stream_get_data_size")
+ (return-type "gsize")
+)
+(define-method steal_data
+ (of-object "GMemoryOutputStream")
+ (c-name "g_memory_output_stream_steal_data")
+ (return-type "gpointer")
+)
+(define-method steal_as_bytes
+ (of-object "GMemoryOutputStream")
+ (c-name "g_memory_output_stream_steal_as_bytes")
+ (return-type "GBytes*")
+)
-;; From giotypes.h
+;; From gmenuexporter.h
-;; From giowin32-priv.h
+(define-method export_menu_model
+ (of-object "GDBusConnection")
+ (c-name "g_dbus_connection_export_menu_model")
+ (return-type "guint")
+ (parameters
+ '("const-gchar*" "object_path")
+ '("GMenuModel*" "menu")
+ '("GError**" "error")
+ )
+)
-(define-function g_win32_output_stream_new_from_fd
- (c-name "g_win32_output_stream_new_from_fd")
- (return-type "GOutputStream*")
+(define-method unexport_menu_model
+ (of-object "GDBusConnection")
+ (c-name "g_dbus_connection_unexport_menu_model")
+ (return-type "none")
(parameters
- '("gint" "fd")
- '("gboolean" "close_fd")
+ '("guint" "export_id")
)
)
-;; From glistmodel.h
+;; From gmenu.h
-(define-method get_item_type
- (of-object "GListModel")
- (c-name "g_list_model_get_item_type")
+(define-function g_menu_get_type
+ (c-name "g_menu_get_type")
(return-type "GType")
)
-(define-method get_n_items
- (of-object "GListModel")
- (c-name "g_list_model_get_n_items")
- (return-type "guint")
+(define-function g_menu_new
+ (c-name "g_menu_new")
+ (is-constructor-of "GMenu")
+ (return-type "GMenu*")
)
-(define-method get_item
- (of-object "GListModel")
- (c-name "g_list_model_get_item")
- (return-type "gpointer")
- (parameters
- '("guint" "position")
- )
+(define-method freeze
+ (of-object "GMenu")
+ (c-name "g_menu_freeze")
+ (return-type "none")
)
-(define-method get_object
- (of-object "GListModel")
- (c-name "g_list_model_get_object")
- (return-type "GObject*")
+(define-method insert_item
+ (of-object "GMenu")
+ (c-name "g_menu_insert_item")
+ (return-type "none")
(parameters
- '("guint" "position")
+ '("gint" "position")
+ '("GMenuItem*" "item")
)
)
-(define-method items_changed
- (of-object "GListModel")
- (c-name "g_list_model_items_changed")
+(define-method prepend_item
+ (of-object "GMenu")
+ (c-name "g_menu_prepend_item")
(return-type "none")
(parameters
- '("guint" "position")
- '("guint" "removed")
- '("guint" "added")
+ '("GMenuItem*" "item")
)
)
-
-
-;; From gliststore.h
-
-(define-function g_list_store_new
- (c-name "g_list_store_new")
- (is-constructor-of "GListStore")
- (return-type "GListStore*")
+(define-method append_item
+ (of-object "GMenu")
+ (c-name "g_menu_append_item")
+ (return-type "none")
(parameters
- '("GType" "item_type")
+ '("GMenuItem*" "item")
)
)
-(define-method insert
- (of-object "GListStore")
- (c-name "g_list_store_insert")
+(define-method remove
+ (of-object "GMenu")
+ (c-name "g_menu_remove")
(return-type "none")
(parameters
- '("guint" "position")
- '("gpointer" "item")
+ '("gint" "position")
)
)
-(define-method insert_sorted
- (of-object "GListStore")
- (c-name "g_list_store_insert_sorted")
- (return-type "guint")
+(define-method remove_all
+ (of-object "GMenu")
+ (c-name "g_menu_remove_all")
+ (return-type "none")
+)
+
+(define-method insert
+ (of-object "GMenu")
+ (c-name "g_menu_insert")
+ (return-type "none")
(parameters
- '("gpointer" "item")
- '("GCompareDataFunc" "compare_func")
- '("gpointer" "user_data")
+ '("gint" "position")
+ '("const-gchar*" "label")
+ '("const-gchar*" "detailed_action")
)
)
-(define-method sort
- (of-object "GListStore")
- (c-name "g_list_store_sort")
+(define-method prepend
+ (of-object "GMenu")
+ (c-name "g_menu_prepend")
(return-type "none")
(parameters
- '("GCompareDataFunc" "compare_func")
- '("gpointer" "user_data")
+ '("const-gchar*" "label")
+ '("const-gchar*" "detailed_action")
)
)
(define-method append
- (of-object "GListStore")
- (c-name "g_list_store_append")
+ (of-object "GMenu")
+ (c-name "g_menu_append")
(return-type "none")
(parameters
- '("gpointer" "item")
+ '("const-gchar*" "label")
+ '("const-gchar*" "detailed_action")
)
)
-(define-method remove
- (of-object "GListStore")
- (c-name "g_list_store_remove")
+(define-method insert_section
+ (of-object "GMenu")
+ (c-name "g_menu_insert_section")
(return-type "none")
(parameters
- '("guint" "position")
+ '("gint" "position")
+ '("const-gchar*" "label")
+ '("GMenuModel*" "section")
)
)
-(define-method remove_all
- (of-object "GListStore")
- (c-name "g_list_store_remove_all")
+(define-method prepend_section
+ (of-object "GMenu")
+ (c-name "g_menu_prepend_section")
(return-type "none")
+ (parameters
+ '("const-gchar*" "label")
+ '("GMenuModel*" "section")
+ )
)
-(define-method splice
- (of-object "GListStore")
- (c-name "g_list_store_splice")
+(define-method append_section
+ (of-object "GMenu")
+ (c-name "g_menu_append_section")
(return-type "none")
(parameters
- '("guint" "position")
- '("guint" "n_removals")
- '("gpointer*" "additions")
- '("guint" "n_additions")
+ '("const-gchar*" "label")
+ '("GMenuModel*" "section")
)
)
-
-
-;; From gloadableicon.h
-
-(define-function g_loadable_icon_get_type
- (c-name "g_loadable_icon_get_type")
- (return-type "GType")
-)
-
-(define-method load
- (of-object "GLoadableIcon")
- (c-name "g_loadable_icon_load")
- (return-type "GInputStream*")
+(define-method insert_submenu
+ (of-object "GMenu")
+ (c-name "g_menu_insert_submenu")
+ (return-type "none")
(parameters
- '("int" "size")
- '("char**" "type")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gint" "position")
+ '("const-gchar*" "label")
+ '("GMenuModel*" "submenu")
)
)
-(define-method load_async
- (of-object "GLoadableIcon")
- (c-name "g_loadable_icon_load_async")
+(define-method prepend_submenu
+ (of-object "GMenu")
+ (c-name "g_menu_prepend_submenu")
(return-type "none")
(parameters
- '("int" "size")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-gchar*" "label")
+ '("GMenuModel*" "submenu")
)
)
-(define-method load_finish
- (of-object "GLoadableIcon")
- (c-name "g_loadable_icon_load_finish")
- (return-type "GInputStream*")
+(define-method append_submenu
+ (of-object "GMenu")
+ (c-name "g_menu_append_submenu")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "res")
- '("char**" "type")
- '("GError**" "error")
+ '("const-gchar*" "label")
+ '("GMenuModel*" "submenu")
)
)
+(define-function g_menu_item_get_type
+ (c-name "g_menu_item_get_type")
+ (return-type "GType")
+)
-
-;; From glocalfileenumerator.h
-
-
-
-;; From glocalfile.h
-
-(define-function g_local_file_is_remote
- (c-name "g_local_file_is_remote")
- (return-type "gboolean")
+(define-function g_menu_item_new
+ (c-name "g_menu_item_new")
+ (is-constructor-of "GMenuItem")
+ (return-type "GMenuItem*")
(parameters
- '("const-gchar*" "filename")
+ '("const-gchar*" "label")
+ '("const-gchar*" "detailed_action")
)
)
-(define-function g_local_file_new_from_dirname_and_basename
- (c-name "g_local_file_new_from_dirname_and_basename")
- (return-type "GFile*")
+(define-function g_menu_item_new_from_model
+ (c-name "g_menu_item_new_from_model")
+ (return-type "GMenuItem*")
(parameters
- '("const-char*" "dirname")
- '("const-char*" "basename")
+ '("GMenuModel*" "model")
+ '("gint" "item_index")
)
)
-
-
-;; From glocalfileinfo.h
-
-
-
-;; From glocalfileinputstream.h
-
-
-
-;; From glocalfileiostream.h
-
-
-
-;; From glocalfilemonitor.h
-
-(define-function g_local_file_monitor_get_type
- (c-name "g_local_file_monitor_get_type")
- (return-type "GType")
+(define-function g_menu_item_new_submenu
+ (c-name "g_menu_item_new_submenu")
+ (return-type "GMenuItem*")
+ (parameters
+ '("const-gchar*" "label")
+ '("GMenuModel*" "submenu")
+ )
)
-(define-function g_local_file_monitor_new_for_path
- (c-name "g_local_file_monitor_new_for_path")
- (return-type "GFileMonitor*")
+(define-function g_menu_item_new_section
+ (c-name "g_menu_item_new_section")
+ (return-type "GMenuItem*")
(parameters
- '("const-gchar*" "pathname")
- '("gboolean" "is_directory")
- '("GFileMonitorFlags" "flags")
- '("GError**" "error")
+ '("const-gchar*" "label")
+ '("GMenuModel*" "section")
)
)
-(define-function g_local_file_monitor_new_in_worker
- (c-name "g_local_file_monitor_new_in_worker")
- (return-type "GFileMonitor*")
+(define-method get_attribute_value
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_get_attribute_value")
+ (return-type "GVariant*")
(parameters
- '("const-gchar*" "pathname")
- '("gboolean" "is_directory")
- '("GFileMonitorFlags" "flags")
- '("GFileMonitorCallback" "callback")
- '("gpointer" "user_data")
- '("GError**" "error")
+ '("const-gchar*" "attribute")
+ '("const-GVariantType*" "expected_type")
)
)
-(define-method handle_event
- (of-object "GFileMonitorSource")
- (c-name "g_file_monitor_source_handle_event")
+(define-method get_attribute
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_get_attribute")
(return-type "gboolean")
(parameters
- '("GFileMonitorEvent" "event_type")
- '("const-gchar*" "child")
- '("const-gchar*" "rename_to")
- '("GFile*" "other")
- '("gint64" "event_time")
+ '("const-gchar*" "attribute")
+ '("const-gchar*" "format_string")
)
+ (varargs #t)
)
+(define-method get_link
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_get_link")
+ (return-type "GMenuModel*")
+ (parameters
+ '("const-gchar*" "link")
+ )
+)
+(define-method set_attribute_value
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_attribute_value")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "attribute")
+ '("GVariant*" "value")
+ )
+)
-;; From glocalfileoutputstream.h
-
-
-
-;; From glocalvfs.h
-
-
-
-;; From gmemoryinputstream.h
-
-(define-function g_memory_input_stream_get_type
- (c-name "g_memory_input_stream_get_type")
- (return-type "GType")
-)
-
-(define-function g_memory_input_stream_new
- (c-name "g_memory_input_stream_new")
- (is-constructor-of "GMemoryInputStream")
- (return-type "GInputStream*")
-)
-
-(define-function g_memory_input_stream_new_from_data
- (c-name "g_memory_input_stream_new_from_data")
- (return-type "GInputStream*")
+(define-method set_attribute
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_attribute")
+ (return-type "none")
(parameters
- '("const-void*" "data")
- '("gssize" "len")
- '("GDestroyNotify" "destroy")
+ '("const-gchar*" "attribute")
+ '("const-gchar*" "format_string")
)
+ (varargs #t)
)
-(define-function g_memory_input_stream_new_from_bytes
- (c-name "g_memory_input_stream_new_from_bytes")
- (return-type "GInputStream*")
+(define-method set_link
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_link")
+ (return-type "none")
(parameters
- '("GBytes*" "bytes")
+ '("const-gchar*" "link")
+ '("GMenuModel*" "model")
)
)
-(define-method add_data
- (of-object "GMemoryInputStream")
- (c-name "g_memory_input_stream_add_data")
+(define-method set_label
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_label")
(return-type "none")
(parameters
- '("const-void*" "data")
- '("gssize" "len")
- '("GDestroyNotify" "destroy")
+ '("const-gchar*" "label")
)
)
-(define-method add_bytes
- (of-object "GMemoryInputStream")
- (c-name "g_memory_input_stream_add_bytes")
+(define-method set_submenu
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_submenu")
(return-type "none")
(parameters
- '("GBytes*" "bytes")
+ '("GMenuModel*" "submenu")
)
)
-
-
-;; From gmemoryoutputstream.h
-
-(define-function g_memory_output_stream_get_type
- (c-name "g_memory_output_stream_get_type")
- (return-type "GType")
-)
-
-(define-function g_memory_output_stream_new
- (c-name "g_memory_output_stream_new")
- (is-constructor-of "GMemoryOutputStream")
- (return-type "GOutputStream*")
+(define-method set_section
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_section")
+ (return-type "none")
(parameters
- '("gpointer" "data")
- '("gsize" "size")
- '("GReallocFunc" "realloc_function")
- '("GDestroyNotify" "destroy_function")
+ '("GMenuModel*" "section")
)
)
-(define-function g_memory_output_stream_new_resizable
- (c-name "g_memory_output_stream_new_resizable")
- (return-type "GOutputStream*")
-)
-
-(define-method get_data
- (of-object "GMemoryOutputStream")
- (c-name "g_memory_output_stream_get_data")
- (return-type "gpointer")
-)
-
-(define-method get_size
- (of-object "GMemoryOutputStream")
- (c-name "g_memory_output_stream_get_size")
- (return-type "gsize")
-)
-
-(define-method get_data_size
- (of-object "GMemoryOutputStream")
- (c-name "g_memory_output_stream_get_data_size")
- (return-type "gsize")
-)
-
-(define-method steal_data
- (of-object "GMemoryOutputStream")
- (c-name "g_memory_output_stream_steal_data")
- (return-type "gpointer")
+(define-method set_action_and_target_value
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_action_and_target_value")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "action")
+ '("GVariant*" "target_value")
+ )
)
-(define-method steal_as_bytes
- (of-object "GMemoryOutputStream")
- (c-name "g_memory_output_stream_steal_as_bytes")
- (return-type "GBytes*")
+(define-method set_action_and_target
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_action_and_target")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "action")
+ '("const-gchar*" "format_string")
+ )
+ (varargs #t)
)
-
-
-;; From gmenuexporter.h
-
-(define-method export_menu_model
- (of-object "GDBusConnection")
- (c-name "g_dbus_connection_export_menu_model")
- (return-type "guint")
+(define-method set_detailed_action
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_detailed_action")
+ (return-type "none")
(parameters
- '("const-gchar*" "object_path")
- '("GMenuModel*" "menu")
- '("GError**" "error")
+ '("const-gchar*" "detailed_action")
)
)
-(define-method unexport_menu_model
- (of-object "GDBusConnection")
- (c-name "g_dbus_connection_unexport_menu_model")
+(define-method set_icon
+ (of-object "GMenuItem")
+ (c-name "g_menu_item_set_icon")
(return-type "none")
(parameters
- '("guint" "export_id")
+ '("GIcon*" "icon")
)
)
-;; From gmenu.h
+;; From gmenumodel.h
-(define-function g_menu_get_type
- (c-name "g_menu_get_type")
+(define-function g_menu_model_get_type
+ (c-name "g_menu_model_get_type")
(return-type "GType")
)
-(define-function g_menu_new
- (c-name "g_menu_new")
- (is-constructor-of "GMenu")
- (return-type "GMenu*")
+(define-method is_mutable
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_is_mutable")
+ (return-type "gboolean")
)
-(define-method freeze
- (of-object "GMenu")
- (c-name "g_menu_freeze")
- (return-type "none")
+(define-method get_n_items
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_get_n_items")
+ (return-type "gint")
)
-(define-method insert_item
- (of-object "GMenu")
- (c-name "g_menu_insert_item")
- (return-type "none")
+(define-method iterate_item_attributes
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_iterate_item_attributes")
+ (return-type "GMenuAttributeIter*")
(parameters
- '("gint" "position")
- '("GMenuItem*" "item")
+ '("gint" "item_index")
)
)
-(define-method prepend_item
- (of-object "GMenu")
- (c-name "g_menu_prepend_item")
- (return-type "none")
+(define-method get_item_attribute_value
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_get_item_attribute_value")
+ (return-type "GVariant*")
(parameters
- '("GMenuItem*" "item")
+ '("gint" "item_index")
+ '("const-gchar*" "attribute")
+ '("const-GVariantType*" "expected_type")
)
)
-(define-method append_item
- (of-object "GMenu")
- (c-name "g_menu_append_item")
- (return-type "none")
+(define-method get_item_attribute
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_get_item_attribute")
+ (return-type "gboolean")
(parameters
- '("GMenuItem*" "item")
+ '("gint" "item_index")
+ '("const-gchar*" "attribute")
+ '("const-gchar*" "format_string")
)
+ (varargs #t)
)
-(define-method remove
- (of-object "GMenu")
- (c-name "g_menu_remove")
- (return-type "none")
+(define-method iterate_item_links
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_iterate_item_links")
+ (return-type "GMenuLinkIter*")
(parameters
- '("gint" "position")
+ '("gint" "item_index")
)
)
-(define-method remove_all
- (of-object "GMenu")
- (c-name "g_menu_remove_all")
- (return-type "none")
+(define-method get_item_link
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_get_item_link")
+ (return-type "GMenuModel*")
+ (parameters
+ '("gint" "item_index")
+ '("const-gchar*" "link")
+ )
)
-(define-method insert
- (of-object "GMenu")
- (c-name "g_menu_insert")
+(define-method items_changed
+ (of-object "GMenuModel")
+ (c-name "g_menu_model_items_changed")
(return-type "none")
(parameters
'("gint" "position")
- '("const-gchar*" "label")
- '("const-gchar*" "detailed_action")
+ '("gint" "removed")
+ '("gint" "added")
)
)
-(define-method prepend
- (of-object "GMenu")
- (c-name "g_menu_prepend")
- (return-type "none")
- (parameters
- '("const-gchar*" "label")
- '("const-gchar*" "detailed_action")
- )
+(define-function g_menu_attribute_iter_get_type
+ (c-name "g_menu_attribute_iter_get_type")
+ (return-type "GType")
)
-(define-method append
- (of-object "GMenu")
- (c-name "g_menu_append")
- (return-type "none")
+(define-method get_next
+ (of-object "GMenuAttributeIter")
+ (c-name "g_menu_attribute_iter_get_next")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "label")
- '("const-gchar*" "detailed_action")
+ '("const-gchar**" "out_name")
+ '("GVariant**" "value")
)
)
-(define-method insert_section
- (of-object "GMenu")
- (c-name "g_menu_insert_section")
- (return-type "none")
- (parameters
- '("gint" "position")
- '("const-gchar*" "label")
- '("GMenuModel*" "section")
- )
+(define-method next
+ (of-object "GMenuAttributeIter")
+ (c-name "g_menu_attribute_iter_next")
+ (return-type "gboolean")
)
-(define-method prepend_section
- (of-object "GMenu")
- (c-name "g_menu_prepend_section")
- (return-type "none")
- (parameters
- '("const-gchar*" "label")
- '("GMenuModel*" "section")
- )
+(define-method get_name
+ (of-object "GMenuAttributeIter")
+ (c-name "g_menu_attribute_iter_get_name")
+ (return-type "const-gchar*")
)
-(define-method append_section
- (of-object "GMenu")
- (c-name "g_menu_append_section")
- (return-type "none")
- (parameters
- '("const-gchar*" "label")
- '("GMenuModel*" "section")
- )
+(define-method get_value
+ (of-object "GMenuAttributeIter")
+ (c-name "g_menu_attribute_iter_get_value")
+ (return-type "GVariant*")
)
-(define-method insert_submenu
- (of-object "GMenu")
- (c-name "g_menu_insert_submenu")
- (return-type "none")
- (parameters
- '("gint" "position")
- '("const-gchar*" "label")
- '("GMenuModel*" "submenu")
- )
+(define-function g_menu_link_iter_get_type
+ (c-name "g_menu_link_iter_get_type")
+ (return-type "GType")
)
-(define-method prepend_submenu
- (of-object "GMenu")
- (c-name "g_menu_prepend_submenu")
- (return-type "none")
+(define-method get_next
+ (of-object "GMenuLinkIter")
+ (c-name "g_menu_link_iter_get_next")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "label")
- '("GMenuModel*" "submenu")
+ '("const-gchar**" "out_link")
+ '("GMenuModel**" "value")
)
)
-(define-method append_submenu
- (of-object "GMenu")
- (c-name "g_menu_append_submenu")
- (return-type "none")
- (parameters
- '("const-gchar*" "label")
- '("GMenuModel*" "submenu")
- )
+(define-method next
+ (of-object "GMenuLinkIter")
+ (c-name "g_menu_link_iter_next")
+ (return-type "gboolean")
)
-(define-function g_menu_item_get_type
- (c-name "g_menu_item_get_type")
+(define-method get_name
+ (of-object "GMenuLinkIter")
+ (c-name "g_menu_link_iter_get_name")
+ (return-type "const-gchar*")
+)
+
+(define-method get_value
+ (of-object "GMenuLinkIter")
+ (c-name "g_menu_link_iter_get_value")
+ (return-type "GMenuModel*")
+)
+
+
+
+;; From gmount.h
+
+(define-function g_mount_get_type
+ (c-name "g_mount_get_type")
(return-type "GType")
)
-(define-function g_menu_item_new
- (c-name "g_menu_item_new")
- (is-constructor-of "GMenuItem")
- (return-type "GMenuItem*")
- (parameters
- '("const-gchar*" "label")
- '("const-gchar*" "detailed_action")
- )
+(define-method get_root
+ (of-object "GMount")
+ (c-name "g_mount_get_root")
+ (return-type "GFile*")
)
-(define-function g_menu_item_new_from_model
- (c-name "g_menu_item_new_from_model")
- (return-type "GMenuItem*")
- (parameters
- '("GMenuModel*" "model")
- '("gint" "item_index")
- )
+(define-method get_default_location
+ (of-object "GMount")
+ (c-name "g_mount_get_default_location")
+ (return-type "GFile*")
)
-(define-function g_menu_item_new_submenu
- (c-name "g_menu_item_new_submenu")
- (return-type "GMenuItem*")
- (parameters
- '("const-gchar*" "label")
- '("GMenuModel*" "submenu")
- )
+(define-method get_name
+ (of-object "GMount")
+ (c-name "g_mount_get_name")
+ (return-type "char*")
)
-(define-function g_menu_item_new_section
- (c-name "g_menu_item_new_section")
- (return-type "GMenuItem*")
- (parameters
- '("const-gchar*" "label")
- '("GMenuModel*" "section")
- )
+(define-method get_icon
+ (of-object "GMount")
+ (c-name "g_mount_get_icon")
+ (return-type "GIcon*")
)
-(define-method get_attribute_value
- (of-object "GMenuItem")
- (c-name "g_menu_item_get_attribute_value")
- (return-type "GVariant*")
- (parameters
- '("const-gchar*" "attribute")
- '("const-GVariantType*" "expected_type")
- )
+(define-method get_symbolic_icon
+ (of-object "GMount")
+ (c-name "g_mount_get_symbolic_icon")
+ (return-type "GIcon*")
)
-(define-method get_attribute
- (of-object "GMenuItem")
- (c-name "g_menu_item_get_attribute")
+(define-method get_uuid
+ (of-object "GMount")
+ (c-name "g_mount_get_uuid")
+ (return-type "char*")
+)
+
+(define-method get_volume
+ (of-object "GMount")
+ (c-name "g_mount_get_volume")
+ (return-type "GVolume*")
+)
+
+(define-method get_drive
+ (of-object "GMount")
+ (c-name "g_mount_get_drive")
+ (return-type "GDrive*")
+)
+
+(define-method can_unmount
+ (of-object "GMount")
+ (c-name "g_mount_can_unmount")
(return-type "gboolean")
- (parameters
- '("const-gchar*" "attribute")
- '("const-gchar*" "format_string")
- )
- (varargs #t)
)
-(define-method get_link
- (of-object "GMenuItem")
- (c-name "g_menu_item_get_link")
- (return-type "GMenuModel*")
- (parameters
- '("const-gchar*" "link")
- )
+(define-method can_eject
+ (of-object "GMount")
+ (c-name "g_mount_can_eject")
+ (return-type "gboolean")
)
-(define-method set_attribute_value
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_attribute_value")
+(define-method unmount
+ (of-object "GMount")
+ (c-name "g_mount_unmount")
(return-type "none")
(parameters
- '("const-gchar*" "attribute")
- '("GVariant*" "value")
+ '("GMountUnmountFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method set_attribute
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_attribute")
- (return-type "none")
+(define-method unmount_finish
+ (of-object "GMount")
+ (c-name "g_mount_unmount_finish")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "attribute")
- '("const-gchar*" "format_string")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
- (varargs #t)
)
-(define-method set_link
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_link")
+(define-method eject
+ (of-object "GMount")
+ (c-name "g_mount_eject")
(return-type "none")
(parameters
- '("const-gchar*" "link")
- '("GMenuModel*" "model")
+ '("GMountUnmountFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method set_label
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_label")
- (return-type "none")
+(define-method eject_finish
+ (of-object "GMount")
+ (c-name "g_mount_eject_finish")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "label")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-method set_submenu
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_submenu")
+(define-method remount
+ (of-object "GMount")
+ (c-name "g_mount_remount")
(return-type "none")
(parameters
- '("GMenuModel*" "submenu")
- )
-)
-
-(define-method set_section
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_section")
- (return-type "none")
- (parameters
- '("GMenuModel*" "section")
+ '("GMountMountFlags" "flags")
+ '("GMountOperation*" "mount_operation")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method set_action_and_target_value
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_action_and_target_value")
- (return-type "none")
+(define-method remount_finish
+ (of-object "GMount")
+ (c-name "g_mount_remount_finish")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "action")
- '("GVariant*" "target_value")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-method set_action_and_target
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_action_and_target")
+(define-method guess_content_type
+ (of-object "GMount")
+ (c-name "g_mount_guess_content_type")
(return-type "none")
(parameters
- '("const-gchar*" "action")
- '("const-gchar*" "format_string")
+ '("gboolean" "force_rescan")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
- (varargs #t)
)
-(define-method set_detailed_action
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_detailed_action")
- (return-type "none")
+(define-method guess_content_type_finish
+ (of-object "GMount")
+ (c-name "g_mount_guess_content_type_finish")
+ (return-type "gchar**")
(parameters
- '("const-gchar*" "detailed_action")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-method set_icon
- (of-object "GMenuItem")
- (c-name "g_menu_item_set_icon")
- (return-type "none")
+(define-method guess_content_type_sync
+ (of-object "GMount")
+ (c-name "g_mount_guess_content_type_sync")
+ (return-type "gchar**")
(parameters
- '("GIcon*" "icon")
+ '("gboolean" "force_rescan")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-
-
-;; From gmenumodel.h
-
-(define-function g_menu_model_get_type
- (c-name "g_menu_model_get_type")
- (return-type "GType")
-)
-
-(define-method is_mutable
- (of-object "GMenuModel")
- (c-name "g_menu_model_is_mutable")
+(define-method is_shadowed
+ (of-object "GMount")
+ (c-name "g_mount_is_shadowed")
(return-type "gboolean")
)
-(define-method get_n_items
- (of-object "GMenuModel")
- (c-name "g_menu_model_get_n_items")
- (return-type "gint")
+(define-method shadow
+ (of-object "GMount")
+ (c-name "g_mount_shadow")
+ (return-type "none")
)
-(define-method iterate_item_attributes
- (of-object "GMenuModel")
- (c-name "g_menu_model_iterate_item_attributes")
- (return-type "GMenuAttributeIter*")
- (parameters
- '("gint" "item_index")
- )
+(define-method unshadow
+ (of-object "GMount")
+ (c-name "g_mount_unshadow")
+ (return-type "none")
)
-(define-method get_item_attribute_value
- (of-object "GMenuModel")
- (c-name "g_menu_model_get_item_attribute_value")
- (return-type "GVariant*")
+(define-method unmount_with_operation
+ (of-object "GMount")
+ (c-name "g_mount_unmount_with_operation")
+ (return-type "none")
(parameters
- '("gint" "item_index")
- '("const-gchar*" "attribute")
- '("const-GVariantType*" "expected_type")
+ '("GMountUnmountFlags" "flags")
+ '("GMountOperation*" "mount_operation")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method get_item_attribute
- (of-object "GMenuModel")
- (c-name "g_menu_model_get_item_attribute")
+(define-method unmount_with_operation_finish
+ (of-object "GMount")
+ (c-name "g_mount_unmount_with_operation_finish")
(return-type "gboolean")
(parameters
- '("gint" "item_index")
- '("const-gchar*" "attribute")
- '("const-gchar*" "format_string")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
- (varargs #t)
)
-(define-method iterate_item_links
- (of-object "GMenuModel")
- (c-name "g_menu_model_iterate_item_links")
- (return-type "GMenuLinkIter*")
+(define-method eject_with_operation
+ (of-object "GMount")
+ (c-name "g_mount_eject_with_operation")
+ (return-type "none")
(parameters
- '("gint" "item_index")
+ '("GMountUnmountFlags" "flags")
+ '("GMountOperation*" "mount_operation")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method get_item_link
- (of-object "GMenuModel")
- (c-name "g_menu_model_get_item_link")
- (return-type "GMenuModel*")
+(define-method eject_with_operation_finish
+ (of-object "GMount")
+ (c-name "g_mount_eject_with_operation_finish")
+ (return-type "gboolean")
(parameters
- '("gint" "item_index")
- '("const-gchar*" "link")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-method items_changed
- (of-object "GMenuModel")
- (c-name "g_menu_model_items_changed")
- (return-type "none")
- (parameters
- '("gint" "position")
- '("gint" "removed")
- '("gint" "added")
- )
+(define-method get_sort_key
+ (of-object "GMount")
+ (c-name "g_mount_get_sort_key")
+ (return-type "const-gchar*")
)
-(define-function g_menu_attribute_iter_get_type
- (c-name "g_menu_attribute_iter_get_type")
- (return-type "GType")
-)
-(define-method get_next
- (of-object "GMenuAttributeIter")
- (c-name "g_menu_attribute_iter_get_next")
- (return-type "gboolean")
- (parameters
- '("const-gchar**" "out_name")
- '("GVariant**" "value")
- )
+
+;; From gmountoperation.h
+
+(define-function g_mount_operation_get_type
+ (c-name "g_mount_operation_get_type")
+ (return-type "GType")
)
-(define-method next
- (of-object "GMenuAttributeIter")
- (c-name "g_menu_attribute_iter_next")
- (return-type "gboolean")
+(define-function g_mount_operation_new
+ (c-name "g_mount_operation_new")
+ (is-constructor-of "GMountOperation")
+ (return-type "GMountOperation*")
)
-(define-method get_name
- (of-object "GMenuAttributeIter")
- (c-name "g_menu_attribute_iter_get_name")
- (return-type "const-gchar*")
+(define-method get_username
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_username")
+ (return-type "const-char*")
)
-(define-method get_value
- (of-object "GMenuAttributeIter")
- (c-name "g_menu_attribute_iter_get_value")
- (return-type "GVariant*")
+(define-method set_username
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_username")
+ (return-type "none")
+ (parameters
+ '("const-char*" "username")
+ )
)
-(define-function g_menu_link_iter_get_type
- (c-name "g_menu_link_iter_get_type")
- (return-type "GType")
+(define-method get_password
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_password")
+ (return-type "const-char*")
)
-(define-method get_next
- (of-object "GMenuLinkIter")
- (c-name "g_menu_link_iter_get_next")
- (return-type "gboolean")
+(define-method set_password
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_password")
+ (return-type "none")
(parameters
- '("const-gchar**" "out_link")
- '("GMenuModel**" "value")
+ '("const-char*" "password")
)
)
-(define-method next
- (of-object "GMenuLinkIter")
- (c-name "g_menu_link_iter_next")
+(define-method get_anonymous
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_anonymous")
(return-type "gboolean")
)
-(define-method get_name
- (of-object "GMenuLinkIter")
- (c-name "g_menu_link_iter_get_name")
- (return-type "const-gchar*")
+(define-method set_anonymous
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_anonymous")
+ (return-type "none")
+ (parameters
+ '("gboolean" "anonymous")
+ )
)
-(define-method get_value
- (of-object "GMenuLinkIter")
- (c-name "g_menu_link_iter_get_value")
- (return-type "GMenuModel*")
+(define-method get_domain
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_domain")
+ (return-type "const-char*")
)
-
-
-;; From gmount.h
-
-(define-function g_mount_get_type
- (c-name "g_mount_get_type")
- (return-type "GType")
-)
-
-(define-method get_root
- (of-object "GMount")
- (c-name "g_mount_get_root")
- (return-type "GFile*")
-)
-
-(define-method get_default_location
- (of-object "GMount")
- (c-name "g_mount_get_default_location")
- (return-type "GFile*")
-)
-
-(define-method get_name
- (of-object "GMount")
- (c-name "g_mount_get_name")
- (return-type "char*")
-)
-
-(define-method get_icon
- (of-object "GMount")
- (c-name "g_mount_get_icon")
- (return-type "GIcon*")
-)
-
-(define-method get_symbolic_icon
- (of-object "GMount")
- (c-name "g_mount_get_symbolic_icon")
- (return-type "GIcon*")
-)
-
-(define-method get_uuid
- (of-object "GMount")
- (c-name "g_mount_get_uuid")
- (return-type "char*")
+(define-method set_domain
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_domain")
+ (return-type "none")
+ (parameters
+ '("const-char*" "domain")
+ )
)
-(define-method get_volume
- (of-object "GMount")
- (c-name "g_mount_get_volume")
- (return-type "GVolume*")
+(define-method get_password_save
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_password_save")
+ (return-type "GPasswordSave")
)
-(define-method get_drive
- (of-object "GMount")
- (c-name "g_mount_get_drive")
- (return-type "GDrive*")
+(define-method set_password_save
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_password_save")
+ (return-type "none")
+ (parameters
+ '("GPasswordSave" "save")
+ )
)
-(define-method can_unmount
- (of-object "GMount")
- (c-name "g_mount_can_unmount")
- (return-type "gboolean")
+(define-method get_choice
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_choice")
+ (return-type "int")
)
-(define-method can_eject
- (of-object "GMount")
- (c-name "g_mount_can_eject")
- (return-type "gboolean")
+(define-method set_choice
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_choice")
+ (return-type "none")
+ (parameters
+ '("int" "choice")
+ )
)
-(define-method unmount
- (of-object "GMount")
- (c-name "g_mount_unmount")
+(define-method reply
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_reply")
(return-type "none")
(parameters
- '("GMountUnmountFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GMountOperationResult" "result")
)
)
-(define-method unmount_finish
- (of-object "GMount")
- (c-name "g_mount_unmount_finish")
+(define-method get_is_tcrypt_hidden_volume
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_is_tcrypt_hidden_volume")
(return-type "gboolean")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
)
-(define-method eject
- (of-object "GMount")
- (c-name "g_mount_eject")
+(define-method set_is_tcrypt_hidden_volume
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_is_tcrypt_hidden_volume")
(return-type "none")
(parameters
- '("GMountUnmountFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "hidden_volume")
)
)
-(define-method eject_finish
- (of-object "GMount")
- (c-name "g_mount_eject_finish")
+(define-method get_is_tcrypt_system_volume
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_is_tcrypt_system_volume")
(return-type "gboolean")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
)
-(define-method remount
- (of-object "GMount")
- (c-name "g_mount_remount")
+(define-method set_is_tcrypt_system_volume
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_is_tcrypt_system_volume")
(return-type "none")
(parameters
- '("GMountMountFlags" "flags")
- '("GMountOperation*" "mount_operation")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "system_volume")
)
)
-(define-method remount_finish
- (of-object "GMount")
- (c-name "g_mount_remount_finish")
- (return-type "gboolean")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
+(define-method get_pim
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_get_pim")
+ (return-type "guint")
)
-(define-method guess_content_type
- (of-object "GMount")
- (c-name "g_mount_guess_content_type")
+(define-method set_pim
+ (of-object "GMountOperation")
+ (c-name "g_mount_operation_set_pim")
(return-type "none")
(parameters
- '("gboolean" "force_rescan")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("guint" "pim")
)
)
-(define-method guess_content_type_finish
- (of-object "GMount")
- (c-name "g_mount_guess_content_type_finish")
- (return-type "gchar**")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
+
+
+;; From gnativesocketaddress.h
+
+(define-function g_native_socket_address_get_type
+ (c-name "g_native_socket_address_get_type")
+ (return-type "GType")
)
-(define-method guess_content_type_sync
- (of-object "GMount")
- (c-name "g_mount_guess_content_type_sync")
- (return-type "gchar**")
+(define-function g_native_socket_address_new
+ (c-name "g_native_socket_address_new")
+ (is-constructor-of "GNativeSocketAddress")
+ (return-type "GSocketAddress*")
(parameters
- '("gboolean" "force_rescan")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gpointer" "native")
+ '("gsize" "len")
)
)
-(define-method is_shadowed
- (of-object "GMount")
- (c-name "g_mount_is_shadowed")
- (return-type "gboolean")
-)
-(define-method shadow
- (of-object "GMount")
- (c-name "g_mount_shadow")
- (return-type "none")
+
+;; From gnativevolumemonitor.h
+
+(define-function g_native_volume_monitor_get_type
+ (c-name "g_native_volume_monitor_get_type")
+ (return-type "GType")
)
-(define-method unshadow
- (of-object "GMount")
- (c-name "g_mount_unshadow")
- (return-type "none")
+
+
+;; From gnetworkaddress.h
+
+(define-function g_network_address_get_type
+ (c-name "g_network_address_get_type")
+ (return-type "GType")
)
-(define-method unmount_with_operation
- (of-object "GMount")
- (c-name "g_mount_unmount_with_operation")
- (return-type "none")
+(define-function g_network_address_new
+ (c-name "g_network_address_new")
+ (is-constructor-of "GNetworkAddress")
+ (return-type "GSocketConnectable*")
(parameters
- '("GMountUnmountFlags" "flags")
- '("GMountOperation*" "mount_operation")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-gchar*" "hostname")
+ '("guint16" "port")
)
)
-(define-method unmount_with_operation_finish
- (of-object "GMount")
- (c-name "g_mount_unmount_with_operation_finish")
- (return-type "gboolean")
+(define-function g_network_address_new_loopback
+ (c-name "g_network_address_new_loopback")
+ (return-type "GSocketConnectable*")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("guint16" "port")
)
)
-(define-method eject_with_operation
- (of-object "GMount")
- (c-name "g_mount_eject_with_operation")
- (return-type "none")
+(define-function g_network_address_parse
+ (c-name "g_network_address_parse")
+ (return-type "GSocketConnectable*")
(parameters
- '("GMountUnmountFlags" "flags")
- '("GMountOperation*" "mount_operation")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-gchar*" "host_and_port")
+ '("guint16" "default_port")
+ '("GError**" "error")
)
)
-(define-method eject_with_operation_finish
- (of-object "GMount")
- (c-name "g_mount_eject_with_operation_finish")
- (return-type "gboolean")
+(define-function g_network_address_parse_uri
+ (c-name "g_network_address_parse_uri")
+ (return-type "GSocketConnectable*")
(parameters
- '("GAsyncResult*" "result")
+ '("const-gchar*" "uri")
+ '("guint16" "default_port")
'("GError**" "error")
)
)
-(define-method get_sort_key
- (of-object "GMount")
- (c-name "g_mount_get_sort_key")
- (return-type "const-gchar*")
-)
-
-
-
-;; From gmountoperation.h
-
-(define-function g_mount_operation_get_type
- (c-name "g_mount_operation_get_type")
- (return-type "GType")
-)
-
-(define-function g_mount_operation_new
- (c-name "g_mount_operation_new")
- (is-constructor-of "GMountOperation")
- (return-type "GMountOperation*")
-)
-
-(define-method get_username
- (of-object "GMountOperation")
- (c-name "g_mount_operation_get_username")
- (return-type "const-char*")
-)
-
-(define-method set_username
- (of-object "GMountOperation")
- (c-name "g_mount_operation_set_username")
- (return-type "none")
- (parameters
- '("const-char*" "username")
- )
-)
-
-(define-method get_password
- (of-object "GMountOperation")
- (c-name "g_mount_operation_get_password")
- (return-type "const-char*")
-)
-
-(define-method set_password
- (of-object "GMountOperation")
- (c-name "g_mount_operation_set_password")
- (return-type "none")
- (parameters
- '("const-char*" "password")
- )
-)
-
-(define-method get_anonymous
- (of-object "GMountOperation")
- (c-name "g_mount_operation_get_anonymous")
- (return-type "gboolean")
-)
-
-(define-method set_anonymous
- (of-object "GMountOperation")
- (c-name "g_mount_operation_set_anonymous")
- (return-type "none")
- (parameters
- '("gboolean" "anonymous")
- )
-)
-
-(define-method get_domain
- (of-object "GMountOperation")
- (c-name "g_mount_operation_get_domain")
- (return-type "const-char*")
-)
-
-(define-method set_domain
- (of-object "GMountOperation")
- (c-name "g_mount_operation_set_domain")
- (return-type "none")
- (parameters
- '("const-char*" "domain")
- )
-)
-
-(define-method get_password_save
- (of-object "GMountOperation")
- (c-name "g_mount_operation_get_password_save")
- (return-type "GPasswordSave")
-)
-
-(define-method set_password_save
- (of-object "GMountOperation")
- (c-name "g_mount_operation_set_password_save")
- (return-type "none")
- (parameters
- '("GPasswordSave" "save")
- )
-)
-
-(define-method get_choice
- (of-object "GMountOperation")
- (c-name "g_mount_operation_get_choice")
- (return-type "int")
-)
-
-(define-method set_choice
- (of-object "GMountOperation")
- (c-name "g_mount_operation_set_choice")
- (return-type "none")
- (parameters
- '("int" "choice")
- )
-)
-
-(define-method reply
- (of-object "GMountOperation")
- (c-name "g_mount_operation_reply")
- (return-type "none")
- (parameters
- '("GMountOperationResult" "result")
- )
-)
-
-
-
-;; 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
- (c-name "g_native_volume_monitor_get_type")
- (return-type "GType")
-)
-
-
-
-;; From gnetworkaddress.h
-
-(define-function g_network_address_get_type
- (c-name "g_network_address_get_type")
- (return-type "GType")
-)
-
-(define-function g_network_address_new
- (c-name "g_network_address_new")
- (is-constructor-of "GNetworkAddress")
- (return-type "GSocketConnectable*")
- (parameters
- '("const-gchar*" "hostname")
- '("guint16" "port")
- )
-)
-
-(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*")
- (parameters
- '("const-gchar*" "host_and_port")
- '("guint16" "default_port")
- '("GError**" "error")
- )
-)
-
-(define-function g_network_address_parse_uri
- (c-name "g_network_address_parse_uri")
- (return-type "GSocketConnectable*")
- (parameters
- '("const-gchar*" "uri")
- '("guint16" "default_port")
- '("GError**" "error")
- )
-)
-
-(define-method get_hostname
- (of-object "GNetworkAddress")
- (c-name "g_network_address_get_hostname")
+(define-method get_hostname
+ (of-object "GNetworkAddress")
+ (c-name "g_network_address_get_hostname")
(return-type "const-gchar*")
)
-;; From gnetworking.h
-
-(define-function g_networking_init
- (c-name "g_networking_init")
- (return-type "none")
-)
-
-
-
;; From gnetworkmonitorbase.h
(define-function g_network_monitor_base_get_type
(return-type "GVariantIter*")
(parameters
'("const-gchar*" "key")
- )
-)
-
-(define-method list
- (of-object "GSettingsSchema")
- (c-name "g_settings_schema_list")
- (return-type "const-GQuark*")
- (parameters
- '("gint*" "n_items")
- )
-)
-
-(define-method get_string
- (of-object "GSettingsSchema")
- (c-name "g_settings_schema_get_string")
- (return-type "const-gchar*")
- (parameters
- '("const-gchar*" "key")
- )
-)
-
-(define-method init
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_init")
- (return-type "none")
- (parameters
- '("GSettingsSchema*" "schema")
- '("const-gchar*" "name")
- )
-)
-
-(define-method clear
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_clear")
- (return-type "none")
-)
-
-(define-method type_check
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_type_check")
- (return-type "gboolean")
- (parameters
- '("GVariant*" "value")
- )
-)
-
-(define-method range_fixup
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_range_fixup")
- (return-type "GVariant*")
- (parameters
- '("GVariant*" "value")
- )
-)
-
-(define-method get_translated_default
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_get_translated_default")
- (return-type "GVariant*")
-)
-
-(define-method to_enum
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_to_enum")
- (return-type "gint")
- (parameters
- '("GVariant*" "value")
- )
-)
-
-(define-method from_enum
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_from_enum")
- (return-type "GVariant*")
- (parameters
- '("gint" "value")
- )
-)
-
-(define-method to_flags
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_to_flags")
- (return-type "guint")
- (parameters
- '("GVariant*" "value")
- )
-)
-
-(define-method from_flags
- (of-object "GSettingsSchemaKey")
- (c-name "g_settings_schema_key_from_flags")
- (return-type "GVariant*")
- (parameters
- '("guint" "value")
- )
-)
-
-
-
-;; From gsimpleactiongroup.h
-
-(define-function g_simple_action_group_get_type
- (c-name "g_simple_action_group_get_type")
- (return-type "GType")
-)
-
-(define-function g_simple_action_group_new
- (c-name "g_simple_action_group_new")
- (is-constructor-of "GSimpleActionGroup")
- (return-type "GSimpleActionGroup*")
-)
-
-(define-method lookup
- (of-object "GSimpleActionGroup")
- (c-name "g_simple_action_group_lookup")
- (return-type "GAction*")
- (parameters
- '("const-gchar*" "action_name")
- )
-)
-
-(define-method insert
- (of-object "GSimpleActionGroup")
- (c-name "g_simple_action_group_insert")
- (return-type "none")
- (parameters
- '("GAction*" "action")
- )
-)
-
-(define-method remove
- (of-object "GSimpleActionGroup")
- (c-name "g_simple_action_group_remove")
- (return-type "none")
- (parameters
- '("const-gchar*" "action_name")
- )
-)
-
-(define-method add_entries
- (of-object "GSimpleActionGroup")
- (c-name "g_simple_action_group_add_entries")
- (return-type "none")
- (parameters
- '("const-GActionEntry*" "entries")
- '("gint" "n_entries")
- '("gpointer" "user_data")
- )
-)
-
-
-
-;; From gsimpleaction.h
-
-(define-function g_simple_action_get_type
- (c-name "g_simple_action_get_type")
- (return-type "GType")
-)
-
-(define-function g_simple_action_new
- (c-name "g_simple_action_new")
- (is-constructor-of "GSimpleAction")
- (return-type "GSimpleAction*")
- (parameters
- '("const-gchar*" "name")
- '("const-GVariantType*" "parameter_type")
- )
-)
-
-(define-function g_simple_action_new_stateful
- (c-name "g_simple_action_new_stateful")
- (return-type "GSimpleAction*")
- (parameters
- '("const-gchar*" "name")
- '("const-GVariantType*" "parameter_type")
- '("GVariant*" "state")
- )
-)
-
-(define-method set_enabled
- (of-object "GSimpleAction")
- (c-name "g_simple_action_set_enabled")
- (return-type "none")
- (parameters
- '("gboolean" "enabled")
- )
-)
-
-(define-method set_state
- (of-object "GSimpleAction")
- (c-name "g_simple_action_set_state")
- (return-type "none")
- (parameters
- '("GVariant*" "value")
- )
-)
-
-(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
-
-(define-function g_simple_async_result_get_type
- (c-name "g_simple_async_result_get_type")
- (return-type "GType")
-)
-
-(define-function g_simple_async_result_new
- (c-name "g_simple_async_result_new")
- (is-constructor-of "GSimpleAsyncResult")
- (return-type "GSimpleAsyncResult*")
- (parameters
- '("GObject*" "source_object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("gpointer" "source_tag")
- )
-)
-
-(define-function g_simple_async_result_new_error
- (c-name "g_simple_async_result_new_error")
- (return-type "GSimpleAsyncResult*")
- (parameters
- '("GObject*" "source_object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("GQuark" "domain")
- '("gint" "code")
- '("const-char*" "format")
- )
- (varargs #t)
-)
-
-(define-function g_simple_async_result_new_from_error
- (c-name "g_simple_async_result_new_from_error")
- (return-type "GSimpleAsyncResult*")
- (parameters
- '("GObject*" "source_object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("const-GError*" "error")
- )
-)
-
-(define-function g_simple_async_result_new_take_error
- (c-name "g_simple_async_result_new_take_error")
- (return-type "GSimpleAsyncResult*")
- (parameters
- '("GObject*" "source_object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("GError*" "error")
- )
-)
-
-(define-method set_op_res_gpointer
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_op_res_gpointer")
- (return-type "none")
- (parameters
- '("gpointer" "op_res")
- '("GDestroyNotify" "destroy_op_res")
- )
-)
-
-(define-method get_op_res_gpointer
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_get_op_res_gpointer")
- (return-type "gpointer")
-)
-
-(define-method set_op_res_gssize
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_op_res_gssize")
- (return-type "none")
- (parameters
- '("gssize" "op_res")
- )
-)
-
-(define-method get_op_res_gssize
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_get_op_res_gssize")
- (return-type "gssize")
-)
-
-(define-method set_op_res_gboolean
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_op_res_gboolean")
- (return-type "none")
- (parameters
- '("gboolean" "op_res")
- )
-)
-
-(define-method get_op_res_gboolean
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_get_op_res_gboolean")
- (return-type "gboolean")
-)
-
-(define-method set_check_cancellable
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_check_cancellable")
- (return-type "none")
- (parameters
- '("GCancellable*" "check_cancellable")
- )
-)
-
-(define-method get_source_tag
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_get_source_tag")
- (return-type "gpointer")
-)
-
-(define-method set_handle_cancellation
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_handle_cancellation")
- (return-type "none")
- (parameters
- '("gboolean" "handle_cancellation")
- )
-)
-
-(define-method complete
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_complete")
- (return-type "none")
-)
-
-(define-method complete_in_idle
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_complete_in_idle")
- (return-type "none")
-)
-
-(define-method run_in_thread
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_run_in_thread")
- (return-type "none")
- (parameters
- '("GSimpleAsyncThreadFunc" "func")
- '("int" "io_priority")
- '("GCancellable*" "cancellable")
- )
-)
-
-(define-method set_from_error
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_from_error")
- (return-type "none")
- (parameters
- '("const-GError*" "error")
- )
-)
-
-(define-method take_error
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_take_error")
- (return-type "none")
- (parameters
- '("GError*" "error")
- )
-)
-
-(define-method propagate_error
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_propagate_error")
- (return-type "gboolean")
- (parameters
- '("GError**" "dest")
- )
-)
-
-(define-method set_error
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_error")
- (return-type "none")
- (parameters
- '("GQuark" "domain")
- '("gint" "code")
- '("const-char*" "format")
- )
- (varargs #t)
-)
-
-(define-method set_error_va
- (of-object "GSimpleAsyncResult")
- (c-name "g_simple_async_result_set_error_va")
- (return-type "none")
- (parameters
- '("GQuark" "domain")
- '("gint" "code")
- '("const-char*" "format")
- '("va_list" "args")
- )
-)
-
-(define-function g_simple_async_result_is_valid
- (c-name "g_simple_async_result_is_valid")
- (return-type "gboolean")
- (parameters
- '("GAsyncResult*" "result")
- '("GObject*" "source")
- '("gpointer" "source_tag")
- )
-)
-
-(define-function g_simple_async_report_error_in_idle
- (c-name "g_simple_async_report_error_in_idle")
- (return-type "none")
- (parameters
- '("GObject*" "object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("GQuark" "domain")
- '("gint" "code")
- '("const-char*" "format")
- )
- (varargs #t)
-)
-
-(define-function g_simple_async_report_gerror_in_idle
- (c-name "g_simple_async_report_gerror_in_idle")
- (return-type "none")
- (parameters
- '("GObject*" "object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("const-GError*" "error")
- )
-)
-
-(define-function g_simple_async_report_take_gerror_in_idle
- (c-name "g_simple_async_report_take_gerror_in_idle")
- (return-type "none")
- (parameters
- '("GObject*" "object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- '("GError*" "error")
- )
-)
-
-
-
-;; 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
- (c-name "g_simple_permission_get_type")
- (return-type "GType")
-)
-
-(define-function g_simple_permission_new
- (c-name "g_simple_permission_new")
- (is-constructor-of "GSimplePermission")
- (return-type "GPermission*")
- (parameters
- '("gboolean" "allowed")
- )
-)
-
-
-
-;; From gsimpleproxyresolver.h
-
-(define-function g_simple_proxy_resolver_get_type
- (c-name "g_simple_proxy_resolver_get_type")
- (return-type "GType")
-)
-
-(define-function g_simple_proxy_resolver_new
- (c-name "g_simple_proxy_resolver_new")
- (is-constructor-of "GSimpleProxyResolver")
- (return-type "GProxyResolver*")
- (parameters
- '("const-gchar*" "default_proxy")
- '("gchar**" "ignore_hosts")
- )
-)
-
-(define-method set_default_proxy
- (of-object "GSimpleProxyResolver")
- (c-name "g_simple_proxy_resolver_set_default_proxy")
- (return-type "none")
- (parameters
- '("const-gchar*" "default_proxy")
- )
-)
-
-(define-method set_ignore_hosts
- (of-object "GSimpleProxyResolver")
- (c-name "g_simple_proxy_resolver_set_ignore_hosts")
- (return-type "none")
- (parameters
- '("gchar**" "ignore_hosts")
- )
-)
-
-(define-method set_uri_proxy
- (of-object "GSimpleProxyResolver")
- (c-name "g_simple_proxy_resolver_set_uri_proxy")
- (return-type "none")
- (parameters
- '("const-gchar*" "uri_scheme")
- '("const-gchar*" "proxy")
- )
-)
-
-
-
-;; From gsocketaddressenumerator.h
-
-(define-function g_socket_address_enumerator_get_type
- (c-name "g_socket_address_enumerator_get_type")
- (return-type "GType")
-)
-
-(define-method next
- (of-object "GSocketAddressEnumerator")
- (c-name "g_socket_address_enumerator_next")
- (return-type "GSocketAddress*")
- (parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
-)
-
-(define-method next_async
- (of-object "GSocketAddressEnumerator")
- (c-name "g_socket_address_enumerator_next_async")
- (return-type "none")
- (parameters
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-
-(define-method next_finish
- (of-object "GSocketAddressEnumerator")
- (c-name "g_socket_address_enumerator_next_finish")
- (return-type "GSocketAddress*")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
-)
-
-
-
-;; From gsocketaddress.h
-
-(define-function g_socket_address_get_type
- (c-name "g_socket_address_get_type")
- (return-type "GType")
-)
-
-(define-method get_family
- (of-object "GSocketAddress")
- (c-name "g_socket_address_get_family")
- (return-type "GSocketFamily")
-)
-
-(define-function g_socket_address_new_from_native
- (c-name "g_socket_address_new_from_native")
- (return-type "GSocketAddress*")
- (parameters
- '("gpointer" "native")
- '("gsize" "len")
- )
-)
-
-(define-method to_native
- (of-object "GSocketAddress")
- (c-name "g_socket_address_to_native")
- (return-type "gboolean")
- (parameters
- '("gpointer" "dest")
- '("gsize" "destlen")
- '("GError**" "error")
- )
-)
-
-(define-method get_native_size
- (of-object "GSocketAddress")
- (c-name "g_socket_address_get_native_size")
- (return-type "gssize")
-)
-
-
-
-;; From gsocketclient.h
-
-(define-function g_socket_client_get_type
- (c-name "g_socket_client_get_type")
- (return-type "GType")
-)
-
-(define-function g_socket_client_new
- (c-name "g_socket_client_new")
- (is-constructor-of "GSocketClient")
- (return-type "GSocketClient*")
-)
-
-(define-method get_family
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_family")
- (return-type "GSocketFamily")
-)
-
-(define-method set_family
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_family")
- (return-type "none")
- (parameters
- '("GSocketFamily" "family")
- )
-)
-
-(define-method get_socket_type
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_socket_type")
- (return-type "GSocketType")
-)
-
-(define-method set_socket_type
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_socket_type")
- (return-type "none")
- (parameters
- '("GSocketType" "type")
- )
-)
-
-(define-method get_protocol
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_protocol")
- (return-type "GSocketProtocol")
-)
-
-(define-method set_protocol
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_protocol")
- (return-type "none")
- (parameters
- '("GSocketProtocol" "protocol")
- )
-)
-
-(define-method get_local_address
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_local_address")
- (return-type "GSocketAddress*")
-)
-
-(define-method set_local_address
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_local_address")
- (return-type "none")
- (parameters
- '("GSocketAddress*" "address")
- )
-)
-
-(define-method get_timeout
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_timeout")
- (return-type "guint")
-)
-
-(define-method set_timeout
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_timeout")
- (return-type "none")
- (parameters
- '("guint" "timeout")
- )
-)
-
-(define-method get_enable_proxy
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_enable_proxy")
- (return-type "gboolean")
-)
-
-(define-method set_enable_proxy
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_enable_proxy")
- (return-type "none")
- (parameters
- '("gboolean" "enable")
- )
-)
-
-(define-method get_tls
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_tls")
- (return-type "gboolean")
-)
-
-(define-method set_tls
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_tls")
- (return-type "none")
- (parameters
- '("gboolean" "tls")
- )
-)
-
-(define-method get_tls_validation_flags
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_tls_validation_flags")
- (return-type "GTlsCertificateFlags")
-)
-
-(define-method set_tls_validation_flags
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_tls_validation_flags")
- (return-type "none")
- (parameters
- '("GTlsCertificateFlags" "flags")
- )
-)
-
-(define-method get_proxy_resolver
- (of-object "GSocketClient")
- (c-name "g_socket_client_get_proxy_resolver")
- (return-type "GProxyResolver*")
-)
-
-(define-method set_proxy_resolver
- (of-object "GSocketClient")
- (c-name "g_socket_client_set_proxy_resolver")
- (return-type "none")
- (parameters
- '("GProxyResolver*" "proxy_resolver")
- )
-)
-
-(define-method connect
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect")
- (return-type "GSocketConnection*")
- (parameters
- '("GSocketConnectable*" "connectable")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
-)
-
-(define-method connect_to_host
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_host")
- (return-type "GSocketConnection*")
- (parameters
- '("const-gchar*" "host_and_port")
- '("guint16" "default_port")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
-)
-
-(define-method connect_to_service
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_service")
- (return-type "GSocketConnection*")
- (parameters
- '("const-gchar*" "domain")
- '("const-gchar*" "service")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
-)
-
-(define-method connect_to_uri
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_uri")
- (return-type "GSocketConnection*")
- (parameters
- '("const-gchar*" "uri")
- '("guint16" "default_port")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
-)
-
-(define-method connect_async
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_async")
- (return-type "none")
- (parameters
- '("GSocketConnectable*" "connectable")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-
-(define-method connect_finish
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_finish")
- (return-type "GSocketConnection*")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
-)
-
-(define-method connect_to_host_async
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_host_async")
- (return-type "none")
- (parameters
- '("const-gchar*" "host_and_port")
- '("guint16" "default_port")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-
-(define-method connect_to_host_finish
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_host_finish")
- (return-type "GSocketConnection*")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
-)
-
-(define-method connect_to_service_async
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_service_async")
- (return-type "none")
- (parameters
- '("const-gchar*" "domain")
- '("const-gchar*" "service")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-
-(define-method connect_to_service_finish
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_service_finish")
- (return-type "GSocketConnection*")
- (parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
- )
-)
-
-(define-method connect_to_uri_async
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_uri_async")
- (return-type "none")
+ )
+)
+
+(define-method list
+ (of-object "GSettingsSchema")
+ (c-name "g_settings_schema_list")
+ (return-type "const-GQuark*")
(parameters
- '("const-gchar*" "uri")
- '("guint16" "default_port")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gint*" "n_items")
)
)
-(define-method connect_to_uri_finish
- (of-object "GSocketClient")
- (c-name "g_socket_client_connect_to_uri_finish")
- (return-type "GSocketConnection*")
+(define-method get_string
+ (of-object "GSettingsSchema")
+ (c-name "g_settings_schema_get_string")
+ (return-type "const-gchar*")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("const-gchar*" "key")
)
)
-(define-method add_application_proxy
- (of-object "GSocketClient")
- (c-name "g_socket_client_add_application_proxy")
+(define-method init
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_init")
(return-type "none")
(parameters
- '("const-gchar*" "protocol")
+ '("GSettingsSchema*" "schema")
+ '("const-gchar*" "name")
)
)
-
-
-;; From gsocketconnectable.h
-
-(define-function g_socket_connectable_get_type
- (c-name "g_socket_connectable_get_type")
- (return-type "GType")
+(define-method clear
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_clear")
+ (return-type "none")
)
-(define-method enumerate
- (of-object "GSocketConnectable")
- (c-name "g_socket_connectable_enumerate")
- (return-type "GSocketAddressEnumerator*")
+(define-method type_check
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_type_check")
+ (return-type "gboolean")
+ (parameters
+ '("GVariant*" "value")
+ )
)
-(define-method proxy_enumerate
- (of-object "GSocketConnectable")
- (c-name "g_socket_connectable_proxy_enumerate")
- (return-type "GSocketAddressEnumerator*")
+(define-method range_fixup
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_range_fixup")
+ (return-type "GVariant*")
+ (parameters
+ '("GVariant*" "value")
+ )
)
-(define-method to_string
- (of-object "GSocketConnectable")
- (c-name "g_socket_connectable_to_string")
- (return-type "gchar*")
+(define-method get_translated_default
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_get_translated_default")
+ (return-type "GVariant*")
)
-
-
-;; From gsocketconnection.h
-
-(define-function g_socket_connection_get_type
- (c-name "g_socket_connection_get_type")
- (return-type "GType")
+(define-method get_per_desktop_default
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_get_per_desktop_default")
+ (return-type "GVariant*")
)
-(define-method is_connected
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_is_connected")
- (return-type "gboolean")
+(define-method to_enum
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_to_enum")
+ (return-type "gint")
+ (parameters
+ '("GVariant*" "value")
+ )
)
-(define-method connect
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_connect")
- (return-type "gboolean")
+(define-method from_enum
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_from_enum")
+ (return-type "GVariant*")
(parameters
- '("GSocketAddress*" "address")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gint" "value")
)
)
-(define-method connect_async
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_connect_async")
- (return-type "none")
+(define-method to_flags
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_to_flags")
+ (return-type "guint")
(parameters
- '("GSocketAddress*" "address")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GVariant*" "value")
)
)
-(define-method connect_finish
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_connect_finish")
- (return-type "gboolean")
+(define-method from_flags
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_from_flags")
+ (return-type "GVariant*")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("guint" "value")
)
)
-(define-method get_socket
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_get_socket")
- (return-type "GSocket*")
+
+
+;; From gsimpleactiongroup.h
+
+(define-function g_simple_action_group_get_type
+ (c-name "g_simple_action_group_get_type")
+ (return-type "GType")
)
-(define-method get_local_address
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_get_local_address")
- (return-type "GSocketAddress*")
- (parameters
- '("GError**" "error")
- )
+(define-function g_simple_action_group_new
+ (c-name "g_simple_action_group_new")
+ (is-constructor-of "GSimpleActionGroup")
+ (return-type "GSimpleActionGroup*")
)
-(define-method get_remote_address
- (of-object "GSocketConnection")
- (c-name "g_socket_connection_get_remote_address")
- (return-type "GSocketAddress*")
+(define-method lookup
+ (of-object "GSimpleActionGroup")
+ (c-name "g_simple_action_group_lookup")
+ (return-type "GAction*")
(parameters
- '("GError**" "error")
+ '("const-gchar*" "action_name")
)
)
-(define-function g_socket_connection_factory_register_type
- (c-name "g_socket_connection_factory_register_type")
+(define-method insert
+ (of-object "GSimpleActionGroup")
+ (c-name "g_simple_action_group_insert")
(return-type "none")
(parameters
- '("GType" "g_type")
- '("GSocketFamily" "family")
- '("GSocketType" "type")
- '("gint" "protocol")
+ '("GAction*" "action")
)
)
-(define-function g_socket_connection_factory_lookup_type
- (c-name "g_socket_connection_factory_lookup_type")
- (return-type "GType")
+(define-method remove
+ (of-object "GSimpleActionGroup")
+ (c-name "g_simple_action_group_remove")
+ (return-type "none")
(parameters
- '("GSocketFamily" "family")
- '("GSocketType" "type")
- '("gint" "protocol_id")
+ '("const-gchar*" "action_name")
)
)
-(define-method connection_factory_create_connection
- (of-object "GSocket")
- (c-name "g_socket_connection_factory_create_connection")
- (return-type "GSocketConnection*")
+(define-method add_entries
+ (of-object "GSimpleActionGroup")
+ (c-name "g_simple_action_group_add_entries")
+ (return-type "none")
+ (parameters
+ '("const-GActionEntry*" "entries")
+ '("gint" "n_entries")
+ '("gpointer" "user_data")
+ )
)
-;; From gsocketcontrolmessage.h
+;; From gsimpleaction.h
-(define-function g_socket_control_message_get_type
- (c-name "g_socket_control_message_get_type")
+(define-function g_simple_action_get_type
+ (c-name "g_simple_action_get_type")
(return-type "GType")
)
-(define-method get_size
- (of-object "GSocketControlMessage")
- (c-name "g_socket_control_message_get_size")
- (return-type "gsize")
+(define-function g_simple_action_new
+ (c-name "g_simple_action_new")
+ (is-constructor-of "GSimpleAction")
+ (return-type "GSimpleAction*")
+ (parameters
+ '("const-gchar*" "name")
+ '("const-GVariantType*" "parameter_type")
+ )
)
-(define-method get_level
- (of-object "GSocketControlMessage")
- (c-name "g_socket_control_message_get_level")
- (return-type "int")
+(define-function g_simple_action_new_stateful
+ (c-name "g_simple_action_new_stateful")
+ (return-type "GSimpleAction*")
+ (parameters
+ '("const-gchar*" "name")
+ '("const-GVariantType*" "parameter_type")
+ '("GVariant*" "state")
+ )
)
-(define-method get_msg_type
- (of-object "GSocketControlMessage")
- (c-name "g_socket_control_message_get_msg_type")
- (return-type "int")
+(define-method set_enabled
+ (of-object "GSimpleAction")
+ (c-name "g_simple_action_set_enabled")
+ (return-type "none")
+ (parameters
+ '("gboolean" "enabled")
+ )
)
-(define-method serialize
- (of-object "GSocketControlMessage")
- (c-name "g_socket_control_message_serialize")
+(define-method set_state
+ (of-object "GSimpleAction")
+ (c-name "g_simple_action_set_state")
(return-type "none")
(parameters
- '("gpointer" "data")
+ '("GVariant*" "value")
)
)
-(define-function g_socket_control_message_deserialize
- (c-name "g_socket_control_message_deserialize")
- (return-type "GSocketControlMessage*")
- (parameters
- '("int" "level")
- '("int" "type")
- '("gsize" "size")
- '("gpointer" "data")
+(define-method set_state_hint
+ (of-object "GSimpleAction")
+ (c-name "g_simple_action_set_state_hint")
+ (return-type "none")
+ (parameters
+ '("GVariant*" "state_hint")
)
)
-;; From gsocket.h
+;; From gsimpleasyncresult.h
-(define-function g_socket_get_type
- (c-name "g_socket_get_type")
+(define-function g_simple_async_result_get_type
+ (c-name "g_simple_async_result_get_type")
(return-type "GType")
)
-(define-function g_socket_new
- (c-name "g_socket_new")
- (is-constructor-of "GSocket")
- (return-type "GSocket*")
+(define-function g_simple_async_result_new
+ (c-name "g_simple_async_result_new")
+ (is-constructor-of "GSimpleAsyncResult")
+ (return-type "GSimpleAsyncResult*")
(parameters
- '("GSocketFamily" "family")
- '("GSocketType" "type")
- '("GSocketProtocol" "protocol")
- '("GError**" "error")
+ '("GObject*" "source_object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("gpointer" "source_tag")
)
)
-(define-function g_socket_new_from_fd
- (c-name "g_socket_new_from_fd")
- (return-type "GSocket*")
+(define-function g_simple_async_result_new_error
+ (c-name "g_simple_async_result_new_error")
+ (return-type "GSimpleAsyncResult*")
(parameters
- '("gint" "fd")
- '("GError**" "error")
+ '("GObject*" "source_object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("GQuark" "domain")
+ '("gint" "code")
+ '("const-char*" "format")
)
+ (varargs #t)
)
-(define-method get_fd
- (of-object "GSocket")
- (c-name "g_socket_get_fd")
- (return-type "int")
-)
-
-(define-method get_family
- (of-object "GSocket")
- (c-name "g_socket_get_family")
- (return-type "GSocketFamily")
-)
-
-(define-method get_socket_type
- (of-object "GSocket")
- (c-name "g_socket_get_socket_type")
- (return-type "GSocketType")
-)
-
-(define-method get_protocol
- (of-object "GSocket")
- (c-name "g_socket_get_protocol")
- (return-type "GSocketProtocol")
-)
-
-(define-method get_local_address
- (of-object "GSocket")
- (c-name "g_socket_get_local_address")
- (return-type "GSocketAddress*")
+(define-function g_simple_async_result_new_from_error
+ (c-name "g_simple_async_result_new_from_error")
+ (return-type "GSimpleAsyncResult*")
(parameters
- '("GError**" "error")
+ '("GObject*" "source_object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("const-GError*" "error")
)
)
-(define-method get_remote_address
- (of-object "GSocket")
- (c-name "g_socket_get_remote_address")
- (return-type "GSocketAddress*")
+(define-function g_simple_async_result_new_take_error
+ (c-name "g_simple_async_result_new_take_error")
+ (return-type "GSimpleAsyncResult*")
(parameters
- '("GError**" "error")
+ '("GObject*" "source_object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("GError*" "error")
)
)
-(define-method set_blocking
- (of-object "GSocket")
- (c-name "g_socket_set_blocking")
+(define-method set_op_res_gpointer
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_op_res_gpointer")
(return-type "none")
(parameters
- '("gboolean" "blocking")
+ '("gpointer" "op_res")
+ '("GDestroyNotify" "destroy_op_res")
)
)
-(define-method get_blocking
- (of-object "GSocket")
- (c-name "g_socket_get_blocking")
- (return-type "gboolean")
+(define-method get_op_res_gpointer
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_get_op_res_gpointer")
+ (return-type "gpointer")
)
-(define-method set_keepalive
- (of-object "GSocket")
- (c-name "g_socket_set_keepalive")
+(define-method set_op_res_gssize
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_op_res_gssize")
(return-type "none")
(parameters
- '("gboolean" "keepalive")
+ '("gssize" "op_res")
)
)
-(define-method get_keepalive
- (of-object "GSocket")
- (c-name "g_socket_get_keepalive")
- (return-type "gboolean")
-)
-
-(define-method get_listen_backlog
- (of-object "GSocket")
- (c-name "g_socket_get_listen_backlog")
- (return-type "gint")
+(define-method get_op_res_gssize
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_get_op_res_gssize")
+ (return-type "gssize")
)
-(define-method set_listen_backlog
- (of-object "GSocket")
- (c-name "g_socket_set_listen_backlog")
+(define-method set_op_res_gboolean
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_op_res_gboolean")
(return-type "none")
(parameters
- '("gint" "backlog")
+ '("gboolean" "op_res")
)
)
-(define-method get_timeout
- (of-object "GSocket")
- (c-name "g_socket_get_timeout")
- (return-type "guint")
+(define-method get_op_res_gboolean
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_get_op_res_gboolean")
+ (return-type "gboolean")
)
-(define-method set_timeout
- (of-object "GSocket")
- (c-name "g_socket_set_timeout")
+(define-method set_check_cancellable
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_check_cancellable")
(return-type "none")
(parameters
- '("guint" "timeout")
+ '("GCancellable*" "check_cancellable")
)
)
-(define-method get_ttl
- (of-object "GSocket")
- (c-name "g_socket_get_ttl")
- (return-type "guint")
+(define-method get_source_tag
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_get_source_tag")
+ (return-type "gpointer")
)
-(define-method set_ttl
- (of-object "GSocket")
- (c-name "g_socket_set_ttl")
+(define-method set_handle_cancellation
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_handle_cancellation")
(return-type "none")
(parameters
- '("guint" "ttl")
+ '("gboolean" "handle_cancellation")
)
)
-(define-method get_broadcast
- (of-object "GSocket")
- (c-name "g_socket_get_broadcast")
- (return-type "gboolean")
-)
-
-(define-method set_broadcast
- (of-object "GSocket")
- (c-name "g_socket_set_broadcast")
+(define-method complete
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_complete")
(return-type "none")
- (parameters
- '("gboolean" "broadcast")
- )
)
-(define-method get_multicast_loopback
- (of-object "GSocket")
- (c-name "g_socket_get_multicast_loopback")
- (return-type "gboolean")
+(define-method complete_in_idle
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_complete_in_idle")
+ (return-type "none")
)
-(define-method set_multicast_loopback
- (of-object "GSocket")
- (c-name "g_socket_set_multicast_loopback")
+(define-method run_in_thread
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_run_in_thread")
(return-type "none")
(parameters
- '("gboolean" "loopback")
+ '("GSimpleAsyncThreadFunc" "func")
+ '("int" "io_priority")
+ '("GCancellable*" "cancellable")
)
)
-(define-method get_multicast_ttl
- (of-object "GSocket")
- (c-name "g_socket_get_multicast_ttl")
- (return-type "guint")
-)
-
-(define-method set_multicast_ttl
- (of-object "GSocket")
- (c-name "g_socket_set_multicast_ttl")
+(define-method set_from_error
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_from_error")
(return-type "none")
(parameters
- '("guint" "ttl")
+ '("const-GError*" "error")
)
)
-(define-method is_connected
- (of-object "GSocket")
- (c-name "g_socket_is_connected")
- (return-type "gboolean")
-)
-
-(define-method bind
- (of-object "GSocket")
- (c-name "g_socket_bind")
- (return-type "gboolean")
+(define-method take_error
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_take_error")
+ (return-type "none")
(parameters
- '("GSocketAddress*" "address")
- '("gboolean" "allow_reuse")
- '("GError**" "error")
+ '("GError*" "error")
)
)
-(define-method join_multicast_group
- (of-object "GSocket")
- (c-name "g_socket_join_multicast_group")
+(define-method propagate_error
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_propagate_error")
(return-type "gboolean")
(parameters
- '("GInetAddress*" "group")
- '("gboolean" "source_specific")
- '("const-gchar*" "iface")
- '("GError**" "error")
+ '("GError**" "dest")
)
)
-(define-method leave_multicast_group
- (of-object "GSocket")
- (c-name "g_socket_leave_multicast_group")
- (return-type "gboolean")
+(define-method set_error
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_error")
+ (return-type "none")
+ (parameters
+ '("GQuark" "domain")
+ '("gint" "code")
+ '("const-char*" "format")
+ )
+ (varargs #t)
+)
+
+(define-method set_error_va
+ (of-object "GSimpleAsyncResult")
+ (c-name "g_simple_async_result_set_error_va")
+ (return-type "none")
(parameters
- '("GInetAddress*" "group")
- '("gboolean" "source_specific")
- '("const-gchar*" "iface")
- '("GError**" "error")
+ '("GQuark" "domain")
+ '("gint" "code")
+ '("const-char*" "format")
+ '("va_list" "args")
)
)
-(define-method join_multicast_group_ssm
- (of-object "GSocket")
- (c-name "g_socket_join_multicast_group_ssm")
+(define-function g_simple_async_result_is_valid
+ (c-name "g_simple_async_result_is_valid")
(return-type "gboolean")
(parameters
- '("GInetAddress*" "group")
- '("GInetAddress*" "source_specific")
- '("const-gchar*" "iface")
- '("GError**" "error")
+ '("GAsyncResult*" "result")
+ '("GObject*" "source")
+ '("gpointer" "source_tag")
)
)
-(define-method leave_multicast_group_ssm
- (of-object "GSocket")
- (c-name "g_socket_leave_multicast_group_ssm")
- (return-type "gboolean")
+(define-function g_simple_async_report_error_in_idle
+ (c-name "g_simple_async_report_error_in_idle")
+ (return-type "none")
(parameters
- '("GInetAddress*" "group")
- '("GInetAddress*" "source_specific")
- '("const-gchar*" "iface")
- '("GError**" "error")
+ '("GObject*" "object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("GQuark" "domain")
+ '("gint" "code")
+ '("const-char*" "format")
)
+ (varargs #t)
)
-(define-method connect
- (of-object "GSocket")
- (c-name "g_socket_connect")
- (return-type "gboolean")
+(define-function g_simple_async_report_gerror_in_idle
+ (c-name "g_simple_async_report_gerror_in_idle")
+ (return-type "none")
(parameters
- '("GSocketAddress*" "address")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("GObject*" "object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("const-GError*" "error")
)
)
-(define-method check_connect_result
- (of-object "GSocket")
- (c-name "g_socket_check_connect_result")
- (return-type "gboolean")
+(define-function g_simple_async_report_take_gerror_in_idle
+ (c-name "g_simple_async_report_take_gerror_in_idle")
+ (return-type "none")
(parameters
- '("GError**" "error")
+ '("GObject*" "object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ '("GError*" "error")
)
)
-(define-method get_available_bytes
- (of-object "GSocket")
- (c-name "g_socket_get_available_bytes")
- (return-type "gssize")
+
+
+;; From gsimpleiostream.h
+
+(define-function g_simple_io_stream_get_type
+ (c-name "g_simple_io_stream_get_type")
+ (return-type "GType")
)
-(define-method condition_check
- (of-object "GSocket")
- (c-name "g_socket_condition_check")
- (return-type "GIOCondition")
+(define-function g_simple_io_stream_new
+ (c-name "g_simple_io_stream_new")
+ (is-constructor-of "GSimpleIoStream")
+ (return-type "GIOStream*")
(parameters
- '("GIOCondition" "condition")
+ '("GInputStream*" "input_stream")
+ '("GOutputStream*" "output_stream")
)
)
-(define-method condition_wait
- (of-object "GSocket")
- (c-name "g_socket_condition_wait")
- (return-type "gboolean")
- (parameters
- '("GIOCondition" "condition")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+
+
+;; From gsimplepermission.h
+
+(define-function g_simple_permission_get_type
+ (c-name "g_simple_permission_get_type")
+ (return-type "GType")
)
-(define-method condition_timed_wait
- (of-object "GSocket")
- (c-name "g_socket_condition_timed_wait")
- (return-type "gboolean")
+(define-function g_simple_permission_new
+ (c-name "g_simple_permission_new")
+ (is-constructor-of "GSimplePermission")
+ (return-type "GPermission*")
(parameters
- '("GIOCondition" "condition")
- '("gint64" "timeout")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gboolean" "allowed")
)
)
-(define-method accept
- (of-object "GSocket")
- (c-name "g_socket_accept")
- (return-type "GSocket*")
- (parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+
+
+;; From gsimpleproxyresolver.h
+
+(define-function g_simple_proxy_resolver_get_type
+ (c-name "g_simple_proxy_resolver_get_type")
+ (return-type "GType")
)
-(define-method listen
- (of-object "GSocket")
- (c-name "g_socket_listen")
- (return-type "gboolean")
+(define-function g_simple_proxy_resolver_new
+ (c-name "g_simple_proxy_resolver_new")
+ (is-constructor-of "GSimpleProxyResolver")
+ (return-type "GProxyResolver*")
(parameters
- '("GError**" "error")
+ '("const-gchar*" "default_proxy")
+ '("gchar**" "ignore_hosts")
)
)
-(define-method receive
- (of-object "GSocket")
- (c-name "g_socket_receive")
- (return-type "gssize")
+(define-method set_default_proxy
+ (of-object "GSimpleProxyResolver")
+ (c-name "g_simple_proxy_resolver_set_default_proxy")
+ (return-type "none")
(parameters
- '("gchar*" "buffer")
- '("gsize" "size")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("const-gchar*" "default_proxy")
)
)
-(define-method receive_from
- (of-object "GSocket")
- (c-name "g_socket_receive_from")
- (return-type "gssize")
+(define-method set_ignore_hosts
+ (of-object "GSimpleProxyResolver")
+ (c-name "g_simple_proxy_resolver_set_ignore_hosts")
+ (return-type "none")
(parameters
- '("GSocketAddress**" "address")
- '("gchar*" "buffer")
- '("gsize" "size")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gchar**" "ignore_hosts")
)
)
-(define-method send
- (of-object "GSocket")
- (c-name "g_socket_send")
- (return-type "gssize")
+(define-method set_uri_proxy
+ (of-object "GSimpleProxyResolver")
+ (c-name "g_simple_proxy_resolver_set_uri_proxy")
+ (return-type "none")
(parameters
- '("const-gchar*" "buffer")
- '("gsize" "size")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("const-gchar*" "uri_scheme")
+ '("const-gchar*" "proxy")
)
)
-(define-method send_to
- (of-object "GSocket")
- (c-name "g_socket_send_to")
- (return-type "gssize")
- (parameters
- '("GSocketAddress*" "address")
- '("const-gchar*" "buffer")
- '("gsize" "size")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+
+
+;; From gsocketaddressenumerator.h
+
+(define-function g_socket_address_enumerator_get_type
+ (c-name "g_socket_address_enumerator_get_type")
+ (return-type "GType")
)
-(define-method receive_message
- (of-object "GSocket")
- (c-name "g_socket_receive_message")
- (return-type "gssize")
+(define-method next
+ (of-object "GSocketAddressEnumerator")
+ (c-name "g_socket_address_enumerator_next")
+ (return-type "GSocketAddress*")
(parameters
- '("GSocketAddress**" "address")
- '("GInputVector*" "vectors")
- '("gint" "num_vectors")
- '("GSocketControlMessage***" "messages")
- '("gint*" "num_messages")
- '("gint*" "flags")
'("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method send_message
- (of-object "GSocket")
- (c-name "g_socket_send_message")
- (return-type "gssize")
+(define-method next_async
+ (of-object "GSocketAddressEnumerator")
+ (c-name "g_socket_address_enumerator_next_async")
+ (return-type "none")
(parameters
- '("GSocketAddress*" "address")
- '("GOutputVector*" "vectors")
- '("gint" "num_vectors")
- '("GSocketControlMessage**" "messages")
- '("gint" "num_messages")
- '("gint" "flags")
'("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method receive_messages
- (of-object "GSocket")
- (c-name "g_socket_receive_messages")
- (return-type "gint")
+(define-method next_finish
+ (of-object "GSocketAddressEnumerator")
+ (c-name "g_socket_address_enumerator_next_finish")
+ (return-type "GSocketAddress*")
(parameters
- '("GInputMessage*" "messages")
- '("guint" "num_messages")
- '("gint" "flags")
- '("GCancellable*" "cancellable")
+ '("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method send_messages
- (of-object "GSocket")
- (c-name "g_socket_send_messages")
- (return-type "gint")
+
+
+;; From gsocketaddress.h
+
+(define-function g_socket_address_get_type
+ (c-name "g_socket_address_get_type")
+ (return-type "GType")
+)
+
+(define-method get_family
+ (of-object "GSocketAddress")
+ (c-name "g_socket_address_get_family")
+ (return-type "GSocketFamily")
+)
+
+(define-function g_socket_address_new_from_native
+ (c-name "g_socket_address_new_from_native")
+ (return-type "GSocketAddress*")
(parameters
- '("GOutputMessage*" "messages")
- '("guint" "num_messages")
- '("gint" "flags")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gpointer" "native")
+ '("gsize" "len")
)
)
-(define-method close
- (of-object "GSocket")
- (c-name "g_socket_close")
+(define-method to_native
+ (of-object "GSocketAddress")
+ (c-name "g_socket_address_to_native")
(return-type "gboolean")
(parameters
+ '("gpointer" "dest")
+ '("gsize" "destlen")
'("GError**" "error")
)
)
-(define-method shutdown
- (of-object "GSocket")
- (c-name "g_socket_shutdown")
- (return-type "gboolean")
+(define-method get_native_size
+ (of-object "GSocketAddress")
+ (c-name "g_socket_address_get_native_size")
+ (return-type "gssize")
+)
+
+
+
+;; From gsocketclient.h
+
+(define-function g_socket_client_get_type
+ (c-name "g_socket_client_get_type")
+ (return-type "GType")
+)
+
+(define-function g_socket_client_new
+ (c-name "g_socket_client_new")
+ (is-constructor-of "GSocketClient")
+ (return-type "GSocketClient*")
+)
+
+(define-method get_family
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_family")
+ (return-type "GSocketFamily")
+)
+
+(define-method set_family
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_family")
+ (return-type "none")
(parameters
- '("gboolean" "shutdown_read")
- '("gboolean" "shutdown_write")
- '("GError**" "error")
+ '("GSocketFamily" "family")
)
)
-(define-method is_closed
- (of-object "GSocket")
- (c-name "g_socket_is_closed")
- (return-type "gboolean")
+(define-method get_socket_type
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_socket_type")
+ (return-type "GSocketType")
)
-(define-method create_source
- (of-object "GSocket")
- (c-name "g_socket_create_source")
- (return-type "GSource*")
+(define-method set_socket_type
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_socket_type")
+ (return-type "none")
(parameters
- '("GIOCondition" "condition")
- '("GCancellable*" "cancellable")
+ '("GSocketType" "type")
)
)
-(define-method speaks_ipv4
- (of-object "GSocket")
- (c-name "g_socket_speaks_ipv4")
- (return-type "gboolean")
+(define-method get_protocol
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_protocol")
+ (return-type "GSocketProtocol")
)
-(define-method get_credentials
- (of-object "GSocket")
- (c-name "g_socket_get_credentials")
- (return-type "GCredentials*")
+(define-method set_protocol
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_protocol")
+ (return-type "none")
(parameters
- '("GError**" "error")
+ '("GSocketProtocol" "protocol")
)
)
-(define-method receive_with_blocking
- (of-object "GSocket")
- (c-name "g_socket_receive_with_blocking")
- (return-type "gssize")
+(define-method get_local_address
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_local_address")
+ (return-type "GSocketAddress*")
+)
+
+(define-method set_local_address
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_local_address")
+ (return-type "none")
(parameters
- '("gchar*" "buffer")
- '("gsize" "size")
- '("gboolean" "blocking")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("GSocketAddress*" "address")
)
)
-(define-method send_with_blocking
- (of-object "GSocket")
- (c-name "g_socket_send_with_blocking")
- (return-type "gssize")
+(define-method get_timeout
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_timeout")
+ (return-type "guint")
+)
+
+(define-method set_timeout
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_timeout")
+ (return-type "none")
(parameters
- '("const-gchar*" "buffer")
- '("gsize" "size")
- '("gboolean" "blocking")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("guint" "timeout")
)
)
-(define-method get_option
- (of-object "GSocket")
- (c-name "g_socket_get_option")
+(define-method get_enable_proxy
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_enable_proxy")
(return-type "gboolean")
+)
+
+(define-method set_enable_proxy
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_enable_proxy")
+ (return-type "none")
(parameters
- '("gint" "level")
- '("gint" "optname")
- '("gint*" "value")
- '("GError**" "error")
+ '("gboolean" "enable")
)
)
-(define-method set_option
- (of-object "GSocket")
- (c-name "g_socket_set_option")
+(define-method get_tls
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_tls")
(return-type "gboolean")
+)
+
+(define-method set_tls
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_tls")
+ (return-type "none")
(parameters
- '("gint" "level")
- '("gint" "optname")
- '("gint" "value")
- '("GError**" "error")
+ '("gboolean" "tls")
)
)
+(define-method get_tls_validation_flags
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_tls_validation_flags")
+ (return-type "GTlsCertificateFlags")
+)
-
-;; From gsocketinputstream.h
-
-
-
-;; From gsocketlistener.h
-
-(define-function g_socket_listener_get_type
- (c-name "g_socket_listener_get_type")
- (return-type "GType")
+(define-method set_tls_validation_flags
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_tls_validation_flags")
+ (return-type "none")
+ (parameters
+ '("GTlsCertificateFlags" "flags")
+ )
)
-(define-function g_socket_listener_new
- (c-name "g_socket_listener_new")
- (is-constructor-of "GSocketListener")
- (return-type "GSocketListener*")
+(define-method get_proxy_resolver
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_get_proxy_resolver")
+ (return-type "GProxyResolver*")
)
-(define-method set_backlog
- (of-object "GSocketListener")
- (c-name "g_socket_listener_set_backlog")
+(define-method set_proxy_resolver
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_set_proxy_resolver")
(return-type "none")
(parameters
- '("int" "listen_backlog")
+ '("GProxyResolver*" "proxy_resolver")
)
)
-(define-method add_socket
- (of-object "GSocketListener")
- (c-name "g_socket_listener_add_socket")
- (return-type "gboolean")
+(define-method connect
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect")
+ (return-type "GSocketConnection*")
(parameters
- '("GSocket*" "socket")
- '("GObject*" "source_object")
+ '("GSocketConnectable*" "connectable")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method add_address
- (of-object "GSocketListener")
- (c-name "g_socket_listener_add_address")
- (return-type "gboolean")
+(define-method connect_to_host
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_host")
+ (return-type "GSocketConnection*")
(parameters
- '("GSocketAddress*" "address")
- '("GSocketType" "type")
- '("GSocketProtocol" "protocol")
- '("GObject*" "source_object")
- '("GSocketAddress**" "effective_address")
+ '("const-gchar*" "host_and_port")
+ '("guint16" "default_port")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
+)
+
+(define-method connect_to_service
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_service")
+ (return-type "GSocketConnection*")
+ (parameters
+ '("const-gchar*" "domain")
+ '("const-gchar*" "service")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method add_inet_port
- (of-object "GSocketListener")
- (c-name "g_socket_listener_add_inet_port")
- (return-type "gboolean")
+(define-method connect_to_uri
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_uri")
+ (return-type "GSocketConnection*")
(parameters
- '("guint16" "port")
- '("GObject*" "source_object")
+ '("const-gchar*" "uri")
+ '("guint16" "default_port")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method add_any_inet_port
- (of-object "GSocketListener")
- (c-name "g_socket_listener_add_any_inet_port")
- (return-type "guint16")
+(define-method connect_async
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_async")
+ (return-type "none")
(parameters
- '("GObject*" "source_object")
- '("GError**" "error")
+ '("GSocketConnectable*" "connectable")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method accept_socket
- (of-object "GSocketListener")
- (c-name "g_socket_listener_accept_socket")
- (return-type "GSocket*")
+(define-method connect_finish
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_finish")
+ (return-type "GSocketConnection*")
(parameters
- '("GObject**" "source_object")
- '("GCancellable*" "cancellable")
+ '("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method accept_socket_async
- (of-object "GSocketListener")
- (c-name "g_socket_listener_accept_socket_async")
+(define-method connect_to_host_async
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_host_async")
(return-type "none")
(parameters
+ '("const-gchar*" "host_and_port")
+ '("guint16" "default_port")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method accept_socket_finish
- (of-object "GSocketListener")
- (c-name "g_socket_listener_accept_socket_finish")
- (return-type "GSocket*")
+(define-method connect_to_host_finish
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_host_finish")
+ (return-type "GSocketConnection*")
(parameters
'("GAsyncResult*" "result")
- '("GObject**" "source_object")
'("GError**" "error")
)
)
-(define-method accept
- (of-object "GSocketListener")
- (c-name "g_socket_listener_accept")
- (return-type "GSocketConnection*")
+(define-method connect_to_service_async
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_service_async")
+ (return-type "none")
(parameters
- '("GObject**" "source_object")
+ '("const-gchar*" "domain")
+ '("const-gchar*" "service")
'("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
+)
+
+(define-method connect_to_service_finish
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_service_finish")
+ (return-type "GSocketConnection*")
+ (parameters
+ '("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method accept_async
- (of-object "GSocketListener")
- (c-name "g_socket_listener_accept_async")
+(define-method connect_to_uri_async
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_uri_async")
(return-type "none")
(parameters
+ '("const-gchar*" "uri")
+ '("guint16" "default_port")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method accept_finish
- (of-object "GSocketListener")
- (c-name "g_socket_listener_accept_finish")
+(define-method connect_to_uri_finish
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_connect_to_uri_finish")
(return-type "GSocketConnection*")
(parameters
'("GAsyncResult*" "result")
- '("GObject**" "source_object")
'("GError**" "error")
)
)
-(define-method close
- (of-object "GSocketListener")
- (c-name "g_socket_listener_close")
+(define-method add_application_proxy
+ (of-object "GSocketClient")
+ (c-name "g_socket_client_add_application_proxy")
(return-type "none")
+ (parameters
+ '("const-gchar*" "protocol")
+ )
)
-;; From gsocketoutputstream.h
-
-
-
-;; From gsocketservice.h
+;; From gsocketconnectable.h
-(define-function g_socket_service_get_type
- (c-name "g_socket_service_get_type")
+(define-function g_socket_connectable_get_type
+ (c-name "g_socket_connectable_get_type")
(return-type "GType")
)
-(define-function g_socket_service_new
- (c-name "g_socket_service_new")
- (is-constructor-of "GSocketService")
- (return-type "GSocketService*")
-)
-
-(define-method start
- (of-object "GSocketService")
- (c-name "g_socket_service_start")
- (return-type "none")
+(define-method enumerate
+ (of-object "GSocketConnectable")
+ (c-name "g_socket_connectable_enumerate")
+ (return-type "GSocketAddressEnumerator*")
)
-(define-method stop
- (of-object "GSocketService")
- (c-name "g_socket_service_stop")
- (return-type "none")
+(define-method proxy_enumerate
+ (of-object "GSocketConnectable")
+ (c-name "g_socket_connectable_proxy_enumerate")
+ (return-type "GSocketAddressEnumerator*")
)
-(define-method is_active
- (of-object "GSocketService")
- (c-name "g_socket_service_is_active")
- (return-type "gboolean")
+(define-method to_string
+ (of-object "GSocketConnectable")
+ (c-name "g_socket_connectable_to_string")
+ (return-type "gchar*")
)
-;; From gsocks4aproxy.h
-
+;; From gsocketconnection.h
+(define-function g_socket_connection_get_type
+ (c-name "g_socket_connection_get_type")
+ (return-type "GType")
+)
-;; From gsocks4proxy.h
+(define-method is_connected
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_is_connected")
+ (return-type "gboolean")
+)
+(define-method connect
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_connect")
+ (return-type "gboolean")
+ (parameters
+ '("GSocketAddress*" "address")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
+)
+(define-method connect_async
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_connect_async")
+ (return-type "none")
+ (parameters
+ '("GSocketAddress*" "address")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
+)
-;; From gsocks5proxy.h
+(define-method connect_finish
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_connect_finish")
+ (return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
+)
+(define-method get_socket
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_get_socket")
+ (return-type "GSocket*")
+)
+(define-method get_local_address
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_get_local_address")
+ (return-type "GSocketAddress*")
+ (parameters
+ '("GError**" "error")
+ )
+)
-;; From gsrvtarget.h
+(define-method get_remote_address
+ (of-object "GSocketConnection")
+ (c-name "g_socket_connection_get_remote_address")
+ (return-type "GSocketAddress*")
+ (parameters
+ '("GError**" "error")
+ )
+)
-(define-function g_srv_target_get_type
- (c-name "g_srv_target_get_type")
- (return-type "GType")
+(define-function g_socket_connection_factory_register_type
+ (c-name "g_socket_connection_factory_register_type")
+ (return-type "none")
+ (parameters
+ '("GType" "g_type")
+ '("GSocketFamily" "family")
+ '("GSocketType" "type")
+ '("gint" "protocol")
+ )
)
-(define-function g_srv_target_new
- (c-name "g_srv_target_new")
- (is-constructor-of "GSrvTarget")
- (return-type "GSrvTarget*")
+(define-function g_socket_connection_factory_lookup_type
+ (c-name "g_socket_connection_factory_lookup_type")
+ (return-type "GType")
(parameters
- '("const-gchar*" "hostname")
- '("guint16" "port")
- '("guint16" "priority")
- '("guint16" "weight")
+ '("GSocketFamily" "family")
+ '("GSocketType" "type")
+ '("gint" "protocol_id")
)
)
-(define-method copy
- (of-object "GSrvTarget")
- (c-name "g_srv_target_copy")
- (return-type "GSrvTarget*")
+(define-method connection_factory_create_connection
+ (of-object "GSocket")
+ (c-name "g_socket_connection_factory_create_connection")
+ (return-type "GSocketConnection*")
)
-(define-method free
- (of-object "GSrvTarget")
- (c-name "g_srv_target_free")
- (return-type "none")
+
+
+;; From gsocketcontrolmessage.h
+
+(define-function g_socket_control_message_get_type
+ (c-name "g_socket_control_message_get_type")
+ (return-type "GType")
)
-(define-method get_hostname
- (of-object "GSrvTarget")
- (c-name "g_srv_target_get_hostname")
- (return-type "const-gchar*")
+(define-method get_size
+ (of-object "GSocketControlMessage")
+ (c-name "g_socket_control_message_get_size")
+ (return-type "gsize")
)
-(define-method get_port
- (of-object "GSrvTarget")
- (c-name "g_srv_target_get_port")
- (return-type "guint16")
+(define-method get_level
+ (of-object "GSocketControlMessage")
+ (c-name "g_socket_control_message_get_level")
+ (return-type "int")
)
-(define-method get_priority
- (of-object "GSrvTarget")
- (c-name "g_srv_target_get_priority")
- (return-type "guint16")
+(define-method get_msg_type
+ (of-object "GSocketControlMessage")
+ (c-name "g_socket_control_message_get_msg_type")
+ (return-type "int")
)
-(define-method get_weight
- (of-object "GSrvTarget")
- (c-name "g_srv_target_get_weight")
- (return-type "guint16")
+(define-method serialize
+ (of-object "GSocketControlMessage")
+ (c-name "g_socket_control_message_serialize")
+ (return-type "none")
+ (parameters
+ '("gpointer" "data")
+ )
)
-(define-function g_srv_target_list_sort
- (c-name "g_srv_target_list_sort")
- (return-type "GList*")
+(define-function g_socket_control_message_deserialize
+ (c-name "g_socket_control_message_deserialize")
+ (return-type "GSocketControlMessage*")
(parameters
- '("GList*" "targets")
+ '("int" "level")
+ '("int" "type")
+ '("gsize" "size")
+ '("gpointer" "data")
)
)
-;; From gsubprocess.h
+;; From gsocket.h
-(define-function g_subprocess_get_type
- (c-name "g_subprocess_get_type")
+(define-function g_socket_get_type
+ (c-name "g_socket_get_type")
(return-type "GType")
)
-(define-function g_subprocess_new
- (c-name "g_subprocess_new")
- (is-constructor-of "GSubprocess")
- (return-type "GSubprocess*")
+(define-function g_socket_new
+ (c-name "g_socket_new")
+ (is-constructor-of "GSocket")
+ (return-type "GSocket*")
(parameters
- '("GSubprocessFlags" "flags")
+ '("GSocketFamily" "family")
+ '("GSocketType" "type")
+ '("GSocketProtocol" "protocol")
'("GError**" "error")
- '("const-gchar*" "argv0")
)
- (varargs #t)
)
-(define-function g_subprocess_newv
- (c-name "g_subprocess_newv")
- (return-type "GSubprocess*")
+(define-function g_socket_new_from_fd
+ (c-name "g_socket_new_from_fd")
+ (return-type "GSocket*")
(parameters
- '("const-gchar*-const*" "argv")
- '("GSubprocessFlags" "flags")
+ '("gint" "fd")
'("GError**" "error")
)
)
-(define-method get_stdin_pipe
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_stdin_pipe")
- (return-type "GOutputStream*")
+(define-method get_fd
+ (of-object "GSocket")
+ (c-name "g_socket_get_fd")
+ (return-type "int")
)
-(define-method get_stdout_pipe
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_stdout_pipe")
- (return-type "GInputStream*")
+(define-method get_family
+ (of-object "GSocket")
+ (c-name "g_socket_get_family")
+ (return-type "GSocketFamily")
)
-(define-method get_stderr_pipe
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_stderr_pipe")
- (return-type "GInputStream*")
+(define-method get_socket_type
+ (of-object "GSocket")
+ (c-name "g_socket_get_socket_type")
+ (return-type "GSocketType")
)
-(define-method get_identifier
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_identifier")
- (return-type "const-gchar*")
+(define-method get_protocol
+ (of-object "GSocket")
+ (c-name "g_socket_get_protocol")
+ (return-type "GSocketProtocol")
)
-(define-method send_signal
- (of-object "GSubprocess")
- (c-name "g_subprocess_send_signal")
- (return-type "none")
+(define-method get_local_address
+ (of-object "GSocket")
+ (c-name "g_socket_get_local_address")
+ (return-type "GSocketAddress*")
(parameters
- '("gint" "signal_num")
+ '("GError**" "error")
)
)
-(define-method force_exit
- (of-object "GSubprocess")
- (c-name "g_subprocess_force_exit")
+(define-method get_remote_address
+ (of-object "GSocket")
+ (c-name "g_socket_get_remote_address")
+ (return-type "GSocketAddress*")
+ (parameters
+ '("GError**" "error")
+ )
+)
+
+(define-method set_blocking
+ (of-object "GSocket")
+ (c-name "g_socket_set_blocking")
(return-type "none")
+ (parameters
+ '("gboolean" "blocking")
+ )
)
-(define-method wait
- (of-object "GSubprocess")
- (c-name "g_subprocess_wait")
+(define-method get_blocking
+ (of-object "GSocket")
+ (c-name "g_socket_get_blocking")
(return-type "gboolean")
+)
+
+(define-method set_keepalive
+ (of-object "GSocket")
+ (c-name "g_socket_set_keepalive")
+ (return-type "none")
(parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gboolean" "keepalive")
)
)
-(define-method wait_async
- (of-object "GSubprocess")
- (c-name "g_subprocess_wait_async")
+(define-method get_keepalive
+ (of-object "GSocket")
+ (c-name "g_socket_get_keepalive")
+ (return-type "gboolean")
+)
+
+(define-method get_listen_backlog
+ (of-object "GSocket")
+ (c-name "g_socket_get_listen_backlog")
+ (return-type "gint")
+)
+
+(define-method set_listen_backlog
+ (of-object "GSocket")
+ (c-name "g_socket_set_listen_backlog")
(return-type "none")
(parameters
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gint" "backlog")
)
)
-(define-method wait_finish
- (of-object "GSubprocess")
- (c-name "g_subprocess_wait_finish")
- (return-type "gboolean")
+(define-method get_timeout
+ (of-object "GSocket")
+ (c-name "g_socket_get_timeout")
+ (return-type "guint")
+)
+
+(define-method set_timeout
+ (of-object "GSocket")
+ (c-name "g_socket_set_timeout")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("guint" "timeout")
)
)
-(define-method wait_check
- (of-object "GSubprocess")
- (c-name "g_subprocess_wait_check")
- (return-type "gboolean")
+(define-method get_ttl
+ (of-object "GSocket")
+ (c-name "g_socket_get_ttl")
+ (return-type "guint")
+)
+
+(define-method set_ttl
+ (of-object "GSocket")
+ (c-name "g_socket_set_ttl")
+ (return-type "none")
(parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("guint" "ttl")
)
)
-(define-method wait_check_async
- (of-object "GSubprocess")
- (c-name "g_subprocess_wait_check_async")
+(define-method get_broadcast
+ (of-object "GSocket")
+ (c-name "g_socket_get_broadcast")
+ (return-type "gboolean")
+)
+
+(define-method set_broadcast
+ (of-object "GSocket")
+ (c-name "g_socket_set_broadcast")
(return-type "none")
(parameters
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "broadcast")
)
)
-(define-method wait_check_finish
- (of-object "GSubprocess")
- (c-name "g_subprocess_wait_check_finish")
+(define-method get_multicast_loopback
+ (of-object "GSocket")
+ (c-name "g_socket_get_multicast_loopback")
(return-type "gboolean")
+)
+
+(define-method set_multicast_loopback
+ (of-object "GSocket")
+ (c-name "g_socket_set_multicast_loopback")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gboolean" "loopback")
)
)
-(define-method get_status
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_status")
- (return-type "gint")
+(define-method get_multicast_ttl
+ (of-object "GSocket")
+ (c-name "g_socket_get_multicast_ttl")
+ (return-type "guint")
)
-(define-method get_successful
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_successful")
- (return-type "gboolean")
+(define-method set_multicast_ttl
+ (of-object "GSocket")
+ (c-name "g_socket_set_multicast_ttl")
+ (return-type "none")
+ (parameters
+ '("guint" "ttl")
+ )
)
-(define-method get_if_exited
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_if_exited")
+(define-method is_connected
+ (of-object "GSocket")
+ (c-name "g_socket_is_connected")
(return-type "gboolean")
)
-(define-method get_exit_status
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_exit_status")
- (return-type "gint")
-)
-
-(define-method get_if_signaled
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_if_signaled")
+(define-method bind
+ (of-object "GSocket")
+ (c-name "g_socket_bind")
(return-type "gboolean")
+ (parameters
+ '("GSocketAddress*" "address")
+ '("gboolean" "allow_reuse")
+ '("GError**" "error")
+ )
)
-(define-method get_term_sig
- (of-object "GSubprocess")
- (c-name "g_subprocess_get_term_sig")
- (return-type "gint")
-)
-
-(define-method communicate
- (of-object "GSubprocess")
- (c-name "g_subprocess_communicate")
+(define-method join_multicast_group
+ (of-object "GSocket")
+ (c-name "g_socket_join_multicast_group")
(return-type "gboolean")
(parameters
- '("GBytes*" "stdin_buf")
- '("GCancellable*" "cancellable")
- '("GBytes**" "stdout_buf")
- '("GBytes**" "stderr_buf")
+ '("GInetAddress*" "group")
+ '("gboolean" "source_specific")
+ '("const-gchar*" "iface")
'("GError**" "error")
)
)
-(define-method communicate_async
- (of-object "GSubprocess")
- (c-name "g_subprocess_communicate_async")
- (return-type "none")
+(define-method leave_multicast_group
+ (of-object "GSocket")
+ (c-name "g_socket_leave_multicast_group")
+ (return-type "gboolean")
(parameters
- '("GBytes*" "stdin_buf")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GInetAddress*" "group")
+ '("gboolean" "source_specific")
+ '("const-gchar*" "iface")
+ '("GError**" "error")
)
)
-(define-method communicate_finish
- (of-object "GSubprocess")
- (c-name "g_subprocess_communicate_finish")
+(define-method join_multicast_group_ssm
+ (of-object "GSocket")
+ (c-name "g_socket_join_multicast_group_ssm")
(return-type "gboolean")
(parameters
- '("GAsyncResult*" "result")
- '("GBytes**" "stdout_buf")
- '("GBytes**" "stderr_buf")
+ '("GInetAddress*" "group")
+ '("GInetAddress*" "source_specific")
+ '("const-gchar*" "iface")
'("GError**" "error")
)
)
-(define-method communicate_utf8
- (of-object "GSubprocess")
- (c-name "g_subprocess_communicate_utf8")
+(define-method leave_multicast_group_ssm
+ (of-object "GSocket")
+ (c-name "g_socket_leave_multicast_group_ssm")
(return-type "gboolean")
(parameters
- '("const-char*" "stdin_buf")
- '("GCancellable*" "cancellable")
- '("char**" "stdout_buf")
- '("char**" "stderr_buf")
+ '("GInetAddress*" "group")
+ '("GInetAddress*" "source_specific")
+ '("const-gchar*" "iface")
'("GError**" "error")
)
)
-(define-method communicate_utf8_async
- (of-object "GSubprocess")
- (c-name "g_subprocess_communicate_utf8_async")
- (return-type "none")
+(define-method connect
+ (of-object "GSocket")
+ (c-name "g_socket_connect")
+ (return-type "gboolean")
(parameters
- '("const-char*" "stdin_buf")
+ '("GSocketAddress*" "address")
'("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GError**" "error")
)
)
-(define-method communicate_utf8_finish
- (of-object "GSubprocess")
- (c-name "g_subprocess_communicate_utf8_finish")
+(define-method check_connect_result
+ (of-object "GSocket")
+ (c-name "g_socket_check_connect_result")
(return-type "gboolean")
(parameters
- '("GAsyncResult*" "result")
- '("char**" "stdout_buf")
- '("char**" "stderr_buf")
'("GError**" "error")
)
)
-
-
-;; From gsubprocesslauncher.h
-
-(define-function g_subprocess_launcher_get_type
- (c-name "g_subprocess_launcher_get_type")
- (return-type "GType")
+(define-method get_available_bytes
+ (of-object "GSocket")
+ (c-name "g_socket_get_available_bytes")
+ (return-type "gssize")
)
-(define-function g_subprocess_launcher_new
- (c-name "g_subprocess_launcher_new")
- (is-constructor-of "GSubprocessLauncher")
- (return-type "GSubprocessLauncher*")
+(define-method condition_check
+ (of-object "GSocket")
+ (c-name "g_socket_condition_check")
+ (return-type "GIOCondition")
(parameters
- '("GSubprocessFlags" "flags")
+ '("GIOCondition" "condition")
)
)
-(define-method spawn
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_spawn")
- (return-type "GSubprocess*")
+(define-method condition_wait
+ (of-object "GSocket")
+ (c-name "g_socket_condition_wait")
+ (return-type "gboolean")
(parameters
+ '("GIOCondition" "condition")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
- '("const-gchar*" "argv0")
)
- (varargs #t)
)
-(define-method spawnv
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_spawnv")
- (return-type "GSubprocess*")
+(define-method condition_timed_wait
+ (of-object "GSocket")
+ (c-name "g_socket_condition_timed_wait")
+ (return-type "gboolean")
(parameters
- '("const-gchar*-const*" "argv")
+ '("GIOCondition" "condition")
+ '("gint64" "timeout")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method set_environ
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_environ")
- (return-type "none")
- (parameters
- '("gchar**" "env")
- )
-)
-
-(define-method setenv
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_setenv")
- (return-type "none")
- (parameters
- '("const-gchar*" "variable")
- '("const-gchar*" "value")
- '("gboolean" "overwrite")
- )
-)
-
-(define-method unsetenv
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_unsetenv")
- (return-type "none")
+(define-method accept
+ (of-object "GSocket")
+ (c-name "g_socket_accept")
+ (return-type "GSocket*")
(parameters
- '("const-gchar*" "variable")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method getenv
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_getenv")
- (return-type "const-gchar*")
+(define-method listen
+ (of-object "GSocket")
+ (c-name "g_socket_listen")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "variable")
+ '("GError**" "error")
)
)
-(define-method set_cwd
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_cwd")
- (return-type "none")
+(define-method receive
+ (of-object "GSocket")
+ (c-name "g_socket_receive")
+ (return-type "gssize")
(parameters
- '("const-gchar*" "cwd")
+ '("gchar*" "buffer")
+ '("gsize" "size")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method set_flags
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_flags")
- (return-type "none")
+(define-method receive_from
+ (of-object "GSocket")
+ (c-name "g_socket_receive_from")
+ (return-type "gssize")
(parameters
- '("GSubprocessFlags" "flags")
+ '("GSocketAddress**" "address")
+ '("gchar*" "buffer")
+ '("gsize" "size")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method set_stdin_file_path
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_stdin_file_path")
- (return-type "none")
+(define-method send
+ (of-object "GSocket")
+ (c-name "g_socket_send")
+ (return-type "gssize")
(parameters
- '("const-gchar*" "path")
+ '("const-gchar*" "buffer")
+ '("gsize" "size")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method take_stdin_fd
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_take_stdin_fd")
- (return-type "none")
+(define-method send_to
+ (of-object "GSocket")
+ (c-name "g_socket_send_to")
+ (return-type "gssize")
(parameters
- '("gint" "fd")
+ '("GSocketAddress*" "address")
+ '("const-gchar*" "buffer")
+ '("gsize" "size")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method set_stdout_file_path
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_stdout_file_path")
- (return-type "none")
+(define-method receive_message
+ (of-object "GSocket")
+ (c-name "g_socket_receive_message")
+ (return-type "gssize")
(parameters
- '("const-gchar*" "path")
+ '("GSocketAddress**" "address")
+ '("GInputVector*" "vectors")
+ '("gint" "num_vectors")
+ '("GSocketControlMessage***" "messages")
+ '("gint*" "num_messages")
+ '("gint*" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method take_stdout_fd
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_take_stdout_fd")
- (return-type "none")
+(define-method send_message
+ (of-object "GSocket")
+ (c-name "g_socket_send_message")
+ (return-type "gssize")
(parameters
- '("gint" "fd")
+ '("GSocketAddress*" "address")
+ '("GOutputVector*" "vectors")
+ '("gint" "num_vectors")
+ '("GSocketControlMessage**" "messages")
+ '("gint" "num_messages")
+ '("gint" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method set_stderr_file_path
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_stderr_file_path")
- (return-type "none")
+(define-method receive_messages
+ (of-object "GSocket")
+ (c-name "g_socket_receive_messages")
+ (return-type "gint")
(parameters
- '("const-gchar*" "path")
+ '("GInputMessage*" "messages")
+ '("guint" "num_messages")
+ '("gint" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method take_stderr_fd
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_take_stderr_fd")
- (return-type "none")
+(define-method send_messages
+ (of-object "GSocket")
+ (c-name "g_socket_send_messages")
+ (return-type "gint")
(parameters
- '("gint" "fd")
+ '("GOutputMessage*" "messages")
+ '("guint" "num_messages")
+ '("gint" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method take_fd
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_take_fd")
- (return-type "none")
+(define-method close
+ (of-object "GSocket")
+ (c-name "g_socket_close")
+ (return-type "gboolean")
(parameters
- '("gint" "source_fd")
- '("gint" "target_fd")
+ '("GError**" "error")
)
)
-(define-method set_child_setup
- (of-object "GSubprocessLauncher")
- (c-name "g_subprocess_launcher_set_child_setup")
- (return-type "none")
+(define-method shutdown
+ (of-object "GSocket")
+ (c-name "g_socket_shutdown")
+ (return-type "gboolean")
(parameters
- '("GSpawnChildSetupFunc" "child_setup")
- '("gpointer" "user_data")
- '("GDestroyNotify" "destroy_notify")
+ '("gboolean" "shutdown_read")
+ '("gboolean" "shutdown_write")
+ '("GError**" "error")
)
)
-
-
-;; From gtask.h
-
-(define-function g_task_get_type
- (c-name "g_task_get_type")
- (return-type "GType")
+(define-method is_closed
+ (of-object "GSocket")
+ (c-name "g_socket_is_closed")
+ (return-type "gboolean")
)
-(define-function g_task_new
- (c-name "g_task_new")
- (is-constructor-of "GTask")
- (return-type "GTask*")
+(define-method create_source
+ (of-object "GSocket")
+ (c-name "g_socket_create_source")
+ (return-type "GSource*")
(parameters
- '("gpointer" "source_object")
+ '("GIOCondition" "condition")
'("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "callback_data")
)
)
-(define-function g_task_report_error
- (c-name "g_task_report_error")
- (return-type "none")
- (parameters
- '("gpointer" "source_object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "callback_data")
- '("gpointer" "source_tag")
- '("GError*" "error")
- )
+(define-method speaks_ipv4
+ (of-object "GSocket")
+ (c-name "g_socket_speaks_ipv4")
+ (return-type "gboolean")
)
-(define-function g_task_report_new_error
- (c-name "g_task_report_new_error")
- (return-type "none")
+(define-method get_credentials
+ (of-object "GSocket")
+ (c-name "g_socket_get_credentials")
+ (return-type "GCredentials*")
(parameters
- '("gpointer" "source_object")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "callback_data")
- '("gpointer" "source_tag")
- '("GQuark" "domain")
- '("gint" "code")
- '("const-char*" "format")
+ '("GError**" "error")
)
- (varargs #t)
)
-(define-method set_task_data
- (of-object "GTask")
- (c-name "g_task_set_task_data")
- (return-type "none")
+(define-method receive_with_blocking
+ (of-object "GSocket")
+ (c-name "g_socket_receive_with_blocking")
+ (return-type "gssize")
(parameters
- '("gpointer" "task_data")
- '("GDestroyNotify" "task_data_destroy")
+ '("gchar*" "buffer")
+ '("gsize" "size")
+ '("gboolean" "blocking")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method set_priority
- (of-object "GTask")
- (c-name "g_task_set_priority")
- (return-type "none")
+(define-method send_with_blocking
+ (of-object "GSocket")
+ (c-name "g_socket_send_with_blocking")
+ (return-type "gssize")
(parameters
- '("gint" "priority")
+ '("const-gchar*" "buffer")
+ '("gsize" "size")
+ '("gboolean" "blocking")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method set_check_cancellable
- (of-object "GTask")
- (c-name "g_task_set_check_cancellable")
- (return-type "none")
+(define-method get_option
+ (of-object "GSocket")
+ (c-name "g_socket_get_option")
+ (return-type "gboolean")
(parameters
- '("gboolean" "check_cancellable")
+ '("gint" "level")
+ '("gint" "optname")
+ '("gint*" "value")
+ '("GError**" "error")
)
)
-(define-method set_source_tag
- (of-object "GTask")
- (c-name "g_task_set_source_tag")
- (return-type "none")
+(define-method set_option
+ (of-object "GSocket")
+ (c-name "g_socket_set_option")
+ (return-type "gboolean")
(parameters
- '("gpointer" "source_tag")
+ '("gint" "level")
+ '("gint" "optname")
+ '("gint" "value")
+ '("GError**" "error")
)
)
-(define-method get_source_object
- (of-object "GTask")
- (c-name "g_task_get_source_object")
- (return-type "gpointer")
-)
-
-(define-method get_task_data
- (of-object "GTask")
- (c-name "g_task_get_task_data")
- (return-type "gpointer")
-)
-(define-method get_priority
- (of-object "GTask")
- (c-name "g_task_get_priority")
- (return-type "gint")
-)
-(define-method get_context
- (of-object "GTask")
- (c-name "g_task_get_context")
- (return-type "GMainContext*")
-)
+;; From gsocketinputstream.h
-(define-method get_cancellable
- (of-object "GTask")
- (c-name "g_task_get_cancellable")
- (return-type "GCancellable*")
-)
-(define-method get_check_cancellable
- (of-object "GTask")
- (c-name "g_task_get_check_cancellable")
- (return-type "gboolean")
-)
-(define-method get_source_tag
- (of-object "GTask")
- (c-name "g_task_get_source_tag")
- (return-type "gpointer")
-)
+;; From gsocketlistener.h
-(define-function g_task_is_valid
- (c-name "g_task_is_valid")
- (return-type "gboolean")
- (parameters
- '("gpointer" "result")
- '("gpointer" "source_object")
- )
+(define-function g_socket_listener_get_type
+ (c-name "g_socket_listener_get_type")
+ (return-type "GType")
)
-(define-method run_in_thread
- (of-object "GTask")
- (c-name "g_task_run_in_thread")
- (return-type "none")
- (parameters
- '("GTaskThreadFunc" "task_func")
- )
+(define-function g_socket_listener_new
+ (c-name "g_socket_listener_new")
+ (is-constructor-of "GSocketListener")
+ (return-type "GSocketListener*")
)
-(define-method run_in_thread_sync
- (of-object "GTask")
- (c-name "g_task_run_in_thread_sync")
+(define-method set_backlog
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_set_backlog")
(return-type "none")
(parameters
- '("GTaskThreadFunc" "task_func")
+ '("int" "listen_backlog")
)
)
-(define-method set_return_on_cancel
- (of-object "GTask")
- (c-name "g_task_set_return_on_cancel")
+(define-method add_socket
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_add_socket")
(return-type "gboolean")
(parameters
- '("gboolean" "return_on_cancel")
+ '("GSocket*" "socket")
+ '("GObject*" "source_object")
+ '("GError**" "error")
)
)
-(define-method get_return_on_cancel
- (of-object "GTask")
- (c-name "g_task_get_return_on_cancel")
+(define-method add_address
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_add_address")
(return-type "gboolean")
-)
-
-(define-method attach_source
- (of-object "GTask")
- (c-name "g_task_attach_source")
- (return-type "none")
(parameters
- '("GSource*" "source")
- '("GSourceFunc" "callback")
+ '("GSocketAddress*" "address")
+ '("GSocketType" "type")
+ '("GSocketProtocol" "protocol")
+ '("GObject*" "source_object")
+ '("GSocketAddress**" "effective_address")
+ '("GError**" "error")
)
)
-(define-method return_pointer
- (of-object "GTask")
- (c-name "g_task_return_pointer")
- (return-type "none")
+(define-method add_inet_port
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_add_inet_port")
+ (return-type "gboolean")
(parameters
- '("gpointer" "result")
- '("GDestroyNotify" "result_destroy")
+ '("guint16" "port")
+ '("GObject*" "source_object")
+ '("GError**" "error")
)
)
-(define-method return_boolean
- (of-object "GTask")
- (c-name "g_task_return_boolean")
- (return-type "none")
+(define-method add_any_inet_port
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_add_any_inet_port")
+ (return-type "guint16")
(parameters
- '("gboolean" "result")
+ '("GObject*" "source_object")
+ '("GError**" "error")
)
)
-(define-method return_int
- (of-object "GTask")
- (c-name "g_task_return_int")
- (return-type "none")
+(define-method accept_socket
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_accept_socket")
+ (return-type "GSocket*")
(parameters
- '("gssize" "result")
+ '("GObject**" "source_object")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method return_error
- (of-object "GTask")
- (c-name "g_task_return_error")
+(define-method accept_socket_async
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_accept_socket_async")
(return-type "none")
(parameters
- '("GError*" "error")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method return_new_error
- (of-object "GTask")
- (c-name "g_task_return_new_error")
- (return-type "none")
+(define-method accept_socket_finish
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_accept_socket_finish")
+ (return-type "GSocket*")
(parameters
- '("GQuark" "domain")
- '("gint" "code")
- '("const-char*" "format")
+ '("GAsyncResult*" "result")
+ '("GObject**" "source_object")
+ '("GError**" "error")
)
- (varargs #t)
-)
-
-(define-method return_error_if_cancelled
- (of-object "GTask")
- (c-name "g_task_return_error_if_cancelled")
- (return-type "gboolean")
)
-(define-method propagate_pointer
- (of-object "GTask")
- (c-name "g_task_propagate_pointer")
- (return-type "gpointer")
+(define-method accept
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_accept")
+ (return-type "GSocketConnection*")
(parameters
+ '("GObject**" "source_object")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method propagate_boolean
- (of-object "GTask")
- (c-name "g_task_propagate_boolean")
- (return-type "gboolean")
+(define-method accept_async
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_accept_async")
+ (return-type "none")
(parameters
- '("GError**" "error")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method propagate_int
- (of-object "GTask")
- (c-name "g_task_propagate_int")
- (return-type "gssize")
+(define-method accept_finish
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_accept_finish")
+ (return-type "GSocketConnection*")
(parameters
+ '("GAsyncResult*" "result")
+ '("GObject**" "source_object")
'("GError**" "error")
)
)
-(define-method had_error
- (of-object "GTask")
- (c-name "g_task_had_error")
- (return-type "gboolean")
+(define-method close
+ (of-object "GSocketListener")
+ (c-name "g_socket_listener_close")
+ (return-type "none")
)
-(define-method get_completed
- (of-object "GTask")
- (c-name "g_task_get_completed")
- (return-type "gboolean")
-)
+;; From gsocketoutputstream.h
-;; From gtcpconnection.h
-(define-function g_tcp_connection_get_type
- (c-name "g_tcp_connection_get_type")
+
+;; From gsocketservice.h
+
+(define-function g_socket_service_get_type
+ (c-name "g_socket_service_get_type")
(return-type "GType")
)
-(define-method set_graceful_disconnect
- (of-object "GTcpConnection")
- (c-name "g_tcp_connection_set_graceful_disconnect")
+(define-function g_socket_service_new
+ (c-name "g_socket_service_new")
+ (is-constructor-of "GSocketService")
+ (return-type "GSocketService*")
+)
+
+(define-method start
+ (of-object "GSocketService")
+ (c-name "g_socket_service_start")
(return-type "none")
- (parameters
- '("gboolean" "graceful_disconnect")
- )
)
-(define-method get_graceful_disconnect
- (of-object "GTcpConnection")
- (c-name "g_tcp_connection_get_graceful_disconnect")
+(define-method stop
+ (of-object "GSocketService")
+ (c-name "g_socket_service_stop")
+ (return-type "none")
+)
+
+(define-method is_active
+ (of-object "GSocketService")
+ (c-name "g_socket_service_is_active")
(return-type "gboolean")
)
-;; From gtcpwrapperconnection.h
+;; From gsocks4aproxy.h
-(define-function g_tcp_wrapper_connection_get_type
- (c-name "g_tcp_wrapper_connection_get_type")
- (return-type "GType")
-)
-(define-function g_tcp_wrapper_connection_new
- (c-name "g_tcp_wrapper_connection_new")
- (is-constructor-of "GTcpWrapperConnection")
- (return-type "GSocketConnection*")
- (parameters
- '("GIOStream*" "base_io_stream")
- '("GSocket*" "socket")
- )
-)
-(define-method get_base_io_stream
- (of-object "GTcpWrapperConnection")
- (c-name "g_tcp_wrapper_connection_get_base_io_stream")
- (return-type "GIOStream*")
-)
+;; From gsocks4proxy.h
-;; From gtestdbus.h
+;; From gsocks5proxy.h
-(define-function g_test_dbus_get_type
- (c-name "g_test_dbus_get_type")
- (return-type "GType")
-)
-(define-function g_test_dbus_new
- (c-name "g_test_dbus_new")
- (is-constructor-of "GTestDbus")
- (return-type "GTestDBus*")
- (parameters
- '("GTestDBusFlags" "flags")
- )
-)
-(define-method get_flags
- (of-object "GTestDBus")
- (c-name "g_test_dbus_get_flags")
- (return-type "GTestDBusFlags")
-)
+;; From gsrvtarget.h
-(define-method get_bus_address
- (of-object "GTestDBus")
- (c-name "g_test_dbus_get_bus_address")
- (return-type "const-gchar*")
+(define-function g_srv_target_get_type
+ (c-name "g_srv_target_get_type")
+ (return-type "GType")
)
-(define-method add_service_dir
- (of-object "GTestDBus")
- (c-name "g_test_dbus_add_service_dir")
- (return-type "none")
+(define-function g_srv_target_new
+ (c-name "g_srv_target_new")
+ (is-constructor-of "GSrvTarget")
+ (return-type "GSrvTarget*")
(parameters
- '("const-gchar*" "path")
+ '("const-gchar*" "hostname")
+ '("guint16" "port")
+ '("guint16" "priority")
+ '("guint16" "weight")
)
)
-(define-method up
- (of-object "GTestDBus")
- (c-name "g_test_dbus_up")
- (return-type "none")
+(define-method copy
+ (of-object "GSrvTarget")
+ (c-name "g_srv_target_copy")
+ (return-type "GSrvTarget*")
)
-(define-method stop
- (of-object "GTestDBus")
- (c-name "g_test_dbus_stop")
+(define-method free
+ (of-object "GSrvTarget")
+ (c-name "g_srv_target_free")
(return-type "none")
)
-(define-method down
- (of-object "GTestDBus")
- (c-name "g_test_dbus_down")
- (return-type "none")
+(define-method get_hostname
+ (of-object "GSrvTarget")
+ (c-name "g_srv_target_get_hostname")
+ (return-type "const-gchar*")
)
-(define-function g_test_dbus_unset
- (c-name "g_test_dbus_unset")
- (return-type "none")
+(define-method get_port
+ (of-object "GSrvTarget")
+ (c-name "g_srv_target_get_port")
+ (return-type "guint16")
)
-
-
-;; From gthemedicon.h
-
-(define-function g_themed_icon_get_type
- (c-name "g_themed_icon_get_type")
- (return-type "GType")
+(define-method get_priority
+ (of-object "GSrvTarget")
+ (c-name "g_srv_target_get_priority")
+ (return-type "guint16")
)
-(define-function g_themed_icon_new
- (c-name "g_themed_icon_new")
- (is-constructor-of "GThemedIcon")
- (return-type "GIcon*")
- (parameters
- '("const-char*" "iconname")
- )
+(define-method get_weight
+ (of-object "GSrvTarget")
+ (c-name "g_srv_target_get_weight")
+ (return-type "guint16")
)
-(define-function g_themed_icon_new_with_default_fallbacks
- (c-name "g_themed_icon_new_with_default_fallbacks")
- (return-type "GIcon*")
+(define-function g_srv_target_list_sort
+ (c-name "g_srv_target_list_sort")
+ (return-type "GList*")
(parameters
- '("const-char*" "iconname")
+ '("GList*" "targets")
)
)
-(define-function g_themed_icon_new_from_names
- (c-name "g_themed_icon_new_from_names")
- (return-type "GIcon*")
- (parameters
- '("char**" "iconnames")
- '("int" "len")
- )
+
+
+;; From gsubprocess.h
+
+(define-function g_subprocess_get_type
+ (c-name "g_subprocess_get_type")
+ (return-type "GType")
)
-(define-method prepend_name
- (of-object "GThemedIcon")
- (c-name "g_themed_icon_prepend_name")
- (return-type "none")
+(define-function g_subprocess_new
+ (c-name "g_subprocess_new")
+ (is-constructor-of "GSubprocess")
+ (return-type "GSubprocess*")
(parameters
- '("const-char*" "iconname")
+ '("GSubprocessFlags" "flags")
+ '("GError**" "error")
+ '("const-gchar*" "argv0")
)
+ (varargs #t)
)
-(define-method append_name
- (of-object "GThemedIcon")
- (c-name "g_themed_icon_append_name")
- (return-type "none")
+(define-function g_subprocess_newv
+ (c-name "g_subprocess_newv")
+ (return-type "GSubprocess*")
(parameters
- '("const-char*" "iconname")
+ '("const-gchar*-const*" "argv")
+ '("GSubprocessFlags" "flags")
+ '("GError**" "error")
)
)
-(define-method get_names
- (of-object "GThemedIcon")
- (c-name "g_themed_icon_get_names")
- (return-type "const-gchar*-const*")
+(define-method get_stdin_pipe
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_stdin_pipe")
+ (return-type "GOutputStream*")
)
-
-
-;; From gthreadedresolver.h
-
-(define-function g_threaded_resolver_get_type
- (c-name "g_threaded_resolver_get_type")
- (return-type "GType")
+(define-method get_stdout_pipe
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_stdout_pipe")
+ (return-type "GInputStream*")
)
+(define-method get_stderr_pipe
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_stderr_pipe")
+ (return-type "GInputStream*")
+)
-
-;; From gthreadedsocketservice.h
-
-(define-function g_threaded_socket_service_get_type
- (c-name "g_threaded_socket_service_get_type")
- (return-type "GType")
+(define-method get_identifier
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_identifier")
+ (return-type "const-gchar*")
)
-(define-function g_threaded_socket_service_new
- (c-name "g_threaded_socket_service_new")
- (is-constructor-of "GThreadedSocketService")
- (return-type "GSocketService*")
+(define-method send_signal
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_send_signal")
+ (return-type "none")
(parameters
- '("int" "max_threads")
+ '("gint" "signal_num")
)
)
-
-
-;; From gtlsbackend.h
-
-(define-function g_tls_backend_get_type
- (c-name "g_tls_backend_get_type")
- (return-type "GType")
+(define-method force_exit
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_force_exit")
+ (return-type "none")
)
-(define-function g_tls_backend_get_default
- (c-name "g_tls_backend_get_default")
- (return-type "GTlsBackend*")
+(define-method wait
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_wait")
+ (return-type "gboolean")
+ (parameters
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
)
-(define-method get_default_database
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_default_database")
- (return-type "GTlsDatabase*")
+(define-method wait_async
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_wait_async")
+ (return-type "none")
+ (parameters
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
)
-(define-method supports_tls
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_supports_tls")
+(define-method wait_finish
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_wait_finish")
(return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-(define-method supports_dtls
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_supports_dtls")
+(define-method wait_check
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_wait_check")
(return-type "gboolean")
+ (parameters
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
)
-(define-method get_certificate_type
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_certificate_type")
- (return-type "GType")
+(define-method wait_check_async
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_wait_check_async")
+ (return-type "none")
+ (parameters
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
)
-(define-method get_client_connection_type
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_client_connection_type")
- (return-type "GType")
+(define-method wait_check_finish
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_wait_check_finish")
+ (return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-(define-method get_server_connection_type
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_server_connection_type")
- (return-type "GType")
+(define-method get_status
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_status")
+ (return-type "gint")
)
-(define-method get_file_database_type
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_file_database_type")
- (return-type "GType")
+(define-method get_successful
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_successful")
+ (return-type "gboolean")
)
-(define-method get_dtls_client_connection_type
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_dtls_client_connection_type")
- (return-type "GType")
+(define-method get_if_exited
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_if_exited")
+ (return-type "gboolean")
)
-(define-method get_dtls_server_connection_type
- (of-object "GTlsBackend")
- (c-name "g_tls_backend_get_dtls_server_connection_type")
- (return-type "GType")
+(define-method get_exit_status
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_exit_status")
+ (return-type "gint")
)
+(define-method get_if_signaled
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_if_signaled")
+ (return-type "gboolean")
+)
-
-;; From gtlscertificate.h
-
-(define-function g_tls_certificate_get_type
- (c-name "g_tls_certificate_get_type")
- (return-type "GType")
+(define-method get_term_sig
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_get_term_sig")
+ (return-type "gint")
)
-(define-function g_tls_certificate_new_from_pem
- (c-name "g_tls_certificate_new_from_pem")
- (return-type "GTlsCertificate*")
- (parameters
- '("const-gchar*" "data")
- '("gssize" "length")
+(define-method communicate
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_communicate")
+ (return-type "gboolean")
+ (parameters
+ '("GBytes*" "stdin_buf")
+ '("GCancellable*" "cancellable")
+ '("GBytes**" "stdout_buf")
+ '("GBytes**" "stderr_buf")
'("GError**" "error")
)
)
-(define-function g_tls_certificate_new_from_file
- (c-name "g_tls_certificate_new_from_file")
- (return-type "GTlsCertificate*")
+(define-method communicate_async
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_communicate_async")
+ (return-type "none")
(parameters
- '("const-gchar*" "file")
- '("GError**" "error")
+ '("GBytes*" "stdin_buf")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-function g_tls_certificate_new_from_files
- (c-name "g_tls_certificate_new_from_files")
- (return-type "GTlsCertificate*")
+(define-method communicate_finish
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_communicate_finish")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "cert_file")
- '("const-gchar*" "key_file")
+ '("GAsyncResult*" "result")
+ '("GBytes**" "stdout_buf")
+ '("GBytes**" "stderr_buf")
'("GError**" "error")
)
)
-(define-function g_tls_certificate_list_new_from_file
- (c-name "g_tls_certificate_list_new_from_file")
- (return-type "GList*")
+(define-method communicate_utf8
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_communicate_utf8")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "file")
+ '("const-char*" "stdin_buf")
+ '("GCancellable*" "cancellable")
+ '("char**" "stdout_buf")
+ '("char**" "stderr_buf")
'("GError**" "error")
)
)
-(define-method get_issuer
- (of-object "GTlsCertificate")
- (c-name "g_tls_certificate_get_issuer")
- (return-type "GTlsCertificate*")
-)
-
-(define-method verify
- (of-object "GTlsCertificate")
- (c-name "g_tls_certificate_verify")
- (return-type "GTlsCertificateFlags")
+(define-method communicate_utf8_async
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_communicate_utf8_async")
+ (return-type "none")
(parameters
- '("GSocketConnectable*" "identity")
- '("GTlsCertificate*" "trusted_ca")
+ '("const-char*" "stdin_buf")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method is_same
- (of-object "GTlsCertificate")
- (c-name "g_tls_certificate_is_same")
+(define-method communicate_utf8_finish
+ (of-object "GSubprocess")
+ (c-name "g_subprocess_communicate_utf8_finish")
(return-type "gboolean")
(parameters
- '("GTlsCertificate*" "cert_two")
+ '("GAsyncResult*" "result")
+ '("char**" "stdout_buf")
+ '("char**" "stderr_buf")
+ '("GError**" "error")
)
)
-;; From gtlsclientconnection.h
+;; From gsubprocesslauncher.h
-(define-function g_tls_client_connection_get_type
- (c-name "g_tls_client_connection_get_type")
+(define-function g_subprocess_launcher_get_type
+ (c-name "g_subprocess_launcher_get_type")
(return-type "GType")
)
-(define-function g_tls_client_connection_new
- (c-name "g_tls_client_connection_new")
- (is-constructor-of "GTlsClientConnection")
- (return-type "GIOStream*")
+(define-function g_subprocess_launcher_new
+ (c-name "g_subprocess_launcher_new")
+ (is-constructor-of "GSubprocessLauncher")
+ (return-type "GSubprocessLauncher*")
(parameters
- '("GIOStream*" "base_io_stream")
- '("GSocketConnectable*" "server_identity")
- '("GError**" "error")
+ '("GSubprocessFlags" "flags")
)
)
-(define-method get_validation_flags
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_get_validation_flags")
- (return-type "GTlsCertificateFlags")
-)
-
-(define-method set_validation_flags
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_set_validation_flags")
- (return-type "none")
+(define-method spawn
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_spawn")
+ (return-type "GSubprocess*")
(parameters
- '("GTlsCertificateFlags" "flags")
+ '("GError**" "error")
+ '("const-gchar*" "argv0")
)
+ (varargs #t)
)
-(define-method get_server_identity
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_get_server_identity")
- (return-type "GSocketConnectable*")
-)
-
-(define-method set_server_identity
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_set_server_identity")
- (return-type "none")
+(define-method spawnv
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_spawnv")
+ (return-type "GSubprocess*")
(parameters
- '("GSocketConnectable*" "identity")
+ '("const-gchar*-const*" "argv")
+ '("GError**" "error")
)
)
-(define-method get_use_ssl3
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_get_use_ssl3")
- (return-type "gboolean")
-)
-
-(define-method set_use_ssl3
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_set_use_ssl3")
+(define-method set_environ
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_environ")
(return-type "none")
(parameters
- '("gboolean" "use_ssl3")
+ '("gchar**" "env")
)
)
-(define-method get_accepted_cas
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_get_accepted_cas")
- (return-type "GList*")
-)
-
-(define-method copy_session_state
- (of-object "GTlsClientConnection")
- (c-name "g_tls_client_connection_copy_session_state")
+(define-method setenv
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_setenv")
(return-type "none")
(parameters
- '("GTlsClientConnection*" "source")
+ '("const-gchar*" "variable")
+ '("const-gchar*" "value")
+ '("gboolean" "overwrite")
)
)
-
-
-;; From gtlsconnection.h
-
-(define-function g_tls_connection_get_type
- (c-name "g_tls_connection_get_type")
- (return-type "GType")
-)
-
-(define-method set_use_system_certdb
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_set_use_system_certdb")
+(define-method unsetenv
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_unsetenv")
(return-type "none")
(parameters
- '("gboolean" "use_system_certdb")
+ '("const-gchar*" "variable")
)
)
-(define-method get_use_system_certdb
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_use_system_certdb")
- (return-type "gboolean")
+(define-method getenv
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_getenv")
+ (return-type "const-gchar*")
+ (parameters
+ '("const-gchar*" "variable")
+ )
)
-(define-method set_database
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_set_database")
+(define-method set_cwd
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_cwd")
(return-type "none")
(parameters
- '("GTlsDatabase*" "database")
+ '("const-gchar*" "cwd")
)
)
-(define-method get_database
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_database")
- (return-type "GTlsDatabase*")
-)
-
-(define-method set_certificate
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_set_certificate")
+(define-method set_flags
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_flags")
(return-type "none")
(parameters
- '("GTlsCertificate*" "certificate")
+ '("GSubprocessFlags" "flags")
)
)
-(define-method get_certificate
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_certificate")
- (return-type "GTlsCertificate*")
-)
-
-(define-method set_interaction
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_set_interaction")
+(define-method set_stdin_file_path
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_stdin_file_path")
(return-type "none")
(parameters
- '("GTlsInteraction*" "interaction")
+ '("const-gchar*" "path")
)
)
-(define-method get_interaction
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_interaction")
- (return-type "GTlsInteraction*")
-)
-
-(define-method get_peer_certificate
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_peer_certificate")
- (return-type "GTlsCertificate*")
-)
-
-(define-method get_peer_certificate_errors
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_peer_certificate_errors")
- (return-type "GTlsCertificateFlags")
-)
-
-(define-method set_require_close_notify
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_set_require_close_notify")
+(define-method take_stdin_fd
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_take_stdin_fd")
(return-type "none")
(parameters
- '("gboolean" "require_close_notify")
+ '("gint" "fd")
)
)
-(define-method get_require_close_notify
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_require_close_notify")
- (return-type "gboolean")
-)
-
-(define-method set_rehandshake_mode
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_set_rehandshake_mode")
+(define-method set_stdout_file_path
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_stdout_file_path")
(return-type "none")
(parameters
- '("GTlsRehandshakeMode" "mode")
+ '("const-gchar*" "path")
)
)
-(define-method get_rehandshake_mode
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_get_rehandshake_mode")
- (return-type "GTlsRehandshakeMode")
-)
-
-(define-method handshake
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_handshake")
- (return-type "gboolean")
+(define-method take_stdout_fd
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_take_stdout_fd")
+ (return-type "none")
(parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gint" "fd")
)
)
-(define-method handshake_async
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_handshake_async")
+(define-method set_stderr_file_path
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_stderr_file_path")
(return-type "none")
(parameters
- '("int" "io_priority")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-gchar*" "path")
)
)
-(define-method handshake_finish
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_handshake_finish")
- (return-type "gboolean")
+(define-method take_stderr_fd
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_take_stderr_fd")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gint" "fd")
)
)
-(define-function g_tls_error_quark
- (c-name "g_tls_error_quark")
- (return-type "GQuark")
+(define-method take_fd
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_take_fd")
+ (return-type "none")
+ (parameters
+ '("gint" "source_fd")
+ '("gint" "target_fd")
+ )
)
-(define-method emit_accept_certificate
- (of-object "GTlsConnection")
- (c-name "g_tls_connection_emit_accept_certificate")
- (return-type "gboolean")
+(define-method set_child_setup
+ (of-object "GSubprocessLauncher")
+ (c-name "g_subprocess_launcher_set_child_setup")
+ (return-type "none")
(parameters
- '("GTlsCertificate*" "peer_cert")
- '("GTlsCertificateFlags" "errors")
+ '("GSpawnChildSetupFunc" "child_setup")
+ '("gpointer" "user_data")
+ '("GDestroyNotify" "destroy_notify")
)
)
-;; From gtlsdatabase.h
+;; From gtask.h
-(define-function g_tls_database_get_type
- (c-name "g_tls_database_get_type")
+(define-function g_task_get_type
+ (c-name "g_task_get_type")
(return-type "GType")
)
-(define-method verify_chain
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_verify_chain")
- (return-type "GTlsCertificateFlags")
+(define-function g_task_new
+ (c-name "g_task_new")
+ (is-constructor-of "GTask")
+ (return-type "GTask*")
(parameters
- '("GTlsCertificate*" "chain")
- '("const-gchar*" "purpose")
- '("GSocketConnectable*" "identity")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseVerifyFlags" "flags")
+ '("gpointer" "source_object")
'("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "callback_data")
)
)
-(define-method verify_chain_async
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_verify_chain_async")
+(define-function g_task_report_error
+ (c-name "g_task_report_error")
(return-type "none")
(parameters
- '("GTlsCertificate*" "chain")
- '("const-gchar*" "purpose")
- '("GSocketConnectable*" "identity")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseVerifyFlags" "flags")
- '("GCancellable*" "cancellable")
+ '("gpointer" "source_object")
'("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gpointer" "callback_data")
+ '("gpointer" "source_tag")
+ '("GError*" "error")
)
)
-(define-method verify_chain_finish
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_verify_chain_finish")
- (return-type "GTlsCertificateFlags")
+(define-function g_task_report_new_error
+ (c-name "g_task_report_new_error")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gpointer" "source_object")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "callback_data")
+ '("gpointer" "source_tag")
+ '("GQuark" "domain")
+ '("gint" "code")
+ '("const-char*" "format")
)
+ (varargs #t)
)
-(define-method create_certificate_handle
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_create_certificate_handle")
- (return-type "gchar*")
+(define-method set_task_data
+ (of-object "GTask")
+ (c-name "g_task_set_task_data")
+ (return-type "none")
(parameters
- '("GTlsCertificate*" "certificate")
+ '("gpointer" "task_data")
+ '("GDestroyNotify" "task_data_destroy")
)
)
-(define-method lookup_certificate_for_handle
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificate_for_handle")
- (return-type "GTlsCertificate*")
+(define-method set_priority
+ (of-object "GTask")
+ (c-name "g_task_set_priority")
+ (return-type "none")
(parameters
- '("const-gchar*" "handle")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseLookupFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gint" "priority")
)
)
-(define-method lookup_certificate_for_handle_async
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificate_for_handle_async")
+(define-method set_check_cancellable
+ (of-object "GTask")
+ (c-name "g_task_set_check_cancellable")
(return-type "none")
(parameters
- '("const-gchar*" "handle")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseLookupFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "check_cancellable")
)
)
-(define-method lookup_certificate_for_handle_finish
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificate_for_handle_finish")
- (return-type "GTlsCertificate*")
+(define-method set_source_tag
+ (of-object "GTask")
+ (c-name "g_task_set_source_tag")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gpointer" "source_tag")
)
)
-(define-method lookup_certificate_issuer
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificate_issuer")
- (return-type "GTlsCertificate*")
- (parameters
- '("GTlsCertificate*" "certificate")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseLookupFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_source_object
+ (of-object "GTask")
+ (c-name "g_task_get_source_object")
+ (return-type "gpointer")
)
-(define-method lookup_certificate_issuer_async
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificate_issuer_async")
- (return-type "none")
- (parameters
- '("GTlsCertificate*" "certificate")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseLookupFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
+(define-method get_task_data
+ (of-object "GTask")
+ (c-name "g_task_get_task_data")
+ (return-type "gpointer")
)
-(define-method lookup_certificate_issuer_finish
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificate_issuer_finish")
- (return-type "GTlsCertificate*")
+(define-method get_priority
+ (of-object "GTask")
+ (c-name "g_task_get_priority")
+ (return-type "gint")
+)
+
+(define-method get_context
+ (of-object "GTask")
+ (c-name "g_task_get_context")
+ (return-type "GMainContext*")
+)
+
+(define-method get_cancellable
+ (of-object "GTask")
+ (c-name "g_task_get_cancellable")
+ (return-type "GCancellable*")
+)
+
+(define-method get_check_cancellable
+ (of-object "GTask")
+ (c-name "g_task_get_check_cancellable")
+ (return-type "gboolean")
+)
+
+(define-method get_source_tag
+ (of-object "GTask")
+ (c-name "g_task_get_source_tag")
+ (return-type "gpointer")
+)
+
+(define-function g_task_is_valid
+ (c-name "g_task_is_valid")
+ (return-type "gboolean")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gpointer" "result")
+ '("gpointer" "source_object")
)
)
-(define-method lookup_certificates_issued_by
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificates_issued_by")
- (return-type "GList*")
- (parameters
- '("GByteArray*" "issuer_raw_dn")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseLookupFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+(define-method run_in_thread
+ (of-object "GTask")
+ (c-name "g_task_run_in_thread")
+ (return-type "none")
+ (parameters
+ '("GTaskThreadFunc" "task_func")
)
)
-(define-method lookup_certificates_issued_by_async
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificates_issued_by_async")
+(define-method run_in_thread_sync
+ (of-object "GTask")
+ (c-name "g_task_run_in_thread_sync")
(return-type "none")
(parameters
- '("GByteArray*" "issuer_raw_dn")
- '("GTlsInteraction*" "interaction")
- '("GTlsDatabaseLookupFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GTaskThreadFunc" "task_func")
)
)
-(define-method lookup_certificates_issued_by_finish
- (of-object "GTlsDatabase")
- (c-name "g_tls_database_lookup_certificates_issued_by_finish")
- (return-type "GList*")
+(define-method set_return_on_cancel
+ (of-object "GTask")
+ (c-name "g_task_set_return_on_cancel")
+ (return-type "gboolean")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("gboolean" "return_on_cancel")
)
)
-
-
-;; From gtlsfiledatabase.h
-
-(define-function g_tls_file_database_get_type
- (c-name "g_tls_file_database_get_type")
- (return-type "GType")
+(define-method get_return_on_cancel
+ (of-object "GTask")
+ (c-name "g_task_get_return_on_cancel")
+ (return-type "gboolean")
)
-(define-function g_tls_file_database_new
- (c-name "g_tls_file_database_new")
- (is-constructor-of "GTlsFileDatabase")
- (return-type "GTlsDatabase*")
+(define-method attach_source
+ (of-object "GTask")
+ (c-name "g_task_attach_source")
+ (return-type "none")
(parameters
- '("const-gchar*" "anchors")
- '("GError**" "error")
+ '("GSource*" "source")
+ '("GSourceFunc" "callback")
)
)
-
-
-;; From gtlsinteraction.h
-
-(define-function g_tls_interaction_get_type
- (c-name "g_tls_interaction_get_type")
- (return-type "GType")
-)
-
-(define-method invoke_ask_password
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_invoke_ask_password")
- (return-type "GTlsInteractionResult")
+(define-method return_pointer
+ (of-object "GTask")
+ (c-name "g_task_return_pointer")
+ (return-type "none")
(parameters
- '("GTlsPassword*" "password")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gpointer" "result")
+ '("GDestroyNotify" "result_destroy")
)
)
-(define-method ask_password
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_ask_password")
- (return-type "GTlsInteractionResult")
+(define-method return_boolean
+ (of-object "GTask")
+ (c-name "g_task_return_boolean")
+ (return-type "none")
(parameters
- '("GTlsPassword*" "password")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("gboolean" "result")
)
)
-(define-method ask_password_async
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_ask_password_async")
+(define-method return_int
+ (of-object "GTask")
+ (c-name "g_task_return_int")
(return-type "none")
(parameters
- '("GTlsPassword*" "password")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gssize" "result")
)
)
-(define-method ask_password_finish
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_ask_password_finish")
- (return-type "GTlsInteractionResult")
+(define-method return_error
+ (of-object "GTask")
+ (c-name "g_task_return_error")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("GError*" "error")
)
)
-(define-method invoke_request_certificate
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_invoke_request_certificate")
- (return-type "GTlsInteractionResult")
+(define-method return_new_error
+ (of-object "GTask")
+ (c-name "g_task_return_new_error")
+ (return-type "none")
(parameters
- '("GTlsConnection*" "connection")
- '("GTlsCertificateRequestFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("GQuark" "domain")
+ '("gint" "code")
+ '("const-char*" "format")
)
+ (varargs #t)
)
-(define-method request_certificate
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_request_certificate")
- (return-type "GTlsInteractionResult")
+(define-method return_error_if_cancelled
+ (of-object "GTask")
+ (c-name "g_task_return_error_if_cancelled")
+ (return-type "gboolean")
+)
+
+(define-method propagate_pointer
+ (of-object "GTask")
+ (c-name "g_task_propagate_pointer")
+ (return-type "gpointer")
(parameters
- '("GTlsConnection*" "connection")
- '("GTlsCertificateRequestFlags" "flags")
- '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method request_certificate_async
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_request_certificate_async")
- (return-type "none")
+(define-method propagate_boolean
+ (of-object "GTask")
+ (c-name "g_task_propagate_boolean")
+ (return-type "gboolean")
(parameters
- '("GTlsConnection*" "connection")
- '("GTlsCertificateRequestFlags" "flags")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GError**" "error")
)
)
-(define-method request_certificate_finish
- (of-object "GTlsInteraction")
- (c-name "g_tls_interaction_request_certificate_finish")
- (return-type "GTlsInteractionResult")
+(define-method propagate_int
+ (of-object "GTask")
+ (c-name "g_task_propagate_int")
+ (return-type "gssize")
(parameters
- '("GAsyncResult*" "result")
'("GError**" "error")
)
)
+(define-method had_error
+ (of-object "GTask")
+ (c-name "g_task_had_error")
+ (return-type "gboolean")
+)
+(define-method get_completed
+ (of-object "GTask")
+ (c-name "g_task_get_completed")
+ (return-type "gboolean")
+)
-;; From gtlspassword.h
-(define-function g_tls_password_get_type
- (c-name "g_tls_password_get_type")
+
+;; From gtcpconnection.h
+
+(define-function g_tcp_connection_get_type
+ (c-name "g_tcp_connection_get_type")
(return-type "GType")
)
-(define-function g_tls_password_new
- (c-name "g_tls_password_new")
- (is-constructor-of "GTlsPassword")
- (return-type "GTlsPassword*")
+(define-method set_graceful_disconnect
+ (of-object "GTcpConnection")
+ (c-name "g_tcp_connection_set_graceful_disconnect")
+ (return-type "none")
(parameters
- '("GTlsPasswordFlags" "flags")
- '("const-gchar*" "description")
+ '("gboolean" "graceful_disconnect")
)
)
-(define-method get_value
- (of-object "GTlsPassword")
- (c-name "g_tls_password_get_value")
- (return-type "const-guchar*")
- (parameters
- '("gsize*" "length")
- )
+(define-method get_graceful_disconnect
+ (of-object "GTcpConnection")
+ (c-name "g_tcp_connection_get_graceful_disconnect")
+ (return-type "gboolean")
)
-(define-method set_value
- (of-object "GTlsPassword")
- (c-name "g_tls_password_set_value")
- (return-type "none")
- (parameters
- '("const-guchar*" "value")
- '("gssize" "length")
- )
+
+
+;; From gtcpwrapperconnection.h
+
+(define-function g_tcp_wrapper_connection_get_type
+ (c-name "g_tcp_wrapper_connection_get_type")
+ (return-type "GType")
)
-(define-method set_value_full
- (of-object "GTlsPassword")
- (c-name "g_tls_password_set_value_full")
- (return-type "none")
+(define-function g_tcp_wrapper_connection_new
+ (c-name "g_tcp_wrapper_connection_new")
+ (is-constructor-of "GTcpWrapperConnection")
+ (return-type "GSocketConnection*")
(parameters
- '("guchar*" "value")
- '("gssize" "length")
- '("GDestroyNotify" "destroy")
+ '("GIOStream*" "base_io_stream")
+ '("GSocket*" "socket")
)
)
-(define-method get_flags
- (of-object "GTlsPassword")
- (c-name "g_tls_password_get_flags")
- (return-type "GTlsPasswordFlags")
+(define-method get_base_io_stream
+ (of-object "GTcpWrapperConnection")
+ (c-name "g_tcp_wrapper_connection_get_base_io_stream")
+ (return-type "GIOStream*")
)
-(define-method set_flags
- (of-object "GTlsPassword")
- (c-name "g_tls_password_set_flags")
- (return-type "none")
+
+
+;; From gtestdbus.h
+
+(define-function g_test_dbus_get_type
+ (c-name "g_test_dbus_get_type")
+ (return-type "GType")
+)
+
+(define-function g_test_dbus_new
+ (c-name "g_test_dbus_new")
+ (is-constructor-of "GTestDbus")
+ (return-type "GTestDBus*")
(parameters
- '("GTlsPasswordFlags" "flags")
+ '("GTestDBusFlags" "flags")
)
)
-(define-method get_description
- (of-object "GTlsPassword")
- (c-name "g_tls_password_get_description")
+(define-method get_flags
+ (of-object "GTestDBus")
+ (c-name "g_test_dbus_get_flags")
+ (return-type "GTestDBusFlags")
+)
+
+(define-method get_bus_address
+ (of-object "GTestDBus")
+ (c-name "g_test_dbus_get_bus_address")
(return-type "const-gchar*")
)
-(define-method set_description
- (of-object "GTlsPassword")
- (c-name "g_tls_password_set_description")
+(define-method add_service_dir
+ (of-object "GTestDBus")
+ (c-name "g_test_dbus_add_service_dir")
(return-type "none")
(parameters
- '("const-gchar*" "description")
+ '("const-gchar*" "path")
)
)
-(define-method get_warning
- (of-object "GTlsPassword")
- (c-name "g_tls_password_get_warning")
- (return-type "const-gchar*")
+(define-method up
+ (of-object "GTestDBus")
+ (c-name "g_test_dbus_up")
+ (return-type "none")
)
-(define-method set_warning
- (of-object "GTlsPassword")
- (c-name "g_tls_password_set_warning")
+(define-method stop
+ (of-object "GTestDBus")
+ (c-name "g_test_dbus_stop")
(return-type "none")
- (parameters
- '("const-gchar*" "warning")
- )
)
-
-
-;; From gtlsserverconnection.h
-
-(define-function g_tls_server_connection_get_type
- (c-name "g_tls_server_connection_get_type")
- (return-type "GType")
+(define-method down
+ (of-object "GTestDBus")
+ (c-name "g_test_dbus_down")
+ (return-type "none")
)
-(define-function g_tls_server_connection_new
- (c-name "g_tls_server_connection_new")
- (is-constructor-of "GTlsServerConnection")
- (return-type "GIOStream*")
- (parameters
- '("GIOStream*" "base_io_stream")
- '("GTlsCertificate*" "certificate")
- '("GError**" "error")
- )
+(define-function g_test_dbus_unset
+ (c-name "g_test_dbus_unset")
+ (return-type "none")
)
-;; From gunionvolumemonitor.h
-
-
-
-;; From gunixconnection.h
+;; From gthemedicon.h
-(define-function g_unix_connection_get_type
- (c-name "g_unix_connection_get_type")
+(define-function g_themed_icon_get_type
+ (c-name "g_themed_icon_get_type")
(return-type "GType")
)
-(define-method send_fd
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_send_fd")
- (return-type "gboolean")
+(define-function g_themed_icon_new
+ (c-name "g_themed_icon_new")
+ (is-constructor-of "GThemedIcon")
+ (return-type "GIcon*")
(parameters
- '("gint" "fd")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("const-char*" "iconname")
)
)
-(define-method receive_fd
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_receive_fd")
- (return-type "gint")
+(define-function g_themed_icon_new_with_default_fallbacks
+ (c-name "g_themed_icon_new_with_default_fallbacks")
+ (return-type "GIcon*")
(parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("const-char*" "iconname")
)
)
-(define-method send_credentials
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_send_credentials")
- (return-type "gboolean")
+(define-function g_themed_icon_new_from_names
+ (c-name "g_themed_icon_new_from_names")
+ (return-type "GIcon*")
(parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("char**" "iconnames")
+ '("int" "len")
)
)
-(define-method send_credentials_async
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_send_credentials_async")
+(define-method prepend_name
+ (of-object "GThemedIcon")
+ (c-name "g_themed_icon_prepend_name")
(return-type "none")
(parameters
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-char*" "iconname")
)
)
-(define-method send_credentials_finish
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_send_credentials_finish")
- (return-type "gboolean")
+(define-method append_name
+ (of-object "GThemedIcon")
+ (c-name "g_themed_icon_append_name")
+ (return-type "none")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("const-char*" "iconname")
)
)
-(define-method receive_credentials
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_receive_credentials")
- (return-type "GCredentials*")
- (parameters
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_names
+ (of-object "GThemedIcon")
+ (c-name "g_themed_icon_get_names")
+ (return-type "const-gchar*-const*")
)
-(define-method receive_credentials_async
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_receive_credentials_async")
- (return-type "none")
- (parameters
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
+
+
+;; From gthreadedresolver.h
+
+(define-function g_threaded_resolver_get_type
+ (c-name "g_threaded_resolver_get_type")
+ (return-type "GType")
)
-(define-method receive_credentials_finish
- (of-object "GUnixConnection")
- (c-name "g_unix_connection_receive_credentials_finish")
- (return-type "GCredentials*")
+
+
+;; From gthreadedsocketservice.h
+
+(define-function g_threaded_socket_service_get_type
+ (c-name "g_threaded_socket_service_get_type")
+ (return-type "GType")
+)
+
+(define-function g_threaded_socket_service_new
+ (c-name "g_threaded_socket_service_new")
+ (is-constructor-of "GThreadedSocketService")
+ (return-type "GSocketService*")
(parameters
- '("GAsyncResult*" "result")
- '("GError**" "error")
+ '("int" "max_threads")
)
)
-;; From gunixcredentialsmessage.h
+;; From gtlsbackend.h
-(define-function g_unix_credentials_message_get_type
- (c-name "g_unix_credentials_message_get_type")
+(define-function g_tls_backend_get_type
+ (c-name "g_tls_backend_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_tls_backend_get_default
+ (c-name "g_tls_backend_get_default")
+ (return-type "GTlsBackend*")
)
-(define-function g_unix_credentials_message_new_with_credentials
- (c-name "g_unix_credentials_message_new_with_credentials")
- (return-type "GSocketControlMessage*")
+(define-method get_default_database
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_default_database")
+ (return-type "GTlsDatabase*")
+)
+
+(define-method set_default_database
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_set_default_database")
+ (return-type "none")
(parameters
- '("GCredentials*" "credentials")
+ '("GTlsDatabase*" "database")
)
)
-(define-method get_credentials
- (of-object "GUnixCredentialsMessage")
- (c-name "g_unix_credentials_message_get_credentials")
- (return-type "GCredentials*")
+(define-method supports_tls
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_supports_tls")
+ (return-type "gboolean")
)
-(define-function g_unix_credentials_message_is_supported
- (c-name "g_unix_credentials_message_is_supported")
+(define-method supports_dtls
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_supports_dtls")
(return-type "gboolean")
)
+(define-method get_certificate_type
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_certificate_type")
+ (return-type "GType")
+)
+(define-method get_client_connection_type
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_client_connection_type")
+ (return-type "GType")
+)
-;; From gunixfdlist.h
+(define-method get_server_connection_type
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_server_connection_type")
+ (return-type "GType")
+)
-(define-function g_unix_fd_list_get_type
- (c-name "g_unix_fd_list_get_type")
+(define-method get_file_database_type
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_file_database_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-method get_dtls_client_connection_type
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_dtls_client_connection_type")
+ (return-type "GType")
+)
+
+(define-method get_dtls_server_connection_type
+ (of-object "GTlsBackend")
+ (c-name "g_tls_backend_get_dtls_server_connection_type")
+ (return-type "GType")
+)
+
+
+
+;; From gtlscertificate.h
+
+(define-function g_tls_certificate_get_type
+ (c-name "g_tls_certificate_get_type")
+ (return-type "GType")
)
-(define-function g_unix_fd_list_new_from_array
- (c-name "g_unix_fd_list_new_from_array")
- (return-type "GUnixFDList*")
+(define-function g_tls_certificate_new_from_pem
+ (c-name "g_tls_certificate_new_from_pem")
+ (return-type "GTlsCertificate*")
(parameters
- '("const-gint*" "fds")
- '("gint" "n_fds")
+ '("const-gchar*" "data")
+ '("gssize" "length")
+ '("GError**" "error")
)
)
-(define-method append
- (of-object "GUnixFDList")
- (c-name "g_unix_fd_list_append")
- (return-type "gint")
+(define-function g_tls_certificate_new_from_file
+ (c-name "g_tls_certificate_new_from_file")
+ (return-type "GTlsCertificate*")
(parameters
- '("gint" "fd")
+ '("const-gchar*" "file")
'("GError**" "error")
)
)
-(define-method get_length
- (of-object "GUnixFDList")
- (c-name "g_unix_fd_list_get_length")
- (return-type "gint")
+(define-function g_tls_certificate_new_from_files
+ (c-name "g_tls_certificate_new_from_files")
+ (return-type "GTlsCertificate*")
+ (parameters
+ '("const-gchar*" "cert_file")
+ '("const-gchar*" "key_file")
+ '("GError**" "error")
+ )
)
-(define-method get
- (of-object "GUnixFDList")
- (c-name "g_unix_fd_list_get")
- (return-type "gint")
+(define-function g_tls_certificate_list_new_from_file
+ (c-name "g_tls_certificate_list_new_from_file")
+ (return-type "GList*")
(parameters
- '("gint" "index_")
+ '("const-gchar*" "file")
'("GError**" "error")
)
)
-(define-method peek_fds
- (of-object "GUnixFDList")
- (c-name "g_unix_fd_list_peek_fds")
- (return-type "const-gint*")
+(define-method get_issuer
+ (of-object "GTlsCertificate")
+ (c-name "g_tls_certificate_get_issuer")
+ (return-type "GTlsCertificate*")
+)
+
+(define-method verify
+ (of-object "GTlsCertificate")
+ (c-name "g_tls_certificate_verify")
+ (return-type "GTlsCertificateFlags")
(parameters
- '("gint*" "length")
+ '("GSocketConnectable*" "identity")
+ '("GTlsCertificate*" "trusted_ca")
)
)
-(define-method steal_fds
- (of-object "GUnixFDList")
- (c-name "g_unix_fd_list_steal_fds")
- (return-type "gint*")
+(define-method is_same
+ (of-object "GTlsCertificate")
+ (c-name "g_tls_certificate_is_same")
+ (return-type "gboolean")
(parameters
- '("gint*" "length")
+ '("GTlsCertificate*" "cert_two")
)
)
-;; From gunixfdmessage.h
+;; From gtlsclientconnection.h
-(define-function g_unix_fd_message_get_type
- (c-name "g_unix_fd_message_get_type")
+(define-function g_tls_client_connection_get_type
+ (c-name "g_tls_client_connection_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*")
+(define-function g_tls_client_connection_new
+ (c-name "g_tls_client_connection_new")
+ (is-constructor-of "GTlsClientConnection")
+ (return-type "GIOStream*")
(parameters
- '("GUnixFDList*" "fd_list")
+ '("GIOStream*" "base_io_stream")
+ '("GSocketConnectable*" "server_identity")
+ '("GError**" "error")
)
)
-(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 get_validation_flags
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_get_validation_flags")
+ (return-type "GTlsCertificateFlags")
)
-(define-method append_fd
- (of-object "GUnixFDMessage")
- (c-name "g_unix_fd_message_append_fd")
- (return-type "gboolean")
+(define-method set_validation_flags
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_set_validation_flags")
+ (return-type "none")
(parameters
- '("gint" "fd")
- '("GError**" "error")
+ '("GTlsCertificateFlags" "flags")
)
)
-
-
-;; From gunixinputstream.h
-
-(define-function g_unix_input_stream_get_type
- (c-name "g_unix_input_stream_get_type")
- (return-type "GType")
+(define-method get_server_identity
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_get_server_identity")
+ (return-type "GSocketConnectable*")
)
-(define-function g_unix_input_stream_new
- (c-name "g_unix_input_stream_new")
- (is-constructor-of "GUnixInputStream")
- (return-type "GInputStream*")
+(define-method set_server_identity
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_set_server_identity")
+ (return-type "none")
(parameters
- '("gint" "fd")
- '("gboolean" "close_fd")
+ '("GSocketConnectable*" "identity")
)
)
-(define-method set_close_fd
- (of-object "GUnixInputStream")
- (c-name "g_unix_input_stream_set_close_fd")
+(define-method get_use_ssl3
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_get_use_ssl3")
+ (return-type "gboolean")
+)
+
+(define-method set_use_ssl3
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_set_use_ssl3")
(return-type "none")
(parameters
- '("gboolean" "close_fd")
+ '("gboolean" "use_ssl3")
)
)
-(define-method get_close_fd
- (of-object "GUnixInputStream")
- (c-name "g_unix_input_stream_get_close_fd")
- (return-type "gboolean")
+(define-method get_accepted_cas
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_get_accepted_cas")
+ (return-type "GList*")
)
-(define-method get_fd
- (of-object "GUnixInputStream")
- (c-name "g_unix_input_stream_get_fd")
- (return-type "gint")
+(define-method copy_session_state
+ (of-object "GTlsClientConnection")
+ (c-name "g_tls_client_connection_copy_session_state")
+ (return-type "none")
+ (parameters
+ '("GTlsClientConnection*" "source")
+ )
)
-;; From gunixmount.h
-
-
-
-;; From gunixmounts.h
-
-(define-function g_unix_mount_entry_get_type
- (c-name "g_unix_mount_entry_get_type")
- (return-type "GType")
-)
+;; From gtlsconnection.h
-(define-function g_unix_mount_point_get_type
- (c-name "g_unix_mount_point_get_type")
+(define-function g_tls_connection_get_type
+ (c-name "g_tls_connection_get_type")
(return-type "GType")
)
-(define-function g_unix_mount_copy
- (c-name "g_unix_mount_copy")
- (return-type "GUnixMountEntry*")
+(define-method set_use_system_certdb
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_set_use_system_certdb")
+ (return-type "none")
(parameters
- '("GUnixMountEntry*" "mount_entry")
+ '("gboolean" "use_system_certdb")
)
)
-(define-method free
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_free")
+(define-method get_use_system_certdb
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_use_system_certdb")
+ (return-type "gboolean")
+)
+
+(define-method set_database
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_set_database")
(return-type "none")
+ (parameters
+ '("GTlsDatabase*" "database")
+ )
)
-(define-method copy
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_copy")
- (return-type "GUnixMountPoint*")
+(define-method get_database
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_database")
+ (return-type "GTlsDatabase*")
)
-(define-function g_unix_mount_compare
- (c-name "g_unix_mount_compare")
- (return-type "gint")
+(define-method set_certificate
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_set_certificate")
+ (return-type "none")
(parameters
- '("GUnixMountEntry*" "mount1")
- '("GUnixMountEntry*" "mount2")
+ '("GTlsCertificate*" "certificate")
)
)
-(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-method get_certificate
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_certificate")
+ (return-type "GTlsCertificate*")
)
-(define-function g_unix_mount_get_device_path
- (c-name "g_unix_mount_get_device_path")
- (return-type "const-char*")
+(define-method set_interaction
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_set_interaction")
+ (return-type "none")
(parameters
- '("GUnixMountEntry*" "mount_entry")
+ '("GTlsInteraction*" "interaction")
)
)
-(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-method get_interaction
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_interaction")
+ (return-type "GTlsInteraction*")
+)
+
+(define-method get_peer_certificate
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_peer_certificate")
+ (return-type "GTlsCertificate*")
)
-(define-function g_unix_mount_is_readonly
- (c-name "g_unix_mount_is_readonly")
- (return-type "gboolean")
- (parameters
- '("GUnixMountEntry*" "mount_entry")
- )
+(define-method get_peer_certificate_errors
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_peer_certificate_errors")
+ (return-type "GTlsCertificateFlags")
)
-(define-function g_unix_mount_is_system_internal
- (c-name "g_unix_mount_is_system_internal")
- (return-type "gboolean")
+(define-method set_require_close_notify
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_set_require_close_notify")
+ (return-type "none")
(parameters
- '("GUnixMountEntry*" "mount_entry")
+ '("gboolean" "require_close_notify")
)
)
-(define-function g_unix_mount_guess_can_eject
- (c-name "g_unix_mount_guess_can_eject")
+(define-method get_require_close_notify
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_require_close_notify")
(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")
+(define-method set_rehandshake_mode
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_set_rehandshake_mode")
+ (return-type "none")
(parameters
- '("GUnixMountEntry*" "mount_entry")
+ '("GTlsRehandshakeMode" "mode")
)
)
-(define-function g_unix_mount_guess_name
- (c-name "g_unix_mount_guess_name")
- (return-type "char*")
- (parameters
- '("GUnixMountEntry*" "mount_entry")
- )
+(define-method get_rehandshake_mode
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_get_rehandshake_mode")
+ (return-type "GTlsRehandshakeMode")
)
-(define-function g_unix_mount_guess_icon
- (c-name "g_unix_mount_guess_icon")
- (return-type "GIcon*")
+(define-method handshake
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_handshake")
+ (return-type "gboolean")
(parameters
- '("GUnixMountEntry*" "mount_entry")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function g_unix_mount_guess_symbolic_icon
- (c-name "g_unix_mount_guess_symbolic_icon")
- (return-type "GIcon*")
+(define-method handshake_async
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_handshake_async")
+ (return-type "none")
(parameters
- '("GUnixMountEntry*" "mount_entry")
+ '("int" "io_priority")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(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 get_options
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_get_options")
- (return-type "const-char*")
-)
-
-(define-method is_readonly
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_is_readonly")
+(define-method handshake_finish
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_handshake_finish")
(return-type "gboolean")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-(define-method is_user_mountable
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_is_user_mountable")
- (return-type "gboolean")
+(define-function g_tls_error_quark
+ (c-name "g_tls_error_quark")
+ (return-type "GQuark")
)
-(define-method is_loopback
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_is_loopback")
+(define-method emit_accept_certificate
+ (of-object "GTlsConnection")
+ (c-name "g_tls_connection_emit_accept_certificate")
(return-type "gboolean")
+ (parameters
+ '("GTlsCertificate*" "peer_cert")
+ '("GTlsCertificateFlags" "errors")
+ )
)
-(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*")
-)
+;; From gtlsdatabase.h
-(define-method guess_symbolic_icon
- (of-object "GUnixMountPoint")
- (c-name "g_unix_mount_point_guess_symbolic_icon")
- (return-type "GIcon*")
+(define-function g_tls_database_get_type
+ (c-name "g_tls_database_get_type")
+ (return-type "GType")
)
-(define-function g_unix_mount_points_get
- (c-name "g_unix_mount_points_get")
- (return-type "GList*")
+(define-method verify_chain
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_verify_chain")
+ (return-type "GTlsCertificateFlags")
(parameters
- '("guint64*" "time_read")
+ '("GTlsCertificate*" "chain")
+ '("const-gchar*" "purpose")
+ '("GSocketConnectable*" "identity")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseVerifyFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function g_unix_mounts_get
- (c-name "g_unix_mounts_get")
- (return-type "GList*")
+(define-method verify_chain_async
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_verify_chain_async")
+ (return-type "none")
(parameters
- '("guint64*" "time_read")
+ '("GTlsCertificate*" "chain")
+ '("const-gchar*" "purpose")
+ '("GSocketConnectable*" "identity")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseVerifyFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-function g_unix_mount_at
- (c-name "g_unix_mount_at")
- (return-type "GUnixMountEntry*")
+(define-method verify_chain_finish
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_verify_chain_finish")
+ (return-type "GTlsCertificateFlags")
(parameters
- '("const-char*" "mount_path")
- '("guint64*" "time_read")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-function g_unix_mount_for
- (c-name "g_unix_mount_for")
- (return-type "GUnixMountEntry*")
+(define-method create_certificate_handle
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_create_certificate_handle")
+ (return-type "gchar*")
(parameters
- '("const-char*" "file_path")
- '("guint64*" "time_read")
+ '("GTlsCertificate*" "certificate")
)
)
-(define-function g_unix_mounts_changed_since
- (c-name "g_unix_mounts_changed_since")
- (return-type "gboolean")
+(define-method lookup_certificate_for_handle
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificate_for_handle")
+ (return-type "GTlsCertificate*")
(parameters
- '("guint64" "time")
+ '("const-gchar*" "handle")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseLookupFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function g_unix_mount_points_changed_since
- (c-name "g_unix_mount_points_changed_since")
- (return-type "gboolean")
+(define-method lookup_certificate_for_handle_async
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificate_for_handle_async")
+ (return-type "none")
(parameters
- '("guint64" "time")
+ '("const-gchar*" "handle")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseLookupFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(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_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")
- (return-type "GUnixMountMonitor*")
-)
-
-(define-method set_rate_limit
- (of-object "GUnixMountMonitor")
- (c-name "g_unix_mount_monitor_set_rate_limit")
- (return-type "none")
+(define-method lookup_certificate_for_handle_finish
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificate_for_handle_finish")
+ (return-type "GTlsCertificate*")
(parameters
- '("int" "limit_msec")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-function g_unix_is_mount_path_system_internal
- (c-name "g_unix_is_mount_path_system_internal")
- (return-type "gboolean")
+(define-method lookup_certificate_issuer
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificate_issuer")
+ (return-type "GTlsCertificate*")
(parameters
- '("const-char*" "mount_path")
+ '("GTlsCertificate*" "certificate")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseLookupFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function g_unix_is_system_fs_type
- (c-name "g_unix_is_system_fs_type")
- (return-type "gboolean")
+(define-method lookup_certificate_issuer_async
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificate_issuer_async")
+ (return-type "none")
(parameters
- '("const-char*" "fs_type")
+ '("GTlsCertificate*" "certificate")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseLookupFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-function g_unix_is_system_device_path
- (c-name "g_unix_is_system_device_path")
- (return-type "gboolean")
+(define-method lookup_certificate_issuer_finish
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificate_issuer_finish")
+ (return-type "GTlsCertificate*")
(parameters
- '("const-char*" "device_path")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-
-
-;; From gunixoutputstream.h
-
-(define-function g_unix_output_stream_get_type
- (c-name "g_unix_output_stream_get_type")
- (return-type "GType")
+(define-method lookup_certificates_issued_by
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificates_issued_by")
+ (return-type "GList*")
+ (parameters
+ '("GByteArray*" "issuer_raw_dn")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseLookupFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
)
-(define-function g_unix_output_stream_new
- (c-name "g_unix_output_stream_new")
- (is-constructor-of "GUnixOutputStream")
- (return-type "GOutputStream*")
+(define-method lookup_certificates_issued_by_async
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificates_issued_by_async")
+ (return-type "none")
(parameters
- '("gint" "fd")
- '("gboolean" "close_fd")
+ '("GByteArray*" "issuer_raw_dn")
+ '("GTlsInteraction*" "interaction")
+ '("GTlsDatabaseLookupFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method set_close_fd
- (of-object "GUnixOutputStream")
- (c-name "g_unix_output_stream_set_close_fd")
- (return-type "none")
+(define-method lookup_certificates_issued_by_finish
+ (of-object "GTlsDatabase")
+ (c-name "g_tls_database_lookup_certificates_issued_by_finish")
+ (return-type "GList*")
(parameters
- '("gboolean" "close_fd")
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
)
)
-(define-method get_close_fd
- (of-object "GUnixOutputStream")
- (c-name "g_unix_output_stream_get_close_fd")
- (return-type "gboolean")
+
+
+;; From gtlsfiledatabase.h
+
+(define-function g_tls_file_database_get_type
+ (c-name "g_tls_file_database_get_type")
+ (return-type "GType")
)
-(define-method get_fd
- (of-object "GUnixOutputStream")
- (c-name "g_unix_output_stream_get_fd")
- (return-type "gint")
+(define-function g_tls_file_database_new
+ (c-name "g_tls_file_database_new")
+ (is-constructor-of "GTlsFileDatabase")
+ (return-type "GTlsDatabase*")
+ (parameters
+ '("const-gchar*" "anchors")
+ '("GError**" "error")
+ )
)
-;; From gunixsocketaddress.h
+;; From gtlsinteraction.h
-(define-function g_unix_socket_address_get_type
- (c-name "g_unix_socket_address_get_type")
+(define-function g_tls_interaction_get_type
+ (c-name "g_tls_interaction_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*")
+(define-method invoke_ask_password
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_invoke_ask_password")
+ (return-type "GTlsInteractionResult")
(parameters
- '("const-gchar*" "path")
+ '("GTlsPassword*" "password")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function g_unix_socket_address_new_abstract
- (c-name "g_unix_socket_address_new_abstract")
- (return-type "GSocketAddress*")
+(define-method ask_password
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_ask_password")
+ (return-type "GTlsInteractionResult")
(parameters
- '("const-gchar*" "path")
- '("gint" "path_len")
+ '("GTlsPassword*" "password")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-function g_unix_socket_address_new_with_type
- (c-name "g_unix_socket_address_new_with_type")
- (return-type "GSocketAddress*")
+(define-method ask_password_async
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_ask_password_async")
+ (return-type "none")
(parameters
- '("const-gchar*" "path")
- '("gint" "path_len")
- '("GUnixSocketAddressType" "type")
+ '("GTlsPassword*" "password")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
)
)
-(define-method get_path
- (of-object "GUnixSocketAddress")
- (c-name "g_unix_socket_address_get_path")
- (return-type "const-char*")
+(define-method ask_password_finish
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_ask_password_finish")
+ (return-type "GTlsInteractionResult")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-(define-method get_path_len
- (of-object "GUnixSocketAddress")
- (c-name "g_unix_socket_address_get_path_len")
- (return-type "gsize")
+(define-method invoke_request_certificate
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_invoke_request_certificate")
+ (return-type "GTlsInteractionResult")
+ (parameters
+ '("GTlsConnection*" "connection")
+ '("GTlsCertificateRequestFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
)
-(define-method get_address_type
- (of-object "GUnixSocketAddress")
- (c-name "g_unix_socket_address_get_address_type")
- (return-type "GUnixSocketAddressType")
+(define-method request_certificate
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_request_certificate")
+ (return-type "GTlsInteractionResult")
+ (parameters
+ '("GTlsConnection*" "connection")
+ '("GTlsCertificateRequestFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
+ )
)
-(define-method get_is_abstract
- (of-object "GUnixSocketAddress")
- (c-name "g_unix_socket_address_get_is_abstract")
- (return-type "gboolean")
+(define-method request_certificate_async
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_request_certificate_async")
+ (return-type "none")
+ (parameters
+ '("GTlsConnection*" "connection")
+ '("GTlsCertificateRequestFlags" "flags")
+ '("GCancellable*" "cancellable")
+ '("GAsyncReadyCallback" "callback")
+ '("gpointer" "user_data")
+ )
)
-(define-function g_unix_socket_address_abstract_names_supported
- (c-name "g_unix_socket_address_abstract_names_supported")
- (return-type "gboolean")
+(define-method request_certificate_finish
+ (of-object "GTlsInteraction")
+ (c-name "g_tls_interaction_request_certificate_finish")
+ (return-type "GTlsInteractionResult")
+ (parameters
+ '("GAsyncResult*" "result")
+ '("GError**" "error")
+ )
)
-;; From gunixvolume.h
-
-
-
-;; From gunixvolumemonitor.h
-
-
-
-;; From gvfs.h
+;; From gtlspassword.h
-(define-function g_vfs_get_type
- (c-name "g_vfs_get_type")
+(define-function g_tls_password_get_type
+ (c-name "g_tls_password_get_type")
(return-type "GType")
)
-(define-method is_active
- (of-object "GVfs")
- (c-name "g_vfs_is_active")
- (return-type "gboolean")
+(define-function g_tls_password_new
+ (c-name "g_tls_password_new")
+ (is-constructor-of "GTlsPassword")
+ (return-type "GTlsPassword*")
+ (parameters
+ '("GTlsPasswordFlags" "flags")
+ '("const-gchar*" "description")
+ )
)
-(define-method get_file_for_path
- (of-object "GVfs")
- (c-name "g_vfs_get_file_for_path")
- (return-type "GFile*")
+(define-method get_value
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_get_value")
+ (return-type "const-guchar*")
+ (parameters
+ '("gsize*" "length")
+ )
+)
+
+(define-method set_value
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_set_value")
+ (return-type "none")
(parameters
- '("const-char*" "path")
+ '("const-guchar*" "value")
+ '("gssize" "length")
)
)
-(define-method get_file_for_uri
- (of-object "GVfs")
- (c-name "g_vfs_get_file_for_uri")
- (return-type "GFile*")
+(define-method set_value_full
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_set_value_full")
+ (return-type "none")
(parameters
- '("const-char*" "uri")
+ '("guchar*" "value")
+ '("gssize" "length")
+ '("GDestroyNotify" "destroy")
)
)
-(define-method get_supported_uri_schemes
- (of-object "GVfs")
- (c-name "g_vfs_get_supported_uri_schemes")
- (return-type "const-gchar*-const*")
+(define-method get_flags
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_get_flags")
+ (return-type "GTlsPasswordFlags")
)
-(define-method parse_name
- (of-object "GVfs")
- (c-name "g_vfs_parse_name")
- (return-type "GFile*")
+(define-method set_flags
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_set_flags")
+ (return-type "none")
(parameters
- '("const-char*" "parse_name")
+ '("GTlsPasswordFlags" "flags")
)
)
-(define-function g_vfs_get_default
- (c-name "g_vfs_get_default")
- (return-type "GVfs*")
-)
-
-(define-function g_vfs_get_local
- (c-name "g_vfs_get_local")
- (return-type "GVfs*")
+(define-method get_description
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_get_description")
+ (return-type "const-gchar*")
)
-(define-method register_uri_scheme
- (of-object "GVfs")
- (c-name "g_vfs_register_uri_scheme")
- (return-type "gboolean")
+(define-method set_description
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_set_description")
+ (return-type "none")
(parameters
- '("const-char*" "scheme")
- '("GVfsFileLookupFunc" "uri_func")
- '("gpointer" "uri_data")
- '("GDestroyNotify" "uri_destroy")
- '("GVfsFileLookupFunc" "parse_name_func")
- '("gpointer" "parse_name_data")
- '("GDestroyNotify" "parse_name_destroy")
+ '("const-gchar*" "description")
)
)
-(define-method unregister_uri_scheme
- (of-object "GVfs")
- (c-name "g_vfs_unregister_uri_scheme")
- (return-type "gboolean")
+(define-method get_warning
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_get_warning")
+ (return-type "const-gchar*")
+)
+
+(define-method set_warning
+ (of-object "GTlsPassword")
+ (c-name "g_tls_password_set_warning")
+ (return-type "none")
(parameters
- '("const-char*" "scheme")
+ '("const-gchar*" "warning")
)
)
-;; From gvolume.h
+;; From gtlsserverconnection.h
-(define-function g_volume_get_type
- (c-name "g_volume_get_type")
+(define-function g_tls_server_connection_get_type
+ (c-name "g_tls_server_connection_get_type")
(return-type "GType")
)
-(define-method get_name
- (of-object "GVolume")
- (c-name "g_volume_get_name")
- (return-type "char*")
+(define-function g_tls_server_connection_new
+ (c-name "g_tls_server_connection_new")
+ (is-constructor-of "GTlsServerConnection")
+ (return-type "GIOStream*")
+ (parameters
+ '("GIOStream*" "base_io_stream")
+ '("GTlsCertificate*" "certificate")
+ '("GError**" "error")
+ )
)
-(define-method get_icon
- (of-object "GVolume")
- (c-name "g_volume_get_icon")
- (return-type "GIcon*")
-)
-(define-method get_symbolic_icon
- (of-object "GVolume")
- (c-name "g_volume_get_symbolic_icon")
- (return-type "GIcon*")
-)
-(define-method get_uuid
- (of-object "GVolume")
- (c-name "g_volume_get_uuid")
- (return-type "char*")
-)
+;; From gunionvolumemonitor.h
-(define-method get_drive
- (of-object "GVolume")
- (c-name "g_volume_get_drive")
- (return-type "GDrive*")
-)
-(define-method get_mount
- (of-object "GVolume")
- (c-name "g_volume_get_mount")
- (return-type "GMount*")
-)
-(define-method can_mount
- (of-object "GVolume")
- (c-name "g_volume_can_mount")
- (return-type "gboolean")
-)
+;; From gunixconnection.h
-(define-method can_eject
- (of-object "GVolume")
- (c-name "g_volume_can_eject")
- (return-type "gboolean")
+(define-function g_unix_connection_get_type
+ (c-name "g_unix_connection_get_type")
+ (return-type "GType")
)
-(define-method should_automount
- (of-object "GVolume")
- (c-name "g_volume_should_automount")
+(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 mount
- (of-object "GVolume")
- (c-name "g_volume_mount")
- (return-type "none")
+(define-method receive_fd
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_receive_fd")
+ (return-type "gint")
(parameters
- '("GMountMountFlags" "flags")
- '("GMountOperation*" "mount_operation")
'("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GError**" "error")
)
)
-(define-method mount_finish
- (of-object "GVolume")
- (c-name "g_volume_mount_finish")
+(define-method send_credentials
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_send_credentials")
(return-type "gboolean")
(parameters
- '("GAsyncResult*" "result")
+ '("GCancellable*" "cancellable")
'("GError**" "error")
)
)
-(define-method eject
- (of-object "GVolume")
- (c-name "g_volume_eject")
+(define-method send_credentials_async
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_send_credentials_async")
(return-type "none")
(parameters
- '("GMountUnmountFlags" "flags")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method eject_finish
- (of-object "GVolume")
- (c-name "g_volume_eject_finish")
+(define-method send_credentials_finish
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_send_credentials_finish")
(return-type "gboolean")
(parameters
'("GAsyncResult*" "result")
)
)
-(define-method get_identifier
- (of-object "GVolume")
- (c-name "g_volume_get_identifier")
- (return-type "char*")
+(define-method receive_credentials
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_receive_credentials")
+ (return-type "GCredentials*")
(parameters
- '("const-char*" "kind")
+ '("GCancellable*" "cancellable")
+ '("GError**" "error")
)
)
-(define-method enumerate_identifiers
- (of-object "GVolume")
- (c-name "g_volume_enumerate_identifiers")
- (return-type "char**")
-)
-
-(define-method get_activation_root
- (of-object "GVolume")
- (c-name "g_volume_get_activation_root")
- (return-type "GFile*")
-)
-
-(define-method eject_with_operation
- (of-object "GVolume")
- (c-name "g_volume_eject_with_operation")
+(define-method receive_credentials_async
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_receive_credentials_async")
(return-type "none")
(parameters
- '("GMountUnmountFlags" "flags")
- '("GMountOperation*" "mount_operation")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method eject_with_operation_finish
- (of-object "GVolume")
- (c-name "g_volume_eject_with_operation_finish")
- (return-type "gboolean")
+(define-method receive_credentials_finish
+ (of-object "GUnixConnection")
+ (c-name "g_unix_connection_receive_credentials_finish")
+ (return-type "GCredentials*")
(parameters
'("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method get_sort_key
- (of-object "GVolume")
- (c-name "g_volume_get_sort_key")
- (return-type "const-gchar*")
+
+
+;; 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 gvolumemonitor.h
+;; From gunixfdlist.h
-(define-function g_volume_monitor_get_type
- (c-name "g_volume_monitor_get_type")
+(define-function g_unix_fd_list_get_type
+ (c-name "g_unix_fd_list_get_type")
(return-type "GType")
)
-(define-function g_volume_monitor_get
- (c-name "g_volume_monitor_get")
- (return-type "GVolumeMonitor*")
+(define-function g_unix_fd_list_new
+ (c-name "g_unix_fd_list_new")
+ (is-constructor-of "GUnixFdList")
+ (return-type "GUnixFDList*")
)
-(define-method get_connected_drives
- (of-object "GVolumeMonitor")
- (c-name "g_volume_monitor_get_connected_drives")
- (return-type "GList*")
+(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 get_volumes
- (of-object "GVolumeMonitor")
- (c-name "g_volume_monitor_get_volumes")
- (return-type "GList*")
+(define-method append
+ (of-object "GUnixFDList")
+ (c-name "g_unix_fd_list_append")
+ (return-type "gint")
+ (parameters
+ '("gint" "fd")
+ '("GError**" "error")
+ )
)
-(define-method get_mounts
- (of-object "GVolumeMonitor")
- (c-name "g_volume_monitor_get_mounts")
- (return-type "GList*")
+(define-method get_length
+ (of-object "GUnixFDList")
+ (c-name "g_unix_fd_list_get_length")
+ (return-type "gint")
)
-(define-method get_volume_for_uuid
- (of-object "GVolumeMonitor")
- (c-name "g_volume_monitor_get_volume_for_uuid")
- (return-type "GVolume*")
+(define-method get
+ (of-object "GUnixFDList")
+ (c-name "g_unix_fd_list_get")
+ (return-type "gint")
(parameters
- '("const-char*" "uuid")
+ '("gint" "index_")
+ '("GError**" "error")
)
)
-(define-method get_mount_for_uuid
- (of-object "GVolumeMonitor")
- (c-name "g_volume_monitor_get_mount_for_uuid")
- (return-type "GMount*")
+(define-method peek_fds
+ (of-object "GUnixFDList")
+ (c-name "g_unix_fd_list_peek_fds")
+ (return-type "const-gint*")
(parameters
- '("const-char*" "uuid")
+ '("gint*" "length")
)
)
-(define-function g_volume_monitor_adopt_orphan_mount
- (c-name "g_volume_monitor_adopt_orphan_mount")
- (return-type "GVolume*")
+(define-method steal_fds
+ (of-object "GUnixFDList")
+ (c-name "g_unix_fd_list_steal_fds")
+ (return-type "gint*")
(parameters
- '("GMount*" "mount")
+ '("gint*" "length")
)
)
-;; From gwin32appinfo.h
+;; From gunixfdmessage.h
-(define-function g_win32_app_info_get_type
- (c-name "g_win32_app_info_get_type")
+(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")
+ )
+)
-;; From gwin32inputstream.h
+(define-method append_fd
+ (of-object "GUnixFDMessage")
+ (c-name "g_unix_fd_message_append_fd")
+ (return-type "gboolean")
+ (parameters
+ '("gint" "fd")
+ '("GError**" "error")
+ )
+)
-(define-function g_win32_input_stream_get_type
- (c-name "g_win32_input_stream_get_type")
+
+
+;; 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_win32_input_stream_new
- (c-name "g_win32_input_stream_new")
- (is-constructor-of "GWin32InputStream")
+(define-function g_unix_input_stream_new
+ (c-name "g_unix_input_stream_new")
+ (is-constructor-of "GUnixInputStream")
(return-type "GInputStream*")
(parameters
- '("void*" "handle")
- '("gboolean" "close_handle")
+ '("gint" "fd")
+ '("gboolean" "close_fd")
)
)
-(define-method set_close_handle
- (of-object "GWin32InputStream")
- (c-name "g_win32_input_stream_set_close_handle")
+(define-method set_close_fd
+ (of-object "GUnixInputStream")
+ (c-name "g_unix_input_stream_set_close_fd")
(return-type "none")
(parameters
- '("gboolean" "close_handle")
+ '("gboolean" "close_fd")
)
)
-(define-method get_close_handle
- (of-object "GWin32InputStream")
- (c-name "g_win32_input_stream_get_close_handle")
+(define-method get_close_fd
+ (of-object "GUnixInputStream")
+ (c-name "g_unix_input_stream_get_close_fd")
(return-type "gboolean")
)
-(define-method get_handle
- (of-object "GWin32InputStream")
- (c-name "g_win32_input_stream_get_handle")
- (return-type "void*")
+(define-method get_fd
+ (of-object "GUnixInputStream")
+ (c-name "g_unix_input_stream_get_fd")
+ (return-type "gint")
)
-;; From gwin32mount.h
-
-
-
-;; From gwin32networking.h
-
-
-
-;; From gwin32networkmonitor.h
+;; From gunixmount.h
-;; From gwin32outputstream.h
+;; From gunixmounts.h
-(define-function g_win32_output_stream_get_type
- (c-name "g_win32_output_stream_get_type")
+(define-function g_unix_mount_entry_get_type
+ (c-name "g_unix_mount_entry_get_type")
(return-type "GType")
)
-(define-function g_win32_output_stream_new
- (c-name "g_win32_output_stream_new")
- (is-constructor-of "GWin32OutputStream")
- (return-type "GOutputStream*")
- (parameters
- '("void*" "handle")
- '("gboolean" "close_handle")
- )
+(define-function g_unix_mount_point_get_type
+ (c-name "g_unix_mount_point_get_type")
+ (return-type "GType")
)
-(define-method set_close_handle
- (of-object "GWin32OutputStream")
- (c-name "g_win32_output_stream_set_close_handle")
- (return-type "none")
+(define-function g_unix_mount_copy
+ (c-name "g_unix_mount_copy")
+ (return-type "GUnixMountEntry*")
(parameters
- '("gboolean" "close_handle")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-method get_close_handle
- (of-object "GWin32OutputStream")
- (c-name "g_win32_output_stream_get_close_handle")
- (return-type "gboolean")
-)
-
-(define-method get_handle
- (of-object "GWin32OutputStream")
- (c-name "g_win32_output_stream_get_handle")
- (return-type "void*")
+(define-method free
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_free")
+ (return-type "none")
)
-
-
-;; From gwin32registrykey.h
-
(define-method copy
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_copy")
- (return-type "GWin32RegistrySubkeyIter*")
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_copy")
+ (return-type "GUnixMountPoint*")
)
-(define-method free
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_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-method assign
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_assign")
- (return-type "none")
+(define-function g_unix_mount_get_mount_path
+ (c-name "g_unix_mount_get_mount_path")
+ (return-type "const-char*")
(parameters
- '("const-GWin32RegistrySubkeyIter*" "other")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-function g_win32_registry_subkey_iter_get_type
- (c-name "g_win32_registry_subkey_iter_get_type")
- (return-type "GType")
+(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-method copy
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_copy")
- (return-type "GWin32RegistryValueIter*")
+(define-function g_unix_mount_get_root_path
+ (c-name "g_unix_mount_get_root_path")
+ (return-type "const-char*")
+ (parameters
+ '("GUnixMountEntry*" "mount_entry")
+ )
)
-(define-method free
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_free")
- (return-type "none")
+(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-method assign
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_assign")
- (return-type "none")
+(define-function g_unix_mount_get_options
+ (c-name "g_unix_mount_get_options")
+ (return-type "const-char*")
(parameters
- '("const-GWin32RegistryValueIter*" "other")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-function g_win32_registry_value_iter_get_type
- (c-name "g_win32_registry_value_iter_get_type")
- (return-type "GType")
+(define-function g_unix_mount_is_readonly
+ (c-name "g_unix_mount_is_readonly")
+ (return-type "gboolean")
+ (parameters
+ '("GUnixMountEntry*" "mount_entry")
+ )
)
-(define-function g_win32_registry_key_get_type
- (c-name "g_win32_registry_key_get_type")
- (return-type "GType")
+(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_win32_registry_key_new
- (c-name "g_win32_registry_key_new")
- (is-constructor-of "GWin32RegistryKey")
- (return-type "GWin32RegistryKey*")
+(define-function g_unix_mount_guess_can_eject
+ (c-name "g_unix_mount_guess_can_eject")
+ (return-type "gboolean")
(parameters
- '("const-gchar*" "path")
- '("GError**" "error")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-function g_win32_registry_key_new_w
- (c-name "g_win32_registry_key_new_w")
- (return-type "GWin32RegistryKey*")
+(define-function g_unix_mount_guess_should_display
+ (c-name "g_unix_mount_guess_should_display")
+ (return-type "gboolean")
(parameters
- '("const-gunichar2*" "path")
- '("GError**" "error")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-method get_child
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_get_child")
- (return-type "GWin32RegistryKey*")
+(define-function g_unix_mount_guess_name
+ (c-name "g_unix_mount_guess_name")
+ (return-type "char*")
(parameters
- '("const-gchar*" "subkey")
- '("GError**" "error")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-method get_child_w
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_get_child_w")
- (return-type "GWin32RegistryKey*")
+(define-function g_unix_mount_guess_icon
+ (c-name "g_unix_mount_guess_icon")
+ (return-type "GIcon*")
(parameters
- '("const-gunichar2*" "subkey")
- '("GError**" "error")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-method init
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_init")
- (return-type "gboolean")
+(define-function g_unix_mount_guess_symbolic_icon
+ (c-name "g_unix_mount_guess_symbolic_icon")
+ (return-type "GIcon*")
(parameters
- '("GWin32RegistryKey*" "key")
- '("GError**" "error")
+ '("GUnixMountEntry*" "mount_entry")
)
)
-(define-method clear
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_clear")
- (return-type "none")
+(define-method get_mount_path
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_get_mount_path")
+ (return-type "const-char*")
)
-(define-method n_subkeys
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_n_subkeys")
- (return-type "gsize")
+(define-method get_device_path
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_get_device_path")
+ (return-type "const-char*")
)
-(define-method next
- (of-object "GWin32RegistrySubkeyIter")
- (c-name "g_win32_registry_subkey_iter_next")
+(define-method get_fs_type
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_get_fs_type")
+ (return-type "const-char*")
+)
+
+(define-method get_options
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_get_options")
+ (return-type "const-char*")
+)
+
+(define-method is_readonly
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_is_readonly")
(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")
+(define-method is_user_mountable
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_is_user_mountable")
(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")
+(define-method is_loopback
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_is_loopback")
(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")
+(define-method guess_can_eject
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_guess_can_eject")
(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 guess_name
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_guess_name")
+ (return-type "char*")
)
-(define-method n_values
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_n_values")
- (return-type "gsize")
+(define-method guess_icon
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_guess_icon")
+ (return-type "GIcon*")
)
-(define-method next
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_next")
- (return-type "gboolean")
+(define-method guess_symbolic_icon
+ (of-object "GUnixMountPoint")
+ (c-name "g_unix_mount_point_guess_symbolic_icon")
+ (return-type "GIcon*")
+)
+
+(define-function g_unix_mount_points_get
+ (c-name "g_unix_mount_points_get")
+ (return-type "GList*")
(parameters
- '("gboolean" "skip_errors")
- '("GError**" "error")
+ '("guint64*" "time_read")
)
)
-(define-method get_value_type
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_get_value_type")
- (return-type "gboolean")
+(define-function g_unix_mounts_get
+ (c-name "g_unix_mounts_get")
+ (return-type "GList*")
(parameters
- '("GWin32RegistryValueType*" "value_type")
- '("GError**" "error")
+ '("guint64*" "time_read")
)
)
-(define-method get_name
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_get_name")
- (return-type "gboolean")
+(define-function g_unix_mount_at
+ (c-name "g_unix_mount_at")
+ (return-type "GUnixMountEntry*")
(parameters
- '("gchar**" "value_name")
- '("gsize*" "value_name_len")
- '("GError**" "error")
+ '("const-char*" "mount_path")
+ '("guint64*" "time_read")
)
)
-(define-method get_name_w
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_get_name_w")
+(define-function g_unix_mount_for
+ (c-name "g_unix_mount_for")
+ (return-type "GUnixMountEntry*")
+ (parameters
+ '("const-char*" "file_path")
+ '("guint64*" "time_read")
+ )
+)
+
+(define-function g_unix_mounts_changed_since
+ (c-name "g_unix_mounts_changed_since")
(return-type "gboolean")
(parameters
- '("gunichar2**" "value_name")
- '("gsize*" "value_name_len")
- '("GError**" "error")
+ '("guint64" "time")
)
)
-(define-method get_data
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_get_data")
+(define-function g_unix_mount_points_changed_since
+ (c-name "g_unix_mount_points_changed_since")
(return-type "gboolean")
(parameters
- '("gboolean" "auto_expand")
- '("gpointer*" "value_data")
- '("gsize*" "value_data_size")
- '("GError**" "error")
+ '("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_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")
+ (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-method get_data_w
- (of-object "GWin32RegistryValueIter")
- (c-name "g_win32_registry_value_iter_get_data_w")
+(define-function g_unix_is_mount_path_system_internal
+ (c-name "g_unix_is_mount_path_system_internal")
(return-type "gboolean")
(parameters
- '("gboolean" "auto_expand")
- '("gpointer*" "value_data")
- '("gsize*" "value_data_size")
- '("GError**" "error")
+ '("const-char*" "mount_path")
)
)
-(define-method get_value
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_get_value")
+(define-function g_unix_is_system_fs_type
+ (c-name "g_unix_is_system_fs_type")
(return-type "gboolean")
(parameters
- '("gboolean" "auto_expand")
- '("const-gchar*" "value_name")
- '("GWin32RegistryValueType*" "value_type")
- '("gpointer*" "value_data")
- '("gsize*" "value_data_size")
- '("GError**" "error")
+ '("const-char*" "fs_type")
)
)
-(define-method get_value_w
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_get_value_w")
+(define-function g_unix_is_system_device_path
+ (c-name "g_unix_is_system_device_path")
(return-type "gboolean")
(parameters
- '("gboolean" "auto_expand")
- '("const-gunichar2*" "value_name")
- '("GWin32RegistryValueType*" "value_type")
- '("gpointer*" "value_data")
- '("gsize*" "value_data_size")
- '("GError**" "error")
+ '("const-char*" "device_path")
)
)
-(define-method get_path
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_get_path")
- (return-type "const-gchar*")
+
+
+;; From gunixoutputstream.h
+
+(define-function g_unix_output_stream_get_type
+ (c-name "g_unix_output_stream_get_type")
+ (return-type "GType")
)
-(define-method get_path_w
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_get_path_w")
- (return-type "const-gunichar2*")
+(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 watch
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_watch")
- (return-type "gboolean")
+(define-method set_close_fd
+ (of-object "GUnixOutputStream")
+ (c-name "g_unix_output_stream_set_close_fd")
+ (return-type "none")
(parameters
- '("gboolean" "watch_children")
- '("GWin32RegistryKeyWatcherFlags" "watch_flags")
- '("GWin32RegistryKeyWatchCallbackFunc" "callback")
- '("gpointer" "user_data")
- '("GError**" "error")
+ '("gboolean" "close_fd")
)
)
-(define-method has_changed
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_has_changed")
+(define-method get_close_fd
+ (of-object "GUnixOutputStream")
+ (c-name "g_unix_output_stream_get_close_fd")
(return-type "gboolean")
)
-(define-method erase_change_indicator
- (of-object "GWin32RegistryKey")
- (c-name "g_win32_registry_key_erase_change_indicator")
- (return-type "none")
+(define-method get_fd
+ (of-object "GUnixOutputStream")
+ (c-name "g_unix_output_stream_get_fd")
+ (return-type "gint")
)
-;; From gwin32volumemonitor.h
-
-
-
-;; From gzlibcompressor.h
+;; From gunixsocketaddress.h
-(define-function g_zlib_compressor_get_type
- (c-name "g_zlib_compressor_get_type")
+(define-function g_unix_socket_address_get_type
+ (c-name "g_unix_socket_address_get_type")
(return-type "GType")
)
-(define-function g_zlib_compressor_new
- (c-name "g_zlib_compressor_new")
- (is-constructor-of "GZlibCompressor")
- (return-type "GZlibCompressor*")
+(define-function g_unix_socket_address_new
+ (c-name "g_unix_socket_address_new")
+ (is-constructor-of "GUnixSocketAddress")
+ (return-type "GSocketAddress*")
(parameters
- '("GZlibCompressorFormat" "format")
- '("int" "level")
+ '("const-gchar*" "path")
)
)
-(define-method get_file_info
- (of-object "GZlibCompressor")
- (c-name "g_zlib_compressor_get_file_info")
- (return-type "GFileInfo*")
+(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-method set_file_info
- (of-object "GZlibCompressor")
- (c-name "g_zlib_compressor_set_file_info")
- (return-type "none")
+(define-function g_unix_socket_address_new_with_type
+ (c-name "g_unix_socket_address_new_with_type")
+ (return-type "GSocketAddress*")
(parameters
- '("GFileInfo*" "file_info")
+ '("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")
+)
-;; From gzlibdecompressor.h
-
-(define-function g_zlib_decompressor_get_type
- (c-name "g_zlib_decompressor_get_type")
- (return-type "GType")
+(define-method get_address_type
+ (of-object "GUnixSocketAddress")
+ (c-name "g_unix_socket_address_get_address_type")
+ (return-type "GUnixSocketAddressType")
)
-(define-function g_zlib_decompressor_new
- (c-name "g_zlib_decompressor_new")
- (is-constructor-of "GZlibDecompressor")
- (return-type "GZlibDecompressor*")
- (parameters
- '("GZlibCompressorFormat" "format")
- )
+(define-method get_is_abstract
+ (of-object "GUnixSocketAddress")
+ (c-name "g_unix_socket_address_get_is_abstract")
+ (return-type "gboolean")
)
-(define-method get_file_info
- (of-object "GZlibDecompressor")
- (c-name "g_zlib_decompressor_get_file_info")
- (return-type "GFileInfo*")
+(define-function g_unix_socket_address_abstract_names_supported
+ (c-name "g_unix_socket_address_abstract_names_supported")
+ (return-type "gboolean")
)
-;; From thumbnail-verify.h
+;; From gunixvolume.h
+
-(define-function thumbnail_verify
- (c-name "thumbnail_verify")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "thumbnail_path")
- '("const-gchar*" "file_uri")
- '("const-GLocalFileStat*" "file_stat_buf")
- )
-)
+
+;; From gunixvolumemonitor.h
-;; From xdp-dbus.h
+;; From gvfs.h
-(define-function gxdp_documents_get_type
- (c-name "gxdp_documents_get_type")
+(define-function g_vfs_get_type
+ (c-name "g_vfs_get_type")
(return-type "GType")
)
-(define-function gxdp_documents_interface_info
- (c-name "gxdp_documents_interface_info")
- (return-type "GDBusInterfaceInfo*")
+(define-method is_active
+ (of-object "GVfs")
+ (c-name "g_vfs_is_active")
+ (return-type "gboolean")
)
-(define-function gxdp_documents_override_properties
- (c-name "gxdp_documents_override_properties")
- (return-type "guint")
+(define-method get_file_for_path
+ (of-object "GVfs")
+ (c-name "g_vfs_get_file_for_path")
+ (return-type "GFile*")
(parameters
- '("GObjectClass*" "klass")
- '("guint" "property_id_begin")
+ '("const-char*" "path")
)
)
-(define-method complete_get_mount_point
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_get_mount_point")
- (return-type "none")
+(define-method get_file_for_uri
+ (of-object "GVfs")
+ (c-name "g_vfs_get_file_for_uri")
+ (return-type "GFile*")
(parameters
- '("GDBusMethodInvocation*" "invocation")
- '("const-gchar*" "path")
+ '("const-char*" "uri")
)
)
-(define-method complete_add
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_add")
- (return-type "none")
+(define-method get_supported_uri_schemes
+ (of-object "GVfs")
+ (c-name "g_vfs_get_supported_uri_schemes")
+ (return-type "const-gchar*-const*")
+)
+
+(define-method parse_name
+ (of-object "GVfs")
+ (c-name "g_vfs_parse_name")
+ (return-type "GFile*")
(parameters
- '("GDBusMethodInvocation*" "invocation")
- '("GUnixFDList*" "fd_list")
- '("const-gchar*" "doc_id")
+ '("const-char*" "parse_name")
)
)
-(define-method complete_add_named
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_add_named")
- (return-type "none")
+(define-function g_vfs_get_default
+ (c-name "g_vfs_get_default")
+ (return-type "GVfs*")
+)
+
+(define-function g_vfs_get_local
+ (c-name "g_vfs_get_local")
+ (return-type "GVfs*")
+)
+
+(define-method register_uri_scheme
+ (of-object "GVfs")
+ (c-name "g_vfs_register_uri_scheme")
+ (return-type "gboolean")
(parameters
- '("GDBusMethodInvocation*" "invocation")
- '("GUnixFDList*" "fd_list")
- '("const-gchar*" "doc_id")
+ '("const-char*" "scheme")
+ '("GVfsFileLookupFunc" "uri_func")
+ '("gpointer" "uri_data")
+ '("GDestroyNotify" "uri_destroy")
+ '("GVfsFileLookupFunc" "parse_name_func")
+ '("gpointer" "parse_name_data")
+ '("GDestroyNotify" "parse_name_destroy")
)
)
-(define-method complete_add_full
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_add_full")
- (return-type "none")
+(define-method unregister_uri_scheme
+ (of-object "GVfs")
+ (c-name "g_vfs_unregister_uri_scheme")
+ (return-type "gboolean")
(parameters
- '("GDBusMethodInvocation*" "invocation")
- '("GUnixFDList*" "fd_list")
- '("const-gchar*-const*" "doc_ids")
- '("GVariant*" "extra_out")
+ '("const-char*" "scheme")
)
)
-(define-method complete_grant_permissions
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_grant_permissions")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- )
+
+
+;; From gvolume.h
+
+(define-function g_volume_get_type
+ (c-name "g_volume_get_type")
+ (return-type "GType")
+)
+
+(define-method get_name
+ (of-object "GVolume")
+ (c-name "g_volume_get_name")
+ (return-type "char*")
)
-(define-method complete_revoke_permissions
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_revoke_permissions")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- )
+(define-method get_icon
+ (of-object "GVolume")
+ (c-name "g_volume_get_icon")
+ (return-type "GIcon*")
)
-(define-method complete_delete
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_delete")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- )
+(define-method get_symbolic_icon
+ (of-object "GVolume")
+ (c-name "g_volume_get_symbolic_icon")
+ (return-type "GIcon*")
)
-(define-method complete_lookup
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_lookup")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- '("const-gchar*" "doc_id")
- )
+(define-method get_uuid
+ (of-object "GVolume")
+ (c-name "g_volume_get_uuid")
+ (return-type "char*")
)
-(define-method complete_info
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_info")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- '("const-gchar*" "path")
- '("GVariant*" "apps")
- )
+(define-method get_drive
+ (of-object "GVolume")
+ (c-name "g_volume_get_drive")
+ (return-type "GDrive*")
)
-(define-method complete_list
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_complete_list")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- '("GVariant*" "docs")
- )
+(define-method get_mount
+ (of-object "GVolume")
+ (c-name "g_volume_get_mount")
+ (return-type "GMount*")
)
-(define-method call_get_mount_point
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_get_mount_point")
- (return-type "none")
- (parameters
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
+(define-method can_mount
+ (of-object "GVolume")
+ (c-name "g_volume_can_mount")
+ (return-type "gboolean")
)
-(define-method call_get_mount_point_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_get_mount_point_finish")
+(define-method can_eject
+ (of-object "GVolume")
+ (c-name "g_volume_can_eject")
(return-type "gboolean")
- (parameters
- '("gchar**" "out_path")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
)
-(define-method call_get_mount_point_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_get_mount_point_sync")
+(define-method should_automount
+ (of-object "GVolume")
+ (c-name "g_volume_should_automount")
(return-type "gboolean")
- (parameters
- '("gchar**" "out_path")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
)
-(define-method call_add
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add")
+(define-method mount
+ (of-object "GVolume")
+ (c-name "g_volume_mount")
(return-type "none")
(parameters
- '("GVariant*" "arg_o_path_fd")
- '("gboolean" "arg_reuse_existing")
- '("gboolean" "arg_persistent")
- '("GUnixFDList*" "fd_list")
+ '("GMountMountFlags" "flags")
+ '("GMountOperation*" "mount_operation")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method call_add_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_finish")
- (return-type "gboolean")
- (parameters
- '("gchar**" "out_doc_id")
- '("GUnixFDList**" "out_fd_list")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
-)
-
-(define-method call_add_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_sync")
+(define-method mount_finish
+ (of-object "GVolume")
+ (c-name "g_volume_mount_finish")
(return-type "gboolean")
(parameters
- '("GVariant*" "arg_o_path_fd")
- '("gboolean" "arg_reuse_existing")
- '("gboolean" "arg_persistent")
- '("GUnixFDList*" "fd_list")
- '("gchar**" "out_doc_id")
- '("GUnixFDList**" "out_fd_list")
- '("GCancellable*" "cancellable")
+ '("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method call_add_named
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_named")
+(define-method eject
+ (of-object "GVolume")
+ (c-name "g_volume_eject")
(return-type "none")
(parameters
- '("GVariant*" "arg_o_path_parent_fd")
- '("const-gchar*" "arg_filename")
- '("gboolean" "arg_reuse_existing")
- '("gboolean" "arg_persistent")
- '("GUnixFDList*" "fd_list")
+ '("GMountUnmountFlags" "flags")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method call_add_named_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_named_finish")
- (return-type "gboolean")
- (parameters
- '("gchar**" "out_doc_id")
- '("GUnixFDList**" "out_fd_list")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
-)
-
-(define-method call_add_named_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_named_sync")
+(define-method eject_finish
+ (of-object "GVolume")
+ (c-name "g_volume_eject_finish")
(return-type "gboolean")
(parameters
- '("GVariant*" "arg_o_path_parent_fd")
- '("const-gchar*" "arg_filename")
- '("gboolean" "arg_reuse_existing")
- '("gboolean" "arg_persistent")
- '("GUnixFDList*" "fd_list")
- '("gchar**" "out_doc_id")
- '("GUnixFDList**" "out_fd_list")
- '("GCancellable*" "cancellable")
+ '("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method call_add_full
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_full")
- (return-type "none")
+(define-method get_identifier
+ (of-object "GVolume")
+ (c-name "g_volume_get_identifier")
+ (return-type "char*")
(parameters
- '("GVariant*" "arg_o_path_fds")
- '("guint" "arg_flags")
- '("const-gchar*" "arg_app_id")
- '("const-gchar*-const*" "arg_permissions")
- '("GUnixFDList*" "fd_list")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-char*" "kind")
)
)
-(define-method call_add_full_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_full_finish")
- (return-type "gboolean")
- (parameters
- '("gchar***" "out_doc_ids")
- '("GVariant**" "out_extra_out")
- '("GUnixFDList**" "out_fd_list")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
+(define-method enumerate_identifiers
+ (of-object "GVolume")
+ (c-name "g_volume_enumerate_identifiers")
+ (return-type "char**")
)
-(define-method call_add_full_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_add_full_sync")
- (return-type "gboolean")
- (parameters
- '("GVariant*" "arg_o_path_fds")
- '("guint" "arg_flags")
- '("const-gchar*" "arg_app_id")
- '("const-gchar*-const*" "arg_permissions")
- '("GUnixFDList*" "fd_list")
- '("gchar***" "out_doc_ids")
- '("GVariant**" "out_extra_out")
- '("GUnixFDList**" "out_fd_list")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_activation_root
+ (of-object "GVolume")
+ (c-name "g_volume_get_activation_root")
+ (return-type "GFile*")
)
-(define-method call_grant_permissions
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_grant_permissions")
+(define-method eject_with_operation
+ (of-object "GVolume")
+ (c-name "g_volume_eject_with_operation")
(return-type "none")
(parameters
- '("const-gchar*" "arg_doc_id")
- '("const-gchar*" "arg_app_id")
- '("const-gchar*-const*" "arg_permissions")
+ '("GMountUnmountFlags" "flags")
+ '("GMountOperation*" "mount_operation")
'("GCancellable*" "cancellable")
'("GAsyncReadyCallback" "callback")
'("gpointer" "user_data")
)
)
-(define-method call_grant_permissions_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_grant_permissions_finish")
+(define-method eject_with_operation_finish
+ (of-object "GVolume")
+ (c-name "g_volume_eject_with_operation_finish")
(return-type "gboolean")
(parameters
- '("GAsyncResult*" "res")
+ '("GAsyncResult*" "result")
'("GError**" "error")
)
)
-(define-method call_grant_permissions_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_grant_permissions_sync")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "arg_doc_id")
- '("const-gchar*" "arg_app_id")
- '("const-gchar*-const*" "arg_permissions")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_sort_key
+ (of-object "GVolume")
+ (c-name "g_volume_get_sort_key")
+ (return-type "const-gchar*")
)
-(define-method call_revoke_permissions
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_revoke_permissions")
- (return-type "none")
- (parameters
- '("const-gchar*" "arg_doc_id")
- '("const-gchar*" "arg_app_id")
- '("const-gchar*-const*" "arg_permissions")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-(define-method call_revoke_permissions_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_revoke_permissions_finish")
- (return-type "gboolean")
- (parameters
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
+
+;; From gvolumemonitor.h
+
+(define-function g_volume_monitor_get_type
+ (c-name "g_volume_monitor_get_type")
+ (return-type "GType")
)
-(define-method call_revoke_permissions_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_revoke_permissions_sync")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "arg_doc_id")
- '("const-gchar*" "arg_app_id")
- '("const-gchar*-const*" "arg_permissions")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-function g_volume_monitor_get
+ (c-name "g_volume_monitor_get")
+ (return-type "GVolumeMonitor*")
)
-(define-method call_delete
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_delete")
- (return-type "none")
- (parameters
- '("const-gchar*" "arg_doc_id")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
+(define-method get_connected_drives
+ (of-object "GVolumeMonitor")
+ (c-name "g_volume_monitor_get_connected_drives")
+ (return-type "GList*")
)
-(define-method call_delete_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_delete_finish")
- (return-type "gboolean")
- (parameters
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
+(define-method get_volumes
+ (of-object "GVolumeMonitor")
+ (c-name "g_volume_monitor_get_volumes")
+ (return-type "GList*")
)
-(define-method call_delete_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_delete_sync")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "arg_doc_id")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_mounts
+ (of-object "GVolumeMonitor")
+ (c-name "g_volume_monitor_get_mounts")
+ (return-type "GList*")
)
-(define-method call_lookup
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_lookup")
- (return-type "none")
+(define-method get_volume_for_uuid
+ (of-object "GVolumeMonitor")
+ (c-name "g_volume_monitor_get_volume_for_uuid")
+ (return-type "GVolume*")
(parameters
- '("const-gchar*" "arg_filename")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-char*" "uuid")
)
)
-(define-method call_lookup_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_lookup_finish")
- (return-type "gboolean")
+(define-method get_mount_for_uuid
+ (of-object "GVolumeMonitor")
+ (c-name "g_volume_monitor_get_mount_for_uuid")
+ (return-type "GMount*")
(parameters
- '("gchar**" "out_doc_id")
- '("GAsyncResult*" "res")
- '("GError**" "error")
+ '("const-char*" "uuid")
)
)
-(define-method call_lookup_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_lookup_sync")
- (return-type "gboolean")
+(define-function g_volume_monitor_adopt_orphan_mount
+ (c-name "g_volume_monitor_adopt_orphan_mount")
+ (return-type "GVolume*")
(parameters
- '("const-gchar*" "arg_filename")
- '("gchar**" "out_doc_id")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("GMount*" "mount")
)
)
-(define-method call_info
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_info")
- (return-type "none")
- (parameters
- '("const-gchar*" "arg_doc_id")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
+
+
+;; From gwin32appinfo.h
+
+(define-function g_win32_app_info_get_type
+ (c-name "g_win32_app_info_get_type")
+ (return-type "GType")
)
-(define-method call_info_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_info_finish")
- (return-type "gboolean")
- (parameters
- '("gchar**" "out_path")
- '("GVariant**" "out_apps")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
+
+
+;; From gwin32inputstream.h
+
+(define-function g_win32_input_stream_get_type
+ (c-name "g_win32_input_stream_get_type")
+ (return-type "GType")
)
-(define-method call_info_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_info_sync")
- (return-type "gboolean")
+(define-function g_win32_input_stream_new
+ (c-name "g_win32_input_stream_new")
+ (is-constructor-of "GWin32InputStream")
+ (return-type "GInputStream*")
(parameters
- '("const-gchar*" "arg_doc_id")
- '("gchar**" "out_path")
- '("GVariant**" "out_apps")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("void*" "handle")
+ '("gboolean" "close_handle")
)
)
-(define-method call_list
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_list")
+(define-method set_close_handle
+ (of-object "GWin32InputStream")
+ (c-name "g_win32_input_stream_set_close_handle")
(return-type "none")
(parameters
- '("const-gchar*" "arg_app_id")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "close_handle")
)
)
-(define-method call_list_finish
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_list_finish")
+(define-method get_close_handle
+ (of-object "GWin32InputStream")
+ (c-name "g_win32_input_stream_get_close_handle")
(return-type "gboolean")
- (parameters
- '("GVariant**" "out_docs")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
)
-(define-method call_list_sync
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_call_list_sync")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "arg_app_id")
- '("GVariant**" "out_docs")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_handle
+ (of-object "GWin32InputStream")
+ (c-name "g_win32_input_stream_get_handle")
+ (return-type "void*")
)
-(define-method get_version
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_get_version")
- (return-type "guint")
-)
-(define-method set_version
- (of-object "GXdpDocuments")
- (c-name "gxdp_documents_set_version")
- (return-type "none")
- (parameters
- '("guint" "value")
- )
-)
-(define-function gxdp_documents_proxy_get_type
- (c-name "gxdp_documents_proxy_get_type")
- (return-type "GType")
-)
+;; From gwin32mount.h
-(define-function gxdp_documents_proxy_new_finish
- (c-name "gxdp_documents_proxy_new_finish")
- (return-type "GXdpDocuments*")
- (parameters
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
+
+
+;; From gwin32networking.h
+
+
+
+;; From gwin32networkmonitor.h
+
+
+
+;; From gwin32outputstream.h
+
+(define-function g_win32_output_stream_get_type
+ (c-name "g_win32_output_stream_get_type")
+ (return-type "GType")
)
-(define-function gxdp_documents_proxy_new_sync
- (c-name "gxdp_documents_proxy_new_sync")
- (return-type "GXdpDocuments*")
+(define-function g_win32_output_stream_new
+ (c-name "g_win32_output_stream_new")
+ (is-constructor-of "GWin32OutputStream")
+ (return-type "GOutputStream*")
(parameters
- '("GDBusConnection*" "connection")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("void*" "handle")
+ '("gboolean" "close_handle")
)
)
-(define-function gxdp_documents_proxy_new_for_bus
- (c-name "gxdp_documents_proxy_new_for_bus")
+(define-method set_close_handle
+ (of-object "GWin32OutputStream")
+ (c-name "g_win32_output_stream_set_close_handle")
(return-type "none")
(parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "close_handle")
)
)
-(define-function gxdp_documents_proxy_new_for_bus_finish
- (c-name "gxdp_documents_proxy_new_for_bus_finish")
- (return-type "GXdpDocuments*")
- (parameters
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
+(define-method get_close_handle
+ (of-object "GWin32OutputStream")
+ (c-name "g_win32_output_stream_get_close_handle")
+ (return-type "gboolean")
)
-(define-function gxdp_documents_proxy_new_for_bus_sync
- (c-name "gxdp_documents_proxy_new_for_bus_sync")
- (return-type "GXdpDocuments*")
- (parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_handle
+ (of-object "GWin32OutputStream")
+ (c-name "g_win32_output_stream_get_handle")
+ (return-type "void*")
)
-(define-function gxdp_documents_skeleton_get_type
- (c-name "gxdp_documents_skeleton_get_type")
- (return-type "GType")
-)
-(define-function gxdp_open_uri_get_type
- (c-name "gxdp_open_uri_get_type")
- (return-type "GType")
-)
-(define-function gxdp_open_uri_interface_info
- (c-name "gxdp_open_uri_interface_info")
- (return-type "GDBusInterfaceInfo*")
+;; From gwin32registrykey.h
+
+(define-method copy
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_copy")
+ (return-type "GWin32RegistrySubkeyIter*")
)
-(define-function gxdp_open_uri_override_properties
- (c-name "gxdp_open_uri_override_properties")
- (return-type "guint")
- (parameters
- '("GObjectClass*" "klass")
- '("guint" "property_id_begin")
- )
+(define-method free
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_free")
+ (return-type "none")
)
-(define-method complete_open_uri
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_complete_open_uri")
+(define-method assign
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_assign")
(return-type "none")
(parameters
- '("GDBusMethodInvocation*" "invocation")
- '("const-gchar*" "handle")
+ '("const-GWin32RegistrySubkeyIter*" "other")
)
)
-(define-method complete_open_file
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_complete_open_file")
+(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")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- '("GUnixFDList*" "fd_list")
- '("const-gchar*" "handle")
- )
)
-(define-method call_open_uri
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_call_open_uri")
+(define-method assign
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_assign")
(return-type "none")
(parameters
- '("const-gchar*" "arg_parent_window")
- '("const-gchar*" "arg_uri")
- '("GVariant*" "arg_options")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-GWin32RegistryValueIter*" "other")
)
)
-(define-method call_open_uri_finish
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_call_open_uri_finish")
- (return-type "gboolean")
+(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
- '("gchar**" "out_handle")
- '("GAsyncResult*" "res")
+ '("const-gchar*" "path")
'("GError**" "error")
)
)
-(define-method call_open_uri_sync
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_call_open_uri_sync")
- (return-type "gboolean")
+(define-function g_win32_registry_key_new_w
+ (c-name "g_win32_registry_key_new_w")
+ (return-type "GWin32RegistryKey*")
(parameters
- '("const-gchar*" "arg_parent_window")
- '("const-gchar*" "arg_uri")
- '("GVariant*" "arg_options")
- '("gchar**" "out_handle")
- '("GCancellable*" "cancellable")
+ '("const-gunichar2*" "path")
'("GError**" "error")
)
)
-(define-method call_open_file
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_call_open_file")
- (return-type "none")
+(define-method get_child
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_get_child")
+ (return-type "GWin32RegistryKey*")
(parameters
- '("const-gchar*" "arg_parent_window")
- '("GVariant*" "arg_fd")
- '("GVariant*" "arg_options")
- '("GUnixFDList*" "fd_list")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("const-gchar*" "subkey")
+ '("GError**" "error")
)
)
-(define-method call_open_file_finish
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_call_open_file_finish")
- (return-type "gboolean")
+(define-method get_child_w
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_get_child_w")
+ (return-type "GWin32RegistryKey*")
(parameters
- '("gchar**" "out_handle")
- '("GUnixFDList**" "out_fd_list")
- '("GAsyncResult*" "res")
+ '("const-gunichar2*" "subkey")
'("GError**" "error")
)
)
-(define-method call_open_file_sync
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_call_open_file_sync")
+(define-method init
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_init")
(return-type "gboolean")
(parameters
- '("const-gchar*" "arg_parent_window")
- '("GVariant*" "arg_fd")
- '("GVariant*" "arg_options")
- '("GUnixFDList*" "fd_list")
- '("gchar**" "out_handle")
- '("GUnixFDList**" "out_fd_list")
- '("GCancellable*" "cancellable")
+ '("GWin32RegistryKey*" "key")
'("GError**" "error")
)
)
-(define-method get_version
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_get_version")
- (return-type "guint")
-)
-
-(define-method set_version
- (of-object "GXdpOpenURI")
- (c-name "gxdp_open_uri_set_version")
+(define-method clear
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_clear")
(return-type "none")
- (parameters
- '("guint" "value")
- )
)
-(define-function gxdp_open_uri_proxy_get_type
- (c-name "gxdp_open_uri_proxy_get_type")
- (return-type "GType")
+(define-method n_subkeys
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_n_subkeys")
+ (return-type "gsize")
)
-(define-function gxdp_open_uri_proxy_new_finish
- (c-name "gxdp_open_uri_proxy_new_finish")
- (return-type "GXdpOpenURI*")
+(define-method next
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_next")
+ (return-type "gboolean")
(parameters
- '("GAsyncResult*" "res")
+ '("gboolean" "skip_errors")
'("GError**" "error")
)
)
-(define-function gxdp_open_uri_proxy_new_sync
- (c-name "gxdp_open_uri_proxy_new_sync")
- (return-type "GXdpOpenURI*")
+(define-method get_name
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_get_name")
+ (return-type "gboolean")
(parameters
- '("GDBusConnection*" "connection")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
+ '("gchar**" "subkey_name")
+ '("gsize*" "subkey_name_len")
'("GError**" "error")
)
)
-(define-function gxdp_open_uri_proxy_new_for_bus
- (c-name "gxdp_open_uri_proxy_new_for_bus")
- (return-type "none")
- (parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-
-(define-function gxdp_open_uri_proxy_new_for_bus_finish
- (c-name "gxdp_open_uri_proxy_new_for_bus_finish")
- (return-type "GXdpOpenURI*")
+(define-method get_name_w
+ (of-object "GWin32RegistrySubkeyIter")
+ (c-name "g_win32_registry_subkey_iter_get_name_w")
+ (return-type "gboolean")
(parameters
- '("GAsyncResult*" "res")
+ '("gunichar2**" "subkey_name")
+ '("gsize*" "subkey_name_len")
'("GError**" "error")
)
)
-(define-function gxdp_open_uri_proxy_new_for_bus_sync
- (c-name "gxdp_open_uri_proxy_new_for_bus_sync")
- (return-type "GXdpOpenURI*")
+(define-method init
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_init")
+ (return-type "gboolean")
(parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
+ '("GWin32RegistryKey*" "key")
'("GError**" "error")
)
)
-(define-function gxdp_open_uri_skeleton_get_type
- (c-name "gxdp_open_uri_skeleton_get_type")
- (return-type "GType")
-)
-
-(define-function gxdp_network_monitor_get_type
- (c-name "gxdp_network_monitor_get_type")
- (return-type "GType")
+(define-method clear
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_clear")
+ (return-type "none")
)
-(define-function gxdp_network_monitor_interface_info
- (c-name "gxdp_network_monitor_interface_info")
- (return-type "GDBusInterfaceInfo*")
+(define-method n_values
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_n_values")
+ (return-type "gsize")
)
-(define-function gxdp_network_monitor_override_properties
- (c-name "gxdp_network_monitor_override_properties")
- (return-type "guint")
+(define-method next
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_next")
+ (return-type "gboolean")
(parameters
- '("GObjectClass*" "klass")
- '("guint" "property_id_begin")
+ '("gboolean" "skip_errors")
+ '("GError**" "error")
)
)
-(define-method emit_changed
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_emit_changed")
- (return-type "none")
+(define-method get_value_type
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_get_value_type")
+ (return-type "gboolean")
(parameters
- '("gboolean" "arg_available")
+ '("GWin32RegistryValueType*" "value_type")
+ '("GError**" "error")
)
)
-(define-method get_available
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_get_available")
+(define-method get_name
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_get_name")
(return-type "gboolean")
-)
-
-(define-method set_available
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_set_available")
- (return-type "none")
(parameters
- '("gboolean" "value")
+ '("gchar**" "value_name")
+ '("gsize*" "value_name_len")
+ '("GError**" "error")
)
)
-(define-method get_metered
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_get_metered")
+(define-method get_name_w
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_get_name_w")
(return-type "gboolean")
-)
-
-(define-method set_metered
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_set_metered")
- (return-type "none")
(parameters
- '("gboolean" "value")
+ '("gunichar2**" "value_name")
+ '("gsize*" "value_name_len")
+ '("GError**" "error")
)
)
-(define-method get_connectivity
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_get_connectivity")
- (return-type "guint")
-)
-
-(define-method set_connectivity
- (of-object "GXdpNetworkMonitor")
- (c-name "gxdp_network_monitor_set_connectivity")
- (return-type "none")
+(define-method get_data
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_get_data")
+ (return-type "gboolean")
(parameters
- '("guint" "value")
+ '("gboolean" "auto_expand")
+ '("gpointer*" "value_data")
+ '("gsize*" "value_data_size")
+ '("GError**" "error")
)
)
-(define-function gxdp_network_monitor_proxy_get_type
- (c-name "gxdp_network_monitor_proxy_get_type")
- (return-type "GType")
-)
-
-(define-function gxdp_network_monitor_proxy_new_finish
- (c-name "gxdp_network_monitor_proxy_new_finish")
- (return-type "GXdpNetworkMonitor*")
+(define-method get_data_w
+ (of-object "GWin32RegistryValueIter")
+ (c-name "g_win32_registry_value_iter_get_data_w")
+ (return-type "gboolean")
(parameters
- '("GAsyncResult*" "res")
+ '("gboolean" "auto_expand")
+ '("gpointer*" "value_data")
+ '("gsize*" "value_data_size")
'("GError**" "error")
)
)
-(define-function gxdp_network_monitor_proxy_new_sync
- (c-name "gxdp_network_monitor_proxy_new_sync")
- (return-type "GXdpNetworkMonitor*")
+(define-method get_value
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_get_value")
+ (return-type "gboolean")
(parameters
- '("GDBusConnection*" "connection")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
+ '("gboolean" "auto_expand")
+ '("const-gchar*" "value_name")
+ '("GWin32RegistryValueType*" "value_type")
+ '("gpointer*" "value_data")
+ '("gsize*" "value_data_size")
'("GError**" "error")
)
)
-(define-function gxdp_network_monitor_proxy_new_for_bus
- (c-name "gxdp_network_monitor_proxy_new_for_bus")
- (return-type "none")
+(define-method get_value_w
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_get_value_w")
+ (return-type "gboolean")
(parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("gboolean" "auto_expand")
+ '("const-gunichar2*" "value_name")
+ '("GWin32RegistryValueType*" "value_type")
+ '("gpointer*" "value_data")
+ '("gsize*" "value_data_size")
+ '("GError**" "error")
)
)
-(define-function gxdp_network_monitor_proxy_new_for_bus_finish
- (c-name "gxdp_network_monitor_proxy_new_for_bus_finish")
- (return-type "GXdpNetworkMonitor*")
- (parameters
- '("GAsyncResult*" "res")
- '("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-function gxdp_network_monitor_proxy_new_for_bus_sync
- (c-name "gxdp_network_monitor_proxy_new_for_bus_sync")
- (return-type "GXdpNetworkMonitor*")
+(define-method watch
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_watch")
+ (return-type "gboolean")
(parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
+ '("gboolean" "watch_children")
+ '("GWin32RegistryKeyWatcherFlags" "watch_flags")
+ '("GWin32RegistryKeyWatchCallbackFunc" "callback")
+ '("gpointer" "user_data")
'("GError**" "error")
)
)
-(define-function gxdp_network_monitor_skeleton_get_type
- (c-name "gxdp_network_monitor_skeleton_get_type")
- (return-type "GType")
+(define-method has_changed
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_has_changed")
+ (return-type "gboolean")
)
-(define-function gxdp_proxy_resolver_get_type
- (c-name "gxdp_proxy_resolver_get_type")
- (return-type "GType")
+(define-method erase_change_indicator
+ (of-object "GWin32RegistryKey")
+ (c-name "g_win32_registry_key_erase_change_indicator")
+ (return-type "none")
)
-(define-function gxdp_proxy_resolver_interface_info
- (c-name "gxdp_proxy_resolver_interface_info")
- (return-type "GDBusInterfaceInfo*")
+
+
+;; From gwin32volumemonitor.h
+
+
+
+;; From gzlibcompressor.h
+
+(define-function g_zlib_compressor_get_type
+ (c-name "g_zlib_compressor_get_type")
+ (return-type "GType")
)
-(define-function gxdp_proxy_resolver_override_properties
- (c-name "gxdp_proxy_resolver_override_properties")
- (return-type "guint")
+(define-function g_zlib_compressor_new
+ (c-name "g_zlib_compressor_new")
+ (is-constructor-of "GZlibCompressor")
+ (return-type "GZlibCompressor*")
(parameters
- '("GObjectClass*" "klass")
- '("guint" "property_id_begin")
+ '("GZlibCompressorFormat" "format")
+ '("int" "level")
)
)
-(define-method complete_lookup
- (of-object "GXdpProxyResolver")
- (c-name "gxdp_proxy_resolver_complete_lookup")
- (return-type "none")
- (parameters
- '("GDBusMethodInvocation*" "invocation")
- '("const-gchar*-const*" "proxies")
- )
+(define-method get_file_info
+ (of-object "GZlibCompressor")
+ (c-name "g_zlib_compressor_get_file_info")
+ (return-type "GFileInfo*")
)
-(define-method call_lookup
- (of-object "GXdpProxyResolver")
- (c-name "gxdp_proxy_resolver_call_lookup")
+(define-method set_file_info
+ (of-object "GZlibCompressor")
+ (c-name "g_zlib_compressor_set_file_info")
(return-type "none")
(parameters
- '("const-gchar*" "arg_uri")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
+ '("GFileInfo*" "file_info")
)
)
-(define-method call_lookup_finish
- (of-object "GXdpProxyResolver")
- (c-name "gxdp_proxy_resolver_call_lookup_finish")
- (return-type "gboolean")
- (parameters
- '("gchar***" "out_proxies")
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
-)
-(define-method call_lookup_sync
- (of-object "GXdpProxyResolver")
- (c-name "gxdp_proxy_resolver_call_lookup_sync")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "arg_uri")
- '("gchar***" "out_proxies")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
-)
-(define-function gxdp_proxy_resolver_proxy_get_type
- (c-name "gxdp_proxy_resolver_proxy_get_type")
+;; From gzlibdecompressor.h
+
+(define-function g_zlib_decompressor_get_type
+ (c-name "g_zlib_decompressor_get_type")
(return-type "GType")
)
-(define-function gxdp_proxy_resolver_proxy_new_finish
- (c-name "gxdp_proxy_resolver_proxy_new_finish")
- (return-type "GXdpProxyResolver*")
+(define-function g_zlib_decompressor_new
+ (c-name "g_zlib_decompressor_new")
+ (is-constructor-of "GZlibDecompressor")
+ (return-type "GZlibDecompressor*")
(parameters
- '("GAsyncResult*" "res")
- '("GError**" "error")
+ '("GZlibCompressorFormat" "format")
)
)
-(define-function gxdp_proxy_resolver_proxy_new_sync
- (c-name "gxdp_proxy_resolver_proxy_new_sync")
- (return-type "GXdpProxyResolver*")
- (parameters
- '("GDBusConnection*" "connection")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
- )
+(define-method get_file_info
+ (of-object "GZlibDecompressor")
+ (c-name "g_zlib_decompressor_get_file_info")
+ (return-type "GFileInfo*")
)
-(define-function gxdp_proxy_resolver_proxy_new_for_bus
- (c-name "gxdp_proxy_resolver_proxy_new_for_bus")
- (return-type "none")
- (parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GAsyncReadyCallback" "callback")
- '("gpointer" "user_data")
- )
-)
-(define-function gxdp_proxy_resolver_proxy_new_for_bus_finish
- (c-name "gxdp_proxy_resolver_proxy_new_for_bus_finish")
- (return-type "GXdpProxyResolver*")
- (parameters
- '("GAsyncResult*" "res")
- '("GError**" "error")
- )
-)
-(define-function gxdp_proxy_resolver_proxy_new_for_bus_sync
- (c-name "gxdp_proxy_resolver_proxy_new_for_bus_sync")
- (return-type "GXdpProxyResolver*")
+;; From thumbnail-verify.h
+
+(define-function thumbnail_verify
+ (c-name "thumbnail_verify")
+ (return-type "gboolean")
(parameters
- '("GBusType" "bus_type")
- '("GDBusProxyFlags" "flags")
- '("const-gchar*" "name")
- '("const-gchar*" "object_path")
- '("GCancellable*" "cancellable")
- '("GError**" "error")
+ '("const-gchar*" "thumbnail_path")
+ '("const-gchar*" "file_uri")
+ '("const-GLocalFileStat*" "file_stat_buf")
)
)
-(define-function gxdp_proxy_resolver_skeleton_get_type
- (c-name "gxdp_proxy_resolver_skeleton_get_type")
- (return-type "GType")
-)
-
(readable #t)
(writable #t)
(construct-only #t)
- (deprecated #t)
(default-value "FALSE")
)
(default-value "0")
)
+(define-property is-tcrypt-hidden-volume
+ (of-object "GMountOperation")
+ (prop-type "GParamBoolean")
+ (docs "Whether to unlock a TCRYPT hidden volume. See https://www.veracrypt.fr/en/Hidden%20Volume.html.")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+ (default-value "FALSE")
+)
+
+(define-property is-tcrypt-system-volume
+ (of-object "GMountOperation")
+ (prop-type "GParamBoolean")
+ (docs "Whether to unlock a TCRYPT system volume. Only supported for unlocking Windows system volumes. See https://www.veracrypt.fr/en/System%20Encryption.html.")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+ (default-value "FALSE")
+)
+
+(define-property pim
+ (of-object "GMountOperation")
+ (prop-type "GParamUInt")
+ (docs "The VeraCrypt PIM value")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+ (default-value "0")
+)
+
;; From GNotification
;; From GPermission
(readable #t)
(writable #t)
(construct-only #f)
- (deprecated #t)
(default-value "TRUE")
)
---- ./../../gio/src/gio_signals.defs.orig 2017-09-12 17:06:06.023464567 +0200
-+++ ./../../gio/src/gio_signals.defs 2017-09-13 08:41:32.428298292 +0200
+--- ./../../gio/src/gio_signals.defs.orig 2017-09-11 09:52:55.272837455 +0200
++++ ./../../gio/src/gio_signals.defs 2017-09-11 14:56:39.662521043 +0200
@@ -87,11 +87,11 @@
(return-type "void")
(flags "Run Last, Must Collect")
;; From GApplication
-@@ -591,10 +591,11 @@
- (prop-type "GParamBoolean")
- (docs "Whether or not this is an abstract address")
- (readable #t)
- (writable #t)
- (construct-only #t)
-+ (deprecated #t)
- (default-value "FALSE")
- )
-
- (define-property address-type
- (of-object "GUnixSocketAddress")
-@@ -738,11 +739,11 @@
+@@ -738,11 +738,11 @@
(of-object "GMountOperation")
(return-type "void")
(flags "Run Last")
(define-signal reply
(of-object "GMountOperation")
-@@ -1106,11 +1107,11 @@
+@@ -1106,11 +1106,11 @@
(define-signal writable-change-event
(of-object "GSettings")
(return-type "gboolean")
(define-property settings-schema
(of-object "GSettings")
-@@ -1190,20 +1191,20 @@
+@@ -1190,20 +1190,20 @@
(define-signal activate
(of-object "GSimpleAction")
(return-type "void")
(define-property name
(of-object "GSimpleAction")
-@@ -1850,11 +1851,11 @@
+@@ -1850,11 +1850,11 @@
(define-signal writable-change-event
(of-object "GSettings")
(return-type "gboolean")
(define-property settings-schema
(of-object "GSettings")
-@@ -2345,10 +2346,11 @@
- (prop-type "GParamBoolean")
- (docs "Whether to verify peer certificates against the system certificate database")
- (readable #t)
- (writable #t)
- (construct-only #f)
-+ (deprecated #t)
- (default-value "TRUE")
- )
-
- (define-property database
- (of-object "GTlsConnection")
-@@ -2723,23 +2725,23 @@
+@@ -2723,23 +2723,23 @@
(define-signal g-properties-changed
(of-object "GDBusProxy")
(return-type "void")
(return-type "void")
)
-(define-vfunc shutdown
+(define-vfunc dbus_register
+ (of-object "GApplication")
+ (return-type "gboolean")
+ (parameters
+ '("GDBusConnection*" "connection")
+ '("const-gchar*" "object_path")
+ '("GError**" "error")
+ )
+)
+
+(define-vfunc dbus_unregister
(of-object "GApplication")
(return-type "void")
+ (parameters
+ '("GDBusConnection*" "connection")
+ '("const-gchar*" "object_path")
+ )
)
; GAsyncInitable
(return-type "GObject*")
)
+(define-vfunc is_tagged
+ (of-object "GAsyncResult")
+ (return-type "gboolean")
+ (parameters
+ '("gpointer" "source_tag")
+ )
+)
+
; GBufferedInputStream
(define-vfunc fill
)
)
+; GFileDescriptorBased
+
+(define-vfunc get_fd
+ (of-object "GFileDescriptorBased")
+ (return-type "int")
+)
+
; GFileInputStream
(define-vfunc tell
_WRAP_METHOD(guint32 get_flowinfo() const, g_inet_socket_address_get_flowinfo)
_WRAP_METHOD(guint32 get_scope_id() const, g_inet_socket_address_get_scope_id)
- _WRAP_PROPERTY("address", Glib::RefPtr<InetAddress>)
- _WRAP_PROPERTY("port", guint16)
- _WRAP_PROPERTY("flowinfo", guint32)
- _WRAP_PROPERTY("scope-id", guint32)
+ _WRAP_PROPERTY("address", Glib::RefPtr<InetAddress>)
+ // Don't use guint16 or guint32 in _WRAP_PROPERTY().
+ // There are no Glib::Value<> specializations for those types.
+ // Glib::Value<unsigned int> exists, and guint is a typedef of unsigned int.
+ _WRAP_PROPERTY("port", guint)
+ _WRAP_PROPERTY("flowinfo", guint)
+ _WRAP_PROPERTY("scope-id", guint)
};
} // namespace Gio
_WRAP_METHOD(bool set_pending(), g_input_stream_set_pending, errthrow, newin "2,50")
_WRAP_METHOD(void clear_pending(), g_input_stream_clear_pending, newin "2,50")
- //TODO: When we can break ABI, add vfuncs. See https://bugzilla.gnome.org/show_bug.cgi?id=572471
#m4 _CONVERSION(`GCancellable*', `const Glib::RefPtr<Cancellable>&', `Glib::wrap($3, true)')
- //_WRAP_VFUNC(gssize read(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable), read_fn, errthrow, err_return_value -1)
- //_WRAP_VFUNC(gssize skip(gsize count, const Glib::RefPtr<Cancellable>& cancellable), skip, errthrow, err_return_value -1)
- //_WRAP_VFUNC(bool close(const Glib::RefPtr<Cancellable>& cancellable), close_fn, errthrow)
+ _WRAP_VFUNC(gssize read(void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable), read_fn, errthrow, err_return_value -1)
+ _WRAP_VFUNC(gssize skip(gsize count, const Glib::RefPtr<Cancellable>& cancellable), skip, errthrow, err_return_value -1)
+ _WRAP_VFUNC(bool close(const Glib::RefPtr<Cancellable>& cancellable), close_fn, errthrow)
};
} // namespace Gio
void
IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, IOStreamSpliceFlags flags, int io_priority)
+ const Glib::RefPtr<Cancellable>& cancellable, SpliceFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2, const SlotAsyncReady& slot,
- IOStreamSpliceFlags flags, int io_priority)
+ SpliceFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
-// -*- 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
namespace Gio
{
-_WRAP_ENUM(IOStreamSpliceFlags, GIOStreamSpliceFlags, NO_GTYPE)
-
/** IOStream - Base class for implementing read/write streams.
* IOStream represents an object that has both read and write streams.
* Generally the two streams acts as separate input and output streams, but
public:
+ _WRAP_ENUM(SpliceFlags, GIOStreamSpliceFlags, NO_GTYPE)
+
/** Asyncronously splice the output stream to the input stream of @a
* stream2, and splice the output stream of @a stream2 to the input stream of
* this stream.
* @param stream2 The second IOStream.
* @param slot A SlotAsyncReady slot.
* @param cancellable A Cancellable object.
- * @param flags A set of IOStreamSpliceFlags.
+ * @param flags A set of SpliceFlags.
* @param io_priority The io priority of the request.
*
* @newin{2,34}
*/
void splice_async(const Glib::RefPtr<IOStream>& stream2,
const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable,
- IOStreamSpliceFlags flags = Gio::IO_STREAM_SPLICE_NONE,
+ SpliceFlags flags = SpliceFlags::NONE,
int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_io_stream_splice_async)
/// A non-cancellable version of splice_async().
void splice_async(const Glib::RefPtr<IOStream>& stream2,
const SlotAsyncReady& slot,
- IOStreamSpliceFlags flags = Gio::IO_STREAM_SPLICE_NONE,
+ SpliceFlags flags = SpliceFlags::NONE,
int io_priority = Glib::PRIORITY_DEFAULT);
_WRAP_METHOD(static bool splice_finish(const Glib::RefPtr<AsyncResult>& result), g_io_stream_splice_finish, errthrow)
*
* @newin{2,50}
*/
- using SlotCompare = sigc::slot<int, const Glib::RefPtr<const Glib::ObjectBase>&, const Glib::RefPtr<const Glib::ObjectBase>&>;
+ using SlotCompare = sigc::slot<int(const Glib::RefPtr<const Glib::ObjectBase>&, const Glib::RefPtr<const Glib::ObjectBase>&)>;
_WRAP_METHOD(guint insert_sorted(const Glib::RefPtr<Glib::ObjectBase>& item,
const SlotCompare& slot{compare_func}), g_list_store_insert_sorted,
*
* @newin{2,50}
*/
- using SlotCompare = sigc::slot<int, const Glib::RefPtr<const T_item>&, const Glib::RefPtr<const T_item>&>;
+ using SlotCompare = sigc::slot<int(const Glib::RefPtr<const T_item>&, const Glib::RefPtr<const T_item>&)>;
/** Inserts @a item at a position to be determined by the @a slot.
*
template <typename T_item>
Glib::RefPtr<ListStore<T_item>> ListStore<T_item>::create()
{
- return Glib::RefPtr<ListStore<T_item>>(new ListStore<T_item>());
+ return Glib::make_refptr_for_instance<ListStore<T_item>>(new ListStore<T_item>());
}
template <typename T_item>
Glib::RefPtr<T_item> ListStore<T_item>::get_item(guint position)
{
- return Glib::RefPtr<T_item>::cast_dynamic(ListModel::get_object(position));
+ return std::dynamic_pointer_cast<T_item>(ListModel::get_object(position));
}
template <typename T_item>
// cast_dynamic is necessary if T_item is a user-derived class, such as
// class MyObject : public Glib::Object
- const Glib::RefPtr<const T_item> item_a = Glib::RefPtr<T_item>::cast_dynamic(
+ const Glib::RefPtr<const T_item> item_a = std::dynamic_pointer_cast<T_item>(
Glib::wrap(static_cast<typename T_item::BaseObjectType*>(const_cast<gpointer>(a)), true));
- const Glib::RefPtr<const T_item> item_b = Glib::RefPtr<T_item>::cast_dynamic(
+ const Glib::RefPtr<const T_item> item_b = std::dynamic_pointer_cast<T_item>(
Glib::wrap(static_cast<typename T_item::BaseObjectType*>(const_cast<gpointer>(b)), true));
return (*slot)(item_a, item_b);
#include <gio/gio.h>
#include <glibmm/error.h>
-#include <giomm/private/icon_p.h>
#include "slot_async.h"
namespace Gio
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <giomm/icon.h>
+#include <glibmm/interface.h>
#include <giomm/inputstream.h>
-#include <giomm/icon.h>
_DEFS(giomm,gio)
-_PINCLUDE(giomm/private/icon_p.h)
+_PINCLUDE(glibmm/private/interface_p.h)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GLoadableIconIface GLoadableIconIface;
*
* @newin{2,16}
*/
-class LoadableIcon : public Icon
+class LoadableIcon : public Glib::Interface
{
- _CLASS_INTERFACE(LoadableIcon, GLoadableIcon, G_LOADABLE_ICON, GLoadableIconIface, Icon, GIcon)
+ _CLASS_INTERFACE(LoadableIcon, GLoadableIcon, G_LOADABLE_ICON, GLoadableIconIface)
public:
/**
{
}
+ SlotWithData(const SlotWithData& src) = delete;
+ SlotWithData& operator=(const SlotWithData& src) = delete;
+
~SlotWithData() { delete m_slot; }
void operator()() { (*m_slot)(m_data); }
namespace Gio
{
-_DEPRECATE_IFDEF_START
-void
-MemoryInputStream::add_data(const std::string& data)
-{
- char* data_copy = g_strdup(data.c_str());
- g_memory_input_stream_add_data(gobj(), data_copy, -1, g_free);
-}
-
-void
-MemoryInputStream::add_data(const void* data, gssize len)
-{
- char* data_copy = nullptr;
-
- // copy the data so that the caller doesn't need to keep the data alive
- if (len < 0)
- data_copy = g_strdup(static_cast<const gchar*>(data));
- else
- data_copy = static_cast<gchar*>(g_memdup(data, len));
-
- g_memory_input_stream_add_data(gobj(), data_copy, len, g_free);
-}
-_DEPRECATE_IFDEF_END
-
void
MemoryInputStream::add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot)
{
#include <giomm/inputstream.h>
#include <giomm/seekable.h>
+#include <giomm/pollableinputstream.h>
_DEFS(giomm,gio)
_PINCLUDE(giomm/private/inputstream_p.h)
*/
class MemoryInputStream
: public Gio::InputStream,
- public Seekable
+ public Seekable,
+ public PollableInputStream
{
_CLASS_GOBJECT(MemoryInputStream, GMemoryInputStream, G_MEMORY_INPUT_STREAM, Gio::InputStream, GInputStream)
_IMPLEMENTS_INTERFACE(Seekable)
+ _IMPLEMENTS_INTERFACE(PollableInputStream)
protected:
_CTOR_DEFAULT
public:
_WRAP_CREATE()
-_DEPRECATE_IFDEF_START
- /** Appends to data that can be read from the input stream.
- *
- * @param data Input data.
- *
- * @deprecated Use add_data() with SlotDestroyData or GDestroyNotify instead.
- */
- void add_data(const std::string& data);
-
- /** Appends to data that can be read from the input stream.
- *
- * Note that the data will be copied internally and freed when no longer needed.
- *
- * @param data Input data.
- * @param len Length of the data, may be -1 if data is a null-terminated string.
- *
- * @deprecated Use add_data() with SlotDestroyData or GDestroyNotify instead.
- */
- void add_data(const void* data, gssize len);
-_DEPRECATE_IFDEF_END
-
_WRAP_METHOD(void add_data(const void* data, gssize len, GDestroyNotify destroy), g_memory_input_stream_add_data)
/** For example,
*
* @newin{2,40}
*/
- using SlotDestroyData = sigc::slot<void, void*>;
+ using SlotDestroyData = sigc::slot<void(void*)>;
/** Appends to data that can be read from the input stream.
*
#include <giomm/outputstream.h>
#include <giomm/seekable.h>
+#include <giomm/pollableoutputstream.h>
#include <glibmm/object.h>
// TODO: remove this if possible -- it's here for the GReallocFunc definition
#include <gio/gio.h>
*/
class MemoryOutputStream :
public OutputStream,
- public Seekable
+ public Seekable,
+ public PollableOutputStream
{
_CLASS_GOBJECT(MemoryOutputStream, GMemoryOutputStream, G_MEMORY_OUTPUT_STREAM, Gio::OutputStream, GOutputStream)
_IMPLEMENTS_INTERFACE(Seekable)
+ _IMPLEMENTS_INTERFACE(PollableOutputStream)
protected:
// Hand-coded because it's equivalent to g_memory_output_stream_new_resizable(),
_WRAP_METHOD(void freeze(), g_menu_freeze)
- //TODO: Make the item "const Glib::RefPtr<const MenuItem>&" when we can break ABI? The function is documented as just copying its attributes.
- _WRAP_METHOD(void insert_item(int position, const Glib::RefPtr<MenuItem>& item), g_menu_insert_item)
- _WRAP_METHOD(void prepend_item(const Glib::RefPtr<MenuItem>& item), g_menu_prepend_item)
- _WRAP_METHOD(void append_item(const Glib::RefPtr<MenuItem>& item), g_menu_append_item)
+ _WRAP_METHOD(void insert_item(int position, const Glib::RefPtr<const MenuItem>& item), g_menu_insert_item)
+ _WRAP_METHOD(void prepend_item(const Glib::RefPtr<const MenuItem>& item), g_menu_prepend_item)
+ _WRAP_METHOD(void append_item(const Glib::RefPtr<const MenuItem>& item), g_menu_append_item)
_WRAP_METHOD(void remove(int position), g_menu_remove)
_WRAP_METHOD(void remove_all(), g_menu_remove_all)
_WRAP_METHOD(void prepend(const Glib::ustring& label, const Glib::ustring& detailed_action{?}), g_menu_prepend)
_WRAP_METHOD(void append(const Glib::ustring& label, const Glib::ustring& detailed_action{?}), g_menu_append)
+// TODO: Should the MenuModel be const too?
_WRAP_METHOD(void insert_section(int position, const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& section), g_menu_insert_section)
_WRAP_METHOD(void prepend_section(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& section), g_menu_prepend_section)
_WRAP_METHOD(void append_section(const Glib::ustring& label{?}, const Glib::RefPtr<MenuModel>& section), g_menu_append_section)
_WRAP_METHOD(Glib::ustring get_name() const, g_menu_attribute_iter_get_name)
- //TODO: When we can break ABI, remove the method overload and just make it const.
- //It makes no sense to return const by value.
- _WRAP_METHOD(Glib::VariantBase get_value(), g_menu_attribute_iter_get_value)
- _WRAP_METHOD(const Glib::VariantBase get_value() const, g_menu_attribute_iter_get_value, constversion)
+ _WRAP_METHOD(Glib::VariantBase get_value() const, g_menu_attribute_iter_get_value)
_WRAP_METHOD(bool next(), g_menu_attribute_iter_next)
};
set_submenu(submenu);
}
-_DEPRECATE_IFDEF_START
-void
-MenuItem::set_action_and_target(const Glib::ustring& action)
-{
- g_menu_item_set_action_and_target_value(gobj(), action.c_str(), nullptr);
-}
-_DEPRECATE_IFDEF_END
-
void
MenuItem::set_action(const Glib::ustring& action)
{
//void set_attribute(const Glib::ustring& attribute, const T_Value& value) const;
_WRAP_METHOD(void set_attribute_value(const Glib::ustring& attribute, const Glib::VariantBase& value), g_menu_item_set_attribute_value)
- _WRAP_METHOD(void set_attribute(const Glib::ustring& attribute, const Glib::VariantBase& value), g_menu_item_set_attribute_value, deprecated "Use set_attribute() instead.")
_IGNORE(g_menu_item_set_attribute)
//These are documented as transfer-full, so we don't need to use refreturn.
//void get_attribute(const Glib::ustring& attribute, T_Value& value) const;
//_WRAP_METHOD(Glib::VariantBase get_attribute_value(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value)
- _WRAP_METHOD(Glib::VariantBase get_attribute(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value, deprecated "Use get_attribute_value() instead.")
_WRAP_METHOD(Glib::VariantBase get_attribute_value(const Glib::ustring& attribute, const Glib::VariantType& expected_type{?}) const, g_menu_item_get_attribute_value)
// Ignore varargs function.
_IGNORE(g_menu_item_get_attribute)
-_DEPRECATE_IFDEF_START
- /** Unsets the target for the specified @a action.
- * @deprecated Use set_action() or unset_target() instead.
- */
- void set_action_and_target(const Glib::ustring& action);
-_DEPRECATE_IFDEF_END
-
/** Sets the action for the menu item.
* See set_action_and_target().
*
#m4begin
dnl See the .ccg implementation for how this conversion works.
- //TODO: When we can break ABI, remove the method overload and just make it const.
- //It makes no sense to return const by value.
_CONVERSION(`MenuAttribute',`const gchar*',`giomm_get_menu_attribute($3)')
#m4end
//TODO: Add a get_item_attribute() templated method to get values directly
//instead of returning a Glib::VariantBase?
- _WRAP_METHOD(Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type), g_menu_model_get_item_attribute_value)
- _WRAP_METHOD(const Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type) const, g_menu_model_get_item_attribute_value, constversion)
+ _WRAP_METHOD(Glib::VariantBase get_item_attribute(int item_index, MenuAttribute attribute, const Glib::VariantType& expected_type) const, g_menu_model_get_item_attribute_value)
// Ignore varargs function
_IGNORE(g_menu_model_get_item_attribute)
void
Mount::unmount(
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags)
+Mount::unmount(const SlotAsyncReady& slot, UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::unmount(MountUnmountFlags flags)
+Mount::unmount(UnmountFlags flags)
{
g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags),
nullptr, // mount_operation
void
Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- MountUnmountFlags flags)
+ UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation, UnmountFlags flags)
{
g_mount_unmount_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation),
nullptr, // cancellable
void
Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Mount::remount(
- const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountMountFlags flags)
+ const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::remount(const Glib::RefPtr<MountOperation>& operation, MountMountFlags flags)
+Mount::remount(const Glib::RefPtr<MountOperation>& operation, MountFlags flags)
{
g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(operation), nullptr,
nullptr, nullptr);
}
void
-Mount::remount(MountMountFlags flags)
+Mount::remount(MountFlags flags)
{
g_mount_remount(gobj(), static_cast<GMountMountFlags>(flags), nullptr, nullptr, nullptr, nullptr);
}
void
Mount::eject(
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
+Mount::eject(const SlotAsyncReady& slot, UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::eject(MountUnmountFlags flags)
+Mount::eject(UnmountFlags flags)
{
g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags),
nullptr, // mount_operation
void
Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- MountUnmountFlags flags)
+ UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, UnmountFlags flags)
{
g_mount_eject_with_operation(gobj(), GMountUnmountFlags(flags), Glib::unwrap(mount_operation),
nullptr, // cancellable
namespace Gio
{
-_WRAP_ENUM(MountUnmountFlags, GMountUnmountFlags, NO_GTYPE)
-_WRAP_ENUM(MountMountFlags, GMountMountFlags, NO_GTYPE)
class File;
class Drive;
_CLASS_INTERFACE(Mount, GMount, G_MOUNT, GMountIface)
public:
+ _WRAP_ENUM(UnmountFlags, GMountUnmountFlags, NO_GTYPE)
+ _WRAP_ENUM(MountFlags, GMountMountFlags, NO_GTYPE)
_WRAP_METHOD(Glib::RefPtr<File> get_root(), g_mount_get_root, refreturn)
_WRAP_METHOD(Glib::RefPtr<const File> get_root() const, g_mount_get_root, refreturn, constversion)
_WRAP_METHOD(bool can_unmount() const, g_mount_can_unmount)
_WRAP_METHOD(bool can_eject() const, g_mount_can_eject)
- void unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void unmount(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void unmount(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void unmount(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags = UnmountFlags::NONE);
+ void unmount(const SlotAsyncReady& slot, UnmountFlags flags = UnmountFlags::NONE);
+ void unmount(UnmountFlags flags = UnmountFlags::NONE);
+ void unmount(const Glib::RefPtr<MountOperation>& mount_operation, UnmountFlags flags = UnmountFlags::NONE);
+ void unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, UnmountFlags flags = UnmountFlags::NONE);
+ void unmount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags = UnmountFlags::NONE);
_IGNORE(g_mount_unmount)
_IGNORE(g_mount_unmount_with_operation)
* @param cancellable A cancellable object which can be used to cancel the operation.
* @param flags Flags affecting the operation.
*/
- void remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountFlags flags = MountFlags::NONE);
/** Remounts a mount.
* This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.
* @param slot A callback which will be called when the operation is completed or canceled.
* @param flags Flags affecting the operation.
*/
- void remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsyncReady& slot, MountFlags flags = MountFlags::NONE);
/** Remounts a mount.
*
* @param operation A mount operation.
* @param flags Flags affecting the operation.
*/
- void remount(const Glib::RefPtr<MountOperation>& operation, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void remount(const Glib::RefPtr<MountOperation>& operation, MountFlags flags = MountFlags::NONE);
/** Remounts a mount, without user interaction.
*
*
* @param flags Flags affecting the operation.
*/
- void remount(MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void remount(MountFlags flags = MountFlags::NONE);
_IGNORE(g_mount_remount)
_WRAP_METHOD(bool remount_finish(const Glib::RefPtr<AsyncResult>& result), g_mount_remount_finish, errthrow)
- void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags = UnmountFlags::NONE);
+ void eject(const SlotAsyncReady& slot, UnmountFlags flags = UnmountFlags::NONE);
+ void eject(UnmountFlags flags = UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, UnmountFlags flags = UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, UnmountFlags flags = UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, UnmountFlags flags = UnmountFlags::NONE);
_IGNORE(g_mount_eject)
_IGNORE(g_mount_eject_with_operation)
void guess_content_type_sync(bool force_rescan = true);
_IGNORE(g_mount_guess_content_type_sync)
- #m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
+ #m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
/** Finishes guessing content types of the Mount.
* If any errors occurred during the operation, an exception will be thrown.
* @return An array of content types.
* @throw Glib::Error
*/
- _WRAP_METHOD(Glib::StringArrayHandle guess_content_type_finish(const Glib::RefPtr<AsyncResult>& result), g_mount_guess_content_type_finish, errthrow)
+ _WRAP_METHOD(std::vector<Glib::ustring> guess_content_type_finish(const Glib::RefPtr<AsyncResult>& result), g_mount_guess_content_type_finish, errthrow)
_WRAP_METHOD(bool is_shadowed() const, g_mount_is_shadowed)
_WRAP_METHOD(void shadow(), g_mount_shadow)
_WRAP_SIGNAL(void changed(), changed)
_WRAP_SIGNAL(void unmounted(), unmounted)
- _WRAP_SIGNAL(void pre_unmount(), pre_unmount, no_default_handler)
+ _WRAP_SIGNAL(void pre_unmount(), pre_unmount)
//There are no properties.
};
-// -*- 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
*/
#include <glibmm/object.h>
-#include <glibmm/arrayhandle.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
_WRAP_SIGNAL(void ask_password(const Glib::ustring& message, const Glib::ustring& default_user, const Glib::ustring& default_domain, AskPasswordFlags flags), ask_password)
- //TODO: We really need some test to make sure that our use of StringArrayHandle is correct. murrayc.
-#m4 _CONVERSION(`const Glib::StringArrayHandle&',`const gchar**',`const_cast<const gchar**>(($3).data())')
-#m4 _CONVERSION(`const gchar**',`const Glib::StringArrayHandle&',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_SIGNAL(void ask_question(const Glib::ustring& message, const Glib::StringArrayHandle& choices), ask_question)
+ //TODO: We really need some test to make sure that our use of ArrayHandler is correct. murrayc.
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const gchar**',`const_cast<const gchar**>(Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data())')
+#m4 _CONVERSION(`const gchar**',`const std::vector<Glib::ustring>&',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_SIGNAL(void ask_question(const Glib::ustring& message, const std::vector<Glib::ustring>& choices), ask_question)
_WRAP_SIGNAL(void reply(MountOperationResult result), reply)
-
- //TODO: Remove no_default_handler when we can break ABI:
- _WRAP_SIGNAL(void aborted(), aborted, no_default_handler)
+ _WRAP_SIGNAL(void aborted(), aborted)
//TODO: The array of char* is not very pleasant to wrap:
//_WRAP_SIGNAL( void show_processes(const Glib::ustring& message, GArray* processes, const gchar *choices[]);
- _WRAP_SIGNAL(void show_unmount_progress(const Glib::ustring& message, gint64 time_left, gint64 bytes_left), "show_unmount_progress", no_default_handler)
+ _WRAP_SIGNAL(void show_unmount_progress(const Glib::ustring& message, gint64 time_left, gint64 bytes_left), "show_unmount_progress")
_WRAP_PROPERTY("username", Glib::ustring)
_WRAP_PROPERTY("password", Glib::ustring)
_WRAP_ENUM(NetworkConnectivity, GNetworkConnectivity, NO_GTYPE)
-/** TODO
+/** Network status monitor.
*
+ * %NetworkMonitor provides an easy-to-use cross-platform API
+ * for monitoring network connectivity. On Linux, the available
+ * implementations are based on the kernel's netlink interface and
+ * on NetworkManager.
+ *
+ * There is also an implementation for use inside Flatpak sandboxes.
+
* @newin{2,44}
*/
class NetworkMonitor : public Glib::Interface
{
class Icon;
-_WRAP_ENUM(NotificationPriority, GNotificationPriority, newin "2,44")
/** User Notifications (pop up messages).
*
_IGNORE(g_notification_new)
public:
+ _WRAP_ENUM(Priority, GNotificationPriority, newin "2,44")
+
_WRAP_METHOD_DOCS_ONLY(g_notification_new)
_WRAP_CREATE(const Glib::ustring& title)
_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>& 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, newin "2,44")
+ _IGNORE(g_notification_set_urgent)
+ _WRAP_METHOD(void set_priority(Priority priority = 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)
#include <glibmm/exceptionhandler.h>
#include "slot_async.h"
+using SpliceFlags = Gio::OutputStream::SpliceFlags;
+
namespace Gio
{
void
OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags, int io_priority)
+ const Glib::RefPtr<Cancellable>& cancellable, SpliceFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot,
- OutputStreamSpliceFlags flags, int io_priority)
+ SpliceFlags flags, int io_priority)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
gssize
OutputStream::splice(const Glib::RefPtr<InputStream>& source,
- const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, SpliceFlags flags)
{
GError* gerror = nullptr;
gssize retvalue = g_output_stream_splice(gobj(), Glib::unwrap(source),
}
gssize
-OutputStream::splice(const Glib::RefPtr<InputStream>& source, OutputStreamSpliceFlags flags)
+OutputStream::splice(const Glib::RefPtr<InputStream>& source, SpliceFlags flags)
{
GError* gerror = nullptr;
gssize retvalue = g_output_stream_splice(
namespace Gio
{
-_WRAP_ENUM(OutputStreamSpliceFlags, GOutputStreamSpliceFlags, NO_GTYPE)
/** Base class for implementing streaming output.
*
_CTOR_DEFAULT
public:
+ _WRAP_ENUM(SpliceFlags, GOutputStreamSpliceFlags, NO_GTYPE)
_WRAP_METHOD(gssize write(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable{?}),
g_output_stream_write,
/** Splices an input stream into an output stream.
*
* @param source An InputStream.
- * @param flags A set of OutputStreamSpliceFlags.
+ * @param flags A set of SpliceFlags.
* @param cancellable A Cancellable object.
* ignore.
* @return A #gssize containing the size of the data spliced.
*/
- gssize splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags = OUTPUT_STREAM_SPLICE_NONE);
+ gssize splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable, SpliceFlags flags = SpliceFlags::NONE);
/** Splices an input stream into an output stream.
*
* @param source An InputStream.
- * @param flags A set of OutputStreamSpliceFlags.
+ * @param flags A set of SpliceFlags.
* ignore.
* @return A #gssize containing the size of the data spliced.
*/
- gssize splice(const Glib::RefPtr<InputStream>& source, OutputStreamSpliceFlags flags = OUTPUT_STREAM_SPLICE_NONE);
+ gssize splice(const Glib::RefPtr<InputStream>& source, SpliceFlags flags = SpliceFlags::NONE);
_IGNORE(g_output_stream_splice)
_WRAP_METHOD(bool flush(const Glib::RefPtr<Cancellable>& cancellable{?}),
* @param source An InputStream.
* @param slot Callback slot to call when the request is satisfied.
* @param cancellable Cancellable object.
- * @param flags A set of OutputStreamSpliceFlags.
+ * @param flags A set of SpliceFlags.
* @param io_priority The io priority of the request.
*/
- void splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, OutputStreamSpliceFlags flags = OUTPUT_STREAM_SPLICE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, SpliceFlags flags = SpliceFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
/** Splices a stream asynchronously.
* When the operation is finished @a slot will be called.
*
* @param source An InputStream.
* @param slot Callback slot to call when the request is satisfied.
- * @param flags A set of OutputStreamSpliceFlags.
+ * @param flags A set of SpliceFlags.
* @param io_priority The io priority of the request.
*/
- void splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, OutputStreamSpliceFlags flags = OUTPUT_STREAM_SPLICE_NONE, int io_priority = Glib::PRIORITY_DEFAULT);
+ void splice_async(const Glib::RefPtr<InputStream>& source, const SlotAsyncReady& slot, SpliceFlags flags = SpliceFlags::NONE, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_output_stream_splice_async)
_WRAP_METHOD(bool set_pending(), g_output_stream_set_pending, errthrow, newin "2,50")
_WRAP_METHOD(void clear_pending(), g_output_stream_clear_pending, newin "2,50")
- //TODO: When we can break ABI, add vfuncs. See https://bugzilla.gnome.org/show_bug.cgi?id=572471
#m4 _CONVERSION(`GCancellable*', `const Glib::RefPtr<Cancellable>&', `Glib::wrap($3, true)')
#m4 _CONVERSION(`GInputStream*', `const Glib::RefPtr<InputStream>&', `Glib::wrap($3, true)')
- //_WRAP_VFUNC(gssize write(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable), write_fn, errthrow, err_return_value -1)
- //_WRAP_VFUNC(gssize splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable{.}, OutputStreamSpliceFlags flags{.}), splice, errthrow, err_return_value -1)
- //_WRAP_VFUNC(bool flush(const Glib::RefPtr<Cancellable>& cancellable), flush, errthrow)
- //_WRAP_VFUNC(bool close(const Glib::RefPtr<Cancellable>& cancellable), close_fn, errthrow)
+ _WRAP_VFUNC(gssize write(const void* buffer, gsize count, const Glib::RefPtr<Cancellable>& cancellable), write_fn, errthrow, err_return_value -1)
+ _WRAP_VFUNC(gssize splice(const Glib::RefPtr<InputStream>& source, const Glib::RefPtr<Cancellable>& cancellable{.}, SpliceFlags flags{.}), splice, errthrow, err_return_value -1)
+ _WRAP_VFUNC(bool flush(const Glib::RefPtr<Cancellable>& cancellable), flush, errthrow)
+ _WRAP_VFUNC(bool close(const Glib::RefPtr<Cancellable>& cancellable), close_fn, errthrow)
};
} // namespace Gio
class Cancellable;
-//TODO: Instead derive from InputStream, when we can break ABI,
-//because the GPollableInputStream interface requires the GInputStream interface.
-//LoadableIcon does a similar thing correctly, for instance.
+// GPollableInputStream requires GInputStream (a GObject), but Gio::PollableInputStream
+// shall not be derived from Gio::InputStream, like the Gio::Tls[Client|Server]Connection
+// interfaces are derived from Gio::TlsConnection. The unusual Gio::TlsConnection class
+// hierarchy is possible only because no subclass of Glib::Object implements
+// Gio::Tls[Client|Server]Connection.
+// See https://bugzilla.gnome.org/show_bug.cgi?id=776537
/** PollableInputStream - Interface for pollable input streams.
* PollableInputStream is implemented by InputStreams that can be polled for
class Cancellable;
-//TODO: Instead derive from OutputStream, when we can break ABI,
-//because the GPollableOutputStream interface requires the GOutputStream interface.
-//LoadableIcon does a similar thing correctly, for instance.
+// GPollableOutputStream requires GOutputStream (a GObject), but Gio::PollableOutputStream
+// shall not be derived from Gio::OutputStream, like the Gio::Tls[Client|Server]Connection
+// interfaces are derived from Gio::TlsConnection. The unusual Gio::TlsConnection class
+// hierarchy is possible only because no subclass of Glib::Object implements
+// Gio::Tls[Client|Server]Connection.
+// See https://bugzilla.gnome.org/show_bug.cgi?id=776537
/** PollableOutputStream - Interface for pollable output streams.
* PollableOutputStream is implemented by OutputStreams that can be polled for
-#ifndef _GLIBMM_SARRAY_H
-#define _GLIBMM_SARRAY_H
-
-/* array.h
- *
- * Copyright (C) 2002 The gtkmm Development Team
+/* Copyright (C) 2017 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
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmmconfig.h>
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
-#include <glibmm/arrayhandle.h>
-#include <glibmm/ustring.h>
+#include <gio/gio.h>
-namespace Glib
+namespace Gio
{
-/**
- * @deprecated Use a std::vector instead.
- */
-using SArray = Glib::ArrayHandle<Glib::ustring>;
+PropertyAction::PropertyAction(const Glib::ustring& name,
+ const Glib::PropertyProxy_Base& property_proxy, bool invert_boolean)
+:
+_CONSTRUCT("name", name.c_str(), "object", property_proxy.get_object()->gobj(),
+ "property-name", property_proxy.get_name(),
+ "invert-boolean", invert_boolean)
+{
}
-#endif // GLIBMM_DISABLE_DEPRECATED
-
-#endif // _GLIBMM_SARRAY_H
+} // namespace Gio
--- /dev/null
+/* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/object.h>
+#include <glibmm/refptr.h>
+#include <giomm/action.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+/** An Action reflecting a Glib::Object property.
+ *
+ * A %PropertyAction is a way to get an Action with a state value
+ * reflecting and controlling the value of a Glib::Object property.
+ *
+ * The state of the action will correspond to the value of the property.
+ * Changing it will change the property (assuming the requested value
+ * matches the requirements as specified in the GParamSpec, used when the
+ * property was installed).
+ *
+ * Only the most common types are presently supported. Booleans are
+ * mapped to booleans, strings to strings, signed/unsigned integers to
+ * int32/uint32 and floats and doubles to doubles.
+ *
+ * If the property is an enum then the state will be string-typed and
+ * conversion will automatically be performed between the enum value and
+ * "nick" string as per the GEnumValue table.
+ *
+ * Flags types are not currently supported.
+ *
+ * Properties of object types, boxed types and pointer types are not
+ * supported and probably never will be.
+ *
+ * Properties of Glib::Variant types are not currently supported.
+ *
+ * If the property is boolean-valued then the action will have a nullptr
+ * parameter type, and activating the action (with no parameter) will
+ * toggle the value of the property.
+ *
+ * In all other cases, the parameter type will correspond to the type of
+ * the property.
+ *
+ * The general idea here is to reduce the number of locations where a
+ * particular piece of state is kept (and therefore has to be synchronised
+ * between). %PropertyAction does not have a separate state that is kept
+ * in sync with the property value -- its state is the property value.
+ *
+ * For example, it might be useful to create an Action corresponding to
+ * property_visible_child_name() of a Gtk::Stack so that the current
+ * page can be switched from a menu. The active radio indication in the
+ * menu is then directly determined from the active page of the Gtk::Stack.
+ *
+ * An anti-example would be binding property_active_id() on a Gtk::ComboBox.
+ * This is because the state of the combobox itself is probably uninteresting
+ * and is actually being used to control something else.
+ *
+ * Another anti-example would be to bind to property_visible_child_name()
+ * of a Gtk::Stack if this value is actually stored in Gio::Settings.
+ * In that case, the real source of the value is
+ * Gio::Settings. If you want an Action to control a setting stored in
+ * Gio::Settings, see Gio::Settings::create_action() instead, and possibly
+ * combine its use with Gio::Settings::bind().
+ *
+ * @newin{2,58}
+ */
+class PropertyAction : public Glib::Object, public Action
+{
+ _CLASS_GOBJECT(PropertyAction, GPropertyAction, G_PROPERTY_ACTION, Glib::Object, GObject)
+ _IMPLEMENTS_INTERFACE(Action)
+
+protected:
+ PropertyAction(const Glib::ustring& name, const Glib::PropertyProxy_Base& property_proxy,
+ bool invert_boolean = false);
+
+public:
+ /** Creates an Action corresponding to the value of property @a property_proxy.
+ *
+ * The property must be existent and readable and writable (and not construct-only).
+ *
+ * This function takes a reference on the property's object and doesn't
+ * release it until the action is destroyed.
+ *
+ * @param name The name of the action to create.
+ * @param property_proxy The property to bind.
+ * @param invert_boolean If <tt>true</tt>, the state of the action will be
+ * the negation of the property value, provided the property is boolean.
+ * @return A new %PropertyAction.
+ *
+ * @newin{2,58}
+ */
+ _WRAP_CREATE(const Glib::ustring& name, const Glib::PropertyProxy_Base& property_proxy,
+ bool invert_boolean = false)
+
+ _WRAP_PROPERTY("name", Glib::ustring, newin "2,58")
+ _WRAP_PROPERTY("parameter-type", Glib::VariantType, newin "2,58")
+ _WRAP_PROPERTY("enabled", bool, newin "2,58")
+ _WRAP_PROPERTY("state-type", Glib::VariantType, newin "2,58")
+ _WRAP_PROPERTY("state", Glib::VariantBase, newin "2,58")
+ //_WRAP_PROPERTY("object", Glib::ObjectBase) // write-only, construct-only
+ //_WRAP_PROPERTY("property-name", Glib::ustring) // write-only, construct-only
+ _WRAP_PROPERTY("invert-boolean", bool, newin "2,58")
+
+ // There are no methods (apart from ctor and create), signals or vfuncs.
+};
+
+} // namespace Gio
_WRAP_PROPERTY("protocol", Glib::ustring)
_WRAP_PROPERTY("destination_protocol", Glib::ustring)
_WRAP_PROPERTY("destination_hostname", Glib::ustring)
-
-//TODO: This should really be a guint16:
- _WRAP_PROPERTY("destination_port", Glib::ustring)
-
+ // Don't use guint16 in _WRAP_PROPERTY().
+ // There is no Glib::Value<> specialization for guint16.
+ // Glib::Value<unsigned int> exists, and guint is a typedef of unsigned int.
+ _WRAP_PROPERTY("destination_port", guint)
_WRAP_PROPERTY("username", Glib::ustring)
_WRAP_PROPERTY("password", Glib::ustring)
_WRAP_PROPERTY("uri", Glib::ustring)
_WRAP_METHOD(bool is_supported() const, g_proxy_resolver_is_supported)
- //TODO: Use std::string instead of ustring (StringArrayHandle uses ustring)?:
+ //TODO: Use std::string instead of ustring?:
#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> lookup(const Glib::ustring& uri,
const Glib::RefPtr<Cancellable>& cancellable), g_proxy_resolver_lookup, errthrow)
-// -*- 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
namespace Gio
{
-
-//TODO: Instead derive from ActionGroup, when we can break ABI,
-//because the GRemoteActionGroup interface requires the GActionGroup interface.
-//LoadableIcon does a similar thing correctly, for instance.
-
-
/** RemoteActionGroup - a ActionGroup that interacts with other processes.
* The RemoteActionGroup interface is implemented by ActionGroup instances that
* either transmit action invocations to other processes or receive action
#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3, true)')
- _WRAP_VFUNC(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), "activate_action_full")
- _WRAP_VFUNC(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), "change_action_state_full")
+ _WRAP_VFUNC(void activate_action_full(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), "activate_action_full")
+ _WRAP_VFUNC(void change_action_state_full(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), "change_action_state_full")
};
} // namespace Gio
#include <glibmm/error.h>
#include "slot_async.h"
+namespace {
+
+struct SrvTargetListTraits
+{
+ using CppType = Gio::SrvTarget;
+ using CType = const GSrvTarget*;
+ using CTypeNonConst = GSrvTarget*;
+
+ static CType to_c_type(const CppType& item) { return item.gobj(); }
+ static CType to_c_type(CType ptr) { return ptr; }
+ static CppType to_cpp_type(CType item) { return CppType(const_cast<CTypeNonConst>(item), true /* take_copy */); }
+ static void release_c_type(CType item) { g_srv_target_free(const_cast<CTypeNonConst>(item)); }
+};
+
+} // anonymous namespace
+
namespace Gio
{
}
void
-Resolver::lookup_records_async(const Glib::ustring& rrname, ResolverRecordType record_type,
+Resolver::lookup_records_async(const Glib::ustring& rrname, RecordType record_type,
const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
{
auto slot_copy = new SlotAsyncReady(slot);
void
Resolver::lookup_records_async(
- const Glib::ustring& rrname, ResolverRecordType record_type, const SlotAsyncReady& slot)
+ const Glib::ustring& rrname, RecordType record_type, const SlotAsyncReady& slot)
{
auto slot_copy = new SlotAsyncReady(slot);
namespace Gio
{
-_WRAP_ENUM(ResolverRecordType, GResolverRecordType)
-
/** Asynchronous and cancellable DNS resolver
*
* Resolver provides cancellable synchronous and asynchronous DNS resolution,
protected:
public:
+ _WRAP_ENUM(RecordType, GResolverRecordType)
+
static Glib::RefPtr<Resolver> get_default();
_IGNORE(g_resolver_get_default)
static void set_default(const Glib::RefPtr<Resolver>& resolver);
// g_resolver_free_addresses is just a C convenience function
_IGNORE(g_resolver_free_addresses)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<InetAddress> >',`$2($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<InetAddress> > lookup_by_name(const Glib::ustring& hostname, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_by_name, errthrow)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<InetAddress>>',`Glib::ListHandler<Glib::RefPtr<InetAddress>>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<InetAddress>> lookup_by_name(const Glib::ustring& hostname, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_by_name, errthrow)
/** Begins asynchronously resolving hostname to determine its associated IP address(es), and eventually calls @a slot, which must call
* lookup_by_name_finish() to get the result. See lookup_by_name() for more details.
void lookup_by_name_async(const Glib::ustring& hostname, const SlotAsyncReady& slot);
_IGNORE(g_resolver_lookup_by_name_async)
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<InetAddress> > lookup_by_name_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_by_name_finish, errthrow)
+ _WRAP_METHOD(std::vector<Glib::RefPtr<InetAddress>> lookup_by_name_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_by_name_finish, errthrow)
_WRAP_METHOD(Glib::ustring lookup_by_address(const Glib::RefPtr<InetAddress>& address, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_by_address, errthrow)
_WRAP_METHOD(Glib::ustring lookup_by_address_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_by_address_finish, errthrow)
-#m4 _CONVERSION(`GList*',`ListHandle_SrvTarget',`$2($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(ListHandle_SrvTarget lookup_service(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_service, errthrow)
+#m4 _CONVERSION(`GList*',`std::vector<SrvTarget>',`Glib::ListHandler<SrvTarget, SrvTargetListTraits>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<SrvTarget> lookup_service(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_service, errthrow)
/** Begins asynchronously performing a DNS SRV lookup for the given service and protocol in the given domain, and eventually calls callback,
* which must call lookup_service_finish() to get the final result. See glookup_service() for more details.
void lookup_service_async(const Glib::ustring& service, const Glib::ustring& protocol, const Glib::ustring& domain, const SlotAsyncReady& slot);
_IGNORE(g_resolver_lookup_service_async)
- _WRAP_METHOD(ListHandle_SrvTarget lookup_service_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_service_finish, errthrow)
+ _WRAP_METHOD(std::vector<SrvTarget> lookup_service_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_service_finish, errthrow)
#m4 _CONVERSION(`GList*',`std::vector<Glib::VariantContainerBase>',`Glib::ListHandler<Glib::VariantContainerBase>::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(std::vector<Glib::VariantContainerBase> lookup_records(const Glib::ustring& rrname, ResolverRecordType record_type, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_records, errthrow)
+ _WRAP_METHOD(std::vector<Glib::VariantContainerBase> lookup_records(const Glib::ustring& rrname, RecordType record_type, const Glib::RefPtr<Cancellable>& cancellable{?}), g_resolver_lookup_records, errthrow)
/** Begins asynchronously performing a DNS lookup for the given @a rrname,
* and eventually calls @a slot, which must call lookup_records_finish() to
* @newin{2,36}
*/
void lookup_records_async(const Glib::ustring& rrname,
- ResolverRecordType record_type, const SlotAsyncReady& slot,
+ RecordType record_type, const SlotAsyncReady& slot,
const Glib::RefPtr<Cancellable>& cancellable);
_IGNORE(g_resolver_lookup_records_async)
/// A non-cancellable version of lookup_records_async().
void lookup_records_async(const Glib::ustring& rrname,
- ResolverRecordType record_type, const SlotAsyncReady& slot);
+ RecordType record_type, const SlotAsyncReady& slot);
_WRAP_METHOD(std::vector<Glib::VariantContainerBase> lookup_records_finish(const Glib::RefPtr<AsyncResult>& result), g_resolver_lookup_records_finish, errthrow)
- //TODO: Remove no_default_handler when we can break ABI:
- _WRAP_SIGNAL(void reload(), reload, no_default_handler)
+ _WRAP_SIGNAL(void reload(), reload)
};
std::string hostname_to_ascii (const Glib::ustring& hostname);
namespace Gio
{
-// Hand-coded because we want ResourceFlags& instead of guint32&.
+// Hand-coded because we want Flags& instead of guint32&.
void
-Resource::get_info(const std::string& path, gsize& size, ResourceFlags& flags,
- ResourceLookupFlags lookup_flags) const
+Resource::get_info(const std::string& path, gsize& size, Flags& flags,
+ LookupFlags lookup_flags) const
{
guint32 file_flags = 0;
GError* gerror = nullptr;
(GResourceLookupFlags)lookup_flags, &size, &file_flags, &gerror);
if (gerror)
::Glib::Error::throw_exception(gerror);
- flags = static_cast<ResourceFlags>(file_flags);
+ flags = static_cast<Flags>(file_flags);
}
void
-Resource::get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags) const
+Resource::get_file_exists(const std::string& path, LookupFlags lookup_flags) const
{
GError* gerror = nullptr;
g_resource_get_info(const_cast<GResource*>(gobj()), path.c_str(),
}
bool
-Resource::get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags) const
+Resource::get_file_exists_nothrow(const std::string& path, LookupFlags lookup_flags) const
{
return g_resource_get_info(const_cast<GResource*>(gobj()), path.c_str(),
(GResourceLookupFlags)lookup_flags, nullptr, nullptr, nullptr);
}
-// Hand-coded because we want ResourceFlags& instead of guint32&.
+// Hand-coded because we want Flags& instead of guint32&.
// static
void
Resource::get_info_global(
- const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags)
+ const std::string& path, gsize& size, Flags& flags, LookupFlags lookup_flags)
{
guint32 file_flags = 0;
GError* gerror = nullptr;
path.c_str(), (GResourceLookupFlags)lookup_flags, &size, &file_flags, &gerror);
if (gerror)
::Glib::Error::throw_exception(gerror);
- flags = static_cast<ResourceFlags>(file_flags);
+ flags = static_cast<Flags>(file_flags);
}
// static
void
-Resource::get_file_exists_global(const std::string& path, ResourceLookupFlags lookup_flags)
+Resource::get_file_exists_global(const std::string& path, LookupFlags lookup_flags)
{
GError* gerror = nullptr;
g_resources_get_info(path.c_str(), (GResourceLookupFlags)lookup_flags, nullptr, nullptr, &gerror);
// static
bool
-Resource::get_file_exists_global_nothrow(const std::string& path, ResourceLookupFlags lookup_flags)
+Resource::get_file_exists_global_nothrow(const std::string& path, LookupFlags lookup_flags)
{
return g_resources_get_info(
path.c_str(), (GResourceLookupFlags)lookup_flags, nullptr, nullptr, nullptr);
*/
_WRAP_GERROR(ResourceError, GResourceError, G_RESOURCE_ERROR, NO_GTYPE, newin "2,34")
-_WRAP_ENUM(ResourceFlags, GResourceFlags, newin "2,44")
-_WRAP_ENUM(ResourceLookupFlags, GResourceLookupFlags, newin "2,44")
-
/** %Resource framework.
*
* Applications and libraries often contain binary or textual data that is
_IGNORE(g_resource_ref, g_resource_unref)
public:
- _WRAP_METHOD(static Glib::RefPtr<Resource> create_from_data(const Glib::RefPtr<const Glib::Bytes>& data), g_resource_new_from_data, errthrow, newin "2,44")
- _WRAP_METHOD(static Glib::RefPtr<Resource> create_from_file(const std::string& filename), g_resource_load, errthrow, newin "2,44")
- _WRAP_METHOD(Glib::RefPtr<InputStream> 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<const Glib::Bytes> lookup_data(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_lookup_data, errthrow, newin "2,44")
+ _WRAP_ENUM(Flags, GResourceFlags, newin "2,44")
+ _WRAP_ENUM(LookupFlags, GResourceLookupFlags, newin "2,44")
+
+ _WRAP_METHOD(static Glib::RefPtr<Resource> create_from_data(const Glib::RefPtr<const Glib::Bytes>& data), g_resource_new_from_data, errthrow "Glib::FileError", newin "2,44")
+ _WRAP_METHOD(static Glib::RefPtr<Resource> create_from_file(const std::string& filename), g_resource_load, errthrow "Glib::FileError", newin "2,44")
+ _WRAP_METHOD(Glib::RefPtr<InputStream> open_stream(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE) const, g_resource_open_stream, errthrow "Gio::ResourceError", newin "2,44")
+ _WRAP_METHOD(Glib::RefPtr<const Glib::Bytes> lookup_data(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE) const, g_resource_lookup_data, errthrow "Gio::ResourceError", newin "2,44")
#m4 _CONVERSION(`char**',`std::vector<std::string>',`Glib::ArrayHandler<std::string>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(std::vector<std::string> enumerate_children(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const, g_resource_enumerate_children, errthrow, newin "2,44")
+ _WRAP_METHOD(std::vector<std::string> enumerate_children(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE) const, g_resource_enumerate_children, errthrow "Gio::ResourceError", newin "2,44")
/** Looks for a file at the specified @a path in the resource and
* if found returns information about it.
* @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.
+ * @param lookup_flags A LookupFlags.
* @throw Gio::ResourceError if the file was not found.
*/
- void get_info(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const;
+ void get_info(const std::string& path, gsize& size, Flags& flags, LookupFlags lookup_flags = LookupFlags::NONE) const;
_IGNORE(g_resource_get_info)
/** Looks for a file at the specified @a path in the resource.
* @newin{2,44}
*
* @param path A pathname inside the resource.
- * @param lookup_flags A ResourceLookupFlags.
+ * @param lookup_flags A LookupFlags.
* @throw Gio::ResourceError if the file was not found.
*/
- void get_file_exists(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const;
+ void get_file_exists(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE) const;
/** Looks for a file at the specified @a path in the resource.
*
* @newin{2,44}
*
* @param path A pathname inside the resource.
- * @param lookup_flags A ResourceLookupFlags.
+ * @param lookup_flags A LookupFlags.
* @return <tt>true</tt> if the file was found, <tt>false</tt> if there were errors.
*/
- bool get_file_exists_nothrow(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE) const;
+ bool get_file_exists_nothrow(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE) const;
// 'register' is a keyword. Can't be the name of a method.
_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<InputStream> 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<const Glib::Bytes> 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<std::string> enumerate_children_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE), g_resources_enumerate_children, errthrow, newin "2,44")
+ _WRAP_METHOD(static Glib::RefPtr<InputStream> open_stream_global(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE), g_resources_open_stream, errthrow "Gio::ResourceError", newin "2,44")
+ _WRAP_METHOD(static Glib::RefPtr<const Glib::Bytes> lookup_data_global(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE), g_resources_lookup_data, errthrow "Gio::ResourceError", newin "2,44")
+ _WRAP_METHOD(static std::vector<std::string> enumerate_children_global(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE), g_resources_enumerate_children, errthrow "Gio::ResourceError", 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.
* @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.
+ * @param lookup_flags A LookupFlags.
* @throw Gio::ResourceError if the file was not found.
*/
- static void get_info_global(const std::string& path, gsize& size, ResourceFlags& flags, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE);
+ static void get_info_global(const std::string& path, gsize& size, Flags& flags, LookupFlags lookup_flags = LookupFlags::NONE);
_IGNORE(g_resources_get_info)
/** Looks for a file at the specified @a path in the set of
* @newin{2,44}
*
* @param path A pathname inside the resource.
- * @param lookup_flags A ResourceLookupFlags.
+ * @param lookup_flags A LookupFlags.
* @throw Gio::ResourceError if the file was not found.
*/
- static void get_file_exists_global(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE);
+ static void get_file_exists_global(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE);
/** Looks for a file at the specified @a path in the set of
* globally registered resources.
* @newin{2,44}
*
* @param path A pathname inside the resource.
- * @param lookup_flags A ResourceLookupFlags.
+ * @param lookup_flags A LookupFlags.
* @return <tt>true</tt> if the file was found, <tt>false</tt> if there were errors.
*/
- static bool get_file_exists_global_nothrow(const std::string& path, ResourceLookupFlags lookup_flags = RESOURCE_LOOKUP_FLAGS_NONE);
+ static bool get_file_exists_global_nothrow(const std::string& path, LookupFlags lookup_flags = LookupFlags::NONE);
_IGNORE(g_static_resource_init, g_static_resource_fini, g_static_resource_get_resource)dnl//Used only by the glib-compile-resources command
};
#include <gio/gio.h>
#include <glibmm/exceptionhandler.h>
#include <glibmm/vectorutils.h>
+#include <giomm/settingsschema.h>
namespace Gio
{
}
void
Settings::bind(
- const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, SettingsBindFlags flags)
+ const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, BindFlags flags)
{
bind(key, property_proxy.get_object(), property_proxy.get_name(), flags);
}
bind_writable(key, property_proxy.get_object(), property_proxy.get_name(), inverted);
}
-_DEPRECATE_IFDEF_START
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-std::vector<Glib::ustring>
-Settings::list_schemas()
-{
- return Glib::ArrayHandler<Glib::ustring>::array_to_vector(
- g_settings_list_schemas(), Glib::OWNERSHIP_NONE);
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-_DEPRECATE_IFDEF_END
}
_CONFIGINCLUDE(giommconfig.h)
-#include <glibmm/arrayhandle.h>
#include <glibmm/object.h>
#include <glibmm/variant.h>
#include <giomm/action.h>
namespace Gio
{
-
- _WRAP_ENUM(SettingsBindFlags, GSettingsBindFlags)
+class SettingsSchema;
/** A high-level API for application settings
*
{
_CLASS_GOBJECT(Settings, GSettings, G_SETTINGS, Glib::Object, GObject)
+public:
+ _WRAP_ENUM(BindFlags, GSettingsBindFlags)
+
protected:
_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<SettingsBackend>& backend), g_settings_new_with_backend)
//TODO: Requires SettingsBackend: _WRAP_CTOR(Settings(const Glib::ustring& schema_id, const Glib::RefPtr<SettingsBackend>& backend, const Glib::ustring& path), g_settings_new_with_backend_and_path)
+ //TODO: Requires SettingsBackend: _WRAP_CTOR(Settings(const Glib::RefPtr<SettingsSchema>& settings_schema, const Glib::RefPtr<SettingsBackend>& backend, const Glib::ustring& path), g_settings_new_full)
public:
_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<SettingsBackend>& backend)
//TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::ustring& schema_id, const Glib::RefPtr<SettingsBackend>& backend, const Glib::ustring& path)
+ //TODO: Requires SettingsBackend: _WRAP_CREATE(const Glib::RefPtr<SettingsSchema>& settings_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)
_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(bool set_int(const Glib::ustring& key, int value), g_settings_set_int)
_WRAP_METHOD(gint64 get_int64(const Glib::ustring& key) const, g_settings_get_int64)
- _WRAP_METHOD(void set_int64(const Glib::ustring& key, gint64 value), g_settings_set_int64)
+ _WRAP_METHOD(bool set_int64(const Glib::ustring& key, gint64 value), g_settings_set_int64)
_WRAP_METHOD(guint get_uint(const Glib::ustring& key) const, g_settings_get_uint)
- _WRAP_METHOD(void set_uiint(const Glib::ustring& key, guint value), g_settings_set_uint, deprecated "Use set_uint() instead.")
- _WRAP_METHOD(void set_uint(const Glib::ustring& key, guint value), g_settings_set_uint)
+ _WRAP_METHOD(bool set_uint(const Glib::ustring& key, guint value), g_settings_set_uint)
_WRAP_METHOD(guint64 get_uint64(const Glib::ustring& key) const, g_settings_get_uint64)
- _WRAP_METHOD(void set_uint64(const Glib::ustring& key, guint64 value), g_settings_set_uint64)
+ _WRAP_METHOD(bool set_uint64(const Glib::ustring& key, guint64 value), g_settings_set_uint64)
_WRAP_METHOD(bool get_boolean(const Glib::ustring& key) const, g_settings_get_boolean)
- _WRAP_METHOD(void set_boolean(const Glib::ustring& key, bool value), g_settings_set_boolean)
+ _WRAP_METHOD(bool set_boolean(const Glib::ustring& key, bool value), g_settings_set_boolean)
_WRAP_METHOD(Glib::ustring get_string(const Glib::ustring& key) const, g_settings_get_string)
- _WRAP_METHOD(void set_string(const Glib::ustring& key, const Glib::ustring& value), g_settings_set_string)
+ _WRAP_METHOD(bool set_string(const Glib::ustring& key, const Glib::ustring& value), g_settings_set_string)
_WRAP_METHOD(double get_double(const Glib::ustring& key) const, g_settings_get_double)
- _WRAP_METHOD(void set_double(const Glib::ustring& key, double value), g_settings_set_double)
+ _WRAP_METHOD(bool set_double(const Glib::ustring& key, double value), g_settings_set_double)
- #m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle get_string_array(const Glib::ustring& key) const, g_settings_get_strv)
+ #m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_string_array(const Glib::ustring& key) const, g_settings_get_strv)
- _WRAP_METHOD(bool set_string_array(const Glib::ustring& key, const Glib::StringArrayHandle& value), g_settings_set_strv)
+ _WRAP_METHOD(bool set_string_array(const Glib::ustring& key, const std::vector<Glib::ustring>& value), g_settings_set_strv)
_WRAP_METHOD(int get_enum(const Glib::ustring& key) const, g_settings_get_enum)
- _WRAP_METHOD(bool get_enum(const Glib::ustring& key, int value), g_settings_set_enum,
- deprecated "This method is misnamed. Use set_enum() instead.")
_WRAP_METHOD(bool set_enum(const Glib::ustring& key, int value), g_settings_set_enum)
_WRAP_METHOD(guint get_flags(const Glib::ustring& key) const, g_settings_get_flags)
- _WRAP_METHOD(bool get_flags(const Glib::ustring& key, guint value), g_settings_set_flags,
- deprecated "This method is misnamed. Use set_flags() instead.")
_WRAP_METHOD(bool set_flags(const Glib::ustring& key, guint value), g_settings_set_flags)
// Ignore varargs functions.
_WRAP_METHOD(void reset(const Glib::ustring& key), g_settings_reset)
-_DEPRECATE_IFDEF_START
-//We must hand-code this because gmmproc is confused by the static keyword with the vector.
-//#m4 _CONVERSION(`const gchar*const*',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
- _WRAP_METHOD_DOCS_ONLY(g_settings_list_schemas)
- static std::vector<Glib::ustring> list_schemas();
- _IGNORE(g_settings_list_schemas)
-_DEPRECATE_IFDEF_END
-
#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector<Glib::ustring> list_children() const, g_settings_list_children)
- _WRAP_METHOD(std::vector<Glib::ustring> list_keys() const, g_settings_list_keys, deprecated "Use SettingsSchema::list_keys().")
+ _IGNORE(g_settings_list_keys)
_IGNORE(g_settings_get_range, g_settings_list_relocatable_schemas) // deprecated
- _WRAP_METHOD(bool range_check(const Glib::ustring& key, const Glib::VariantBase& value) const, g_settings_range_check,
- deprecated "Use g_settings_schema_key_range_check() instead.")
- //TODO: Wrap GSettingsSchema
+ _IGNORE(g_settings_range_check)
#m4 _CONVERSION(`Glib::ObjectBase*',`gpointer',(gpointer)$3->gobj())
- _WRAP_METHOD(void bind(const Glib::ustring& key, Glib::ObjectBase* object, const Glib::ustring& property, SettingsBindFlags flags=SETTINGS_BIND_DEFAULT), g_settings_bind)
- void bind(const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, SettingsBindFlags flags=SETTINGS_BIND_DEFAULT);
+ _WRAP_METHOD(void bind(const Glib::ustring& key, Glib::ObjectBase* object, const Glib::ustring& property, BindFlags flags = BindFlags::DEFAULT), g_settings_bind)
+ void bind(const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, BindFlags flags = BindFlags::DEFAULT);
// TODO: implement bind_with_mapping
_WRAP_METHOD(void bind_writable(const Glib::ustring& key, Glib::ObjectBase* object, const Glib::ustring& property, bool inverted=false), g_settings_bind_writable)
void bind_writable(const Glib::ustring& key, const Glib::PropertyProxy_Base& property_proxy, bool inverted=false);
_WRAP_PROPERTY("delay-apply", bool)
_WRAP_PROPERTY("has-unapplied", bool)
_WRAP_PROPERTY("path", std::string)
- _WRAP_PROPERTY("schema", Glib::ustring, deprecated "Use the 'schema-id' property instead. In a future version, this property may instead refer to a SettingsSchema.")
+ _IGNORE_PROPERTY("schema")
_WRAP_PROPERTY("schema-id", Glib::ustring)
- //TODO: _WRAP_PROPERTY("settings-schema", Glib::RefPtr<SettingsSchema>)
+ _WRAP_PROPERTY("settings-schema", Glib::RefPtr<SettingsSchema>, newin "2,58")
- //TODO?: _WRAP_SIGNAL(bool change_event(const Glib::ArrayHandle<Glib::QueryQuark>& keys, int n_keys), "change-event")
+ //TODO?: _WRAP_SIGNAL(bool change_event(const std::vector<Glib::QueryQuark>& 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", detail_name key, two_signal_methods)
+ _WRAP_SIGNAL(void changed(const Glib::ustring& key), "changed", detail_name key)
_WRAP_SIGNAL(bool writable_change_event(GQuark key), "writable-change-event")
- _WRAP_SIGNAL(void writable_changed(const Glib::ustring& key), writable_changed, detail_name key, two_signal_methods)
+ _WRAP_SIGNAL(void writable_changed(const Glib::ustring& key), writable_changed, detail_name key)
};
} // namespace Gio
_CONFIGINCLUDE(giommconfig.h)
#include <giomm/settingsschemakey.h>
-#include <glibmm/arrayhandle.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
_WRAP_METHOD_DOCS_ONLY(g_simple_action_group_new)
_WRAP_CREATE()
- _WRAP_METHOD(Glib::RefPtr<Action> lookup(const Glib::ustring& action_name), g_simple_action_group_lookup, refreturn, deprecated "Use ActionMap::lookup_action() instead")
- _WRAP_METHOD(Glib::RefPtr<const Action> lookup(const Glib::ustring& action_name) const, g_simple_action_group_lookup, refreturn, constversion, deprecated "Use ActionMap::lookup_action() instead")
-
- _WRAP_METHOD(void insert(const Glib::RefPtr<Action>& action), g_simple_action_group_insert, deprecated "Use ActionMap::add_action() instead")
- _WRAP_METHOD(void remove(const Glib::ustring& action_name), g_simple_action_group_remove, deprecated "Use ActionMap::remove_action() instead")
+ _IGNORE(g_simple_action_group_lookup, g_simple_action_group_insert, g_simple_action_group_remove)
_IGNORE(g_simple_action_group_add_entries) // deprecated
};
#include <giomm/socketsource.h>
#include "slot_async.h"
+using Type = Gio::Socket::Type;
+using Protocol = Gio::Socket::Protocol;
+
namespace Gio
{
-Socket::Socket(SocketFamily family, SocketType type, SocketProtocol protocol,
+Socket::Socket(SocketFamily family, Type type, Protocol protocol,
const Glib::RefPtr<Cancellable>& cancellable)
: _CONSTRUCT("family", int(family), "type", int(type), "protocol", int(protocol))
{
// static
Glib::RefPtr<Socket>
-Socket::create(SocketFamily family, SocketType type, SocketProtocol protocol,
+Socket::create(SocketFamily family, Type type, Protocol protocol,
const Glib::RefPtr<Cancellable>& cancellable)
{
- return Glib::RefPtr<Socket>(new Socket(family, type, protocol, cancellable));
+ return Glib::make_refptr_for_instance<Socket>(new Socket(family, type, protocol, cancellable));
}
// static
Glib::RefPtr<Socket>
Socket::create_from_fd(int fd, const Glib::RefPtr<Cancellable>& cancellable)
{
- return Glib::RefPtr<Socket>(new Socket(fd, cancellable));
+ return Glib::make_refptr_for_instance<Socket>(new Socket(fd, cancellable));
}
gssize
Glib::RefPtr<SocketSource>
Socket::create_source(Glib::IOCondition condition, const Glib::RefPtr<Cancellable>& cancellable)
{
- // The corresponding unreference() takes place in the dtor
- // of the Glib::RefPtr<Socket> object below.
- reference();
- return SocketSource::create(Glib::RefPtr<Socket>(this), condition, cancellable);
+ return SocketSource::create(gobj(), condition, cancellable);
}
} // namespace Gio
{
class SocketSource;
-_WRAP_ENUM(SocketType, GSocketType)
-_WRAP_ENUM(SocketProtocol, GSocketProtocol)
-_WRAP_ENUM(SocketMsgFlags, GSocketMsgFlags)
/** @defgroup NetworkIO Portable Network I/O Functionality
*/
_CLASS_GOBJECT(Socket, GSocket, G_SOCKET, Glib::Object, GObject)
_IMPLEMENTS_INTERFACE(Initable)
+public:
+ _WRAP_ENUM(Type, GSocketType)
+ _WRAP_ENUM(Protocol, GSocketProtocol)
+ _WRAP_ENUM(MsgFlags, GSocketMsgFlags)
+
protected:
- Socket(SocketFamily family, SocketType type, SocketProtocol protocol,
+ Socket(SocketFamily family, Type type, Protocol protocol,
const Glib::RefPtr<Cancellable>& cancellable);
Socket(int fd, const Glib::RefPtr<Cancellable>& cancellable);
* @throw Glib::Error
*/
static Glib::RefPtr<Socket>
- create(SocketFamily family, SocketType type, SocketProtocol protocol,
+ create(SocketFamily family, Type type, Protocol protocol,
const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
// gmmproc thinks that this function should be wrapped in this class because
_WRAP_METHOD(int get_fd() const, g_socket_get_fd)
_WRAP_METHOD(Glib::RefPtr<SocketAddress> get_local_address() const, g_socket_get_local_address, errthrow)
_WRAP_METHOD(Glib::RefPtr<SocketAddress> get_remote_address() const, g_socket_get_remote_address, errthrow)
- _WRAP_METHOD(SocketProtocol get_protocol() const, g_socket_get_protocol)
- _WRAP_METHOD(SocketType get_socket_type() const, g_socket_get_socket_type)
+ _WRAP_METHOD(Protocol get_protocol() const, g_socket_get_protocol)
+ _WRAP_METHOD(Type get_socket_type() const, g_socket_get_socket_type)
_WRAP_METHOD(bool speaks_ipv4() const, g_socket_speaks_ipv4)
_WRAP_METHOD(Glib::RefPtr<Credentials> get_credentials(), g_socket_get_credentials, errthrow)
_WRAP_PROPERTY("local-address", Glib::RefPtr<SocketAddress>)
_WRAP_PROPERTY("remote-address", Glib::RefPtr<SocketAddress>)
_WRAP_PROPERTY("timeout", guint)
- _WRAP_PROPERTY("protocol", SocketProtocol)
+ _WRAP_PROPERTY("protocol", Protocol)
_WRAP_PROPERTY("broadcast", bool)
- _WRAP_PROPERTY("type", SocketType)
+ _WRAP_PROPERTY("type", Type)
_WRAP_PROPERTY("ttl", guint)
_WRAP_PROPERTY("multicast-loopback", bool)
_WRAP_PROPERTY("multicast-ttl", guint)
-// -*- 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
_WRAP_CREATE()
_WRAP_METHOD(SocketFamily get_family() const, g_socket_client_get_family)
_WRAP_METHOD(void set_family(SocketFamily family), g_socket_client_set_family)
- _WRAP_METHOD(SocketType get_socket_type() const, g_socket_client_get_socket_type)
- _WRAP_METHOD(void set_socket_type(SocketType type), g_socket_client_set_socket_type)
- _WRAP_METHOD(SocketProtocol get_protocol() const, g_socket_client_get_protocol)
- _WRAP_METHOD(void set_protocol(SocketProtocol protocol), g_socket_client_set_protocol)
+ _WRAP_METHOD(Socket::Type get_socket_type() const, g_socket_client_get_socket_type)
+ _WRAP_METHOD(void set_socket_type(Socket::Type type), g_socket_client_set_socket_type)
+ _WRAP_METHOD(Socket::Protocol get_protocol() const, g_socket_client_get_protocol)
+ _WRAP_METHOD(void set_protocol(Socket::Protocol protocol), g_socket_client_set_protocol)
_WRAP_METHOD(Glib::RefPtr<SocketAddress> get_local_address(), g_socket_client_get_local_address)
_WRAP_METHOD(Glib::RefPtr<const SocketAddress> get_local_address() const, g_socket_client_get_local_address, constversion)
_WRAP_METHOD(void set_local_address(const Glib::RefPtr<SocketAddress>& address), g_socket_client_set_local_address)
_WRAP_PROPERTY("family", SocketFamily)
_WRAP_PROPERTY("local-address", Glib::RefPtr<SocketAddress>)
- _WRAP_PROPERTY("protocol", SocketProtocol)
- _WRAP_PROPERTY("type", SocketType)
+ _WRAP_PROPERTY("protocol", Socket::Protocol)
+ _WRAP_PROPERTY("type", Socket::Type)
_WRAP_PROPERTY("timeout", guint)
_WRAP_PROPERTY("enable-proxy", bool)
_WRAP_PROPERTY("tls", bool)
#m4 _CONVERSION(`GSocketConnectable*',`const Glib::RefPtr<SocketConnectable>&',`Glib::wrap($3, true)')
#m4 _CONVERSION(`GIOStream*',`const Glib::RefPtr<IOStream>&',`Glib::wrap($3, true)')
- _WRAP_SIGNAL(void event(SocketClientEvent event, const Glib::RefPtr<SocketConnectable>& connectable, const Glib::RefPtr<IOStream>& connection), event, no_default_handler)
+ _WRAP_SIGNAL(void event(SocketClientEvent event, const Glib::RefPtr<SocketConnectable>& connectable, const Glib::RefPtr<IOStream>& connection), event)
};
} // namespace Gio
}
bool
-SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type,
- SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object,
+SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, Socket::Type type,
+ Socket::Protocol protocol, const Glib::RefPtr<Glib::Object>& source_object,
Glib::RefPtr<SocketAddress>& effective_address)
{
GError* gerror = nullptr;
}
bool
-SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type,
- SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address)
+SocketListener::add_address(const Glib::RefPtr<SocketAddress>& address, Socket::Type type,
+ Socket::Protocol protocol, Glib::RefPtr<SocketAddress>& effective_address)
{
GError* gerror = nullptr;
GSocketAddress* retaddr = nullptr;
bool add_socket(const Glib::RefPtr<Socket>& socket);
_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_address)
-bool add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address);
+bool add_address(const Glib::RefPtr<SocketAddress>& address, Socket::Type type, Socket::Protocol protocol, const Glib::RefPtr<Glib::Object>& source_object, Glib::RefPtr<SocketAddress>& effective_address);
_IGNORE(g_socket_listener_add_address)
_WRAP_METHOD_DOCS_ONLY(g_socket_listener_add_address)
- bool add_address(const Glib::RefPtr<SocketAddress>& address, SocketType type, SocketProtocol protocol, Glib::RefPtr<SocketAddress>& effective_address);
+ bool add_address(const Glib::RefPtr<SocketAddress>& address, Socket::Type type, Socket::Protocol protocol, Glib::RefPtr<SocketAddress>& effective_address);
_WRAP_METHOD(bool add_inet_port(guint16 port, const Glib::RefPtr<Glib::Object>& source_object), g_socket_listener_add_inet_port, errthrow)
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/listhandle.h>
-
-// unfortunately we need to include the C header for the type traits
-// implementation
-#include <gio/gio.h>
+#include <glibmm/value.h>
_DEFS(giomm,gio)
};
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-struct SrvTargetListTraits
-{
- using CppType = Gio::SrvTarget;
- using CType = const GSrvTarget*;
- using CTypeNonConst = GSrvTarget*;
-
- static CType to_c_type(const CppType& item) { return item.gobj(); }
- static CType to_c_type(CType ptr) { return ptr; }
- static CppType to_cpp_type(CType item) { return CppType(const_cast<CTypeNonConst>(item), true /* take_copy */); }
- static void release_c_type(CType item) { g_srv_target_free(const_cast<CTypeNonConst>(item)); }
-};
-
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
-using ListHandle_SrvTarget = Glib::ListHandle<Gio::SrvTarget, SrvTargetListTraits>;
} // namespace Gio
_WRAP_METHOD(void prepend_name(const std::string& iconname), g_themed_icon_prepend_name)
_WRAP_METHOD(void append_name(const std::string& iconname), g_themed_icon_append_name)
- #m4 _CONVERSION(`const gchar* const*',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle get_names() const, g_themed_icon_get_names)
+ #m4 _CONVERSION(`const gchar* const*',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> get_names() const, g_themed_icon_get_names)
//There are no signals.
Glib::RefPtr<TlsCertificate>
TlsCertificate::create_from_pem(const std::string& data, gssize length)
{
- return Glib::RefPtr<TlsCertificate>(new TlsCertificate(data, length));
+ return Glib::make_refptr_for_instance<TlsCertificate>(new TlsCertificate(data, length));
}
} // namesapce Gio
class SocketConnectable;
+// It's unusual that a subclass of Glib::Object is a base class of an interface.
+// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
+// especially the last paragraph of comment 6.
+
/** TlsClientConnection - TLS client-side connection.
* TlsClientConnection is the client-side subclass of TlsConnection,
* representing a client-side TLS connection.
_CUSTOM_CTOR_CAST
public:
- //TODO: It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
- //function because this is an interface.
+ // It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
+ // function because this is an interface.
#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsClientConnection>',`Glib::wrap(G_TLS_CLIENT_CONNECTION($3))')
_WRAP_METHOD(static Glib::RefPtr<TlsClientConnection> create(const Glib::RefPtr<IOStream>& base_io_stream, const Glib::RefPtr<const SocketConnectable>& server_identity{?}), g_tls_client_connection_new, errthrow)
_WRAP_METHOD(void set_validation_flags(TlsCertificateFlags flags), g_tls_client_connection_set_validation_flags)
_WRAP_METHOD(TlsCertificateFlags get_validation_flags() const, g_tls_client_connection_get_validation_flags)
- _WRAP_METHOD(void set_use_ssl3(bool use_ssl3 = true), g_tls_client_connection_set_use_ssl3,
- deprecated "SSL 3.0 is insecure, and this function does not generally enable or disable it, despite its name.")
- _WRAP_METHOD(bool get_use_ssl3() const, g_tls_client_connection_get_use_ssl3,
- deprecated "SSL 3.0 is insecure, and this function does not actually indicate whether it is enabled.")
+ _IGNORE(g_tls_client_connection_set_use_ssl3, g_tls_client_connection_get_use_ssl3) dnl// deprecated
#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Glib::ByteArray> >',`Glib::ListHandler< Glib::RefPtr<Glib::ByteArray> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(std::vector< Glib::RefPtr<Glib::ByteArray> > get_accepted_cas(), g_tls_client_connection_get_accepted_cas)
_WRAP_PROPERTY("accepted-cas", std::vector< Glib::RefPtr<Glib::ByteArray> >)
_WRAP_PROPERTY("server-identity", Glib::RefPtr<SocketConnectable>)
- _WRAP_PROPERTY("use-ssl3", bool, deprecated "SSL 3.0 is insecure, and this property does not generally enable or disable it, despite its name.")
_WRAP_PROPERTY("validation-flags", TlsCertificateFlags)
+ _IGNORE_PROPERTY(use-ssl3) dnl// deprecated
};
} // namespace Gio
#include <giomm/tlsdatabase.h>
#include <giomm/tlsinteraction.h>
#include "slot_async.h"
-
-namespace Gio
-{
-
-// Deprecated in glib 2.60, but not in glibmm 2.58.
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-void TlsConnection::set_rehandshake_mode(TlsRehandshakeMode mode)
-{
- g_tls_connection_set_rehandshake_mode(gobj(), ((GTlsRehandshakeMode)(mode)));
-}
-TlsRehandshakeMode TlsConnection::get_rehandshake_mode() const
-{
- return ((TlsRehandshakeMode)(g_tls_connection_get_rehandshake_mode(const_cast<GTlsConnection*>(gobj()))));
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-} // namespace Gio
_WRAP_METHOD(void set_require_close_notify(bool require_close_notify = true), g_tls_connection_set_require_close_notify)
_WRAP_METHOD(bool get_require_close_notify() const, g_tls_connection_get_require_close_notify)
- // Deprecated in glib 2.60, but not in glibmm 2.58.
- _WRAP_METHOD_DOCS_ONLY(g_tls_connection_set_rehandshake_mode)
- void set_rehandshake_mode(TlsRehandshakeMode mode);
- _WRAP_METHOD_DOCS_ONLY(g_tls_connection_get_rehandshake_mode)
- TlsRehandshakeMode get_rehandshake_mode() const;
+ _WRAP_METHOD(void set_rehandshake_mode(TlsRehandshakeMode mode), g_tls_connection_set_rehandshake_mode)
+ _WRAP_METHOD(TlsRehandshakeMode get_rehandshake_mode() const, g_tls_connection_get_rehandshake_mode)
- _WRAP_METHOD(void set_use_system_certdb(bool use_system_certdb = true), g_tls_connection_set_use_system_certdb,
- deprecated "Use set_database() instead.")
- _WRAP_METHOD(bool get_use_system_certdb() const, g_tls_connection_get_use_system_certdb,
- deprecated "Use get_database() instead.")
+ _IGNORE(g_tls_connection_set_use_system_certdb, g_tls_connection_get_use_system_certdb)
_WRAP_METHOD(Glib::RefPtr<TlsDatabase> get_database(), g_tls_connection_get_database)
_WRAP_METHOD(Glib::RefPtr<const TlsDatabase> get_database() const, g_tls_connection_get_database, constversion)
_WRAP_PROPERTY("peer-certificate-errors", TlsCertificateFlags)
_WRAP_PROPERTY("rehandshake-mode", TlsRehandshakeMode)
_WRAP_PROPERTY("require-close-notify", bool)
- _WRAP_PROPERTY("use-system-certdb", bool, deprecated "Use property_database() instead.")
+ _IGNORE_PROPERTY("use-system-certdb")
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(bool accept_certificate(const Glib::RefPtr<const TlsCertificate>& peer_cert, TlsCertificateFlags errors), "accept_certificate")
#include <giomm/tlscertificate.h>
#include <giomm/tlsinteraction.h>
#include "slot_async.h"
+
+
+using VerifyFlags = Gio::TlsDatabase::VerifyFlags;
+using LookupFlags = Gio::TlsDatabase::LookupFlags;
namespace Gio
{
-_WRAP_ENUM(TlsDatabaseVerifyFlags, GTlsDatabaseVerifyFlags)
-_WRAP_ENUM(TlsDatabaseLookupFlags, GTlsDatabaseLookupFlags)
-
class Cancellable;
class SocketConnectable;
class TlsCertificate;
//TODO?: Have a constant for the C macro G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER (which is a string)?
//TODO?: Have a constant for the C macro G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT (which is a string)?
- _WRAP_METHOD(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.} = TLS_DATABASE_VERIFY_NONE) const, g_tls_database_verify_chain, errthrow)
- _WRAP_METHOD(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.} = TLS_DATABASE_VERIFY_NONE) const, g_tls_database_verify_chain_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_ENUM(VerifyFlags, GTlsDatabaseVerifyFlags)
+ _WRAP_ENUM(LookupFlags, GTlsDatabaseLookupFlags)
+
+ _WRAP_METHOD(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, VerifyFlags flags{.} = VerifyFlags::NONE) const, g_tls_database_verify_chain, errthrow)
+ _WRAP_METHOD(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity{?}, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, VerifyFlags flags{.} = VerifyFlags::NONE) const, g_tls_database_verify_chain_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(TlsCertificateFlags verify_chain_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_verify_chain_finish, errthrow)
- _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer, errthrow)
- _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE) const, g_tls_database_lookup_certificate_issuer, errthrow, constversion)
+ _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificate_issuer, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE) const, g_tls_database_lookup_certificate_issuer, errthrow, constversion)
- _WRAP_METHOD(void lookup_certificate_issuer_async(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_issuer_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_METHOD(void lookup_certificate_issuer_async(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificate_issuer_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificate_issuer_finish, errthrow)
#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<TlsCertificate> >',`Glib::ListHandler< Glib::RefPtr<TlsCertificate> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificates_issued_by, errthrow)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificates_issued_by, errthrow)
#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const TlsCertificate> >',`Glib::ListHandler< Glib::RefPtr<const TlsCertificate> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(std::vector< Glib::RefPtr<const TlsCertificate> > lookup_certificates_issued_by(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE) const, g_tls_database_lookup_certificates_issued_by, errthrow)
+ _WRAP_METHOD(std::vector< Glib::RefPtr<const TlsCertificate> > lookup_certificates_issued_by(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE) const, g_tls_database_lookup_certificates_issued_by, errthrow)
- _WRAP_METHOD(void lookup_certificates_issued_by_async(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = Gio::TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificates_issued_by_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_METHOD(void lookup_certificates_issued_by_async(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificates_issued_by_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificates_issued_by_finish, errthrow)
_WRAP_METHOD(Glib::ustring create_certificate_handle(const Glib::RefPtr<const TlsCertificate>& certificate) const, g_tls_database_create_certificate_handle)
- _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_for_handle, errthrow)
- _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE) const, g_tls_database_lookup_certificate_for_handle, errthrow, constversion)
+ _WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificate_for_handle, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<const TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE) const, g_tls_database_lookup_certificate_for_handle, errthrow, constversion)
- _WRAP_METHOD(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.} = TLS_DATABASE_LOOKUP_NONE), g_tls_database_lookup_certificate_for_handle_async, slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_METHOD(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction{?}, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.} = LookupFlags::NONE), g_tls_database_lookup_certificate_for_handle_async, slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_METHOD(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle_finish(const Glib::RefPtr<AsyncResult>& result), g_tls_database_lookup_certificate_for_handle_finish, errthrow)
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<TlsCertificate>&',`Glib::wrap($3, true)')
#m4 _CONVERSION(`GSocketConnectable*',`const Glib::RefPtr<const SocketConnectable>&',`Glib::wrap($3, true)')
#m4 _CONVERSION(`GTlsInteraction*',`const Glib::RefPtr<TlsInteraction>&',`Glib::wrap($3, true)')
- _WRAP_VFUNC(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.}) const, "verify_chain", errthrow)
- _WRAP_VFUNC(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseVerifyFlags flags{.}) const, "verify_chain_async", slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_VFUNC(TlsCertificateFlags verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, VerifyFlags flags{.}) const, "verify_chain", errthrow)
+ _WRAP_VFUNC(void verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, VerifyFlags flags{.}) const, "verify_chain_async", slot_name slot, slot_callback SignalProxy_async_callback)
#m4 _CONVERSION(`GAsyncResult*',`const Glib::RefPtr<AsyncResult>&',`Glib::wrap($3, true)')
_WRAP_VFUNC(TlsCertificateFlags verify_chain_finish(const Glib::RefPtr<AsyncResult>& result), "verify_chain_finish", errthrow)
dnl// create_certificate_handle_vfunc() shall return a newly allocated string.
+dnl// Also, ensure that create_certificate_handle_vfunc() never returns an empty char[],
+dnl// because that could be caused by an intermediate empty ustring from an initial null char*.
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
+#m4 _CONVERSION(`Glib::ustring',`gchar*',`g_strdup(Glib::c_str_or_nullptr($3))')
#m4 _CONVERSION(`gchar*',`Glib::ustring',`Glib::convert_return_gchar_ptr_to_ustring($3)')
_WRAP_VFUNC(Glib::ustring create_certificate_handle(const Glib::RefPtr<const TlsCertificate>& certificate) const, "create_certificate_handle")
#m4 _CONVERSION(`Glib::RefPtr<TlsCertificate>',`GTlsCertificate*',`G_TLS_CERTIFICATE(g_object_ref(Glib::unwrap($3)))')
- _WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_for_handle", errthrow)
- _WRAP_VFUNC(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_for_handle_async", slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.}), "lookup_certificate_for_handle", errthrow)
+ _WRAP_VFUNC(void lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.}), "lookup_certificate_for_handle_async", slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_for_handle_finish(const Glib::RefPtr<AsyncResult>& result), "lookup_certificate_for_handle_finish", errthrow)
- _WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_issuer", errthrow)
- _WRAP_VFUNC(void lookup_certificate_issuer_async(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.}), "lookup_certificate_issuer_async", slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.}), "lookup_certificate_issuer", errthrow)
+ _WRAP_VFUNC(void lookup_certificate_issuer_async(const Glib::RefPtr<TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.}), "lookup_certificate_issuer_async", slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_VFUNC(Glib::RefPtr<TlsCertificate> lookup_certificate_issuer_finish(const Glib::RefPtr<AsyncResult>& result), "lookup_certificate_issuer_finish", errthrow)
#m4 _CONVERSION(`std::vector< Glib::RefPtr<TlsCertificate> >',`GList*',`g_list_copy(Glib::ListHandler< Glib::RefPtr<TlsCertificate> >::vector_to_list($3).data())')
#m4 _CONVERSION(`GByteArray*',`const Glib::RefPtr<Glib::ByteArray>&',`Glib::wrap($3, true)')
- _WRAP_VFUNC(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.}), "lookup_certificates_issued_by", errthrow)
- _WRAP_VFUNC(void lookup_certificates_issued_by_async(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, TlsDatabaseLookupFlags flags{.}), "lookup_certificates_issued_by_async", slot_name slot, slot_callback SignalProxy_async_callback)
+ _WRAP_VFUNC(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.}), "lookup_certificates_issued_by", errthrow)
+ _WRAP_VFUNC(void lookup_certificates_issued_by_async(const Glib::RefPtr<Glib::ByteArray>& issuer_raw_dn, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& cancellable{.?}, LookupFlags flags{.}), "lookup_certificates_issued_by_async", slot_name slot, slot_callback SignalProxy_async_callback)
_WRAP_VFUNC(std::vector< Glib::RefPtr<TlsCertificate> > lookup_certificates_issued_by_finish(const Glib::RefPtr<AsyncResult>& result), "lookup_certificates_issued_by_finish", errthrow)
};
namespace Gio
{
+// It's unusual that a subclass of Glib::Object is a base class of an interface.
+// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
+// especially the last paragraph of comment 6.
/** TlsFileDatabase - TLS file based database type.
* TlsFileDatabase is implemented by TlsDatabase objects which load their
_CLASS_INTERFACE(TlsFileDatabase, GTlsFileDatabase, G_TLS_FILE_DATABASE, GTlsFileDatabaseInterface)
public:
- //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.
+ // It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
+ // function because this is an interface.
#m4 _CONVERSION(`GTlsDatabase*',`Glib::RefPtr<TlsFileDatabase>',`Glib::wrap(G_TLS_FILE_DATABASE($3))')
_WRAP_METHOD(static Glib::RefPtr<TlsFileDatabase> create(const std::string& anchors), g_tls_file_database_new, errthrow)
*/
#include <gio/gio.h>
+
+using Flags = Gio::TlsPassword::Flags;
namespace Gio
{
-_WRAP_ENUM(TlsPasswordFlags, GTlsPasswordFlags)
/** TlsPassword - TLS Passwords for prompting.
* Holds a password used in TLS.
{
_CLASS_GOBJECT(TlsPassword, GTlsPassword, G_TLS_PASSWORD, Glib::Object, GObject)
+public:
+ _WRAP_ENUM(Flags, GTlsPasswordFlags)
+
protected:
- _WRAP_CTOR(TlsPassword(const Glib::ustring& description{.}, TlsPasswordFlags flags{.} = Gio::TLS_PASSWORD_NONE), g_tls_password_new)
+ _WRAP_CTOR(TlsPassword(const Glib::ustring& description{.}, Flags flags{.} = Flags::NONE), g_tls_password_new)
public:
_WRAP_METHOD_DOCS_ONLY(g_tls_password_new)
- _WRAP_CREATE(const Glib::ustring& description{.}, TlsPasswordFlags flags{.} = Gio::TLS_PASSWORD_NONE)
+ _WRAP_CREATE(const Glib::ustring& description{.}, Flags flags{.} = Flags::NONE)
_WRAP_METHOD(const guchar* get_value(gsize& length{?}) const, g_tls_password_get_value)
_WRAP_METHOD(Glib::ustring get_description() const, g_tls_password_get_description)
_WRAP_METHOD(void set_description(const Glib::ustring& description), g_tls_password_set_description)
- _WRAP_METHOD(TlsPasswordFlags get_flags() const, g_tls_password_get_flags)
- _WRAP_METHOD(void set_flags(TlsPasswordFlags flags), g_tls_password_set_flags)
+ _WRAP_METHOD(Flags get_flags() const, g_tls_password_get_flags)
+ _WRAP_METHOD(void set_flags(Flags flags), g_tls_password_set_flags)
_WRAP_METHOD(Glib::ustring get_warning() const, g_tls_password_get_warning)
_WRAP_METHOD(void set_warning(const Glib::ustring& warning), g_tls_password_set_warning)
_WRAP_PROPERTY("description", Glib::ustring)
- _WRAP_PROPERTY("flags", TlsPasswordFlags)
+ _WRAP_PROPERTY("flags", Flags)
_WRAP_PROPERTY("warning", Glib::ustring)
#m4 _CONVERSION(`gsize*', `gsize&', `*($3)')
namespace Gio
{
+// It's unusual that a subclass of Glib::Object is a base class of an interface.
+// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
+// especially the last paragraph of comment 6.
/** TlsServerConnection - TLS server-side connection.
* TlsServerConnection is the server-side subclass of TlsConnection,
_CUSTOM_CTOR_CAST
public:
- //TODO: It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
- //function because this is an interface.
+ // It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
+ // function because this is an interface.
#m4 _CONVERSION(`GIOStream*',`Glib::RefPtr<TlsServerConnection>',`Glib::wrap(G_TLS_SERVER_CONNECTION($3))')
_WRAP_METHOD(static Glib::RefPtr<IOStream> create(const Glib::RefPtr<IOStream>& base_io_stream, const Glib::RefPtr<TlsCertificate>& certificate), g_tls_server_connection_new, errthrow)
namespace Gio
{
-UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds)
+UnixFDList::UnixFDList(const std::vector<int>& fds)
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
Glib::ObjectBase(nullptr),
// g_unix_fd_list_new_from_array() must be called.
// _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()))
+ Glib::Object((GObject*)g_unix_fd_list_new_from_array(Glib::ArrayHandler<int>::vector_to_array(fds).data(), fds.size()))
{
}
-UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds, int n_fds)
+UnixFDList::UnixFDList(const std::vector<int>& fds, int n_fds)
: // Mark this class as non-derived to allow C++ vfuncs to be skipped.
Glib::ObjectBase(nullptr),
// g_unix_fd_list_new_from_array() must be called.
// _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))
+ Glib::Object((GObject*)g_unix_fd_list_new_from_array(Glib::ArrayHandler<int>::vector_to_array(fds).data(), n_fds))
{
}
-const Glib::ArrayHandle<int>
+const std::vector<int>
UnixFDList::peek_fds() const
{
int length = 0;
const auto fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(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<int>(fds, length, Glib::OWNERSHIP_NONE);
+ return Glib::ArrayHandler<int>::array_to_vector(fds, length, Glib::OWNERSHIP_NONE);
}
-Glib::ArrayHandle<int>
+std::vector<int>
UnixFDList::steal_fds()
{
int length = 0;
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<int>(fds, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<int>::array_to_vector(fds, length, Glib::OWNERSHIP_DEEP);
}
} // namespace Gio
*/
#include <glibmm/object.h>
-#include <glibmm/arrayhandle.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
_CTOR_DEFAULT
_IGNORE(g_unix_fd_list_new)
- explicit UnixFDList(const Glib::ArrayHandle<int>& fds);
+ explicit UnixFDList(const std::vector<int>& fds);
- explicit UnixFDList(const Glib::ArrayHandle<int>& fds, int n_fds);
+ explicit UnixFDList(const std::vector<int>& fds, int n_fds);
_IGNORE(g_unix_fd_list_new_from_array)
public:
* @param fds The list of file descriptors to use for creation.
* @return A new UnixFDList.
*/
- _WRAP_CREATE(const Glib::ArrayHandle<int>& fds)
+ _WRAP_CREATE(const std::vector<int>& fds)
_WRAP_METHOD_DOCS_ONLY(g_unix_fd_list_new_from_array)
- _WRAP_CREATE(const Glib::ArrayHandle<int>& fds, int n_fds)
+ _WRAP_CREATE(const std::vector<int>& fds, int n_fds)
_WRAP_METHOD(int get_length() const, g_unix_fd_list_get_length)
- _WRAP_METHOD(int get(int index) const, g_unix_fd_list_get, errthrow)
+ _WRAP_METHOD(int get(int index) const, g_unix_fd_list_get, errthrow "Gio::Error")
/** Returns the array of file descriptors that is contained in this object.
*
*
* @newin{2,28}
*/
- const Glib::ArrayHandle<int> peek_fds() const;
+ const std::vector<int> peek_fds() const;
_IGNORE(g_unix_fd_list_peek_fds)
/** Returns the array of file descriptors that is contained in this object.
*
* @newin{2,28}
*/
- Glib::ArrayHandle<int> steal_fds();
+ std::vector<int> steal_fds();
_IGNORE(g_unix_fd_list_steal_fds)
_WRAP_METHOD_DOCS_ONLY(g_unix_fd_list_append)
///@throw Glib::Error.
- _WRAP_METHOD(int append(int fd), g_unix_fd_list_append, errthrow)
+ _WRAP_METHOD(int append(int fd), g_unix_fd_list_append, errthrow "Gio::Error")
};
} // namespace Gio
namespace Gio
{
-Glib::ArrayHandle<int>
+std::vector<int>
UnixFDMessage::steal_fds()
{
int length = 0;
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<int>(fds, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<int>::array_to_vector(fds, length, Glib::OWNERSHIP_DEEP);
}
} // namespace Gio
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/arrayhandle.h>
#include <giomm/socketcontrolmessage.h>
_DEFS(giomm,gio)
_WRAP_METHOD(Glib::RefPtr<UnixFDList> get_fd_list(), g_unix_fd_message_get_fd_list, refreturn)
_WRAP_METHOD(Glib::RefPtr<const UnixFDList> 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)
+ _WRAP_METHOD(bool append_fd(int fd), g_unix_fd_message_append_fd, errthrow "Gio::Error")
/** Returns the array of file descriptors that is contained in this object.
*
*
* @newin{2,28}
*/
- Glib::ArrayHandle<int> steal_fds();
+ std::vector<int> steal_fds();
_IGNORE(g_unix_fd_message_steal_fds)
_WRAP_PROPERTY("fd-list", Glib::RefPtr<UnixFDList>)
-// -*- 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
*/
#include <giomm/inputstream.h>
+#include <giomm/pollableinputstream.h>
+#include <giomm/filedescriptorbased.h>
_DEFS(giomm,gio)
_PINCLUDE(giomm/private/inputstream_p.h)
*
* @newin{2,16}
*/
-class UnixInputStream : public Gio::InputStream
+class UnixInputStream
+: public Gio::InputStream, public PollableInputStream, public FileDescriptorBased
{
_CLASS_GOBJECT(UnixInputStream, GUnixInputStream, G_UNIX_INPUT_STREAM, Gio::InputStream, GInputStream)
+ _IMPLEMENTS_INTERFACE(PollableInputStream)
+ _IMPLEMENTS_INTERFACE(FileDescriptorBased)
_GTKMMPROC_WIN32_NO_WRAP
protected:
-// -*- 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
*/
#include <giomm/outputstream.h>
+#include <giomm/pollableoutputstream.h>
+#include <giomm/filedescriptorbased.h>
_DEFS(giomm,gio)
_PINCLUDE(giomm/private/outputstream_p.h)
*
* @newin{2,16}
*/
-class UnixOutputStream : public Gio::OutputStream
+class UnixOutputStream
+: public Gio::OutputStream, public PollableOutputStream, public FileDescriptorBased
{
_CLASS_GOBJECT(UnixOutputStream, GUnixOutputStream, G_UNIX_OUTPUT_STREAM, Gio::OutputStream, GOutputStream)
+ _IMPLEMENTS_INTERFACE(PollableOutputStream)
+ _IMPLEMENTS_INTERFACE(FileDescriptorBased)
_GTKMMPROC_WIN32_NO_WRAP
protected:
#include <gio/gunixsocketaddress.h>
+using Type = Gio::UnixSocketAddress::Type;
+
namespace Gio
{
Glib::RefPtr<UnixSocketAddress>
-UnixSocketAddress::create(const std::string& path, UnixSocketAddressType type, int path_len)
+UnixSocketAddress::create(const std::string& path, Type type, int path_len)
{
return Glib::wrap(reinterpret_cast<GUnixSocketAddress*>(g_unix_socket_address_new_with_type(
path.c_str(), path_len, static_cast<GUnixSocketAddressType>(type))));
namespace Gio
{
-_WRAP_ENUM(UnixSocketAddressType, GUnixSocketAddressType)
-
class ByteArray;
/** UnixSocketAddress - UNIX SocketAddress.
_CLASS_GOBJECT(UnixSocketAddress, GUnixSocketAddress, G_UNIX_SOCKET_ADDRESS, SocketAddress, GSocketAddress)
_GTKMMPROC_WIN32_NO_WRAP
+public:
+ _WRAP_ENUM(Type, GUnixSocketAddressType)
+
protected:
_WRAP_CTOR(UnixSocketAddress(const std::string& path), g_unix_socket_address_new)
//TODO: Possibly add when g_unix_socket_address_new_with_type() does not do
//more than call g_object_new() (maybe file a bug).
- //_WRAP_CTOR(UnixSocketAddress(const std::string& path, int path_len = -1, UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_PATH), g_unix_socket_address_new_with_type)
+ //_WRAP_CTOR(UnixSocketAddress(const std::string& path, int path_len = -1, Type type = Type::PATH), g_unix_socket_address_new_with_type)
public:
_WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new)
//TODO: Add when the above constructor is included, removing the handwritten
//create() method for it below.
//_WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new_with_type)
- //_WRAP_CREATE(const std::string& path, int path_len = -1, UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_PATH)
+ //_WRAP_CREATE(const std::string& path, int path_len = -1, Type type = Type::PATH)
_WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new_with_type)
static Glib::RefPtr<UnixSocketAddress> create(const std::string& path,
- UnixSocketAddressType type, int path_len = -1);
+ Type type, int path_len = -1);
// Deprecated.
_IGNORE(g_unix_socket_address_get_is_abstract)
- _WRAP_METHOD(UnixSocketAddressType get_address_type() const, g_unix_socket_address_get_address_type)
+ _WRAP_METHOD(Type get_address_type() const, g_unix_socket_address_get_address_type)
_WRAP_METHOD(std::string get_path() const, g_unix_socket_address_get_path)
_IGNORE(g_unix_socket_address_get_path_len)
_WRAP_METHOD(static bool abstract_names_supported(), g_unix_socket_address_abstract_names_supported)
- _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)
+ _IGNORE_PROPERTY("abstract")
+ _WRAP_PROPERTY("address-type", Type)
_WRAP_PROPERTY("path", std::string)
_WRAP_PROPERTY("path-as-array", Glib::RefPtr<ByteArray>)
};
void
Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- MountMountFlags flags)
+ Mount::MountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, MountMountFlags flags)
+Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, Mount::MountFlags flags)
{
g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), Glib::unwrap(mount_operation),
nullptr, // cancellable
}
void
-Volume::mount(MountMountFlags flags)
+Volume::mount(Mount::MountFlags flags)
{
g_volume_mount(gobj(), static_cast<GMountMountFlags>(flags), nullptr,
nullptr, // cancellable
void
Volume::eject(
- const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
+Volume::eject(const SlotAsyncReady& slot, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Volume::eject(MountUnmountFlags flags)
+Volume::eject(Mount::UnmountFlags flags)
{
g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags),
nullptr, // mount_operation
void
Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags)
+ const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
void
Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot,
- MountUnmountFlags flags)
+ Mount::UnmountFlags flags)
{
// Create a copy of the slot.
// A pointer to it will be passed through the callback's data parameter
}
void
-Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags)
+Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags)
{
g_volume_eject_with_operation(gobj(), static_cast<GMountUnmountFlags>(flags),
Glib::unwrap(mount_operation),
* @param cancellable A cancellable object which can be used to cancel the operation.
* @param flags Flags affecting the operation.
*/
- void mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Mounts a volume.
* This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.
* @param slot A callback which will be called when the operation is completed or canceled.
* @param flags Flags affecting the operation.
*/
- void mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Mounts a volume.
*
* @param mount_operation A mount operation.
* @param flags Flags affecting the operation.
*/
- void mount(const Glib::RefPtr<MountOperation>& mount_operation, MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount(const Glib::RefPtr<MountOperation>& mount_operation, Mount::MountFlags flags = Mount::MountFlags::NONE);
/** Mounts a volume.
*
* @param flags Flags affecting the operation.
*/
- void mount(MountMountFlags flags = MOUNT_MOUNT_NONE);
+ void mount(Mount::MountFlags flags = Mount::MountFlags::NONE);
_IGNORE(g_volume_mount)
g_volume_mount_finish,
errthrow)
- void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
- void eject(const Glib::RefPtr<MountOperation>& mount_operation, MountUnmountFlags flags = MOUNT_UNMOUNT_NONE);
+ void eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsyncReady& slot, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
+ void eject(const Glib::RefPtr<MountOperation>& mount_operation, Mount::UnmountFlags flags = Mount::UnmountFlags::NONE);
_IGNORE(g_volume_eject)
_IGNORE(g_volume_eject_with_operation)
_WRAP_METHOD(std::string get_identifier(const std::string& kind) const,
g_volume_get_identifier)
- #m4 _CONVERSION(`char**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
- _WRAP_METHOD(Glib::StringArrayHandle enumerate_identifiers() const,
+ #m4 _CONVERSION(`char**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(std::vector<Glib::ustring> enumerate_identifiers() const,
g_volume_enumerate_identifiers)
_WRAP_METHOD(Glib::RefPtr<File> get_activation_root(), g_volume_get_activation_root)
_WRAP_METHOD(static Glib::RefPtr<VolumeMonitor> get(), g_volume_monitor_get)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Drive> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Drive> > get_connected_drives(), g_volume_monitor_get_connected_drives)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Drive>>',`Glib::ListHandler<Glib::RefPtr<Drive>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Drive>> get_connected_drives(), g_volume_monitor_get_connected_drives)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Volume> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Volume> > get_volumes(), g_volume_monitor_get_volumes)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Volume>>',`Glib::ListHandler<Glib::RefPtr<Volume>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Volume>> get_volumes(), g_volume_monitor_get_volumes)
-#m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Mount> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
- _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<Mount> > get_mounts(), g_volume_monitor_get_mounts)
+#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Mount>>',`Glib::ListHandler<Glib::RefPtr<Mount>>::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+ _WRAP_METHOD(std::vector<Glib::RefPtr<Mount>> get_mounts(), g_volume_monitor_get_mounts)
_WRAP_METHOD(Glib::RefPtr<Volume> get_volume_for_uuid(const std::string& uuid), g_volume_monitor_get_volume_for_uuid, refreturn)
_WRAP_METHOD(Glib::RefPtr<Mount> get_mount_for_uuid(const std::string& uuid), g_volume_monitor_get_mount_for_uuid, refreturn)
- _WRAP_METHOD(static Glib::RefPtr<Volume> adopt_orphan_mount(const Glib::RefPtr<Mount>& mount), g_volume_monitor_adopt_orphan_mount,
- deprecated "Instead of using this function, create shadow mounts with the URI of the mount you intend to adopt.")
+ _IGNORE(g_volume_monitor_adopt_orphan_mount)
#m4 _CONVERSION(`GVolume*',`const Glib::RefPtr<Volume>&',`Glib::wrap($3, true)')
_WRAP_SIGNAL(void volume_added(const Glib::RefPtr<Volume>& volume), volume_added)
_WRAP_SIGNAL(void drive_disconnected(const Glib::RefPtr<Drive>& drive), drive_disconnected)
_WRAP_SIGNAL(void drive_changed(const Glib::RefPtr<Drive>& drive), drive_changed)
- //TODO: Remove no_default_handler when we can break ABI:
- _WRAP_SIGNAL(void drive_eject_button(const Glib::RefPtr<Drive>& drive), drive_eject_button, no_default_handler)
- _WRAP_SIGNAL(void drive_stop_button(const Glib::RefPtr<Drive>& drive), drive_stop_button, no_default_handler)
+ _WRAP_SIGNAL(void drive_eject_button(const Glib::RefPtr<Drive>& drive), drive_eject_button)
+ _WRAP_SIGNAL(void drive_stop_button(const Glib::RefPtr<Drive>& drive), drive_stop_button)
//TODO: Use ListHandle?
//_WRAP_VFUNC(GList* get_volumes(), get_volumes)
*
* If your source file is @c program.cc, you can compile it with:
* @code
- * g++ program.cc -o program `pkg-config --cflags --libs glibmm-2.4 giomm-2.4`
+ * g++ program.cc -o program `pkg-config --cflags --libs glibmm-2.60 giomm-2.60`
* @endcode
*
* Alternatively, if using autoconf, use the following in @c configure.ac:
* @code
- * PKG_CHECK_MODULES([GLIBMM], [glibmm-2.4 giomm-2.4])
+ * PKG_CHECK_MODULES([GLIBMM], [glibmm-2.60 giomm-2.60])
* @endcode
* Then use the generated @c GLIBMM_CFLAGS and @c GLIBMM_LIBS variables in the
* project Makefile.am files. For example:
//#include <glibmm/i18n.h> //This must be included by the application, after system headers such as
//<iostream>.
-// Include this first because we need it to be the first thing to include <glib.h>,
-// so we can do an undef trick to still use deprecated API in the header:
-#include <glibmm/thread.h>
-
-#include <glibmm/threads.h>
-
-#include <glibmm/arrayhandle.h>
#include <glibmm/balancedtree.h>
#include <glibmm/base64.h>
#ifndef GLIBMM_INCLUDED_FROM_WRAP_INIT_CC
#include <glibmm/exception.h>
#include <glibmm/exceptionhandler.h>
#include <glibmm/fileutils.h>
-#include <glibmm/helperlist.h>
#include <glibmm/interface.h>
#include <glibmm/iochannel.h>
#include <glibmm/init.h>
#include <glibmm/keyfile.h>
-#include <glibmm/streamiochannel.h>
-#include <glibmm/listhandle.h>
#include <glibmm/main.h>
#include <glibmm/markup.h>
#include <glibmm/miscutils.h>
#include <glibmm/shell.h>
#include <glibmm/signalproxy_connectionnode.h>
#include <glibmm/signalproxy.h>
-#include <glibmm/slisthandle.h>
#include <glibmm/spawn.h>
#include <glibmm/stringutils.h>
-#include <glibmm/threadpool.h>
#include <glibmm/timer.h>
#include <glibmm/timeval.h>
#include <glibmm/timezone.h>
#include <glibmm/uriutils.h>
#include <glibmm/ustring.h>
#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>
-#include <glibmm/weakref.h>
#include <glibmm/wrap.h>
#endif /* _GLIBMM_H */
Description: C++ wrapper for GLib
Version: @PACKAGE_VERSION@
URL: http://www.gtkmm.org/
-Requires: gobject-2.0 sigc++-2.0
+Requires: gobject-2.0 sigc++-3.0
Libs: -L${libdir} -lglibmm-@GLIBMM_API_VERSION@
Cflags: -I${includedir}/@GLIBMM_MODULE_NAME@ -I${libdir}/@GLIBMM_MODULE_NAME@/include
+++ /dev/null
-/* Copyright (C) 2011 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmm/arrayhandle.h>
-
-namespace Glib
-{
-
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::~ArrayHandle() noexcept
-{
- if (parray_ && ownership_ != Glib::OWNERSHIP_NONE)
- {
- if (ownership_ != Glib::OWNERSHIP_SHALLOW)
- {
- // Deep ownership: release each container element.
- const CType* const pend = parray_ + size_;
- for (const CType* p = parray_; p != pend; ++p)
- Tr::release_c_type(*p);
- }
- g_free(const_cast<CType*>(parray_));
- }
-}
-
-} // namespace Glib
+++ /dev/null
-#ifndef _GLIBMM_ARRAYHANDLE_H
-#define _GLIBMM_ARRAYHANDLE_H
-
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmmconfig.h>
-#include <glibmm/containerhandle_shared.h>
-
-namespace Glib
-{
-
-namespace Container_Helpers
-{
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/* Count the number of elements in a 0-terminated sequence.
- */
-template <class T>
-inline std::size_t
-compute_array_size(const T* array)
-{
- const T* pend = array;
-
- while (*pend)
- ++pend;
-
- return (pend - array);
-}
-
-/* Allocate and fill a 0-terminated array. The size argument
- * specifies the number of elements in the input sequence.
- */
-template <class For, class Tr>
-typename Tr::CType*
-create_array(For pbegin, std::size_t size, Tr)
-{
- using CType = typename Tr::CType;
-
- CType* const array = static_cast<CType*>(g_malloc((size + 1) * sizeof(CType)));
- CType* const array_end = array + size;
-
- for (CType* pdest = array; pdest != array_end; ++pdest)
- {
- // Use & to force a warning if the iterator returns a temporary object.
- *pdest = Tr::to_c_type(*&*pbegin);
- ++pbegin;
- }
-
- *array_end = CType();
- return array;
-}
-
-template <class For>
-gboolean*
-create_bool_array(For pbegin, std::size_t size)
-{
- gboolean* const array(static_cast<gboolean*>(g_malloc((size + 1) * sizeof(gboolean))));
- gboolean* const array_end(array + size);
-
- for (gboolean* pdest(array); pdest != array_end; ++pdest)
- {
- *pdest = *pbegin;
- ++pbegin;
- }
-
- *array_end = false;
- return array;
-}
-
-/* Convert from any container that supports forward
- * iterators and has a size() method.
- */
-template <class Tr, class Cont>
-struct ArraySourceTraits
-{
- using CType = typename Tr::CType;
-
- static std::size_t get_size(const Cont& cont) { return cont.size(); }
-
- static const CType* get_data(const Cont& cont, std::size_t size)
- {
- return Glib::Container_Helpers::create_array(cont.begin(), size, Tr());
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-// source traits for bools.
-template <class Cont>
-struct BoolArraySourceTraits
-{
- using CType = gboolean;
-
- static std::size_t get_size(const Cont& cont) { return cont.size(); }
-
- static const CType* get_data(const Cont& cont, std::size_t size)
- {
- return Glib::Container_Helpers::create_bool_array(cont.begin(), size);
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-/* Convert from a 0-terminated array. The Cont argument must be a pointer
- * to the first element. Note that only arrays of the C type are supported.
- */
-template <class Tr, class Cont>
-struct ArraySourceTraits<Tr, Cont*>
-{
- using CType = typename Tr::CType;
-
- static std::size_t get_size(const CType* array)
- {
- return (array) ? Glib::Container_Helpers::compute_array_size(array) : 0;
- }
-
- static const CType* get_data(const CType* array, std::size_t) { return array; }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
-};
-
-template <class Tr, class Cont>
-struct ArraySourceTraits<Tr, const Cont*> : ArraySourceTraits<Tr, Cont*>
-{
-};
-
-/* Convert from a 0-terminated array. The Cont argument must be a pointer
- * to the first element. Note that only arrays of the C type are supported.
- * For consistency, the array must be 0-terminated, even though the array
- * size is known at compile time.
- */
-template <class Tr, class Cont, std::size_t N>
-struct ArraySourceTraits<Tr, Cont[N]>
-{
- using CType = typename Tr::CType;
-
- static std::size_t get_size(const CType*) { return (N - 1); }
-
- static const CType* get_data(const CType* array, std::size_t) { return array; }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_NONE;
-};
-
-template <class Tr, class Cont, std::size_t N>
-struct ArraySourceTraits<Tr, const Cont[N]> : ArraySourceTraits<Tr, Cont[N]>
-{
-};
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-/**
- * @ingroup ContHelpers
- */
-template <class Tr>
-class ArrayHandleIterator
-{
-public:
- using CppType = typename Tr::CppType;
- using CType = typename Tr::CType;
-
- using iterator_category = std::random_access_iterator_tag;
- using value_type = CppType;
- using difference_type = std::ptrdiff_t;
- using reference = value_type;
- using pointer = void;
-
- explicit inline ArrayHandleIterator(const CType* pos);
-
- inline value_type operator*() const;
- inline value_type operator[](difference_type offset) const;
-
- inline ArrayHandleIterator<Tr>& operator++();
- inline const ArrayHandleIterator<Tr> operator++(int);
- // these are needed by msvc 2005 when using deque.
- inline ArrayHandleIterator<Tr>& operator--();
- inline const ArrayHandleIterator<Tr> operator--(int);
-
- // All this random access stuff is only there because STL algorithms
- // usually have optimized specializations for random access iterators,
- // and we don't want to give away efficiency for nothing.
- //
- inline ArrayHandleIterator<Tr>& operator+=(difference_type rhs);
- inline ArrayHandleIterator<Tr>& operator-=(difference_type rhs);
- inline const ArrayHandleIterator<Tr> operator+(difference_type rhs) const;
- inline const ArrayHandleIterator<Tr> operator-(difference_type rhs) const;
- inline difference_type operator-(const ArrayHandleIterator<Tr>& rhs) const;
-
- inline bool operator==(const ArrayHandleIterator<Tr>& rhs) const;
- inline bool operator!=(const ArrayHandleIterator<Tr>& rhs) const;
- inline bool operator<(const ArrayHandleIterator<Tr>& rhs) const;
- inline bool operator>(const ArrayHandleIterator<Tr>& rhs) const;
- inline bool operator<=(const ArrayHandleIterator<Tr>& rhs) const;
- inline bool operator>=(const ArrayHandleIterator<Tr>& rhs) const;
-
-private:
- const CType* pos_;
-};
-
-} // 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.
- *
- * However, this is not used in new API. We now prefer to just use std::vector,
- * which is less flexibile, but makes the API clearer.
- *
- * @ingroup ContHandles
- */
-template <class T, class Tr = Glib::Container_Helpers::TypeTraits<T>>
-class ArrayHandle
-{
-public:
- using CppType = typename Tr::CppType;
- using CType = typename Tr::CType;
-
- using value_type = CppType;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using const_iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
- using iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
-
- template <class Cont>
- inline ArrayHandle(const Cont& container);
-
- // Take over ownership of an array created by GTK+ functions.
- inline ArrayHandle(const CType* array, std::size_t array_size, Glib::OwnershipType ownership);
- inline ArrayHandle(const CType* array, Glib::OwnershipType ownership);
-
- // Copying clears the ownership flag of the source handle.
- inline ArrayHandle(const ArrayHandle<T, Tr>& other);
-
- ~ArrayHandle() noexcept;
-
- inline const_iterator begin() const;
- inline const_iterator end() const;
-
- template <class U>
- inline operator std::vector<U>() const;
- template <class U>
- inline operator std::deque<U>() const;
- template <class U>
- inline operator std::list<U>() const;
-
- template <class Cont>
- inline void assign_to(Cont& container) const;
-
- template <class Out>
- inline void copy(Out pdest) const;
-
- inline const CType* data() const;
- inline std::size_t size() const;
- inline bool empty() const;
-
-private:
- std::size_t size_;
- const CType* parray_;
- mutable Glib::OwnershipType ownership_;
-
- // No copy assignment.
- ArrayHandle<T, Tr>& operator=(const ArrayHandle<T, Tr>&);
-};
-
-template <>
-class ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>
-{
-public:
- using Me = ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>;
- using Tr = Container_Helpers::TypeTraits<bool>;
-
- using CppType = Tr::CppType;
- using CType = Tr::CType;
-
- using value_type = CppType;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using const_iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
- using iterator = Glib::Container_Helpers::ArrayHandleIterator<Tr>;
-
- template <class Cont>
- inline ArrayHandle(const Cont& container);
-
- // Take over ownership of an array created by GTK+ functions.
- inline ArrayHandle(const CType* array, std::size_t array_size, Glib::OwnershipType ownership);
- inline ArrayHandle(const CType* array, Glib::OwnershipType ownership);
-
- // Copying clears the ownership flag of the source handle.
- inline ArrayHandle(const Me& other);
-
- ~ArrayHandle() noexcept;
-
- inline const_iterator begin() const;
- inline const_iterator end() const;
-
- // this is inside class definition, so msvc 2005, 2008 and 2010 can compile this code.
- template <class U>
- inline operator std::vector<U>() const
- {
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::vector<U>(this->begin(), this->end());
-#else
- std::vector<U> temp;
- temp.reserve(this->size());
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
- }
-
- // this is inside class definition, so msvc 2005, 2008 and 2010 can compile this code.
- template <class U>
- inline operator std::deque<U>() const
- {
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::deque<U>(this->begin(), this->end());
-#else
- std::deque<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
- }
-
- // this is inside class definition, so msvc 2005, 2008 and 2010 can compile this code.
- template <class U>
- inline operator std::list<U>() const
- {
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::list<U>(this->begin(), this->end());
-#else
- std::list<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
- }
-
- template <class Cont>
- inline void assign_to(Cont& container) const;
-
- template <class Out>
- inline void copy(Out pdest) const;
-
- inline const CType* data() const;
- inline std::size_t size() const;
- inline bool empty() const;
-
-private:
- std::size_t size_;
- const CType* parray_;
- mutable Glib::OwnershipType ownership_;
-
- // No copy assignment.
- Me& operator=(const Me&);
-};
-
-// TODO: Remove this when we can break glibmm API.
-/** If a method takes this as an argument, or has this as a return type, then you can use a standard
- * container such as std::list<Glib::ustring> or std::vector<Glib::ustring>.
- *
- *
- * However, this is not used in new API. We now prefer to just use std::vector,
- * which is less flexibile, but makes the API clearer.
- *
- * @ingroup ContHandles
- */
-using StringArrayHandle = ArrayHandle<Glib::ustring>;
-
-/***************************************************************************/
-/* Inline implementation */
-/***************************************************************************/
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-namespace Container_Helpers
-{
-
-/**** Glib::Container_Helpers::ArrayHandleIterator<> ***********************/
-
-template <class Tr>
-inline ArrayHandleIterator<Tr>::ArrayHandleIterator(const CType* pos) : pos_(pos)
-{
-}
-
-template <class Tr>
-inline typename ArrayHandleIterator<Tr>::value_type ArrayHandleIterator<Tr>::operator*() const
-{
- return Tr::to_cpp_type(*pos_);
-}
-
-template <class Tr>
-inline typename ArrayHandleIterator<Tr>::value_type ArrayHandleIterator<Tr>::operator[](
- difference_type offset) const
-{
- return Tr::to_cpp_type(pos_[offset]);
-}
-
-template <class Tr>
-inline ArrayHandleIterator<Tr>& ArrayHandleIterator<Tr>::operator++()
-{
- ++pos_;
- return *this;
-}
-
-template <class Tr>
-inline const ArrayHandleIterator<Tr> ArrayHandleIterator<Tr>::operator++(int)
-{
- return ArrayHandleIterator<Tr>(pos_++);
-}
-
-template <class Tr>
-inline ArrayHandleIterator<Tr>& ArrayHandleIterator<Tr>::operator--()
-{
- --pos_;
- return *this;
-}
-
-template <class Tr>
-inline const ArrayHandleIterator<Tr> ArrayHandleIterator<Tr>::operator--(int)
-{
- return ArrayHandleIterator<Tr>(pos_--);
-}
-
-template <class Tr>
-inline ArrayHandleIterator<Tr>&
-ArrayHandleIterator<Tr>::operator+=(typename ArrayHandleIterator<Tr>::difference_type rhs)
-{
- pos_ += rhs;
- return *this;
-}
-
-template <class Tr>
-inline ArrayHandleIterator<Tr>&
-ArrayHandleIterator<Tr>::operator-=(typename ArrayHandleIterator<Tr>::difference_type rhs)
-{
- pos_ -= rhs;
- return *this;
-}
-
-template <class Tr>
-inline const ArrayHandleIterator<Tr>
-ArrayHandleIterator<Tr>::operator+(typename ArrayHandleIterator<Tr>::difference_type rhs) const
-{
- return ArrayHandleIterator<Tr>(pos_ + rhs);
-}
-
-template <class Tr>
-inline const ArrayHandleIterator<Tr>
-ArrayHandleIterator<Tr>::operator-(typename ArrayHandleIterator<Tr>::difference_type rhs) const
-{
- return ArrayHandleIterator<Tr>(pos_ - rhs);
-}
-
-template <class Tr>
-inline typename ArrayHandleIterator<Tr>::difference_type
-ArrayHandleIterator<Tr>::operator-(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ - rhs.pos_);
-}
-
-template <class Tr>
-inline bool
-ArrayHandleIterator<Tr>::operator==(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ == rhs.pos_);
-}
-
-template <class Tr>
-inline bool
-ArrayHandleIterator<Tr>::operator!=(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ != rhs.pos_);
-}
-
-template <class Tr>
-inline bool
-ArrayHandleIterator<Tr>::operator<(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ < rhs.pos_);
-}
-
-template <class Tr>
-inline bool
-ArrayHandleIterator<Tr>::operator>(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ > rhs.pos_);
-}
-
-template <class Tr>
-inline bool
-ArrayHandleIterator<Tr>::operator<=(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ <= rhs.pos_);
-}
-
-template <class Tr>
-inline bool
-ArrayHandleIterator<Tr>::operator>=(const ArrayHandleIterator<Tr>& rhs) const
-{
- return (pos_ >= rhs.pos_);
-}
-
-} // namespace Container_Helpers
-
-/**** Glib::ArrayHandle<> **************************************************/
-
-template <class T, class Tr>
-template <class Cont>
-inline ArrayHandle<T, Tr>::ArrayHandle(const Cont& container)
-: size_(Glib::Container_Helpers::ArraySourceTraits<Tr, Cont>::get_size(container)),
- parray_(Glib::Container_Helpers::ArraySourceTraits<Tr, Cont>::get_data(container, size_)),
- ownership_(Glib::Container_Helpers::ArraySourceTraits<Tr, Cont>::initial_ownership)
-{
-}
-
-template <class T, class Tr>
-inline ArrayHandle<T, Tr>::ArrayHandle(const typename ArrayHandle<T, Tr>::CType* array,
- std::size_t array_size, Glib::OwnershipType ownership)
-: size_((array) ? array_size : 0), parray_(array), ownership_(ownership)
-{
-}
-
-template <class T, class Tr>
-inline ArrayHandle<T, Tr>::ArrayHandle(
- const typename ArrayHandle<T, Tr>::CType* array, Glib::OwnershipType ownership)
-: size_((array) ? Glib::Container_Helpers::compute_array_size(array) : 0),
- parray_(array),
- ownership_(ownership)
-{
-}
-
-template <class T, class Tr>
-inline ArrayHandle<T, Tr>::ArrayHandle(const ArrayHandle<T, Tr>& other)
-: size_(other.size_), parray_(other.parray_), ownership_(other.ownership_)
-{
- other.ownership_ = Glib::OWNERSHIP_NONE;
-}
-
-template <class T, class Tr>
-ArrayHandle<T, Tr>::~ArrayHandle() noexcept
-{
- if (parray_ && ownership_ != Glib::OWNERSHIP_NONE)
- {
- if (ownership_ != Glib::OWNERSHIP_SHALLOW)
- {
- // Deep ownership: release each container element.
- const CType* const pend = parray_ + size_;
- for (const CType* p = parray_; p != pend; ++p)
- Tr::release_c_type(*p);
- }
- g_free(const_cast<CType*>(parray_));
- }
-}
-
-template <class T, class Tr>
-inline typename ArrayHandle<T, Tr>::const_iterator
-ArrayHandle<T, Tr>::begin() const
-{
- return Glib::Container_Helpers::ArrayHandleIterator<Tr>(parray_);
-}
-
-template <class T, class Tr>
-inline typename ArrayHandle<T, Tr>::const_iterator
-ArrayHandle<T, Tr>::end() const
-{
- return Glib::Container_Helpers::ArrayHandleIterator<Tr>(parray_ + size_);
-}
-
-template <class T, class Tr>
-template <class U>
-inline ArrayHandle<T, Tr>::operator std::vector<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::vector<U>(this->begin(), this->end());
-#else
- std::vector<U> temp;
- temp.reserve(this->size());
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class U>
-inline ArrayHandle<T, Tr>::operator std::deque<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::deque<U>(this->begin(), this->end());
-#else
- std::deque<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class U>
-inline ArrayHandle<T, Tr>::operator std::list<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::list<U>(this->begin(), this->end());
-#else
- std::list<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class Cont>
-inline void
-ArrayHandle<T, Tr>::assign_to(Cont& container) const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- container.assign(this->begin(), this->end());
-#else
- Cont temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- container.swap(temp);
-#endif
-}
-
-template <class T, class Tr>
-template <class Out>
-inline void
-ArrayHandle<T, Tr>::copy(Out pdest) const
-{
- std::copy(this->begin(), this->end(), pdest);
-}
-
-template <class T, class Tr>
-inline const typename ArrayHandle<T, Tr>::CType*
-ArrayHandle<T, Tr>::data() const
-{
- return parray_;
-}
-
-template <class T, class Tr>
-inline std::size_t
-ArrayHandle<T, Tr>::size() const
-{
- return size_;
-}
-
-template <class T, class Tr>
-inline bool
-ArrayHandle<T, Tr>::empty() const
-{
- return (size_ == 0);
-}
-
-/**** Glib::ArrayHandle<bool> **********************************************/
-
-template <class Cont>
-inline ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::ArrayHandle(const Cont& container)
-: size_(Glib::Container_Helpers::BoolArraySourceTraits<Cont>::get_size(container)),
- parray_(Glib::Container_Helpers::BoolArraySourceTraits<Cont>::get_data(container, size_)),
- ownership_(Glib::Container_Helpers::BoolArraySourceTraits<Cont>::initial_ownership)
-{
-}
-
-inline ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::ArrayHandle(
- const gboolean* array, std::size_t array_size, Glib::OwnershipType ownership)
-: size_((array) ? array_size : 0), parray_(array), ownership_(ownership)
-{
-}
-
-inline ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::ArrayHandle(
- const gboolean* array, Glib::OwnershipType ownership)
-: size_((array) ? Glib::Container_Helpers::compute_array_size(array) : 0),
- parray_(array),
- ownership_(ownership)
-{
-}
-
-inline ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::ArrayHandle(
- const ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>& other)
-: size_(other.size_), parray_(other.parray_), ownership_(other.ownership_)
-{
- other.ownership_ = Glib::OWNERSHIP_NONE;
-}
-
-inline ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::const_iterator
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::begin() const
-{
- return Glib::Container_Helpers::ArrayHandleIterator<Tr>(parray_);
-}
-
-inline ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::const_iterator
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::end() const
-{
- return Glib::Container_Helpers::ArrayHandleIterator<Tr>(parray_ + size_);
-}
-
-template <class Cont>
-inline void
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::assign_to(Cont& container) const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- container.assign(this->begin(), this->end());
-#else
- Cont temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- container.swap(temp);
-#endif
-}
-
-template <class Out>
-inline void
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::copy(Out pdest) const
-{
- std::copy(this->begin(), this->end(), pdest);
-}
-
-inline const gboolean*
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::data() const
-{
- return parray_;
-}
-
-inline std::size_t
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::size() const
-{
- return size_;
-}
-
-inline bool
-ArrayHandle<bool, Container_Helpers::TypeTraits<bool>>::empty() const
-{
- return (size_ == 0);
-}
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-} // namespace Glib
-
-#endif /* _GLIBMM_ARRAYHANDLE_H */
}
GType
-Class::clone_custom_type(const char* custom_type_name) const
-{
- return clone_custom_type(custom_type_name, interface_class_vector_type());
-}
-
-GType
Class::clone_custom_type(
- const char* custom_type_name, const interface_class_vector_type& interface_classes) const
+ const char* custom_type_name, const interface_classes_type* interface_classes,
+ const class_init_funcs_type* class_init_funcs, GInstanceInitFunc instance_init_func) const
{
std::string full_name("gtkmm__CustomObject_");
Glib::append_canonical_typename(full_name, custom_type_name);
// GTypeQuery::instance_size is guint but GTypeInfo::instance_size is guint16.
const guint16 instance_size = (guint16)base_query.instance_size;
+ // Let the wrapper's class_init_function() be the first one to call.
+ auto all_class_init_funcs = new class_init_funcs_type(
+ 1, std::tuple<GClassInitFunc, void*>(class_init_func_, nullptr));
+ if (class_init_funcs)
+ all_class_init_funcs->insert(all_class_init_funcs->end(),
+ class_init_funcs->begin(), class_init_funcs->end());
+
const GTypeInfo derived_info = {
class_size,
nullptr, // base_init
&Class::custom_class_base_finalize_function, // base_finalize
&Class::custom_class_init_function,
nullptr, // class_finalize
- this, // class_data
+ all_class_init_funcs, // class_data
instance_size,
0, // n_preallocs
- nullptr, // instance_init
+ instance_init_func, // instance_init
nullptr, // value_table
};
+ // custom_class_init_function() is called when the first object of the custom
+ // class is created, which is after clone_custom_type() has returned.
+ // Let custom_class_init_function() delete all_class_init_funcs.
+
custom_type =
g_type_register_static(base_type, full_name.c_str(), &derived_info, GTypeFlags(0));
// Add derived versions of interfaces, if the C type implements any interfaces.
// For instance, TreeModel_Class::add_interface().
- for (interface_class_vector_type::size_type i = 0; i < interface_classes.size(); i++)
+ if (interface_classes)
{
- const Interface_Class* interface_class = interface_classes[i];
- if (interface_class)
+ for (auto interface_class : *interface_classes)
{
- interface_class->add_interface(custom_type);
+ if (interface_class)
+ {
+ interface_class->add_interface(custom_type);
+ }
}
}
}
void
Class::custom_class_init_function(void* g_class, void* class_data)
{
- // The class_data pointer is set to 'this' by clone_custom_type().
- const Class* const self = static_cast<Class*>(class_data);
+ // clone_custom_type() sets the class data pointer to a pointer to a vector
+ // of pointers to functions to be called.
+ const class_init_funcs_type& class_init_funcs =
+ *static_cast<class_init_funcs_type*>(class_data);
- g_return_if_fail(self->class_init_func_ != nullptr);
+ g_return_if_fail(!class_init_funcs.empty() && std::get<GClassInitFunc>(class_init_funcs[0]) != nullptr);
// Call the wrapper's class_init_function() to redirect
// the vfunc and default signal handler callbacks.
- (*self->class_init_func_)(g_class, nullptr);
+ auto init_func = std::get<GClassInitFunc>(class_init_funcs[0]);
+ (*init_func)(g_class, nullptr);
GObjectClass* const gobject_class = static_cast<GObjectClass*>(g_class);
gobject_class->get_property = &Glib::custom_get_property_callback;
gobject_class->set_property = &Glib::custom_set_property_callback;
+ // Call extra class init functions, if any.
+ for (std::size_t i = 1; i < class_init_funcs.size(); ++i)
+ {
+ if (auto extra_init_func = std::get<GClassInitFunc>(class_init_funcs[i]))
+ {
+ auto extra_class_data = std::get<void*>(class_init_funcs[i]);
+ (*extra_init_func)(g_class, extra_class_data);
+ }
+ }
+
+ // Assume that this function is called exactly once for each type.
+ // Delete the class_init_funcs_type that was created in clone_custom_type().
+ delete static_cast<class_init_funcs_type*>(class_data);
+
// Override the properties of implemented interfaces, if any.
const GType object_type = G_TYPE_FROM_CLASS(g_class);
-// -*- c++ -*-
#ifndef _GLIBMM_CLASS_H
#define _GLIBMM_CLASS_H
-/* $Id$ */
-
/* Copyright 2001 Free Software Foundation
* Copyright (C) 1998-2002 The gtkmm Development Team
*
#include <glibmmconfig.h> //Include this here so that the /private/*.h classes have access to GLIBMM_VFUNCS_ENABLED
#include <vector> //For interface properties that custom types might override.
+#include <tuple>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
inline GType get_type() const;
- // TODO: Remove this method at the next ABI/API break.
- /** Register a static custom GType, derived from the parent of this class's type.
- * The parent type of the registered custom type is the same C class as the parent
- * of the get_type() type. If a type with the specified name is already registered,
- * nothing is done. register_derived_type() must have been called.
- * @param custom_type_name The name of the registered type is
- * "gtkmm__CustomObject_" + canonic(custom_type_name), where canonic()
- * replaces special characters with '+'.
- * @return The registered type.
- */
- GType clone_custom_type(const char* custom_type_name) const;
-
/// The type that holds pointers to the interfaces of custom types.
- using interface_class_vector_type = std::vector<const Interface_Class*>;
+ using interface_classes_type = std::vector<const Interface_Class*>;
+ /** The type that holds pointers to extra class init functions of custom types.
+ * The std::tuple contains a function pointer and a pointer to class data.
+ * The class data pointer can be nullptr, if the function does not need it.
+ */
+ using class_init_funcs_type = std::vector<std::tuple<GClassInitFunc, void*>>;
/** Register a static custom GType, derived from the parent of this class's type.
* The parent type of the registered custom type is the same C class as the parent
* @param custom_type_name The name of the registered type is
* "gtkmm__CustomObject_" + canonic(custom_type_name), where canonic()
* replaces special characters with '+'.
- * @param interface_classes Interfaces that the custom type implements.
+ * @param interface_classes Interfaces that the custom type implements (can be nullptr).
+ * @param class_init_funcs Extra class init functions (can be nullptr). These
+ * functions, if any, are called after the class init function of this
+ * class's type, e.g. Gtk::Widget.
+ * @param instance_init_func Instance init function (can be nullptr).
* @return The registered type.
*/
GType clone_custom_type(
- const char* custom_type_name, const interface_class_vector_type& interface_classes) const;
+ const char* custom_type_name, const interface_classes_type* interface_classes,
+ const class_init_funcs_type* class_init_funcs, GInstanceInitFunc instance_init_func) const;
protected:
GType gtype_;
OWNERSHIP_DEEP /*!< Release the list, and its elements, when the container is deleted. */
};
-/** Utility class holding an iterator sequence.
- * @ingroup ContHandles
- * This can be used to initialize a Glib container handle (such as
- * Glib::ArrayHandle) with an iterator sequence. Use the helper
- * function Glib::sequence() to create a Sequence<> object.
- */
-template <class Iterator>
-class Sequence
-{
-private:
- Iterator pbegin_;
- Iterator pend_;
-
-public:
- Sequence(Iterator pbegin, Iterator pend) : pbegin_(pbegin), pend_(pend) {}
-
- Iterator begin() const { return pbegin_; }
- Iterator end() const { return pend_; }
- std::size_t size() const { return std::distance(pbegin_, pend_); }
-};
-
-/** Helper function to create a Glib::Sequence<> object, which
- * in turn can be used to initialize a container handle.
- * @ingroup ContHandles
- *
- * @par Usage example:
- * @code
- * combo.set_popdown_strings(Glib::sequence(foo_begin, foo_end));
- * @endcode
- */
-template <class Iterator>
-inline Sequence<Iterator>
-sequence(Iterator pbegin, Iterator pend)
-{
- return Sequence<Iterator>(pbegin, pend);
-}
-
namespace Container_Helpers
{
// be next to the objects that they use.
#ifdef GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
-/** Partial specialization for pointers to GtkObject instances.
+/** Partial specialization for pointers to GObject instances.
+ * The C++ type is not a Glib::RefPtr<>. It can be a gtkmm widget.
* @ingroup ContHelpers
*/
template <class T>
// This confuse the SUN Forte compiler, so we ifdef it out:
#ifdef GLIBMM_HAVE_DISAMBIGUOUS_CONST_TEMPLATE_SPECIALIZATIONS
-/** Partial specialization for pointers to const GtkObject instances.
+/** Partial specialization for pointers to const GObject instances.
+ * The C++ type is not a Glib::RefPtr<>. It can be a gtkmm widget.
* @ingroup ContHelpers
*/
template <class T>
// because that would be "dependent", and g++ 3.4 does not allow that.
// The specific Glib::wrap() overloads don't do anything special anyway.
GObject* cobj = (GObject*)(ptr);
- return Glib::RefPtr<T>(dynamic_cast<T*>(Glib::wrap_auto(cobj, true /* take_copy */)));
+ return Glib::make_refptr_for_instance<T>(dynamic_cast<T*>(Glib::wrap_auto(cobj, true /* take_copy */)));
// We use dynamic_cast<> in case of multiple inheritance.
}
// because that would be "dependent", and g++ 3.4 does not allow that.
// The specific Glib::wrap() overloads don't do anything special anyway.
GObject* cobj = (GObject*)const_cast<CTypeNonConst>(ptr);
- return Glib::RefPtr<const T>(
+ return Glib::make_refptr_for_instance<const T>(
dynamic_cast<const T*>(Glib::wrap_auto(cobj, true /* take_copy */)));
// We use dynamic_cast<> in case of multiple inheritance.
}
+++ /dev/null
-#ifndef _GLIBMM_CONTAINERS_H
-#define _GLIBMM_CONTAINERS_H
-
-/* containers.h
- *
- * Copyright (C) 1998-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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmmconfig.h>
-#include <glibmm/sarray.h> /* for backward compatibility */
-#include <glibmm/wrap.h>
-#include <glib.h>
-#include <iterator>
-#include <cstddef>
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-namespace Glib
-{
-
-template <class T>
-class List_Iterator;
-template <class T>
-class List_ConstIterator;
-template <class T>
-class List_ReverseIterator;
-
-// Most of these methods in the non-template classes needs to be moved
-// to implementation.
-
-// Daniel Elstner has ideas about generating these per-widget with m4. murrayc.
-
-extern GLIBMM_API gpointer glibmm_null_pointer;
-
-template <class T>
-class List_Iterator_Base
-{
-public:
- using value_type = T;
- using pointer = T*;
- using reference = T&;
-};
-
-/// For instance, List_Iterator< Gtk::Widget >
-template <class T>
-class List_Iterator : public List_Iterator_Base<T>
-{
-public:
- using iterator_category = std::bidirectional_iterator_tag;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using pointer = typename List_Iterator_Base<T>::pointer;
- using reference = typename List_Iterator_Base<T>::reference;
-
- GList* const* head_;
- GList* node_;
-
- using Self = List_Iterator<T>;
-
- List_Iterator(GList* const& head, GList* node) : head_(&head), node_(node) {}
-
- List_Iterator() : head_(nullptr), node_(nullptr) {}
-
- List_Iterator(const Self& src) : head_(src.head_), node_(src.node_) {}
-
- bool operator==(const Self& src) const { return node_ == src.node_; }
- bool operator!=(const Self& src) const { return node_ != src.node_; }
-
- Self& operator++()
- {
- if (!node_)
- node_ = g_list_first(*head_);
- else
- node_ = (GList*)g_list_next(node_);
- return *this;
- }
-
- Self operator++(int)
- {
- Self tmp = *this;
- ++*this;
- return tmp;
- }
-
- Self& operator--()
- {
- if (!node_)
- node_ = g_list_last(*head_);
- else
- node_ = (GList*)g_list_previous(node_);
-
- return *this;
- }
-
- Self operator--(int)
- {
- Self tmp = *this;
- --*this;
- return tmp;
- }
-
- reference operator*() const { return *(pointer)(node_ ? node_->data : glibmm_null_pointer); }
-
- pointer operator->() const { return &**this; }
-};
-
-/// For instance, SList_Iterator< Gtk::Widget >
-template <class T>
-class SList_Iterator : public List_Iterator_Base<T>
-{
-public:
- using iterator_category = std::forward_iterator_tag;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using pointer = typename List_Iterator_Base<T>::pointer;
- using reference = typename List_Iterator_Base<T>::reference;
-
- GSList* node_;
- using Self = SList_Iterator<T>;
-
- SList_Iterator(GSList* node) : node_(node) {}
-
- SList_Iterator() : node_(nullptr) {}
-
- SList_Iterator(const Self& src) : node_(src.node_) {}
-
- bool operator==(const Self& src) const { return node_ == src.node_; }
- bool operator!=(const Self& src) const { return node_ != src.node_; }
-
- Self& operator++()
- {
- node_ = g_slist_next(node_);
- return *this;
- }
-
- Self operator++(int)
- {
- Self tmp = *this;
- ++*this;
- return tmp;
- }
-
- reference operator*() const
- {
- return reinterpret_cast<T&>(node_ ? node_->data : glibmm_null_pointer);
- }
-
- pointer operator->() const { return &**this; }
-};
-
-// This iterator variation returns T_IFace (wrapped from T_Impl)
-// For instance, List_Cpp_Iterator<GtkWidget, Gtk::Widget> is
-// a little like std::list<Gtk::Widget>::iterator
-template <class T_Impl, class T_IFace>
-class List_Cpp_Iterator : public List_Iterator_Base<T_IFace>
-{
-public:
- using iterator_category = std::bidirectional_iterator_tag;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using pointer = typename List_Iterator_Base<T_IFace>::pointer;
- using reference = typename List_Iterator_Base<T_IFace>::reference;
-
- using Self = List_Cpp_Iterator<T_Impl, T_IFace>;
-
- GList** head_;
- GList* node_;
-
- bool operator==(const Self& src) const { return node_ == src.node_; }
- bool operator!=(const Self& src) const { return node_ != src.node_; }
-
- List_Cpp_Iterator(GList*& head, GList* node) : head_(&head), node_(node) {}
-
- List_Cpp_Iterator() : head_(nullptr), node_(nullptr) {}
-
- List_Cpp_Iterator(const Self& src) : head_(src.head_), node_(src.node_) {}
-
- reference operator*() const
- {
- if (node_ && node_->data)
- {
- // We copy/paste the widget wrap() implementation here,
- // because we can not use a specific Glib::wrap(T_Impl) overload here,
- // because that would be "dependent", and g++ 3.4 does not allow that.
- // The specific Glib::wrap() overloads don't do anything special anyway.
- GObject* cobj = static_cast<GObject*>(node_->data);
-
-#ifdef GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
- return *dynamic_cast<pointer>(Glib::wrap_auto(cobj, false));
-#else
- // We really do need to use dynamic_cast<>, so I expect problems if this code is used.
- // murrayc.
- return *static_cast<pointer>(Glib::wrap_auto(cobj, false));
-#endif
- }
- return *static_cast<pointer>(nullptr); // boom!
- }
-
- pointer operator->() const { return &**this; }
-
- Self& operator++()
- {
- if (!node_)
- node_ = g_list_first(*head_);
- else
- node_ = (GList*)g_list_next(node_);
-
- return *this;
- }
-
- Self operator++(int)
- {
- Self tmp = *this;
- ++*this;
- return tmp;
- }
-
- Self& operator--()
- {
- if (!node_)
- node_ = g_list_last(*head_);
- else
- node_ = (GList*)g_list_previous(node_);
-
- return *this;
- }
-
- Self operator--(int)
- {
- Self tmp = *this;
- --*this;
- return tmp;
- }
-};
-
-template <class T_Base>
-class List_ReverseIterator : private T_Base
-{
-public:
- using iterator_category = typename T_Base::iterator_category;
- using size_type = typename T_Base::size_type;
- using difference_type = typename T_Base::difference_type;
-
- using value_type = typename T_Base::value_type;
- using pointer = typename T_Base::pointer;
- using reference = typename T_Base::reference;
-
- using Self = List_ReverseIterator<T_Base>;
-
- bool operator==(const Self& src) const { return T_Base::operator==(src); }
- bool operator!=(const Self& src) const { return T_Base::operator!=(src); }
-
- List_ReverseIterator(GList* const& head, GList* node) : T_Base(head, node) {}
-
- List_ReverseIterator() : T_Base() {}
-
- List_ReverseIterator(const Self& src) : T_Base(src) {}
-
- List_ReverseIterator(const T_Base& src) : T_Base(src) { ++(*this); }
-
- Self& operator++()
- {
- T_Base::operator--();
- return *this;
- }
- Self& operator--()
- {
- T_Base::operator++();
- return *this;
- }
- Self operator++(int)
- {
- Self src = *this;
- T_Base::operator--();
- return src;
- }
- Self operator--(int)
- {
- Self src = *this;
- T_Base::operator++();
- return src;
- }
-
- reference operator*() const { return T_Base::operator*(); }
- pointer operator->() const { return T_Base::operator->(); }
-};
-
-template <class T_Base>
-class List_ConstIterator : public T_Base
-{
-public:
- using iterator_category = typename T_Base::iterator_category;
- using size_type = typename T_Base::size_type;
- using difference_type = typename T_Base::difference_type;
-
- using value_type = const typename T_Base::value_type;
- using pointer = const typename T_Base::pointer;
- using reference = const typename T_Base::reference;
-
- using Self = List_ConstIterator<T_Base>;
-
- bool operator==(const Self& src) const { return T_Base::operator==(src); }
- bool operator!=(const Self& src) const { return T_Base::operator!=(src); }
-
- List_ConstIterator(GList* const& head, GList* node) : T_Base(head, node) {}
-
- List_ConstIterator() : T_Base() {}
-
- List_ConstIterator(const Self& src) : T_Base(src) {}
-
- List_ConstIterator(const T_Base& src) : T_Base(src) {}
-
- Self& operator++()
- {
- T_Base::operator++();
- return *this;
- }
- Self& operator--()
- {
- T_Base::operator--();
- return *this;
- }
- Self operator++(int)
- {
- Self src = *this;
- T_Base::operator++();
- return src;
- }
- Self operator--(int)
- {
- Self src = *this;
- T_Base::operator--();
- return src;
- }
-
- reference operator*() const { return T_Base::operator*(); }
- pointer operator->() const { return T_Base::operator->(); }
-};
-
-} // namespace Glib
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-#endif /* _GLIBMM_CONTAINERS_H */
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef GLIBMM_CAN_USE_THREAD_LOCAL
-#include <glibmm/threads.h>
-#endif
-
#include <glibmm/dispatcher.h>
#include <glibmm/exceptionhandler.h>
#include <glibmm/fileutils.h>
#include <cerrno>
#include <fcntl.h>
#include <glib.h>
-#include <set>
+#include <forward_list>
+#include <memory>
#include <utility> // For std::move()
#ifdef G_OS_WIN32
#define EINTR 0 /* TODO: should use the real define */
#endif
+namespace Glib
+{
+class DispatchNotifier;
+}
+
namespace
{
struct DispatchNotifyData
{
- Glib::Dispatcher* dispatcher;
+ Glib::Dispatcher::Impl* dispatcher_impl;
Glib::DispatchNotifier* notifier;
- DispatchNotifyData() : dispatcher(nullptr), notifier(nullptr) {}
+ DispatchNotifyData()
+ : dispatcher_impl(nullptr), notifier(nullptr)
+ {}
- DispatchNotifyData(Glib::Dispatcher* d, Glib::DispatchNotifier* n) : dispatcher(d), notifier(n) {}
+ DispatchNotifyData(Glib::Dispatcher::Impl* d, Glib::DispatchNotifier* n)
+ : dispatcher_impl(d), notifier(n)
+ {}
};
static void
}
#endif /* !G_OS_WIN32 */
+void warn_dropped_dispatcher_message()
+{
+ g_warning("Dropped dispatcher message as the dispatcher no longer exists.");
+}
+
} // anonymous namespace
namespace Glib
{
+// The most important reason for having the dispatcher implementation in a separate
+// class is that its deletion can be delayed until it's safe to delete it.
+// Deletion is safe when the pipe does not contain any message to the dispatcher
+// to delete. When the pipe is empty, it's surely safe.
+struct Dispatcher::Impl
+{
+public:
+ sigc::signal<void()> signal_;
+ DispatchNotifier* notifier_;
+
+ explicit Impl(const Glib::RefPtr<MainContext>& context);
+
+ // noncopyable
+ Impl(const Impl&) = delete;
+ Impl& operator=(const Impl&) = delete;
+};
+
class DispatchNotifier : public sigc::trackable
{
public:
DispatchNotifier(const DispatchNotifier&) = delete;
DispatchNotifier& operator=(const DispatchNotifier&) = delete;
- static DispatchNotifier* reference_instance(
- const Glib::RefPtr<MainContext>& context, const Dispatcher* dispatcher);
- static void unreference_instance(DispatchNotifier* notifier, const Dispatcher* dispatcher);
+ static DispatchNotifier* reference_instance(const Glib::RefPtr<MainContext>& context);
+ static void unreference_instance(DispatchNotifier* notifier, Dispatcher::Impl* dispatcher_impl);
- void send_notification(Dispatcher* dispatcher);
+ void send_notification(Dispatcher::Impl* dispatcher_impl);
protected:
// Only used by reference_instance(). Should be private, but that triggers
explicit DispatchNotifier(const Glib::RefPtr<MainContext>& context);
private:
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
static thread_local DispatchNotifier* thread_specific_instance_;
-#else
- static Glib::Threads::Private<DispatchNotifier> thread_specific_instance_;
-#endif
-
- std::set<const Dispatcher*> deleted_dispatchers_;
+ using UniqueImplPtr = std::unique_ptr<Dispatcher::Impl>;
+ std::forward_list<UniqueImplPtr> orphaned_dispatcher_impl_;
long ref_count_;
Glib::RefPtr<MainContext> context_;
#ifdef G_OS_WIN32
/**** Glib::DispatchNotifier ***********************************************/
-// static
-
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
thread_local DispatchNotifier* DispatchNotifier::thread_specific_instance_ = nullptr;
-#else
-Glib::Threads::Private<DispatchNotifier> DispatchNotifier::thread_specific_instance_;
-#endif
DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
-: deleted_dispatchers_(),
+: orphaned_dispatcher_impl_(),
ref_count_(0),
context_(context),
#ifdef G_OS_WIN32
// The following code is equivalent to
// context_->signal_io().connect(
- // sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler), fd, Glib::IO_IN);
+ // sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler), fd, Glib::IOCondition::IO_IN);
// except for source->set_can_recurse(true).
- const auto source = IOSource::create(fd, Glib::IO_IN);
+ const auto source = IOSource::create(fd, Glib::IOCondition::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
}
// static
-DispatchNotifier*
-DispatchNotifier::reference_instance(
- const Glib::RefPtr<MainContext>& context, const Dispatcher* dispatcher)
+DispatchNotifier* DispatchNotifier::reference_instance(
+ const Glib::RefPtr<MainContext>& context)
{
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
DispatchNotifier* instance = thread_specific_instance_;
-#else
- DispatchNotifier* instance = thread_specific_instance_.get();
-#endif
if (!instance)
{
instance = new DispatchNotifier(context);
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
thread_specific_instance_ = instance;
-#else
- thread_specific_instance_.replace(instance);
-#endif
}
else
{
// Prevent massive mess-up.
g_return_val_if_fail(instance->context_ == context, nullptr);
-
- // In the possible but unlikely case that a new dispatcher gets the same
- // address as a newly deleted one, if the pipe still contains messages to
- // the deleted dispatcher, those messages will be delivered to the new one.
- // Not ideal, but perhaps the best that can be done without breaking ABI.
- // The alternative would be to remove the following erase(), and risk not
- // delivering messages sent to the new dispatcher.
- // TODO: When we can break ABI, a better solution without this drawback can
- // be implemented. See https://bugzilla.gnome.org/show_bug.cgi?id=651942
- // especially comment 16.
- instance->deleted_dispatchers_.erase(dispatcher);
}
++instance->ref_count_; // initially 0
}
// static
-void
-DispatchNotifier::unreference_instance(DispatchNotifier* notifier, const Dispatcher* dispatcher)
+void DispatchNotifier::unreference_instance(
+ DispatchNotifier* notifier, Dispatcher::Impl* dispatcher_impl)
{
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
DispatchNotifier* const instance = thread_specific_instance_;
-#else
- DispatchNotifier* const instance = thread_specific_instance_.get();
-#endif
// Yes, the notifier argument is only used to check for sanity.
g_return_if_fail(instance == notifier);
if (instance->pipe_is_empty())
- // No messages in the pipe. No need to keep track of deleted dispatchers.
- instance->deleted_dispatchers_.clear();
+ {
+ // No messages in the pipe. Delete the Dispatcher::Impl immediately.
+ delete dispatcher_impl;
+ instance->orphaned_dispatcher_impl_.clear();
+ }
else
- // There are messages in the pipe, possibly to the deleted dispatcher.
- // Keep its address, so pipe_io_handler() can avoid delivering messages to it.
- instance->deleted_dispatchers_.insert(dispatcher);
+ {
+ // There are messages in the pipe, possibly to the orphaned Dispatcher::Impl.
+ // Keep it around until it can safely be deleted.
+ // Delete all slots connected to the Dispatcher. Then the signal emission
+ // in pipe_io_handler() will do nothing.
+ dispatcher_impl->signal_.clear();
+ // Add a slot that will warn that a message has been dropped.
+ dispatcher_impl->signal_.connect(sigc::ptr_fun(warn_dropped_dispatcher_message));
+ instance->orphaned_dispatcher_impl_.push_front(UniqueImplPtr(dispatcher_impl));
+ }
if (--instance->ref_count_ <= 0)
{
g_return_if_fail(instance->ref_count_ == 0); // could be < 0 if messed up
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
delete thread_specific_instance_;
thread_specific_instance_ = nullptr;
-#else
- thread_specific_instance_.replace(nullptr);
-#endif
}
}
-void
-DispatchNotifier::send_notification(Dispatcher* dispatcher)
+void DispatchNotifier::send_notification(Dispatcher::Impl* dispatcher_impl)
{
#ifdef G_OS_WIN32
{
const std::lock_guard<std::mutex> lock(mutex_);
const bool was_empty = notify_queue_.empty();
- notify_queue_.emplace_back(DispatchNotifyData(dispatcher, this));
+ notify_queue_.emplace_back(DispatchNotifyData(dispatcher_impl, this));
if (was_empty)
{
}
#else /* !G_OS_WIN32 */
- DispatchNotifyData data(dispatcher, this);
+ DispatchNotifyData data(dispatcher_impl, this);
gssize n_written;
do
#ifdef G_OS_WIN32
return notify_queue_.empty();
#else
- PollFD poll_fd(fd_receiver_, Glib::IO_IN);
+ PollFD poll_fd(fd_receiver_, Glib::IOCondition::IO_IN);
// GPollFD*, number of file descriptors to poll, timeout (ms)
g_poll(poll_fd.gobj(), 1, 0);
- return (poll_fd.get_revents() & Glib::IO_IN) == 0;
+ return static_cast<int>(poll_fd.get_revents() & Glib::IOCondition::IO_IN) == 0;
#endif
}
g_return_val_if_fail(data.notifier == this, true);
- // Drop the received message, if it is addressed to a deleted dispatcher.
- const bool drop_message =
- (deleted_dispatchers_.find(data.dispatcher) != deleted_dispatchers_.end());
-
- // If the pipe is empty, there can be no messages to deleted dispatchers.
- // No reason to keep track of them any more.
- if (!deleted_dispatchers_.empty() && pipe_is_empty())
- deleted_dispatchers_.clear();
-
- if (drop_message)
- {
- g_warning("Dropped dispatcher message as the dispatcher no longer exists");
- return true;
- }
-
// Actually, we wouldn't need the try/catch block because the Glib::Source
// C callback already does it for us. However, we do it anyway because the
// default return value is 'false', which is not what we want.
try
{
- data.dispatcher->signal_(); // emit
+ data.dispatcher_impl->signal_(); // emit
}
catch (...)
{
Glib::exception_handlers_invoke();
}
+ if (!orphaned_dispatcher_impl_.empty() && pipe_is_empty())
+ orphaned_dispatcher_impl_.clear();
+
return true;
}
-/**** Glib::Dispatcher *****************************************************/
+/**** Glib::Dispatcher and Glib::Dispatcher::Impl **************************/
-Dispatcher::Dispatcher()
-: signal_(), notifier_(DispatchNotifier::reference_instance(MainContext::get_default(), this))
+Dispatcher::Impl::Impl(const Glib::RefPtr<MainContext>& context)
+: signal_(),
+ notifier_(DispatchNotifier::reference_instance(context))
{
}
+Dispatcher::Dispatcher()
+: impl_(new Dispatcher::Impl(MainContext::get_default()))
+{}
+
+
Dispatcher::Dispatcher(const Glib::RefPtr<MainContext>& context)
-: signal_(), notifier_(DispatchNotifier::reference_instance(context, this))
+: impl_(new Dispatcher::Impl(context))
{
}
Dispatcher::~Dispatcher() noexcept
{
- DispatchNotifier::unreference_instance(notifier_, this);
+ DispatchNotifier::unreference_instance(impl_->notifier_, impl_);
}
void
Dispatcher::emit()
{
- notifier_->send_notification(this);
+ impl_->notifier_->send_notification(impl_);
}
void
Dispatcher::operator()()
{
- notifier_->send_notification(this);
+ impl_->notifier_->send_notification(impl_);
}
sigc::connection
-Dispatcher::connect(const sigc::slot<void>& slot)
+Dispatcher::connect(const sigc::slot<void()>& slot)
{
- return signal_.connect(slot);
+ return impl_->signal_.connect(slot);
}
sigc::connection
-Dispatcher::connect(sigc::slot<void>&& slot)
+Dispatcher::connect(sigc::slot<void()>&& slot)
{
- return signal_.connect(std::move(slot));
+ return impl_->signal_.connect(std::move(slot));
}
} // namespace Glib
namespace Glib
{
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-class DispatchNotifier;
-#endif
-
/** Signal class for inter-thread communication.
* @ingroup Threads
- * Glib::Dispatcher works similar to sigc::signal<void>. But unlike normal
+ * Glib::Dispatcher works similar to sigc::signal<void()>. But unlike normal
* signals, the notification happens asynchronously through a pipe. This is
* a simple and efficient way of communicating between threads, and especially
* useful in a thread model with a single GUI thread.
void emit();
void operator()();
- sigc::connection connect(const sigc::slot<void>& slot);
+ sigc::connection connect(const sigc::slot<void()>& slot);
/** @newin{2,48}
*/
- sigc::connection connect(sigc::slot<void>&& slot);
+ sigc::connection connect(sigc::slot<void()>&& slot);
-private:
- sigc::signal<void> signal_;
- DispatchNotifier* notifier_;
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
+ struct Impl;
+ #endif
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- friend class Glib::DispatchNotifier;
-#endif
+private:
+ Impl* impl_; // hidden implementation
};
/*! A Glib::Dispatcher example.
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef GLIBMM_CAN_USE_THREAD_LOCAL
-#include <glibmm/threads.h>
-#endif
#include <glibmmconfig.h>
#include <glibmm/error.h>
#include <glibmm/exceptionhandler.h>
// Each thread has its own list of exception handlers
// to avoid thread synchronization problems.
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
static thread_local HandlerList* thread_specific_handler_list = nullptr;
-#else
-static Glib::Threads::Private<HandlerList> thread_specific_handler_list;
-#endif
static void
glibmm_exception_warning(const GError* error)
{
sigc::connection
-add_exception_handler(const sigc::slot<void>& slot)
+add_exception_handler(const sigc::slot<void()>& slot)
{
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
HandlerList* handler_list = thread_specific_handler_list;
-#else
- HandlerList* handler_list = thread_specific_handler_list.get();
-#endif
if (!handler_list)
{
handler_list = new HandlerList();
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
thread_specific_handler_list = handler_list;
-#else
- thread_specific_handler_list.set(handler_list);
-#endif
}
handler_list->emplace_back(slot);
// handled. If there are no more handlers in the list and the exception
// is still unhandled, call glibmm_unexpected_exception().
-#ifdef GLIBMM_CAN_USE_THREAD_LOCAL
if (HandlerList* const handler_list = thread_specific_handler_list)
-#else
- if(HandlerList *const handler_list = thread_specific_handler_list.get())
-#endif
{
HandlerList::iterator pslot = handler_list->begin();
/** Specify a slot to be called when an exception is thrown by a signal handler.
*/
-sigc::connection add_exception_handler(const sigc::slot<void>& slot);
+sigc::connection add_exception_handler(const sigc::slot<void()>& slot);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// internal
-/* containers.h
- *
- * Copyright (C) 1998-2002 The gtkmm Development Team
+/* Copyright (C) 2017 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
* 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 <http://www.gnu.org/licenses/>.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/containers.h>
+#include <glibmm/extraclassinit.h>
namespace Glib
{
-gpointer glibmm_null_pointer = nullptr;
+ExtraClassInit::ExtraClassInit(GClassInitFunc class_init_func, void* class_data,
+ GInstanceInitFunc instance_init_func)
+{
+ if (class_init_func)
+ add_custom_class_init_function(class_init_func, class_data);
+
+ if (instance_init_func)
+ set_custom_instance_init_function(instance_init_func);
+}
} // namespace Glib
--- /dev/null
+#ifndef _GLIBMM_EXTRACLASSINIT_H
+#define _GLIBMM_EXTRACLASSINIT_H
+/* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/objectbase.h>
+
+namespace Glib
+{
+
+/** A convenience class for named custom types.
+ *
+ * Use it if you need to add code to GType's class init function and/or
+ * need an instance init function.
+ * Example:
+ * @code
+ * #include <glibmm/extraclassinit.h>
+ *
+ * class MyExtraInit : public Glib::ExtraClassInit
+ * {
+ * public:
+ * MyExtraInit(const Glib::ustring& css_name)
+ * :
+ * Glib::ExtraClassInit(my_extra_class_init_function, &m_css_name, my_instance_init_function),
+ * m_css_name(css_name)
+ * { }
+ *
+ * private:
+ * static void my_extra_class_init_function(void* g_class, void* class_data)
+ * {
+ * const auto klass = static_cast<GtkWidgetClass*>(g_class);
+ * const auto css_name = static_cast<Glib::ustring*>(class_data);
+ * gtk_widget_class_set_css_name(klass, css_name->c_str());
+ * }
+ * static void my_instance_init_function(GTypeInstance* instance, void* g_class)
+ * {
+ * gtk_widget_set_has_surface(GTK_WIDGET(instance), true);
+ * }
+ *
+ * Glib::ustring m_css_name;
+ * };
+ *
+ * class MyWidget : public MyExtraInit, public Gtk::Widget
+ * {
+ * public:
+ * MyWidget()
+ * :
+ * // The GType name will be gtkmm__CustomObject_MyMidget
+ * Glib::ObjectBase("MyWidget"), // Unique class name
+ * MyExtraInit("my-widget"),
+ * Gtk::Widget()
+ * {
+ * // ...
+ * }
+ * // ...
+ * };
+ * @endcode
+ *
+ * @note Classes derived from %ExtraClassInit (MyExtraInit in the example)
+ * must be listed before Glib::Object or a class derived from
+ * %Glib::Object (Gtk::Widget in the example) in the list of base classes.
+ *
+ * @newin{2,58}
+ */
+class ExtraClassInit : virtual public ObjectBase
+{
+protected:
+ /** Constructor.
+ *
+ * @param class_init_func Pointer to an extra class init function.
+ * nullptr, if no extra class init function is needed.
+ * @param class_data Class data pointer, passed to the class init function.
+ * Can be nullptr, if the class init function does not need it.
+ * @param instance_init_func Pointer to an instance init function.
+ * nullptr, if no instance init function is needed.
+ */
+ explicit ExtraClassInit(GClassInitFunc class_init_func, void* class_data = nullptr,
+ GInstanceInitFunc instance_init_func = nullptr);
+};
+
+} // namespace Glib
+
+#endif /* _GLIBMM_EXTRACLASSINIT_H */
glibmm_files_built_h = $(glibmm_files_used_hg:.hg=.h) $(glibmm_files_h_m4:.m4=)
glibmm_files_extra_cc = \
- arrayhandle.cc \
base64.cc \
class.cc \
- containers.cc \
debug.cc \
dispatcher.cc \
error.cc \
exception.cc \
exceptionhandler.cc \
+ extraclassinit.cc \
init.cc \
interface.cc \
main.cc \
propertyproxy_base.cc \
quark.cc \
random.cc \
- sarray.cc \
signalproxy.cc \
signalproxy_connectionnode.cc \
- streamiochannel.cc \
stringutils.cc \
- threadpool.cc \
timer.cc \
timeval.cc \
ustring.cc \
wrap.cc
glibmm_files_extra_h = \
- arrayhandle.h \
base64.h \
class.h \
containerhandle_shared.h \
- containers.h \
debug.h \
dispatcher.h \
error.h \
exception.h \
exceptionhandler.h \
- helperlist.h \
+ extraclassinit.h \
i18n-lib.h \
i18n.h \
init.h \
interface.h \
- listhandle.h \
main.h \
object.h \
objectbase.h \
quark.h \
random.h \
refptr.h \
- sarray.h \
signalproxy.h \
signalproxy_connectionnode.h \
- slisthandle.h \
- streamiochannel.h \
stringutils.h \
- threadpool.h \
timer.h \
timeval.h \
ustring.h \
value_custom.h \
variantdbusstring.h \
vectorutils.h \
- weakref.h \
wrap.h \
wrap_init.h
include $(top_srcdir)/glib/glibmm/filelist.am
-# Split out from $(top_srcdir)/glib/glimm/filelist.am
glibmm_files_built_ph = $(patsubst %.hg,private/%_p.h,$(glibmm_files_used_hg))
+++ /dev/null
-#ifndef _GLIBMM_HELPERLIST_H
-#define _GLIBMM_HELPERLIST_H
-
-/* helperlist.h
- *
- * Copyright 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, see <http://www.gnu.org/licenses/>.
- */
-
-// 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 <glibmm/containers.h>
-
-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
-{
-public:
- HelperList() : gparent_(nullptr) {}
-
- HelperList(GObject*
- gp) // We use gp instead of gparent because that can cause warnings about a shadowed member.
- : gparent_(gp)
- {
- }
-
- virtual ~HelperList() noexcept {}
-
- using value_type = T_Child;
- using reference = value_type&;
- using const_reference = const value_type&;
-
- using iterator = T_Iterator;
- using const_iterator = List_ConstIterator<iterator>;
- using reverse_iterator = List_ReverseIterator<iterator>;
- using const_reverse_iterator = List_ConstIterator<reverse_iterator>;
-
- using element_type = T_CppElement;
-
- using difference_type = std::size_t; // TODO Why not std::ptrdiff_t?
- using size_type = std::size_t;
-
- // These are implemented differently for each Helper List.
- virtual iterator erase(iterator) = 0;
-
- virtual void erase(iterator start, iterator stop)
- {
- while (start != stop)
- start = erase(start); // Implemented in derived class.
- }
-
- virtual void remove(const_reference) = 0;
-
- size_type size() const { return g_list_length(glist()); }
-
- inline size_type max_size() { return size_type(-1); }
- inline bool empty() { return glist() == nullptr; }
-
- inline iterator begin() { return begin_(); }
- inline iterator end() { return end_(); }
-
- inline const_iterator begin() const { return const_iterator(begin_()); }
- inline const_iterator end() const { return const_iterator(end_()); }
-
- inline reverse_iterator rbegin() { return reverse_iterator(end_()); }
- inline reverse_iterator rend() { return reverse_iterator(begin_()); }
-
- inline const_reverse_iterator rbegin() const
- {
- return const_reverse_iterator(reverse_iterator(end_()));
- }
- inline const_reverse_iterator rend() const
- {
- return const_reverse_iterator(reverse_iterator(begin_()));
- }
-
- reference front() const { return *begin(); }
-
- reference back() const { return *(--end()); }
-
- reference operator[](size_type l) const
- {
- size_type j = 0;
- iterator i;
- for (i = begin(), j = 0; i != end() && j < l; ++i, ++j)
- ;
- return (*i);
- }
-
- // iterator find(const_reference w)
- // {
- // iterator i = begin();
- // for(i = begin(); i != end() && (*i != w); i++);
- // return i;
- // }
- //
- // iterator find(Widget& w)
- // {
- // iterator i;
- // for (i = begin(); i != end() && ((*i)->$1() != &w); i++);
- // return i;
- // }
-
- // Derived classes might choose to reimplement these as public:
- inline void pop_front() { erase(begin()); }
- inline void pop_back() { erase(--end()); }
-
- void clear() { erase(begin(), end()); }
-
- GObject* gparent() { return gparent_; };
- const GObject* gparent() const { return gparent_; };
-
-protected:
- virtual GList*& glist() const = 0; // front of list
-
- iterator begin_() const { return iterator(glist(), glist()); }
-
- iterator end_() const { return iterator(glist(), (GList*)nullptr); }
-
- GObject* gparent_;
-};
-
-} /* namespace Glib */
-
-//#endif //GLIBMM_DISABLE_DEPRECATED
-
-#endif /* _GLIBMM_HELPERLIST_H */
#include <glibmm/init.h>
#include <glibmm/error.h>
+#include <locale>
+#include <clocale>
+#include <stdexcept>
+
+namespace
+{
+ bool init_to_users_preferred_locale = true;
+
+} // anonymous namespace
namespace Glib
{
+void set_init_to_users_preferred_locale(bool state)
+{
+ init_to_users_preferred_locale = state;
+}
+
+bool get_init_to_users_preferred_locale()
+{
+ return init_to_users_preferred_locale;
+}
-void
-init()
+void init()
{
+ static bool is_initialized = false;
+
+ if (is_initialized)
+ return;
+
+ if (init_to_users_preferred_locale)
+ {
+ try
+ {
+ // Set the global locale for C++ functions and the locale for C functions
+ // to the user-preferred locale.
+ std::locale::global(std::locale(""));
+ }
+ catch (const std::runtime_error& ex)
+ {
+ g_warning("Can't set the global locale to the user's preferred locale.\n"
+ " %s\n The environment variable LANG may be wrong.\n", ex.what());
+ }
+ }
+ else
+ {
+ try
+ {
+ // Make the C++ locale equal to the C locale.
+ std::locale::global(std::locale(std::setlocale(LC_ALL, nullptr)));
+ }
+ catch (const std::runtime_error& ex)
+ {
+ g_warning("Can't make the global C++ locale equal to the C locale.\n"
+ " %s\n C locale = %s\n", ex.what(), std::setlocale(LC_ALL, nullptr));
+ }
+ }
+
// Also calls Glib::wrap_register_init() and Glib::wrap_init().
Glib::Error::register_init();
+
+ is_initialized = true;
}
} // namespace Glib
-// -*- c++ -*-
#ifndef _GLIBMM_INIT_H
#define _GLIBMM_INIT_H
-/* $Id$ */
-
/* Copyright (C) 2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
{
/** Initialize glibmm.
- * You may call this more than once.
- * You do not need to call this if you are using Glib::MainLoop or Gtk::Main,
- * because they call it for you.
+ *
+ * You may call this more than once. Calls after the first one have no effect.
+ * Sets the global locale as specified by set_init_to_users_preferred_locale().
+ * You do not need to call %Glib::init() if you are using Gtk::Application,
+ * because it calls %Glib::init() for you.
+ *
+ * @see set_init_to_users_preferred_locale()
*/
void init();
+/** Instruct Glib::init() which global locale to set.
+ *
+ * To have the intended effect, this function must be called before init() is called.
+ * Not calling it has the same effect as calling it with @a state = <tt>true</tt>.
+ *
+ * Note the confusing difference between C locale and "C" locale.
+ * The C locale is the locale used by C code, set by std::setlocale(LC_ALL, locale_name).
+ * The "C" locale is the classic locale, set by std::setlocale(LC_ALL, "C")
+ * or std::locale::global(std::locale::classic()). It's the default global locale
+ * in a C or C++ program.
+ *
+ * In a mixed C and C++ program, like a program using glibmm, having the C global
+ * locale differ from std::locale::global() is error prone. Glib::init() tries
+ * to avoid that.
+ *
+ * @param state If <tt>true</tt>, init() will set the C and C++ global locale
+ * to the user's preferred locale (std::locale::global(std::locale(""))).
+ * The user's preferred locale is set in the program's environment,
+ * usually with the LANG environment variable.<br>
+ * If <tt>false</tt>, init() will set the C++ global locale to the C global locale
+ * (std::locale::global(std::locale(std::setlocale(LC_ALL, nullptr)))).
+ *
+ * @newin{2,58}
+ */
+void set_init_to_users_preferred_locale(bool state = true);
+
+/** Get the state, set with set_init_to_users_preferred_locale().
+ * @returns The state, set with set_init_to_users_preferred_locale(); <tt>true</tt>
+ * if set_init_to_users_preferred_locale() has not been called.
+ *
+ * @newin{2,58}
+ */
+bool get_init_to_users_preferred_locale();
+
} // namespace Glib
#endif /* _GLIBMM_INIT_H */
}
else // gobject_ == nullptr
{
- // The GObject is not instantiated yet. Add to the custom_interface_classes
- // and add the interface in the Glib::Object constructor.
- std::lock_guard<std::mutex> lock(extra_object_base_data_mutex);
- extra_object_base_data[this].custom_interface_classes.emplace_back(&interface_class);
+ // The GObject is not instantiated yet. Add to the stored custom interface
+ // classes, and add the interface to the GType in the Glib::Object constructor.
+ add_custom_interface_class(&interface_class);
}
}
}
RefPtr<ObjectBase>
wrap_interface(GObject* object, bool take_copy)
{
- return Glib::RefPtr<ObjectBase>(wrap_auto(object, take_copy));
+ return Glib::make_refptr_for_instance<ObjectBase>(wrap_auto(object, take_copy));
}
} // namespace Glib
+++ /dev/null
-#ifndef _GLIBMM_LISTHANDLE_H
-#define _GLIBMM_LISTHANDLE_H
-
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmmconfig.h>
-#include <glibmm/containerhandle_shared.h>
-#include <glib.h>
-
-namespace Glib
-{
-
-namespace Container_Helpers
-{
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/* Create and fill a GList as efficient as possible.
- * This requires bidirectional iterators.
- */
-template <class Bi, class Tr>
-GList*
-create_list(Bi pbegin, Bi pend, Tr)
-{
- GList* head = nullptr;
-
- while (pend != pbegin)
- {
- // Use & to force a warning if the iterator returns a temporary object.
- const void* const item = Tr::to_c_type(*&*--pend);
- head = g_list_prepend(head, const_cast<void*>(item));
- }
-
- return head;
-}
-
-/* Create a GList from a 0-terminated input sequence.
- * Build it in reverse order and reverse the whole list afterwards,
- * because appending to the list would be horribly inefficient.
- */
-template <class For, class Tr>
-GList*
-create_list(For pbegin, Tr)
-{
- GList* head = nullptr;
-
- while (*pbegin)
- {
- // Use & to force a warning if the iterator returns a temporary object.
- const void* const item = Tr::to_c_type(*&*pbegin);
- head = g_list_prepend(head, const_cast<void*>(item));
- ++pbegin;
- }
-
- return g_list_reverse(head);
-}
-
-/* Convert from any container that supports bidirectional iterators.
- */
-template <class Tr, class Cont>
-struct ListSourceTraits
-{
- static GList* get_data(const Cont& cont)
- {
- return Glib::Container_Helpers::create_list(cont.begin(), cont.end(), Tr());
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-/* Convert from a 0-terminated array. The Cont
- * argument must be a pointer to the first element.
- */
-template <class Tr, class Cont>
-struct ListSourceTraits<Tr, Cont*>
-{
- static GList* get_data(const Cont* array)
- {
- return (array) ? Glib::Container_Helpers::create_list(array, Tr()) : nullptr;
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-template <class Tr, class Cont>
-struct ListSourceTraits<Tr, const Cont*> : ListSourceTraits<Tr, Cont*>
-{
-};
-
-/* Convert from a 0-terminated array. The Cont argument must be a pointer
- * to the first element. For consistency, the array must be 0-terminated,
- * even though the array size is known at compile time.
- */
-template <class Tr, class Cont, std::size_t N>
-struct ListSourceTraits<Tr, Cont[N]>
-{
- static GList* get_data(const Cont* array)
- {
- return Glib::Container_Helpers::create_list(array, array + (N - 1), Tr());
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-template <class Tr, class Cont, std::size_t N>
-struct ListSourceTraits<Tr, const Cont[N]> : ListSourceTraits<Tr, Cont[N]>
-{
-};
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-/**
- * @ingroup ContHelpers
- */
-template <class Tr>
-class ListHandleIterator
-{
-public:
- using CppType = typename Tr::CppType;
- using CType = typename Tr::CType;
-
- using iterator_category = std::forward_iterator_tag;
- using value_type = CppType;
- using difference_type = std::ptrdiff_t;
- using reference = value_type;
- using pointer = void;
-
- explicit inline ListHandleIterator(const GList* node);
-
- inline value_type operator*() const;
- inline ListHandleIterator<Tr>& operator++();
- inline const ListHandleIterator<Tr> operator++(int);
-
- inline bool operator==(const ListHandleIterator<Tr>& rhs) const;
- inline bool operator!=(const ListHandleIterator<Tr>& rhs) const;
-
-private:
- const GList* node_;
-};
-
-} // namespace Container_Helpers
-
-// TODO: Remove this when we can break glibmm API.
-/** 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.
- *
- * However, this is not used in new API. We now prefer to just use std::vector,
- * which is less flexibile, but makes the API clearer.
- *
- * @ingroup ContHandles
- */
-template <class T, class Tr = Glib::Container_Helpers::TypeTraits<T>>
-class ListHandle
-{
-public:
- using CppType = typename Tr::CppType;
- using CType = typename Tr::CType;
-
- using value_type = CppType;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using const_iterator = Glib::Container_Helpers::ListHandleIterator<Tr>;
- using iterator = Glib::Container_Helpers::ListHandleIterator<Tr>;
-
- template <class Cont>
- inline ListHandle(const Cont& container);
-
- // Take over ownership of an array created by GTK+ functions.
- inline ListHandle(GList* glist, Glib::OwnershipType ownership);
-
- // Copying clears the ownership flag of the source handle.
- inline ListHandle(const ListHandle<T, Tr>& other);
-
- ~ListHandle() noexcept;
-
- inline const_iterator begin() const;
- inline const_iterator end() const;
-
- template <class U>
- inline operator std::vector<U>() const;
- template <class U>
- inline operator std::deque<U>() const;
- template <class U>
- inline operator std::list<U>() const;
-
- template <class Cont>
- inline void assign_to(Cont& container) const;
-
- template <class Out>
- inline void copy(Out pdest) const;
-
- inline GList* data() const;
- inline std::size_t size() const;
- inline bool empty() const;
-
-private:
- GList* plist_;
- mutable Glib::OwnershipType ownership_;
-
- // No copy assignment.
- ListHandle<T, Tr>& operator=(const ListHandle<T, Tr>&);
-};
-
-/***************************************************************************/
-/* Inline implementation */
-/***************************************************************************/
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-namespace Container_Helpers
-{
-
-/**** Glib::Container_Helpers::ListHandleIterator<> ************************/
-
-template <class Tr>
-inline ListHandleIterator<Tr>::ListHandleIterator(const GList* node) : node_(node)
-{
-}
-
-template <class Tr>
-inline typename ListHandleIterator<Tr>::value_type ListHandleIterator<Tr>::operator*() const
-{
- return Tr::to_cpp_type(static_cast<typename Tr::CTypeNonConst>(node_->data));
-}
-
-template <class Tr>
-inline ListHandleIterator<Tr>& ListHandleIterator<Tr>::operator++()
-{
- node_ = node_->next;
- return *this;
-}
-
-template <class Tr>
-inline const ListHandleIterator<Tr> ListHandleIterator<Tr>::operator++(int)
-{
- const ListHandleIterator<Tr> tmp(*this);
- node_ = node_->next;
- return tmp;
-}
-
-template <class Tr>
-inline bool
-ListHandleIterator<Tr>::operator==(const ListHandleIterator<Tr>& rhs) const
-{
- return (node_ == rhs.node_);
-}
-
-template <class Tr>
-inline bool
-ListHandleIterator<Tr>::operator!=(const ListHandleIterator<Tr>& rhs) const
-{
- return (node_ != rhs.node_);
-}
-
-} // namespace Container_Helpers
-
-/**** Glib::ListHandle<> ***************************************************/
-
-template <class T, class Tr>
-template <class Cont>
-inline ListHandle<T, Tr>::ListHandle(const Cont& container)
-: plist_(Glib::Container_Helpers::ListSourceTraits<Tr, Cont>::get_data(container)),
- ownership_(Glib::Container_Helpers::ListSourceTraits<Tr, Cont>::initial_ownership)
-{
-}
-
-template <class T, class Tr>
-inline ListHandle<T, Tr>::ListHandle(GList* glist, Glib::OwnershipType ownership)
-: plist_(glist), ownership_(ownership)
-{
-}
-
-template <class T, class Tr>
-inline ListHandle<T, Tr>::ListHandle(const ListHandle<T, Tr>& other)
-: plist_(other.plist_), ownership_(other.ownership_)
-{
- other.ownership_ = Glib::OWNERSHIP_NONE;
-}
-
-template <class T, class Tr>
-ListHandle<T, Tr>::~ListHandle() noexcept
-{
- if (ownership_ != Glib::OWNERSHIP_NONE)
- {
- if (ownership_ != Glib::OWNERSHIP_SHALLOW)
- {
- // Deep ownership: release each container element.
- for (GList* node = plist_; node != nullptr; node = node->next)
- Tr::release_c_type(static_cast<typename Tr::CTypeNonConst>(node->data));
- }
- g_list_free(plist_);
- }
-}
-
-template <class T, class Tr>
-inline typename ListHandle<T, Tr>::const_iterator
-ListHandle<T, Tr>::begin() const
-{
- return Glib::Container_Helpers::ListHandleIterator<Tr>(plist_);
-}
-
-template <class T, class Tr>
-inline typename ListHandle<T, Tr>::const_iterator
-ListHandle<T, Tr>::end() const
-{
- return Glib::Container_Helpers::ListHandleIterator<Tr>(nullptr);
-}
-
-template <class T, class Tr>
-template <class U>
-inline ListHandle<T, Tr>::operator std::vector<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::vector<U>(this->begin(), this->end());
-#else
- std::vector<U> temp;
- temp.reserve(this->size());
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class U>
-inline ListHandle<T, Tr>::operator std::deque<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::deque<U>(this->begin(), this->end());
-#else
- std::deque<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class U>
-inline ListHandle<T, Tr>::operator std::list<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::list<U>(this->begin(), this->end());
-#else
- std::list<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class Cont>
-inline void
-ListHandle<T, Tr>::assign_to(Cont& container) const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- container.assign(this->begin(), this->end());
-#else
- Cont temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- container.swap(temp);
-#endif
-}
-
-template <class T, class Tr>
-template <class Out>
-inline void
-ListHandle<T, Tr>::copy(Out pdest) const
-{
- std::copy(this->begin(), this->end(), pdest);
-}
-
-template <class T, class Tr>
-inline GList*
-ListHandle<T, Tr>::data() const
-{
- return plist_;
-}
-
-template <class T, class Tr>
-inline std::size_t
-ListHandle<T, Tr>::size() const
-{
- return g_list_length(plist_);
-}
-
-template <class T, class Tr>
-inline bool
-ListHandle<T, Tr>::empty() const
-{
- return (plist_ == nullptr);
-}
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-} // namespace Glib
-
-#endif /* _GLIBMM_LISTHANDLE_H */
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmmconfig.h> // May define GLIBMM_DISABLE_DEPRECATED
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
-// Include glibmm/thread.h first because we need it to be first to include <glib.h>,
-// so we can do an undef trick to still use deprecated API in the header:
-#include <glibmm/thread.h>
-#include <glibmm/threads.h>
-#endif // GLIBMM_DISABLE_DEPRECATED
-
#include <glibmm/main.h>
#include <glibmm/exceptionhandler.h>
#include <glibmm/wrap.h>
#include <glibmm/iochannel.h>
#include <glibmm/utility.h>
#include <algorithm>
-#include <map> // Needed until the next ABI break.
namespace
{
-void
-time64_to_time_val(gint64 time64, Glib::TimeVal& time_val)
-{
- // This function is not guaranteed to convert correctly if time64 is negative.
- const long seconds = static_cast<long>(time64 / G_GINT64_CONSTANT(1000000));
- const long microseconds =
- static_cast<long>(time64 - static_cast<gint64>(seconds) * G_GINT64_CONSTANT(1000000));
- time_val = Glib::TimeVal(seconds, microseconds);
-}
-
-// TODO: At the next ABI break, replace ExtraSourceData by new data members in Source.
-// Then the mutex is not necessary, but to keep the code thread-safe, use the
-// g_atomic_*() functions on these data elements.
-// These are new data members that can't be added to Glib::Source now,
-// because it would break ABI.
-struct ExtraSourceData
-{
- ExtraSourceData() : ref_count(1), keep_wrapper(2) {}
- int ref_count;
- // When both Source::unreference() and SourceCallbackData::destroy_notify_callback()
- // have decreased keep_wrapper, it's time to delete the C++ wrapper.
- int keep_wrapper;
-};
-
-std::map<const Glib::Source*, ExtraSourceData> extra_source_data;
-// Source instances may be used in different threads.
-// Accesses to extra_source_data must be thread-safe.
-std::mutex extra_source_data_mutex;
+// Convert an interval from milliseconds to microseconds,
+// suitable for adding to Source::get_time().
+inline gint64 ms2us(unsigned int ms)
+{
+ return static_cast<gint64>(ms) * 1000;
+}
-class SourceConnectionNode
+class SourceConnectionNode : public sigc::notifiable
{
public:
explicit inline SourceConnectionNode(const sigc::slot_base& slot);
- static void* notify(void* data);
- static void destroy_notify_callback(void* data);
+ static void notify(sigc::notifiable* data);
+ static void destroy_notify_callback(sigc::notifiable* data);
inline void install(GSource* source);
inline sigc::slot_base* get_slot();
slot_.set_parent(this, &SourceConnectionNode::notify);
}
-void*
-SourceConnectionNode::notify(void* data)
+void
+SourceConnectionNode::notify(sigc::notifiable* data)
{
SourceConnectionNode* const self = static_cast<SourceConnectionNode*>(data);
// Destroying the object triggers execution of destroy_notify_handler(),
// either immediately or later, so we leave that to do the deletion.
}
-
- return nullptr;
}
// static
void
-SourceConnectionNode::destroy_notify_callback(void* data)
+SourceConnectionNode::destroy_notify_callback(sigc::notifiable* data)
{
SourceConnectionNode* const self = static_cast<SourceConnectionNode*>(data);
if (self->node)
SourceConnectionNode::destroy_notify_callback(self->node);
- if (self->wrapper)
- {
- std::unique_lock<std::mutex> lock(extra_source_data_mutex);
- if (--extra_source_data[self->wrapper].keep_wrapper == 0)
- {
- // No other reference exists to the wrapper. Delete it!
- extra_source_data.erase(self->wrapper);
- lock.unlock();
- Glib::Source::destroy_notify_callback(self->wrapper);
- }
- }
+ // destroy_notify_callback2() does nothing if self->wrapper == nullptr.
+ Glib::Source::destroy_notify_callback2(self->wrapper);
delete self;
}
try
{
// Recreate the specific slot from the generic slot node.
- return (*static_cast<sigc::slot<bool>*>(conn_data->get_slot()))();
+ return (*static_cast<sigc::slot<bool()>*>(conn_data->get_slot()))();
}
catch (...)
{
try
{
// Recreate the specific slot from the generic slot node.
- (*static_cast<sigc::slot<void>*>(conn_data->get_slot()))();
+ (*static_cast<sigc::slot<void()>*>(conn_data->get_slot()))();
}
catch (...)
{
return 0; // Destroy the event source after one call
}
+static void
+glibmm_source_destroy_notify_callback(void* data)
+{
+ SourceConnectionNode* const conn_data = static_cast<SourceConnectionNode*>(data);
+ SourceConnectionNode::destroy_notify_callback(conn_data);
+}
+
static gboolean
glibmm_iosource_callback(GIOChannel*, GIOCondition condition, void* data)
{
try
{
// Recreate the specific slot from the generic slot node.
- return (*static_cast<sigc::slot<bool, Glib::IOCondition>*>(callback_data->node->get_slot()))(
+ return (*static_cast<sigc::slot<bool(Glib::IOCondition)>*>(callback_data->node->get_slot()))(
(Glib::IOCondition)condition);
}
catch (...)
try
{
// Recreate the specific slot from the generic slot node.
- (*static_cast<sigc::slot<void, GPid, int>*>(conn_data->get_slot()))(pid, child_status);
+ (*static_cast<sigc::slot<void(GPid, int)>*>(conn_data->get_slot()))(pid, child_status);
}
catch (...)
{
static void
glibmm_signal_connect_once(
- const sigc::slot<void>& slot, int priority, GSource* source, GMainContext* context)
+ const sigc::slot<void()>& slot, int priority, GSource* source, GMainContext* context)
{
SourceConnectionNode* const conn_node = new SourceConnectionNode(slot);
g_source_set_priority(source, priority);
g_source_set_callback(source, &glibmm_source_callback_once, conn_node,
- &SourceConnectionNode::destroy_notify_callback);
+ &glibmm_source_destroy_notify_callback);
conn_node->install(source);
g_source_attach(source, context);
try
{
// Recreate the specific slot from the generic slot node.
- return (*static_cast<sigc::slot<bool>*>(slot))();
+ return (*static_cast<sigc::slot<bool()>*>(slot))();
}
catch (...)
{
PollFD::PollFD(PollFD::fd_t fd, IOCondition events)
{
gobject_.fd = fd;
- gobject_.events = events;
+ gobject_.events = static_cast<decltype(gobject_.events)>(events);
gobject_.revents = 0;
}
/* Note that this is our equivalent of g_timeout_add(). */
sigc::connection
-SignalTimeout::connect(const sigc::slot<bool>& slot, unsigned int interval, int priority)
+SignalTimeout::connect(const sigc::slot<bool()>& slot, unsigned int interval, int priority)
{
SourceConnectionNode* const conn_node = new SourceConnectionNode(slot);
const sigc::connection connection(*conn_node->get_slot());
g_source_set_priority(source, priority);
g_source_set_callback(
- source, &glibmm_source_callback, conn_node, &SourceConnectionNode::destroy_notify_callback);
+ source, &glibmm_source_callback, conn_node,
+ &glibmm_source_destroy_notify_callback);
conn_node->install(source);
g_source_attach(source, context_);
}
void
-SignalTimeout::connect_once(const sigc::slot<void>& slot, unsigned int interval, int priority)
+SignalTimeout::connect_once(const sigc::slot<void()>& slot, unsigned int interval, int priority)
{
GSource* const source = g_timeout_source_new(interval);
glibmm_signal_connect_once(slot, priority, source, context_);
/* Note that this is our equivalent of g_timeout_add_seconds(). */
sigc::connection
-SignalTimeout::connect_seconds(const sigc::slot<bool>& slot, unsigned int interval, int priority)
+SignalTimeout::connect_seconds(const sigc::slot<bool()>& slot, unsigned int interval, int priority)
{
SourceConnectionNode* const conn_node = new SourceConnectionNode(slot);
const sigc::connection connection(*conn_node->get_slot());
g_source_set_priority(source, priority);
g_source_set_callback(
- source, &glibmm_source_callback, conn_node, &SourceConnectionNode::destroy_notify_callback);
+ source, &glibmm_source_callback, conn_node,
+ &glibmm_source_destroy_notify_callback);
conn_node->install(source);
g_source_attach(source, context_);
void
SignalTimeout::connect_seconds_once(
- const sigc::slot<void>& slot, unsigned int interval, int priority)
+ const sigc::slot<void()>& slot, unsigned int interval, int priority)
{
GSource* const source = g_timeout_source_new_seconds(interval);
glibmm_signal_connect_once(slot, priority, source, context_);
}
sigc::connection
-SignalIdle::connect(const sigc::slot<bool>& slot, int priority)
+SignalIdle::connect(const sigc::slot<bool()>& slot, int priority)
{
SourceConnectionNode* const conn_node = new SourceConnectionNode(slot);
const sigc::connection connection(*conn_node->get_slot());
g_source_set_priority(source, priority);
g_source_set_callback(
- source, &glibmm_source_callback, conn_node, &SourceConnectionNode::destroy_notify_callback);
+ source, &glibmm_source_callback, conn_node,
+ &glibmm_source_destroy_notify_callback);
conn_node->install(source);
g_source_attach(source, context_);
}
void
-SignalIdle::connect_once(const sigc::slot<void>& slot, int priority)
+SignalIdle::connect_once(const sigc::slot<void()>& slot, int priority)
{
GSource* const source = g_idle_source_new();
glibmm_signal_connect_once(slot, priority, source, context_);
sigc::connection
SignalIO::connect(
- const sigc::slot<bool, IOCondition>& slot, PollFD::fd_t fd, IOCondition condition, int priority)
+ const sigc::slot<bool(IOCondition)>& slot, PollFD::fd_t fd, IOCondition condition, int priority)
{
const auto source = IOSource::create(fd, condition);
}
sigc::connection
-SignalIO::connect(const sigc::slot<bool, IOCondition>& slot, const Glib::RefPtr<IOChannel>& channel,
+SignalIO::connect(const sigc::slot<bool(IOCondition)>& slot, const Glib::RefPtr<IOChannel>& channel,
IOCondition condition, int priority)
{
const auto source = IOSource::create(channel, condition);
}
sigc::connection
-SignalChildWatch::connect(const sigc::slot<void, GPid, int>& slot, GPid pid, int priority)
+SignalChildWatch::connect(const sigc::slot<void(GPid, int)>& slot, GPid pid, int priority)
{
SourceConnectionNode* const conn_node = new SourceConnectionNode(slot);
const sigc::connection connection(*conn_node->get_slot());
g_source_set_priority(source, priority);
g_source_set_callback(source, Glib::function_pointer_cast<GSourceFunc>(&glibmm_child_watch_callback),
- conn_node, &SourceConnectionNode::destroy_notify_callback);
+ conn_node,
+ &glibmm_source_destroy_notify_callback);
conn_node->install(source);
g_source_attach(source, context_);
Glib::RefPtr<MainContext>
MainContext::create()
{
- return Glib::RefPtr<MainContext>(reinterpret_cast<MainContext*>(g_main_context_new()));
+ return Glib::make_refptr_for_instance<MainContext>(reinterpret_cast<MainContext*>(g_main_context_new()));
}
// static
return g_main_context_acquire(gobj());
}
-#ifndef GLIBMM_DISABLE_DEPRECATED
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-bool
-MainContext::wait(Glib::Cond& cond, Glib::Mutex& mutex)
-{
- return g_main_context_wait(gobj(), cond.gobj(), mutex.gobj());
-}
-
-bool
-MainContext::wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex)
-{
- return g_main_context_wait(gobj(), cond.gobj(), mutex.gobj());
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif // GLIBMM_DISABLE_DEPRECATED
-
void
MainContext::release()
{
}
void
-MainContext::invoke(const sigc::slot<bool>& slot, int priority)
+MainContext::invoke(const sigc::slot<bool()>& slot, int priority)
{
// Make a copy of slot on the heap.
- sigc::slot_base* const slot_copy = new sigc::slot<bool>(slot);
+ sigc::slot_base* const slot_copy = new sigc::slot<bool()>(slot);
g_main_context_invoke_full(gobj(), priority, glibmm_main_context_invoke_callback, slot_copy,
glibmm_main_context_invoke_destroy_notify_callback);
if (take_copy && gobject)
g_main_context_ref(gobject);
- return Glib::RefPtr<MainContext>(reinterpret_cast<MainContext*>(gobject));
+ return Glib::make_refptr_for_instance<MainContext>(reinterpret_cast<MainContext*>(gobject));
}
/**** Glib::MainLoop *******************************************************/
Glib::RefPtr<MainLoop>
MainLoop::create(bool is_running)
{
- return Glib::RefPtr<MainLoop>(reinterpret_cast<MainLoop*>(g_main_loop_new(nullptr, is_running)));
+ return Glib::make_refptr_for_instance<MainLoop>(reinterpret_cast<MainLoop*>(g_main_loop_new(nullptr, is_running)));
}
Glib::RefPtr<MainLoop>
MainLoop::create(const Glib::RefPtr<MainContext>& context, bool is_running)
{
- return Glib::RefPtr<MainLoop>(
+ return Glib::make_refptr_for_instance<MainLoop>(
reinterpret_cast<MainLoop*>(g_main_loop_new(Glib::unwrap(context), is_running)));
}
if (take_copy && gobject)
g_main_loop_ref(gobject);
- return Glib::RefPtr<MainLoop>(reinterpret_cast<MainLoop*>(gobject));
+ return Glib::make_refptr_for_instance<MainLoop>(reinterpret_cast<MainLoop*>(gobject));
}
/**** Glib::Source *********************************************************/
void
Source::reference() const
{
- std::lock_guard<std::mutex> lock(extra_source_data_mutex);
- ++extra_source_data[this].ref_count;
+ ++ref_count_;
}
void
Source::unreference() const
{
- std::unique_lock<std::mutex> lock(extra_source_data_mutex);
- if (--extra_source_data[this].ref_count == 0)
+ if (--ref_count_ == 0)
{
GSource* const tmp_gobject = gobject_;
- if (--extra_source_data[this].keep_wrapper == 0)
- {
- // The last reference from a RefPtr<Source> has been deleted, and
- // SourceCallbackData::destroy_notify_callback() has been called while
- // extra_source_data[this].keep_wrapper was > 1.
- // Delete the wrapper!
- extra_source_data.erase(this);
- lock.unlock();
- destroy_notify_callback(const_cast<Source*>(this));
- }
- else
- lock.unlock();
+ destroy_notify_callback2(const_cast<Source*>(this));
// Drop the one and only GSource reference held by the C++ wrapper.
// If the GSource instance is attached to a main context, the GMainContext
g_source_remove_poll(gobject_, poll_fd.gobj());
}
-#ifndef GLIBMM_DISABLE_DEPRECATED
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-void
-Source::get_current_time(Glib::TimeVal& current_time)
-{
- g_source_get_current_time(gobject_, ¤t_time);
-}
-G_GNUC_END_IGNORE_DEPRECATIONS
-#endif // GLIBMM_DISABLE_DEPRECATED
-
gint64
Source::get_time() const
{
// static
void
-Source::destroy_notify_callback(void* data)
+Source::destroy_notify_callback2(void* data)
{
if (data)
{
Source* const self = static_cast<Source*>(data);
+ if (--self->keep_wrapper_ == 0)
+ {
+ // gobject_ is already invalid at this point.
+ self->gobject_ = nullptr;
- // gobject_ is already invalid at this point.
- self->gobject_ = nullptr;
-
- // No exception checking: if the dtor throws, you're out of luck anyway.
- delete self;
+ // No exception checking: if the dtor throws, you're out of luck anyway.
+ delete self;
+ }
}
}
g_source_set_priority(source, priority);
g_source_set_callback(
- source, callback_func, conn_node, &SourceConnectionNode::destroy_notify_callback);
+ source, callback_func, conn_node,
+ &glibmm_source_destroy_notify_callback);
conn_node->install(source);
g_source_attach(source, context);
Glib::RefPtr<TimeoutSource>
TimeoutSource::create(unsigned int interval)
{
- return Glib::RefPtr<TimeoutSource>(new TimeoutSource(interval));
+ return Glib::make_refptr_for_instance<TimeoutSource>(new TimeoutSource(interval));
}
sigc::connection
-TimeoutSource::connect(const sigc::slot<bool>& slot)
+TimeoutSource::connect(const sigc::slot<bool()>& slot)
{
return connect_generic(slot);
}
TimeoutSource::TimeoutSource(unsigned int interval) : interval_(interval)
{
- time64_to_time_val(get_time(), expiration_);
- expiration_.add_milliseconds(std::min<unsigned long>(G_MAXLONG, interval_));
+ expiration_ = get_time() + ms2us(interval_);
}
TimeoutSource::~TimeoutSource() noexcept
bool
TimeoutSource::prepare(int& timeout)
{
- Glib::TimeVal current_time;
- time64_to_time_val(get_time(), current_time);
-
- Glib::TimeVal remaining = expiration_;
- remaining.subtract(current_time);
+ gint64 remaining = expiration_ - get_time();
- if (remaining.negative())
+ if (remaining <= 0)
{
// Already expired.
timeout = 0;
}
else
{
- const unsigned long milliseconds = static_cast<unsigned long>(remaining.tv_sec) * 1000U +
- static_cast<unsigned long>(remaining.tv_usec) / 1000U;
-
// Set remaining milliseconds.
- timeout = std::min<unsigned long>(G_MAXINT, milliseconds);
+ timeout = std::min<gint64>(G_MAXINT, remaining / 1000);
// Check if the system time has been set backwards. (remaining > interval)
- remaining.add_milliseconds(-std::min<unsigned long>(G_MAXLONG, interval_) - 1);
- if (!remaining.negative())
+ if (remaining > ms2us(interval_))
{
// Oh well. Reset the expiration time to now + interval;
// this at least avoids hanging for long periods of time.
- expiration_ = current_time;
- expiration_.add_milliseconds(interval_);
+ expiration_ = get_time() + ms2us(interval_);
timeout = std::min<unsigned int>(G_MAXINT, interval_);
}
}
bool
TimeoutSource::check()
{
- Glib::TimeVal current_time;
- time64_to_time_val(get_time(), current_time);
-
- return (expiration_ <= current_time);
+ return expiration_ <= get_time();
}
bool
TimeoutSource::dispatch(sigc::slot_base* slot)
{
- const bool again = (*static_cast<sigc::slot<bool>*>(slot))();
+ const bool again = (*static_cast<sigc::slot<bool()>*>(slot))();
if (again)
- {
- time64_to_time_val(get_time(), expiration_);
- expiration_.add_milliseconds(std::min<unsigned long>(G_MAXLONG, interval_));
- }
+ expiration_ = get_time() + ms2us(interval_);
return again;
}
Glib::RefPtr<IdleSource>
IdleSource::create()
{
- return Glib::RefPtr<IdleSource>(new IdleSource());
+ return Glib::make_refptr_for_instance<IdleSource>(new IdleSource());
}
sigc::connection
-IdleSource::connect(const sigc::slot<bool>& slot)
+IdleSource::connect(const sigc::slot<bool()>& slot)
{
return connect_generic(slot);
}
bool
IdleSource::dispatch(sigc::slot_base* slot)
{
- return (*static_cast<sigc::slot<bool>*>(slot))();
+ return (*static_cast<sigc::slot<bool()>*>(slot))();
}
/**** Glib::IOSource *******************************************************/
Glib::RefPtr<IOSource>
IOSource::create(PollFD::fd_t fd, IOCondition condition)
{
- return Glib::RefPtr<IOSource>(new IOSource(fd, condition));
+ return Glib::make_refptr_for_instance<IOSource>(new IOSource(fd, condition));
}
Glib::RefPtr<IOSource>
IOSource::create(const Glib::RefPtr<IOChannel>& channel, IOCondition condition)
{
- return Glib::RefPtr<IOSource>(new IOSource(channel, condition));
+ return Glib::make_refptr_for_instance<IOSource>(new IOSource(channel, condition));
+}
+
+Glib::RefPtr<IOSource>
+IOSource::create(GIOChannel* channel, IOCondition condition)
+{
+ return Glib::make_refptr_for_instance<IOSource>(new IOSource(channel, condition));
}
sigc::connection
-IOSource::connect(const sigc::slot<bool, IOCondition>& slot)
+IOSource::connect(const sigc::slot<bool(IOCondition)>& slot)
{
return connect_generic(slot);
}
{
}
+IOSource::IOSource(GIOChannel* channel, IOCondition condition)
+: Source(g_io_create_watch(channel, (GIOCondition)condition),
+ Glib::function_pointer_cast<GSourceFunc>(&glibmm_iosource_callback))
+{
+}
+
IOSource::IOSource(GSource* cast_item, GSourceFunc callback_func) : Source(cast_item, callback_func)
{
}
bool
IOSource::check()
{
- return ((poll_fd_.get_revents() & poll_fd_.get_events()) != 0);
+ return static_cast<int>(poll_fd_.get_revents() & poll_fd_.get_events()) != 0;
}
bool
IOSource::dispatch(sigc::slot_base* slot)
{
- return (*static_cast<sigc::slot<bool, IOCondition>*>(slot))(poll_fd_.get_revents());
+ return (*static_cast<sigc::slot<bool(IOCondition)>*>(slot))(poll_fd_.get_revents());
}
} // namespace Glib
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <glibmmconfig.h>
#include <glibmm/refptr.h>
-#include <glibmm/timeval.h>
#include <glibmm/priorities.h>
#include <glibmm/iochannel.h>
#include <sigc++/sigc++.h>
#include <vector>
#include <cstddef>
+#include <atomic>
namespace Glib
{
-#ifndef GLIBMM_DISABLE_DEPRECATED
-class Cond;
-class Mutex;
-
-namespace Threads
-{
-class Cond;
-class Mutex;
-}
-#endif // GLIBMM_DISABLE_DEPRECATED
-
/** @defgroup MainLoop The Main Event Loop
* Manages all available sources of events.
* @{
void set_fd(fd_t fd) { gobject_.fd = fd; }
fd_t get_fd() const { return gobject_.fd; }
- void set_events(IOCondition events) { gobject_.events = events; }
+ void set_events(IOCondition events) { gobject_.events = static_cast<decltype(gobject_.events)>(events); }
IOCondition get_events() const { return static_cast<IOCondition>(gobject_.events); }
- void set_revents(IOCondition revents) { gobject_.revents = revents; }
+ void set_revents(IOCondition revents) { gobject_.revents = static_cast<decltype(gobject_.revents)>(revents); }
IOCondition get_revents() const { return static_cast<IOCondition>(gobject_.revents); }
GPollFD* gobj() { return &gobject_; }
GPollFD gobject_;
};
-// Concerning SignalTimeout::connect_once(), SignalTimeout::connect_seconds_once()
-// and SignalIdle::connect_once():
-// See https://bugzilla.gnome.org/show_bug.cgi?id=396963 and
-// http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
-// It's recommended to replace sigc::slot<void>& by std::function<void()>& in
-// Threads::Thread::create() and ThreadPool::push() at the next ABI break.
-// Such a replacement would be a mixed blessing in SignalTimeout and SignalIdle.
-// In a single-threaded program auto-disconnection of trackable slots is safe
-// and can be useful.
-
class SignalTimeout
{
public:
* @return A connection handle, which can be used to disconnect the handler.
*/
sigc::connection connect(
- const sigc::slot<bool>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
+ const sigc::slot<bool()>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
/** Connects a timeout handler that runs only once.
* This method takes a function pointer to a function with a void return
* @param priority The priority of the new event source.
*/
void connect_once(
- const sigc::slot<void>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
+ const sigc::slot<void()>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
/** Connects a timeout handler with whole second granularity.
*
* @newin{2,14}
*/
sigc::connection connect_seconds(
- const sigc::slot<bool>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
+ const sigc::slot<bool()>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
/** Connects a timeout handler that runs only once with whole second
* granularity.
* @param priority The priority of the new event source.
*/
void connect_seconds_once(
- const sigc::slot<void>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
+ const sigc::slot<void()>& slot, unsigned int interval, int priority = PRIORITY_DEFAULT);
private:
GMainContext* context_;
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- sigc::connection connect(const sigc::slot<bool>& slot, int priority = PRIORITY_DEFAULT_IDLE);
+ sigc::connection connect(const sigc::slot<bool()>& slot, int priority = PRIORITY_DEFAULT_IDLE);
/** Connects an idle handler that runs only once.
* This method takes a function pointer to a function with a void return
* @endcode
* @param priority The priority of the new event source.
*/
- void connect_once(const sigc::slot<void>& slot, int priority = PRIORITY_DEFAULT_IDLE);
+ void connect_once(const sigc::slot<void()>& slot, int priority = PRIORITY_DEFAULT_IDLE);
private:
GMainContext* context_;
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- sigc::connection connect(const sigc::slot<bool, IOCondition>& slot, PollFD::fd_t fd, IOCondition condition,
+ sigc::connection connect(const sigc::slot<bool(IOCondition)>& slot, PollFD::fd_t fd, IOCondition condition,
int priority = PRIORITY_DEFAULT);
/** Connects an I/O handler that watches an I/O channel.
* @param priority The priority of the new event source.
* @return A connection handle, which can be used to disconnect the handler.
*/
- sigc::connection connect(const sigc::slot<bool, IOCondition>& slot,
+ sigc::connection connect(const sigc::slot<bool(IOCondition)>& slot,
const Glib::RefPtr<IOChannel>& channel, IOCondition condition, int priority = PRIORITY_DEFAULT);
private:
* @return A connection handle, which can be used to disconnect the handler.
*/
sigc::connection connect(
- const sigc::slot<void, GPid, int>& slot, GPid pid, int priority = PRIORITY_DEFAULT);
+ const sigc::slot<void(GPid, int)>& slot, GPid pid, int priority = PRIORITY_DEFAULT);
private:
GMainContext* context_;
*/
bool acquire();
-#ifndef GLIBMM_DISABLE_DEPRECATED
- /** Tries to become the owner of the specified context, as with acquire().
- * But if another thread is the owner, atomically drop mutex and wait on cond
- * until that owner releases ownership or until cond is signaled, then try
- * again (once) to become the owner.
- * @param cond A condition variable.
- * @param mutex A mutex, currently held.
- * @return true if the operation succeeded, and this thread is now the owner of context.
- *
- * @deprecated Use the underlying g_main_context_is_owner() function
- * and separate locking, if you really need this functionality.
- */
- bool wait(Glib::Cond& cond, Glib::Mutex& mutex);
-
- /** Tries to become the owner of the specified context, as with acquire().
- * But if another thread is the owner, atomically drop mutex and wait on cond
- * until that owner releases ownership or until cond is signaled, then try
- * again (once) to become the owner.
- * @param cond A condition variable.
- * @param mutex A mutex, currently held.
- * @return true if the operation succeeded, and this thread is now the owner of context.
- *
- * @deprecated Use the underlying g_main_context_is_owner() function
- * and separate locking, if you really need this functionality.
- */
- bool wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex);
-#endif // GLIBMM_DISABLE_DEPRECATED
-
/** Releases ownership of a context previously acquired by this thread with acquire(). If the
* context was acquired
* multiple times, the only release ownership when release() is called as many times as it was
*
* @newin{2,38}
*/
- void invoke(const sigc::slot<bool>& slot, int priority = PRIORITY_DEFAULT);
+ void invoke(const sigc::slot<bool()>& slot, int priority = PRIORITY_DEFAULT);
/** Timeout signal, attached to this MainContext.
* @return A signal proxy; you want to use SignalTimeout::connect().
*/
void remove_poll(PollFD& poll_fd);
-#ifndef GLIBMM_DISABLE_DEPRECATED
- /** Gets the "current time" to be used when checking this source.
- *
- * @param[out] current_time Glib::TimeVal in which to store current time.
- *
- * @deprecated Use get_time() instead.
- */
- void get_current_time(Glib::TimeVal& current_time);
-#endif // GLIBMM_DISABLE_DEPRECATED
-
// TODO: Remove mention of g_get_monotonic time when we wrap it in C++.
/** Gets the time to be used when checking this source. The advantage of
* calling this function over calling g_get_monotonic_time() directly is
private:
GSource* gobject_;
+ mutable std::atomic_int ref_count_ {1};
+ // The C++ wrapper (the Source instance) is deleted, when both Source::unreference()
+ // and SourceCallbackData::destroy_notify_callback() have decreased keep_wrapper_
+ // by calling destroy_notify_callback2().
+ // https://bugzilla.gnome.org/show_bug.cgi?id=561885
+ std::atomic_int keep_wrapper_ {2};
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static inline Source* get_wrapper(GSource* source);
static gboolean dispatch_vfunc(GSource* source, GSourceFunc callback, void* user_data);
public:
- static void destroy_notify_callback(void* data);
+ // Really destroys the object during the second call. See keep_wrapper_.
+ static void destroy_notify_callback2(void* data);
// Used by SignalXyz, possibly in other files.
static sigc::connection attach_signal_source(const sigc::slot_base& slot, int priority,
GSource* source, GMainContext* context, GSourceFunc callback_func);
using CppObjectType = Glib::TimeoutSource;
static Glib::RefPtr<TimeoutSource> create(unsigned int interval);
- sigc::connection connect(const sigc::slot<bool>& slot);
+ sigc::connection connect(const sigc::slot<bool()>& slot);
protected:
explicit TimeoutSource(unsigned int interval);
bool dispatch(sigc::slot_base* slot) override;
private:
- // TODO: Replace with gint64, because TimeVal is deprecated, when we can break ABI.
- Glib::TimeVal expiration_;
-
- unsigned int interval_;
+ gint64 expiration_; // microseconds
+ unsigned int interval_; // milliseconds
};
class IdleSource : public Glib::Source
using CppObjectType = Glib::IdleSource;
static Glib::RefPtr<IdleSource> create();
- sigc::connection connect(const sigc::slot<bool>& slot);
+ sigc::connection connect(const sigc::slot<bool()>& slot);
protected:
IdleSource();
static Glib::RefPtr<IOSource> create(PollFD::fd_t fd, IOCondition condition);
static Glib::RefPtr<IOSource> create(
const Glib::RefPtr<IOChannel>& channel, IOCondition condition);
- sigc::connection connect(const sigc::slot<bool, IOCondition>& slot);
+ sigc::connection connect(const sigc::slot<bool(IOCondition)>& slot);
protected:
IOSource(PollFD::fd_t fd, IOCondition condition);
bool dispatch(sigc::slot_base* slot) override;
private:
+ friend IOChannel;
+
+ // This is just to avoid the need for Gio::Socket to create a RefPtr<> to itself.
+ static Glib::RefPtr<IOSource> create(GIOChannel* channel, IOCondition condition);
+
+ // This is just to avoid the need for Gio::Socket to create a RefPtr<> to itself.
+ IOSource(GIOChannel* channel, IOCondition condition);
+
PollFD poll_fd_;
};
#include <string.h>
-// Weak references:
-// I'm not sure what the point of these are apart from being a hacky way out of circular references,
-// but maybe we could make it easier to use them by making a Java Reference Object -style class like
-// so:
-// Glib::WeakRef<SomeDerivedObject> weakrefSomeObject(object1);
-// ...
-// if(weakrefSomeObject->isStillAlive())
-// {
-// weakrefSomeObject->some_method();
-// }
-// else
-// {
-// //Deal with it, maybe recreating the object.
-// }
-//
-// Without this, the coder has to define his own signal handler which sets his own isStillAlive
-// boolean.
-// weakrefSomeObject<> could still have its own signal_destroyed signal so that coders can choose to
-// deal
-// with the destruction as soon as it happens instead of just checking later before they try to use
-// it.
-
namespace Glib
{
ConstructParams::ConstructParams(const Glib::Class& glibmm_class_)
-: glibmm_class(glibmm_class_), n_parameters(0), parameters(nullptr)
+: glibmm_class(glibmm_class_), n_parameters(0), parameter_names(nullptr), parameter_values(nullptr)
{
}
*/
ConstructParams::ConstructParams(
const Glib::Class& glibmm_class_, const char* first_property_name, ...)
-: glibmm_class(glibmm_class_), n_parameters(0), parameters(nullptr)
+: glibmm_class(glibmm_class_), n_parameters(0), parameter_names(nullptr), parameter_values(nullptr)
{
va_list var_args;
va_start(var_args, first_property_name);
break;
}
- if (n_parameters >= n_alloced_params)
- parameters = g_renew(GParameter, parameters, n_alloced_params += 8);
-
- GParameter& param = parameters[n_parameters];
+ if (n_parameters >= n_alloced_params) {
+ n_alloced_params += 8;
+ parameter_names = g_renew(const char*, parameter_names, n_alloced_params);
+ parameter_values = g_renew(GValue, parameter_values, n_alloced_params);
+ }
- param.name = name;
- param.value.g_type = 0;
+ auto& param_name = parameter_names[n_parameters];
+ auto& param_value = parameter_values[n_parameters];
+ param_name = name;
+ param_value.g_type = 0;
// Fill the GValue with the current vararg, and move on to the next one.
- g_value_init(¶m.value, G_PARAM_SPEC_VALUE_TYPE(pspec));
- G_VALUE_COLLECT(¶m.value, var_args, 0, &collect_error);
+ g_value_init(¶m_value, G_PARAM_SPEC_VALUE_TYPE(pspec));
+ G_VALUE_COLLECT(¶m_value, var_args, 0, &collect_error);
if (collect_error)
{
g_warning("Glib::ConstructParams::ConstructParams(): %s", collect_error);
g_free(collect_error);
- g_value_unset(¶m.value);
+ g_value_unset(¶m_value);
break;
}
ConstructParams::~ConstructParams() noexcept
{
- while (n_parameters > 0)
- g_value_unset(¶meters[--n_parameters].value);
-
- g_free(parameters);
-}
-
-/*
- * Some compilers require the existence of a copy constructor in certain
- * usage contexts. This implementation is fully functional, but unlikely
- * to be ever actually called due to optimization.
- */
-ConstructParams::ConstructParams(const ConstructParams& other)
-: glibmm_class(other.glibmm_class),
- n_parameters(other.n_parameters),
- parameters(g_new(GParameter, n_parameters))
-{
- for (unsigned int i = 0; i < n_parameters; ++i)
- {
- parameters[i].name = other.parameters[i].name;
- parameters[i].value.g_type = 0;
-
- g_value_init(¶meters[i].value, G_VALUE_TYPE(&other.parameters[i].value));
- g_value_copy(&other.parameters[i].value, ¶meters[i].value);
+ while (n_parameters > 0) {
+ auto& param_value = parameter_values[--n_parameters];
+ g_value_unset(¶m_value);
}
+
+ g_free(parameter_names);
+ g_free(parameter_values);
}
/**** Glib::Object_Class ***************************************************/
if (custom_type_name_ && !is_anonymous_custom_())
{
- Class::interface_class_vector_type custom_interface_classes;
-
- {
- std::lock_guard<std::mutex> lock(extra_object_base_data_mutex);
- const extra_object_base_data_type::iterator iter = extra_object_base_data.find(this);
- if (iter != extra_object_base_data.end())
- {
- custom_interface_classes = iter->second.custom_interface_classes;
- extra_object_base_data.erase(iter);
- }
- }
-
object_class_.init();
+
// This creates a type that is derived (indirectly) from GObject.
- object_type = object_class_.clone_custom_type(custom_type_name_, custom_interface_classes);
+ object_type = object_class_.clone_custom_type(custom_type_name_,
+ get_custom_interface_classes(), get_custom_class_init_functions(),
+ get_custom_instance_init_function());
+ custom_class_init_finished();
}
- void* const new_object = g_object_new(object_type, nullptr);
+ GObject* const new_object = g_object_new_with_properties(object_type, 0, nullptr, nullptr);
// Connect the GObject and Glib::Object instances.
- ObjectBase::initialize(static_cast<GObject*>(new_object));
+ ObjectBase::initialize(new_object);
}
Object::Object(const Glib::ConstructParams& construct_params)
if (custom_type_name_ && !is_anonymous_custom_())
{
- Class::interface_class_vector_type custom_interface_classes;
-
- {
- std::lock_guard<std::mutex> lock(extra_object_base_data_mutex);
- const extra_object_base_data_type::iterator iter = extra_object_base_data.find(this);
- if (iter != extra_object_base_data.end())
- {
- custom_interface_classes = iter->second.custom_interface_classes;
- extra_object_base_data.erase(iter);
- }
- }
-
object_type =
- construct_params.glibmm_class.clone_custom_type(custom_type_name_, custom_interface_classes);
+ construct_params.glibmm_class.clone_custom_type(custom_type_name_,
+ get_custom_interface_classes(), get_custom_class_init_functions(),
+ get_custom_instance_init_function());
+ custom_class_init_finished();
}
// Create a new GObject with the specified array of construct properties.
// This works with custom types too, since those inherit the properties of
// their base class.
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- //TODO: Replace g_object_newv() by g_object_new_with_properties() when we can
- // require glib 2.54. GParameter is also deprecated (only mentioned in a comment).
- // Don't use it in ConstructParams when we can break ABI.
- void* const new_object =
- g_object_newv(object_type, construct_params.n_parameters, construct_params.parameters);
- G_GNUC_END_IGNORE_DEPRECATIONS
+ GObject* const new_object =
+ g_object_new_with_properties(object_type, construct_params.n_parameters, construct_params.parameter_names, construct_params.parameter_values);
// Connect the GObject and Glib::Object instances.
- ObjectBase::initialize(static_cast<GObject*>(new_object));
+ ObjectBase::initialize(new_object);
}
Object::Object(GObject* castitem)
/* ConstructParams::ConstructParams() takes a varargs list of properties
* and values, like g_object_new() does. This list will then be converted
- * to a GParameter array, for use with g_object_newv(). No overhead is
- * involved, since g_object_new() is just a wrapper around g_object_newv()
+ * to an array of parameter names and an array of parameter values,
+ * for use with g_object_new_with_properties(). No overhead is
+ * involved, since g_object_new() is just a wrapper around g_object_new_with_properties()
* as well.
*
* The advantage of an auxiliary ConstructParams object over g_object_new()
public:
const Glib::Class& glibmm_class;
unsigned int n_parameters;
- GParameter* parameters;
+ const char ** parameter_names;
+ GValue* parameter_values;
explicit ConstructParams(const Glib::Class& glibmm_class_);
ConstructParams(const Glib::Class& glibmm_class_, const char* first_property_name,
...) G_GNUC_NULL_TERMINATED; // warn if called without a trailing NULL pointer
~ConstructParams() noexcept;
- // The copy constructor is semantically required by the C++ compiler
- // (since g++ 3.4) to be able to create temporary instances, depending
- // on the usage context. Apparently the compiler will actually optimize
- // away the copy, though. See bug #132300.
- ConstructParams(const ConstructParams& other);
-
-private:
- // no copy assignment
- ConstructParams& operator=(const ConstructParams&);
+ ConstructParams(const ConstructParams& other) = delete;
+ ConstructParams& operator=(const ConstructParams&) = delete;
};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
// because that would be "dependent", and g++ 3.4 does not allow that.
// The specific Glib::wrap() overloads don't do anything special anyway.
GObject* cobj = (GObject*)const_cast<CTypeNonConst>(ptr);
- return Glib::RefPtr<T>(dynamic_cast<T*>(Glib::wrap_auto(cobj, true /* take_copy */)));
+ return Glib::make_refptr_for_instance<T>(dynamic_cast<T*>(Glib::wrap_auto(cobj, true /* take_copy */)));
// We use dynamic_cast<> in case of multiple inheritance.
}
// because that would be "dependent", and g++ 3.4 does not allow that.
// The specific Glib::wrap() overloads don't do anything special anyway.
GObject* cobj = (GObject*)(ptr);
- return Glib::RefPtr<const T>(
+ return Glib::make_refptr_for_instance<const T>(
dynamic_cast<const T*>(Glib::wrap_auto(cobj, true /* take_copy */)));
// We use dynamic_cast<> in case of multiple inheritance.
}
} // namespace Container_Helpers
-template <class T, class PtrT>
+template <class PtrT>
inline PtrT
-Value_Pointer<T, PtrT>::get_(Glib::Object*) const
+Value_Pointer<PtrT>::get_(Glib::Object*) const
{
return dynamic_cast<T*>(get_object());
}
static GType value_type() { return T::get_base_type(); }
- void set(const CppType& data) { set_object(data.operator->()); }
- CppType get() const { return Glib::RefPtr<T>::cast_dynamic(get_object_copy()); }
+ void set(const CppType& data) { set_object(data.get()); }
+ CppType get() const { return std::dynamic_pointer_cast<T>(get_object_copy()); }
};
// The SUN Forte Compiler has a problem with this:
static GType value_type() { return T::get_base_type(); }
- void set(const CppType& data) { set_object(const_cast<T*>(data.operator->())); }
- CppType get() const { return Glib::RefPtr<T>::cast_dynamic(get_object_copy()); }
+ void set(const CppType& data) { set_object(const_cast<T*>(data.get())); }
+ CppType get() const { return std::dynamic_pointer_cast<T>(get_object_copy()); }
};
#endif /* GLIBMM_HAVE_DISAMBIGUOUS_CONST_TEMPLATE_SPECIALIZATIONS */
/**** Glib::ObjectBase *****************************************************/
-// static data members
-ObjectBase::extra_object_base_data_type ObjectBase::extra_object_base_data;
-std::mutex ObjectBase::extra_object_base_data_mutex;
+// Used only during the construction of named custom types.
+struct ObjectBase::PrivImpl
+{
+ // Pointers to the interfaces of custom types.
+ Class::interface_classes_type custom_interface_classes;
+ // Pointers to extra class init functions.
+ Class::class_init_funcs_type custom_class_init_functions;
+ // Pointer to the instance init function.
+ GInstanceInitFunc custom_instance_init_function = nullptr;
+};
ObjectBase::ObjectBase()
: gobject_(nullptr),
}
ObjectBase::ObjectBase(const char* custom_type_name)
-: gobject_(nullptr), custom_type_name_(custom_type_name), cpp_destruction_in_progress_(false)
+: gobject_(nullptr), custom_type_name_(custom_type_name),
+ cpp_destruction_in_progress_(false)
{
}
ObjectBase::ObjectBase(const std::type_info& custom_type_info)
-: gobject_(nullptr), custom_type_name_(custom_type_info.name()), cpp_destruction_in_progress_(false)
+: gobject_(nullptr), custom_type_name_(custom_type_info.name()),
+ cpp_destruction_in_progress_(false)
{
}
// we have to call g_object_unref() on our own.
//
- // Just a precaution. Unless a derived class's ctor has thrown an exception,
- // 'this' should have been erased from extra_object_base_data by
- // Glib::Object's constructor.
- {
- std::lock_guard<std::mutex> lock(extra_object_base_data_mutex);
- extra_object_base_data.erase(this);
- }
-
if (GObject* const gobject = gobject_)
{
#ifdef GLIBMM_DEBUG_REFCOUNTING
(void*)cppObject, (void*)cppObject->gobject_, G_OBJECT_TYPE_NAME(cppObject->gobject_));
#endif
- if (cppObject) // This will be 0 if the C++ destructor has already run.
+ if (cppObject) // This will be nullptr if the C++ destructor has already run.
{
- cppObject->destroy_notify_(); // Virtual - it does different things for GObject and GtkObject.
+ cppObject->destroy_notify_(); // Virtual - it does different things for Glib::ObjectBase and Gtk::Object.
}
}
{
// The C instance is about to be disposed, making it unusable. Now is a
// good time to delete the C++ wrapper of the C instance. There is no way
-// to force the disposal of the GObject (though GtkObject has
-// gtk_object_destroy()), So this is the *only* place where we delete the
-// C++ wrapper.
+// to force the disposal of the GObject (though Gtk::Object::destroy_notify_()
+// can call g_object_run_dispose()), so this is the *only* place where we delete
+// the C++ wrapper.
//
// This will only happen after the last unreference(), which will be done by
// the RefPtr<> destructor. There should be no way to access the wrapper or
-// the undobjecterlying instance after that, so it's OK to delete this.
+// the underlying object instance after that, so it's OK to delete this.
#ifdef GLIBMM_DEBUG_REFCOUNTING
g_warning("Glib::ObjectBase::destroy_notify_: gobject_ = %p", (void*)gobject_);
g_object_get_property(const_cast<GObject*>(gobj()), property_name.c_str(), value.gobj());
}
-void
-ObjectBase::connect_property_changed(
- const Glib::ustring& property_name, const sigc::slot<void>& slot)
-{
- connect_property_changed_with_return(property_name, slot);
-}
-
-void
-ObjectBase::connect_property_changed(const Glib::ustring& property_name, sigc::slot<void>&& slot)
-{
- connect_property_changed_with_return(property_name, std::move(slot));
-}
-
sigc::connection
-ObjectBase::connect_property_changed_with_return(
- const Glib::ustring& property_name, const sigc::slot<void>& slot)
+ObjectBase::connect_property_changed(
+ const Glib::ustring& property_name, const sigc::slot<void()>& slot)
{
// Create a proxy to hold our connection info
// This will be deleted by destroy_notify_handler.
}
sigc::connection
-ObjectBase::connect_property_changed_with_return(
- const Glib::ustring& property_name, sigc::slot<void>&& slot)
+ObjectBase::connect_property_changed(
+ const Glib::ustring& property_name, sigc::slot<void()>&& slot)
{
// Create a proxy to hold our connection info
// This will be deleted by destroy_notify_handler.
g_object_thaw_notify(gobj());
}
+void ObjectBase::add_custom_interface_class(const Interface_Class* iface_class)
+{
+ if (!priv_pimpl_)
+ priv_pimpl_ = std::make_unique<PrivImpl>();
+ priv_pimpl_->custom_interface_classes.emplace_back(iface_class);
+}
+
+void ObjectBase::add_custom_class_init_function(GClassInitFunc class_init_func, void* class_data)
+{
+ if (!priv_pimpl_)
+ priv_pimpl_ = std::make_unique<PrivImpl>();
+ priv_pimpl_->custom_class_init_functions.emplace_back(
+ std::make_tuple(class_init_func, class_data));
+}
+
+void ObjectBase::set_custom_instance_init_function(GInstanceInitFunc instance_init_func)
+{
+ if (!priv_pimpl_)
+ priv_pimpl_ = std::make_unique<PrivImpl>();
+ priv_pimpl_->custom_instance_init_function = instance_init_func;
+}
+
+const Class::interface_classes_type* ObjectBase::get_custom_interface_classes() const
+{
+ return priv_pimpl_ ? &priv_pimpl_->custom_interface_classes : nullptr;
+}
+
+const Class::class_init_funcs_type* ObjectBase::get_custom_class_init_functions() const
+{
+ return priv_pimpl_ ? &priv_pimpl_->custom_class_init_functions : nullptr;
+}
+
+GInstanceInitFunc ObjectBase::get_custom_instance_init_function() const
+{
+ return priv_pimpl_ ? priv_pimpl_->custom_instance_init_function : nullptr;
+}
+
+void ObjectBase::custom_class_init_finished()
+{
+ priv_pimpl_.reset();
+}
+
+/**** Global function *****************************************************/
bool
_gobject_cppinstance_already_deleted(GObject* gobject)
{
#include <glibmm/debug.h>
#include <sigc++/trackable.h>
#include <typeinfo>
-#include <map> // Needed until the next ABI break.
-#include <memory> // Not used by ObjectBase any more, but user code may rely on it being here.
-#include <mutex>
+#include <memory>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" {
template <class PropertyType>
void get_property(const Glib::ustring& property_name, PropertyType& value) const;
- // TODO: At the next ABI break, delete connect_property_changed_with_return()
- // and let connect_property_changed() return sigc::connection.
- /** You can use the signal_changed() signal of the property proxy instead.
- *
- * See also connect_property_changed_with_return().
- */
- void connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot);
-
- /** You can use the signal_changed() signal of the property proxy instead.
- *
- * @newin{2,48}
- */
- void connect_property_changed(const Glib::ustring& property_name, sigc::slot<void>&& slot);
+ /// You probably want to use a specific property_*() accessor method instead.
+ template <class PropertyType>
+ PropertyType get_property(const Glib::ustring& property_name) const;
/** You can use the signal_changed() signal of the property proxy instead.
- *
- * This method was added because connect_property_changed() does not return a sigc::connection,
- * and we could not break the ABI by changing that function.
*/
- sigc::connection connect_property_changed_with_return(
- const Glib::ustring& property_name, const sigc::slot<void>& slot);
+ sigc::connection connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void()>& slot);
/** You can use the signal_changed() signal of the property proxy instead.
*
* @newin{2,48}
*/
- sigc::connection connect_property_changed_with_return(
- const Glib::ustring& property_name, sigc::slot<void>&& slot);
+ sigc::connection connect_property_changed(const Glib::ustring& property_name, sigc::slot<void()>&& slot);
/** Increases the freeze count on object. If the freeze count is non-zero, the
* emission of "notify" signals on object is stopped. The signals are queued
bool is_anonymous_custom_() const;
- // TODO: At the next ABI break, replace extra_object_base_data by a non-static
- // data member.
- // This is a new data member that can't be added as instance data to
- // ObjectBase now, because it would break ABI.
- struct ExtraObjectBaseData
- {
- Class::interface_class_vector_type custom_interface_classes;
- };
-
- using extra_object_base_data_type = std::map<const ObjectBase*, ExtraObjectBaseData>;
- 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.
- static std::mutex extra_object_base_data_mutex;
+ // The following 7 methods are used by Glib::ExtraClassInit, Glib::Interface
+ // and Glib::Object during construction of a named custom type.
+ void add_custom_interface_class(const Interface_Class* iface_class);
+ void add_custom_class_init_function(GClassInitFunc class_init_func, void* class_data = nullptr);
+ void set_custom_instance_init_function(GInstanceInitFunc instance_init_func);
+ const Class::interface_classes_type* get_custom_interface_classes() const;
+ const Class::class_init_funcs_type* get_custom_class_init_functions() const;
+ GInstanceInitFunc get_custom_instance_init_function() const;
+ void custom_class_init_finished();
public:
// is_derived_() must be public, so that overridden vfuncs and signal handlers can call it
private:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ // Private part of implementation.
+ // Used only during construction of named custom types.
+ struct PrivImpl;
+ std::unique_ptr<PrivImpl> priv_pimpl_;
+
virtual void set_manage(); // calls g_error()
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
friend class Glib::GSigConnectionNode; // for GSigConnectionNode::notify()
-#endif
+#endif // DOXYGEN_SHOULD_SKIP_THIS
};
#ifndef DOXYGEN_SHOULD_SKIP_THIS
value = property_value.get();
}
+template <class PropertyType>
+inline PropertyType
+ObjectBase::get_property(const Glib::ustring& property_name) const
+{
+ PropertyType value;
+ get_property(property_name, value);
+
+ return value;
+}
+
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
bool _gobject_cppinstance_already_deleted(GObject* gobject);
*
* This Property class currently supports the name, nick name, description default value and flags.
* The minimum and maximum bounds are set to the full range of the value.
- * Because of internal implementation, flags shouldn't be set to values: Glib::PARAM_STATIC_NAME,
- * Glib::PARAM_STATIC_NICK, Glib::PARAM_STATIC_BLURB, Glib::PARAM_CONSTRUCT and
- * Glib::PARAM_CONSTRUCT_ONLY.
+ * Because of internal implementation, flags shouldn't be set to values: Glib::ParamFlags::STATIC_NAME,
+ * Glib::ParamFlags::STATIC_NICK, Glib::ParamFlags::STATIC_BLURB, Glib::ParamFlags::CONSTRUCT and
+ * Glib::ParamFlags::CONSTRUCT_ONLY.
*
* The class information must be installed into the GObject system once per
* property, but this is handled automatically.
template <class T>
Property<T>::Property(Glib::Object& object, const Glib::ustring& name)
-: Property(object, name, Glib::ustring(), Glib::ustring(), Glib::PARAM_READWRITE)
+: Property(object, name, Glib::ustring(), Glib::ustring(), Glib::ParamFlags::READWRITE)
{
}
Property<T>::Property(Glib::Object& object, const Glib::ustring& name,
const typename Property<T>::PropertyType& default_value)
: Property(object, name, default_value, Glib::ustring(),
- Glib::ustring(), Glib::PARAM_READWRITE)
+ Glib::ustring(), Glib::ParamFlags::READWRITE)
{
}
const Glib::ustring& nick, const Glib::ustring& blurb, Glib::ParamFlags flags)
: PropertyBase(object, ValueType::value_type())
{
- flags |= Glib::PARAM_READWRITE;
+ flags |= Glib::ParamFlags::READWRITE;
if (!lookup_property(name))
install_property(static_cast<ValueType&>(value_).create_param_spec(name, nick, blurb, flags));
:
PropertyBase(object, ValueType::value_type())
{
- flags |= Glib::PARAM_READWRITE;
+ flags |= Glib::ParamFlags::READWRITE;
static_cast<ValueType&>(value_).set(default_value);
template <class T>
Property_ReadOnly<T>::Property_ReadOnly(Glib::Object& object, const Glib::ustring& name)
-: Property_ReadOnly(object, name, Glib::ustring(), Glib::ustring(), Glib::PARAM_READABLE)
+: Property_ReadOnly(object, name, Glib::ustring(), Glib::ustring(), Glib::ParamFlags::READABLE)
{
}
Property_ReadOnly<T>::Property_ReadOnly(Glib::Object& object, const Glib::ustring& name,
const typename Property_ReadOnly<T>::PropertyType& default_value)
: Property_ReadOnly(object, name, default_value, Glib::ustring(), Glib::ustring(),
- Glib::PARAM_READABLE)
+ Glib::ParamFlags::READABLE)
{
}
const Glib::ustring& nick, const Glib::ustring& blurb, Glib::ParamFlags flags)
: PropertyBase(object, ValueType::value_type())
{
- flags |= Glib::PARAM_READABLE;
- flags &= ~Glib::PARAM_WRITABLE;
+ flags |= Glib::ParamFlags::READABLE;
+ flags &= ~Glib::ParamFlags::WRITABLE;
if (!lookup_property(name))
install_property(static_cast<ValueType&>(value_).create_param_spec(name, nick, blurb, flags));
const Glib::ustring& nick, const Glib::ustring& blurb, Glib::ParamFlags flags)
: PropertyBase(object, ValueType::value_type())
{
- flags |= Glib::PARAM_READABLE;
- flags &= ~Glib::PARAM_WRITABLE;
+ flags |= Glib::ParamFlags::READABLE;
+ flags &= ~Glib::ParamFlags::WRITABLE;
static_cast<ValueType&>(value_).set(default_value);
template <class T>
Property_WriteOnly<T>::Property_WriteOnly(Glib::Object& object, const Glib::ustring& name)
: Property_WriteOnly(object, name, Glib::ustring(),
- Glib::ustring(), Glib::PARAM_WRITABLE)
+ Glib::ustring(), Glib::ParamFlags::WRITABLE)
{
}
Property_WriteOnly<T>::Property_WriteOnly(Glib::Object& object, const Glib::ustring& name,
const typename Property_WriteOnly<T>::PropertyType& default_value)
: Property_WriteOnly(object, name, default_value, Glib::ustring(),
- Glib::ustring(), Glib::PARAM_WRITABLE)
+ Glib::ustring(), Glib::ParamFlags::WRITABLE)
{
}
const Glib::ustring& nick, const Glib::ustring& blurb, Glib::ParamFlags flags)
: PropertyBase(object, ValueType::value_type())
{
- flags |= Glib::PARAM_WRITABLE;
- flags &= ~Glib::PARAM_READABLE;
+ flags |= Glib::ParamFlags::WRITABLE;
+ flags &= ~Glib::ParamFlags::READABLE;
if (!lookup_property(name))
install_property(static_cast<ValueType&>(value_).create_param_spec(name, nick, blurb, flags));
const Glib::ustring& nick, const Glib::ustring& blurb, Glib::ParamFlags flags)
: PropertyBase(object, ValueType::value_type())
{
- flags |= Glib::PARAM_WRITABLE;
- flags &= ~Glib::PARAM_READABLE;
+ flags |= Glib::ParamFlags::WRITABLE;
+ flags &= ~Glib::ParamFlags::READABLE;
static_cast<ValueType&>(value_).set(default_value);
if (pspec && data)
{
if (sigc::slot_base* const slot = SignalProxyBase::data_to_slot(data))
- (*static_cast<sigc::slot<void>*>(slot))();
+ (*static_cast<sigc::slot<void()>*>(slot))();
}
}
SignalProxyProperty(Glib::ObjectBase* obj, const gchar* property_name);
~SignalProxyProperty() noexcept;
- using SlotType = sigc::slot<void>;
+ using SlotType = sigc::slot<void()>;
sigc::connection connect(const SlotType& slot);
/** @newin{2,48}
*/
#include <glibmmconfig.h>
#include <glib.h>
-#include <utility>
+#include <memory>
namespace Glib
{
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+template <class T_CppObject>
+void RefPtrDeleter(T_CppObject* object)
+{
+ if (!object)
+ return;
+
+ object->unreference();
+}
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
/** RefPtr<> is a reference-counting shared smartpointer.
*
* Some objects in gtkmm are obtained from a shared
* store. Consequently you cannot instantiate them yourself. Instead they
* return a RefPtr which behaves much like an ordinary pointer in that members
* can be reached with the usual <code>object_ptr->member</code> notation.
- * Unlike most other smart pointers, RefPtr doesn't support dereferencing
- * through <code>*object_ptr</code>.
*
* Reference counting means that a shared reference count is incremented each
* time a RefPtr is copied, and decremented each time a RefPtr is destroyed,
* zero, the contained object is deleted, meaning you don't need to remember
* to delete the object.
*
- * RefPtr<> can store any class that has reference() and unreference() methods,
- * and whose destructor is noexcept (the default for destructors).
- * In gtkmm, that is anything derived from Glib::ObjectBase, such as
- * Gdk::Pixbuf.
- *
* See the "Memory Management" section in the "Programming with gtkmm"
* book for further information.
*/
template <class T_CppObject>
-class RefPtr
-{
-private:
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- /** Helper class for disallowing use of Glib::RefPtr with certain classes.
- *
- * Disallow for instance in Gtk::Widget and its subclasses.
- * Glib::RefPtr<T>::is_allowed_type::value is false if
- * T:dont_allow_use_in_glib_refptr_ is a public type, else it's true.
- * Example:
- * @code
- * using dont_allow_use_in_glib_refptr_ = int;
- * @endcode
- */
- class is_allowed_type
- {
- private:
- struct big
- {
- int memory[64];
- };
-
- static big check(...);
-
- // If X::dont_allow_use_in_glib_refptr_ is not a type, this check() overload
- // is ignored because of the SFINAE rule (Substitution Failure Is Not An Error).
- template <typename X>
- static typename X::dont_allow_use_in_glib_refptr_ check(X* obj);
-
- public:
- static const bool value = sizeof(check(static_cast<T_CppObject*>(nullptr))) == sizeof(big);
- };
-
- static_assert(is_allowed_type::value, "Glib::RefPtr must not be used with this class.");
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-public:
- /** Default constructor
- *
- * Afterwards it will be null and use of -> will invoke undefined behaviour.
- */
- inline RefPtr() noexcept;
-
- /// Destructor - decrements reference count.
- inline ~RefPtr() noexcept;
-
- /// For use only by the \::create() methods.
- explicit inline RefPtr(T_CppObject* pCppObject) noexcept;
-
- /** Copy constructor
- *
- * This increments the shared reference count.
- */
- inline RefPtr(const RefPtr& src) noexcept;
-
- /** Move constructor
- */
- inline RefPtr(RefPtr&& src) noexcept;
-
- /** Move constructor (from different, but castable type).
- */
- template <class T_CastFrom>
- inline RefPtr(RefPtr<T_CastFrom>&& src) noexcept;
-
- /** Copy constructor (from different, but castable type).
- *
- * Increments the reference count.
- */
- template <class T_CastFrom>
- inline RefPtr(const RefPtr<T_CastFrom>& src) noexcept;
-
- /** Swap the contents of two RefPtr<>.
- * This method swaps the internal pointers to T_CppObject. This can be
- * done safely without involving a reference/unreference cycle and is
- * therefore highly efficient.
- */
- inline void swap(RefPtr& other) noexcept;
-
- /// Copy from another RefPtr:
- inline RefPtr& operator=(const RefPtr& src) noexcept;
-
- /// Move assignment operator:
- inline RefPtr& operator=(RefPtr&& src) noexcept;
-
- /// Move assignment operator (from different, but castable type):
- template <class T_CastFrom>
- inline RefPtr& operator=(RefPtr<T_CastFrom>&& src) noexcept;
-
- /** Copy from different, but castable type.
- *
- * Increments the reference count.
- */
- template <class T_CastFrom>
- inline RefPtr& operator=(const RefPtr<T_CastFrom>& src) noexcept;
-
- /// Tests whether the RefPtr<> point to the same underlying instance.
- inline bool operator==(const RefPtr& src) const noexcept;
-
- /// See operator==().
- inline bool operator!=(const RefPtr& src) const noexcept;
-
- /** Dereferencing.
- *
- * Use the methods of the underlying instance like so:
- * <code>refptr->memberfun()</code>.
- */
- inline T_CppObject* operator->() const noexcept;
-
- /** Returns the stored pointer.
- *
- * @newin{2,56}
- */
- inline T_CppObject* get() const noexcept;
-
- /** Test whether the RefPtr<> points to any underlying instance.
- *
- * Mimics usage of ordinary pointers:
- * @code
- * if (ptr)
- * do_something();
- * @endcode
- */
- inline explicit operator bool() const noexcept;
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
- /// @deprecated Use reset() instead because this leads to confusion with clear() methods on the
- /// underlying class. For instance, people use .clear() when they mean ->clear().
- inline void clear() noexcept;
-#endif // GLIBMM_DISABLE_DEPRECATED
-
- /** Set underlying instance to nullptr, decrementing reference count of existing instance
- * appropriately.
- * @newin{2,16}
- */
- inline void reset() noexcept;
-
- /** 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.
- *
- * 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() noexcept G_GNUC_WARN_UNUSED_RESULT;
-
- /** Dynamic cast to derived class.
- *
- * The RefPtr can't be cast with the usual notation so instead you can use
- * @code
- * ptr_derived = RefPtr<Derived>::cast_dynamic(ptr_base);
- * @endcode
- */
- template <class T_CastFrom>
- static inline RefPtr cast_dynamic(const RefPtr<T_CastFrom>& src) noexcept;
-
- /** Static cast to derived class.
- *
- * Like the dynamic cast; the notation is
- * @code
- * ptr_derived = RefPtr<Derived>::cast_static(ptr_base);
- * @endcode
- */
- template <class T_CastFrom>
- static inline RefPtr cast_static(const RefPtr<T_CastFrom>& src) noexcept;
-
- /** Cast to non-const.
- *
- * The RefPtr can't be cast with the usual notation so instead you can use
- * @code
- * ptr_unconst = RefPtr<UnConstType>::cast_const(ptr_const);
- * @endcode
- */
- template <class T_CastFrom>
- static inline RefPtr cast_const(const RefPtr<T_CastFrom>& src) noexcept;
-
- /** Compare based on the underlying instance address.
- *
- * This is needed in code that requires an ordering on
- * RefPtr<T_CppObject> instances, e.g. std::set<RefPtr<T_CppObject> >.
- *
- * Without these, comparing two RefPtr<T_CppObject> instances
- * 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 noexcept;
-
- /// See operator<().
- inline bool operator<=(const RefPtr& src) const noexcept;
-
- /// See operator<().
- inline bool operator>(const RefPtr& src) const noexcept;
-
- /// See operator<().
- inline bool operator>=(const RefPtr& src) const noexcept;
-
-private:
- T_CppObject* pCppObject_;
-};
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-// RefPtr<>::operator->() comes first here since it's used by other methods.
-// If it would come after them it wouldn't be inlined.
-
-template <class T_CppObject>
-inline T_CppObject* RefPtr<T_CppObject>::operator->() const noexcept
-{
- return pCppObject_;
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>::RefPtr() noexcept : pCppObject_(nullptr)
-{
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>::~RefPtr() noexcept
-{
- if (pCppObject_)
- pCppObject_->unreference(); // This could cause pCppObject to be deleted.
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>::RefPtr(T_CppObject* pCppObject) noexcept : pCppObject_(pCppObject)
-{
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>::RefPtr(const RefPtr& src) noexcept : pCppObject_(src.pCppObject_)
-{
- if (pCppObject_)
- pCppObject_->reference();
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>::RefPtr(RefPtr&& src) noexcept : pCppObject_(src.pCppObject_)
-{
- src.pCppObject_ = nullptr;
-}
-
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>::RefPtr(RefPtr<T_CastFrom>&& src) noexcept : pCppObject_(src.release())
-{
-}
+using RefPtr = std::shared_ptr<T_CppObject>;
-// The templated ctor allows copy construction from any object that's
-// castable. Thus, it does downcasts:
-// base_ref = derived_ref
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>::RefPtr(const RefPtr<T_CastFrom>& src) noexcept :
- // A different RefPtr<> will not allow us access to pCppObject_. We need
- // to add a get_underlying() for this, but that would encourage incorrect
- // use, so we use the less well-known operator->() accessor:
- pCppObject_(src.operator->())
-{
- if (pCppObject_)
- pCppObject_->reference();
-}
-
-template <class T_CppObject>
-inline void
-RefPtr<T_CppObject>::swap(RefPtr& other) noexcept
-{
- T_CppObject* const temp = pCppObject_;
- pCppObject_ = other.pCppObject_;
- other.pCppObject_ = temp;
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>&
-RefPtr<T_CppObject>::operator=(const RefPtr& src) noexcept
-{
- // In case you haven't seen the swap() technique to implement copy
- // assignment before, here's what it does:
- //
- // 1) Create a temporary RefPtr<> instance via the copy ctor, thereby
- // increasing the reference count of the source object.
- //
- // 2) Swap the internal object pointers of *this and the temporary
- // RefPtr<>. After this step, *this already contains the new pointer,
- // and the old pointer is now managed by temp.
- //
- // 3) The destructor of temp is executed, thereby unreferencing the
- // old object pointer.
- //
- // This technique is described in Herb Sutter's "Exceptional C++", and
- // has a number of advantages over conventional approaches:
- //
- // - Code reuse by calling the copy ctor.
- // - Strong exception safety for free.
- // - Self assignment is handled implicitely.
- // - Simplicity.
- // - It just works and is hard to get wrong; i.e. you can use it without
- // even thinking about it to implement copy assignment whereever the
- // object data is managed indirectly via a pointer, which is very common.
-
- RefPtr<T_CppObject> temp(src);
- this->swap(temp);
- return *this;
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>&
-RefPtr<T_CppObject>::operator=(RefPtr&& src) noexcept
-{
- RefPtr<T_CppObject> temp(std::move(src));
- this->swap(temp);
- src.pCppObject_ = nullptr;
-
- return *this;
-}
-
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>&
-RefPtr<T_CppObject>::operator=(RefPtr<T_CastFrom>&& src) noexcept
-{
- if (pCppObject_)
- pCppObject_->unreference();
- pCppObject_ = src.release();
-
- return *this;
-}
-
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>&
-RefPtr<T_CppObject>::operator=(const RefPtr<T_CastFrom>& src) noexcept
-{
- RefPtr<T_CppObject> temp(src);
- this->swap(temp);
- return *this;
-}
-
-template <class T_CppObject>
-inline bool
-RefPtr<T_CppObject>::operator==(const RefPtr& src) const noexcept
-{
- return (pCppObject_ == src.pCppObject_);
-}
-
-template <class T_CppObject>
-inline bool
-RefPtr<T_CppObject>::operator!=(const RefPtr& src) const noexcept
-{
- return (pCppObject_ != src.pCppObject_);
-}
-
-template <class T_CppObject>
-inline T_CppObject* RefPtr<T_CppObject>::get() const noexcept
-{
- return pCppObject_;
-}
-
-template <class T_CppObject>
-inline RefPtr<T_CppObject>::operator bool() const noexcept
-{
- return (pCppObject_ != nullptr);
-}
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
-template <class T_CppObject>
-inline void
-RefPtr<T_CppObject>::clear() noexcept
-{
- reset();
-}
-#endif // GLIBMM_DISABLE_DEPRECATED
-
-template <class T_CppObject>
-inline void
-RefPtr<T_CppObject>::reset() noexcept
-{
- RefPtr<T_CppObject> temp; // swap with an empty RefPtr<> to clear *this
- this->swap(temp);
-}
-
-template <class T_CppObject>
-inline T_CppObject*
-RefPtr<T_CppObject>::release() noexcept
-{
- T_CppObject* tmp = pCppObject_;
- pCppObject_ = nullptr;
- return tmp;
-}
-
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>
-RefPtr<T_CppObject>::cast_dynamic(const RefPtr<T_CastFrom>& src) noexcept
-{
- T_CppObject* const pCppObject = dynamic_cast<T_CppObject*>(src.operator->());
-
- if (pCppObject)
- pCppObject->reference();
-
- return RefPtr<T_CppObject>(pCppObject);
-}
-
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>
-RefPtr<T_CppObject>::cast_static(const RefPtr<T_CastFrom>& src) noexcept
-{
- T_CppObject* const pCppObject = static_cast<T_CppObject*>(src.operator->());
-
- if (pCppObject)
- pCppObject->reference();
-
- return RefPtr<T_CppObject>(pCppObject);
-}
-
-template <class T_CppObject>
-template <class T_CastFrom>
-inline RefPtr<T_CppObject>
-RefPtr<T_CppObject>::cast_const(const RefPtr<T_CastFrom>& src) noexcept
-{
- T_CppObject* const pCppObject = const_cast<T_CppObject*>(src.operator->());
-
- if (pCppObject)
- pCppObject->reference();
-
- return RefPtr<T_CppObject>(pCppObject);
-}
-
-template <class T_CppObject>
-inline bool
-RefPtr<T_CppObject>::operator<(const RefPtr& src) const noexcept
-{
- return (pCppObject_ < src.pCppObject_);
-}
-
-template <class T_CppObject>
-inline bool
-RefPtr<T_CppObject>::operator<=(const RefPtr& src) const noexcept
-{
- return (pCppObject_ <= src.pCppObject_);
-}
-
-template <class T_CppObject>
-inline bool
-RefPtr<T_CppObject>::operator>(const RefPtr& src) const noexcept
-{
- return (pCppObject_ > src.pCppObject_);
-}
-
-template <class T_CppObject>
-inline bool
-RefPtr<T_CppObject>::operator>=(const RefPtr& src) const noexcept
+/* This would not be useful,
+ * because application code should not new these objects anyway.
+ * And it is not useful inside glibmm or gtkmm code because
+ * the constructors are protected, so can't be called from this utilility
+ * function.
+ *
+template <class T_CppObject, class... T_Arg>
+RefPtr<T_CppObject>
+make_refptr(T_Arg... arg)
{
- return (pCppObject_ >= src.pCppObject_);
+ return RefPtr<T_CppObject>(new T_CppObject(arg...));
}
+*/
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-/** @relates Glib::RefPtr */
+/** Create a RefPtr<> to an instance of any class that has reference() and
+ * unreference() methods, and whose destructor is noexcept (the default for destructors).
+ *
+ * In gtkmm, that is anything derived from Glib::ObjectBase, such as
+ * Gdk::Pixbuf.
+ *
+ * Normal application code should not need to use this. However, this is necessary
+ * when implementing create() methods for derived Glib::ObjectBase-derived
+ * (not Gtk::Widget-derived) classes, such as derived Gtk::TreeModels.
+ */
template <class T_CppObject>
-inline void
-swap(RefPtr<T_CppObject>& lhs, RefPtr<T_CppObject>& rhs) noexcept
+RefPtr<T_CppObject>
+make_refptr_for_instance(T_CppObject* object)
{
- lhs.swap(rhs);
+ return RefPtr<T_CppObject>(object, &RefPtrDeleter<T_CppObject>);
}
} // namespace Glib
}
sigc::slot_base&
-SignalProxyNormal::connect_(const sigc::slot_base& slot, bool after)
-{
- return connect_impl_(info_->callback, slot, after);
-}
-
-sigc::slot_base&
-SignalProxyNormal::connect_notify_(const sigc::slot_base& slot, bool after)
-{
- return connect_impl_(info_->notify_callback, slot, after);
-}
-
-sigc::slot_base&
-SignalProxyNormal::connect_impl_(GCallback callback, const sigc::slot_base& slot, bool after)
+SignalProxyNormal::connect_impl_(bool notify, const sigc::slot_base& slot, bool after)
{
// create a proxy to hold our connection info
auto 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(), info_->signal_name,
- callback, pConnectionNode, &SignalProxyConnectionNode::destroy_notify_handler,
- static_cast<GConnectFlags>((after) ? G_CONNECT_AFTER : 0));
+ notify ? info_->notify_callback : info_->callback, pConnectionNode,
+ &SignalProxyConnectionNode::destroy_notify_handler,
+ static_cast<GConnectFlags>(after ? G_CONNECT_AFTER : 0));
return pConnectionNode->slot_;
}
try
{
if (sigc::slot_base* const slot = data_to_slot(data))
- (*static_cast<sigc::slot<void>*>(slot))();
+ (*static_cast<sigc::slot<void()>*>(slot))();
}
catch (...)
{
}
}
-// SignalProxyDetailed implementation:
+// SignalProxyDetailedBase implementation:
-SignalProxyDetailed::SignalProxyDetailed(
+SignalProxyDetailedBase::SignalProxyDetailedBase(
Glib::ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name)
: SignalProxyBase(obj),
info_(info),
{
}
-SignalProxyDetailed::~SignalProxyDetailed() noexcept
+SignalProxyDetailedBase::~SignalProxyDetailedBase() noexcept
{
}
sigc::slot_base&
-SignalProxyDetailed::connect_impl_(bool notify, const sigc::slot_base& slot, bool after)
+SignalProxyDetailedBase::connect_impl_(bool notify, const sigc::slot_base& slot, bool after)
{
// create a proxy to hold our connection info
auto pConnectionNode = new SignalProxyConnectionNode(slot, obj_->gobj());
}
sigc::slot_base&
-SignalProxyDetailed::connect_impl_(bool notify, sigc::slot_base&& slot, bool after)
+SignalProxyDetailedBase::connect_impl_(bool notify, sigc::slot_base&& slot, bool after)
{
// create a proxy to hold our connection info
auto pConnectionNode = new SignalProxyConnectionNode(std::move(slot), obj_->gobj());
}
void
-SignalProxyDetailed::emission_stop()
+SignalProxyDetailedBase::emission_stop()
{
g_signal_stop_emission_by_name(obj_->gobj(), detailed_name_.c_str());
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
-// This base class is used by SignalProxyNormal, SignalProxyDetailed and SignalProxyProperty.
+// This base class is used by SignalProxyNormal, SignalProxyDetailedBase and SignalProxyProperty.
class SignalProxyBase
{
public:
ObjectBase* obj_;
private:
- SignalProxyBase& operator=(const SignalProxyBase&); // not implemented
+ SignalProxyBase& operator=(const SignalProxyBase&) = delete;
};
// Shared portion of a Signal without detail
* 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.
+ * For signals with a detailed name (signal_name::detail_name) see SignalProxyDetailedBase.
*/
class SignalProxyNormal : public SignalProxyBase
{
void emission_stop();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // This callback for SignalProxy<void>
+ // This callback for SignalProxy<void()>
// is defined here to avoid code duplication.
static void slot0_void_callback(GObject*, void* data);
#endif
*/
SignalProxyNormal(Glib::ObjectBase* obj, const SignalProxyInfo* info);
- /** Connects a generic signal handler to a signal.
- * This is called by connect() in derived SignalProxy classes.
+ /** 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_(const sigc::slot_base& slot, bool after);
-
- /** Connects a signal handler without a return value to a signal.
- * This is called by connect_notify() in derived SignalProxy classes.
*
- * @param slot The signal handler, which should have a @c void return type,
- * 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.
+ * @newin{2,58}
*/
- sigc::slot_base& connect_notify_(const sigc::slot_base& slot, bool after);
+ sigc::slot_base& connect_impl_(bool notify, const sigc::slot_base& slot, bool after);
/** Connects a signal handler to a signal.
- * @see connect_(const sigc::slot_base& slot, bool after) and
- * connect_notify_(const sigc::slot_base& slot, bool after).
+ * @see connect_impl_(bool notify, const sigc::slot_base& slot, bool after).
*
* @newin{2,48}
*/
private:
const SignalProxyInfo* info_;
- // TODO: We could maybe replace both connect_() and connect_notify_() with this in future, because
- // they don't do anything extra.
- /** This is called by connect_() and connect_notify_().
- */
- sigc::slot_base& connect_impl_(GCallback callback, const sigc::slot_base& slot, bool after);
-
// no copy assignment
- SignalProxyNormal& operator=(const SignalProxyNormal&);
+ SignalProxyNormal& operator=(const SignalProxyNormal&) = delete;
};
/**** Glib::SignalProxy ***************************************************/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+template <class R, class... T>
+class SignalProxy;
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
/** Proxy for signals with any number of arguments.
* Use the connect() or connect_notify() method, with sigc::mem_fun() or sigc::ptr_fun()
* to connect signal handlers to signals.
+ *
+ * This is the primary template. There is a specialization for signal handlers
+ * that return @c void. The specialization has no %connect_notify() method, and
+ * the @a after parameter in its %connect() method has a default value.
*/
template <class R, class... T>
-class SignalProxy : public SignalProxyNormal
+class SignalProxy<R(T...)> : public SignalProxyNormal
{
public:
- using SlotType = sigc::slot<R, T...>;
- using VoidSlotType = sigc::slot<void, T...>;
+ using SlotType = sigc::slot<R(T...)>;
+ using VoidSlotType = sigc::slot<void(T...)>;
SignalProxy(ObjectBase* obj, const SignalProxyInfo* info) : SignalProxyNormal(obj, info) {}
/** Connects a signal handler to a signal.
*
- * For instance, connect( sigc::mem_fun(*this, &TheClass::on_something) );
+ * For instance, connect(sigc::mem_fun(*this, &TheClass::on_something), false);
+ *
+ * For some signal handlers that return a value, it can make a big difference
+ * whether you connect before or after the default signal handler.
+ * Examples:
+ * - Gio::Application::signal_command_line() calls only one signal handler.
+ * A handler connected after the default handler will never be called.
+ * - X event signals, such as Gtk::Widget::signal_button_press_event(), stop
+ * calling signal handlers as soon as a called handler returns <tt>true</tt>.
+ * If the default handler returns <tt>true</tt>, a handler connected after it
+ * will not be called.
*
* @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.
+ * @return A sigc::connection.
*/
- sigc::connection connect(const SlotType& slot, bool after = true)
+ sigc::connection connect(const SlotType& slot, bool after)
{
- return sigc::connection(connect_(slot, after));
+ return sigc::connection(connect_impl_(false, slot, after));
}
/** Connects a signal handler to a signal.
*
* @newin{2,48}
*/
- sigc::connection connect(SlotType&& slot, bool after = true)
+ sigc::connection connect(SlotType&& slot, bool after)
{
return sigc::connection(connect_impl_(false, std::move(slot), after));
}
*
* For instance, connect_notify( sigc::mem_fun(*this, &TheClass::on_something) );
*
- * If the signal requires signal handlers with a @c void return type,
- * the only difference between connect() and connect_notify() is the default
- * value of @a after.
- *
* If the signal requires signal handlers with a return value of type T,
- * connect_notify() binds <tt>return T()</tt> to the connected signal handler.
+ * %connect_notify() binds <tt>return T()</tt> to the connected signal handler.
* For instance, if the return type is @c bool, the following two calls are equivalent.
* @code
- * connect_notify( sigc::mem_fun(*this, &TheClass::on_something) );
- * connect( sigc::bind_return<bool>(sigc::mem_fun(*this, &TheClass::on_something), false), false
- * );
+ * connect_notify(sigc::mem_fun(*this, &TheClass::on_something));
+ * connect(sigc::bind_return<bool>(sigc::mem_fun(*this, &TheClass::on_something), false), false);
* @endcode
*
* @param slot The signal handler, which should have a @c void return type,
* 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.
+ * @return A sigc::connection.
*/
sigc::connection connect_notify(const VoidSlotType& slot, bool after = false)
{
- return sigc::connection(connect_notify_(slot, after));
+ return sigc::connection(connect_impl_(true, slot, after));
}
/** Connects a signal handler without a return value to a signal.
}
};
-/* Templates below has been added to avoid API break, and should not be
- * used in a newly created code. SignalProxy class should be used instead
- * of SignalProxy# class.
+/** Proxy for signals with any number of arguments.
+ * Use the connect() method, with sigc::mem_fun() or sigc::ptr_fun()
+ * to connect signal handlers to signals.
+ *
+ * This is a specialization for signal handlers that return @c void.
*/
-template <typename R>
-using SignalProxy0 = SignalProxy<R>;
-template <typename R, typename T1>
-using SignalProxy1 = SignalProxy<R, T1>;
-template <typename R, typename T1, typename T2>
-using SignalProxy2 = SignalProxy<R, T1, T2>;
-template <typename R, typename T1, typename T2, typename T3>
-using SignalProxy3 = SignalProxy<R, T1, T2, T3>;
-template <typename R, typename T1, typename T2, typename T3, typename T4>
-using SignalProxy4 = SignalProxy<R, T1, T2, T3, T4>;
-template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5>
-using SignalProxy5 = SignalProxy<R, T1, T2, T3, T4, T5>;
-template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-using SignalProxy6 = SignalProxy<R, T1, T2, T3, T4, T5, T6>;
-
-// TODO: When we can break ABI, consider renaming
-// SignalProxyDetailed => SignalProxyDetailedBase
-// SignalProxyDetailedAnyType => SignalProxyDetailed
+template <class... T>
+class SignalProxy<void(T...)> : public SignalProxyNormal
+{
+public:
+ using SlotType = sigc::slot<void(T...)>;
+
+ SignalProxy(ObjectBase* obj, const SignalProxyInfo* info) : SignalProxyNormal(obj, info) {}
+
+ /** Connects a signal handler to a signal.
+ *
+ * For instance, connect( sigc::mem_fun(*this, &TheClass::on_something) );
+ *
+ * By default, the signal handler will be called after the default signal handler.
+ * This is usually fine for signal handlers that don't return a value.
+ *
+ * @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.
+ * @return A sigc::connection.
+ */
+ sigc::connection connect(const SlotType& slot, bool after = true)
+ {
+ return sigc::connection(connect_impl_(false, slot, after));
+ }
+
+ /** Connects a signal handler to a signal.
+ * @see connect(const SlotType& slot, bool after).
+ *
+ * @newin{2,48}
+ */
+ sigc::connection connect(SlotType&& slot, bool after = true)
+ {
+ return sigc::connection(connect_impl_(false, std::move(slot), after));
+ }
+};
// Shared portion of a Signal with detail
/** The SignalProxy provides an API similar to sigc::signal that can be used to
* the template derivatives, which serve as gatekeepers for the
* types allowed on a particular signal.
*/
-class SignalProxyDetailed : public SignalProxyBase
+class SignalProxyDetailedBase : public SignalProxyBase
{
public:
- ~SignalProxyDetailed() noexcept;
+ ~SignalProxyDetailedBase() noexcept;
/// Stops the current signal emission (not in libsigc++)
void emission_stop();
* and the C callbacks that should be called by glib.
* @param detail_name The detail name, if any.
*/
- SignalProxyDetailed(
+ SignalProxyDetailedBase(
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 SignalProxyDetailedAnyType classes.
+ * This is called by connect() and connect_notify() in derived SignalProxyDetailed 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().
const Glib::ustring detailed_name_; // signal_name[::detail_name]
// no copy assignment
- SignalProxyDetailed& operator=(const SignalProxyDetailed&);
+ SignalProxyDetailedBase& operator=(const SignalProxyDetailedBase&) = delete;
};
+/**** Glib::SignalProxyDetailed **********************************************/
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+template <class R, class... T>
+class SignalProxyDetailed;
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
/** Proxy for signals with any number of arguments 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.
+ *
+ * This is the primary template. There is a specialization for signal handlers
+ * that return @c void. The specialization has no %connect_notify() method, and
+ * the @a after parameter in its %connect() method has a default value.
*/
template <class R, class... T>
-class SignalProxyDetailedAnyType : public SignalProxyDetailed
+class SignalProxyDetailed<R(T...)> : public SignalProxyDetailedBase
{
public:
- using SlotType = sigc::slot<R, T...>;
- using VoidSlotType = sigc::slot<void, T...>;
+ using SlotType = sigc::slot<R(T...)>;
+ using VoidSlotType = sigc::slot<void(T...)>;
- SignalProxyDetailedAnyType(
+ SignalProxyDetailed(
ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name)
- : SignalProxyDetailed(obj, info, detail_name)
+ : SignalProxyDetailedBase(obj, info, detail_name)
{
}
/** Connects a signal handler to a signal.
*
- * For instance, connect( sigc::mem_fun(*this, &TheClass::on_something) );
+ * For instance, connect(sigc::mem_fun(*this, &TheClass::on_something), false);
+ *
+ * For some signal handlers that return a value, it can make a big difference
+ * whether you connect before or after the default signal handler.
+ * Examples:
+ * - Gio::Application::signal_command_line() calls only one signal handler.
+ * A handler connected after the default handler will never be called.
+ * - X event signals, such as Gtk::Widget::signal_button_press_event(), stop
+ * calling signal handlers as soon as a called handler returns <tt>true</tt>.
+ * If the default handler returns <tt>true</tt>, a handler connected after it
+ * will not be called.
*
* @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.
+ * @return A sigc::connection.
*/
- sigc::connection connect(const SlotType& slot, bool after = true)
+ sigc::connection connect(const SlotType& slot, bool after)
{
return sigc::connection(connect_impl_(false, slot, after));
}
*
* @newin{2,48}
*/
- sigc::connection connect(SlotType&& slot, bool after = true)
+ sigc::connection connect(SlotType&& slot, bool after)
{
return sigc::connection(connect_impl_(false, std::move(slot), after));
}
*
* For instance, connect_notify( sigc::mem_fun(*this, &TheClass::on_something) );
*
- * If the signal requires signal handlers with a @c void return type,
- * the only difference between connect() and connect_notify() is the default
- * value of @a after.
- *
* If the signal requires signal handlers with a return value of type T,
- * connect_notify() binds <tt>return T()</tt> to the connected signal handler.
+ * %connect_notify() binds <tt>return T()</tt> to the connected signal handler.
* For instance, if the return type is @c bool, the following two calls are equivalent.
* @code
- * connect_notify( sigc::mem_fun(*this, &TheClass::on_something) );
- * connect( sigc::bind_return<bool>(sigc::mem_fun(*this, &TheClass::on_something), false), false
- * );
+ * connect_notify(sigc::mem_fun(*this, &TheClass::on_something));
+ * connect(sigc::bind_return<bool>(sigc::mem_fun(*this, &TheClass::on_something), false), false);
* @endcode
*
* @param slot The signal handler, which should have a @c void return type,
* 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.
+ * @return A sigc::connection.
*/
sigc::connection connect_notify(const VoidSlotType& slot, bool after = false)
{
}
};
-/* Templates below has been added to avoid API break, and should not be
- * used in a newly created code. SignalProxyDetailedAnyType class should be
- * used instead of SignalProxyDetailed# class.
+/** Proxy for signals with any number of arguments and possibly a detailed name.
+ * Use the connect() method, with sigc::mem_fun() or sigc::ptr_fun()
+ * to connect signal handlers to signals.
+ *
+ * This is a specialization for signal handlers that return @c void.
*/
-template <typename R>
-using SignalProxyDetailed0 = SignalProxyDetailedAnyType<R>;
-template <typename R, typename T1>
-using SignalProxyDetailed1 = SignalProxyDetailedAnyType<R, T1>;
-template <typename R, typename T1, typename T2>
-using SignalProxyDetailed2 = SignalProxyDetailedAnyType<R, T1, T2>;
-template <typename R, typename T1, typename T2, typename T3>
-using SignalProxyDetailed3 = SignalProxyDetailedAnyType<R, T1, T2, T3>;
-template <typename R, typename T1, typename T2, typename T3, typename T4>
-using SignalProxyDetailed4 = SignalProxyDetailedAnyType<R, T1, T2, T3, T4>;
-template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5>
-using SignalProxyDetailed5 = SignalProxyDetailedAnyType<R, T1, T2, T3, T4, T5>;
-template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-using SignalProxyDetailed6 = SignalProxyDetailedAnyType<R, T1, T2, T3, T4, T5, T6>;
+template <class... T>
+class SignalProxyDetailed<void(T...)> : public SignalProxyDetailedBase
+{
+public:
+ using SlotType = sigc::slot<void(T...)>;
+
+ SignalProxyDetailed(
+ ObjectBase* obj, const SignalProxyInfo* info, const Glib::ustring& detail_name)
+ : SignalProxyDetailedBase(obj, info, detail_name)
+ {
+ }
+
+ /** Connects a signal handler to a signal.
+ *
+ * For instance, connect( sigc::mem_fun(*this, &TheClass::on_something) );
+ *
+ * By default, the signal handler will be called after the default signal handler.
+ * This is usually fine for signal handlers that don't return a value.
+ *
+ * @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.
+ * @return A sigc::connection.
+ */
+ sigc::connection connect(const SlotType& slot, bool after = true)
+ {
+ return sigc::connection(connect_impl_(false, slot, after));
+ }
+
+ /** Connects a signal handler to a signal.
+ * @see connect(const SlotType& slot, bool after).
+ *
+ * @newin{2,48}
+ */
+ sigc::connection connect(SlotType&& slot, bool after = true)
+ {
+ return sigc::connection(connect_impl_(false, std::move(slot), after));
+ }
+};
} // namespace Glib
// notify is a message coming up from the slot to be passed back to Gtk+
// disconnect is a message coming up from the Gtk+ to be passed down to SigC++
// static
-void*
-SignalProxyConnectionNode::notify(void* data)
+void
+SignalProxyConnectionNode::notify(sigc::notifiable* data)
{
// notification from libsigc++.
SignalProxyConnectionNode* conn = static_cast<SignalProxyConnectionNode*>(data);
g_signal_handler_disconnect(o, connection_id);
}
}
-
- return nullptr; // apparently unused in libsigc++
}
// static
* It lives between the layer of Gtk+ and libsigc++.
* It is very much an internal class.
*/
-class SignalProxyConnectionNode
+class SignalProxyConnectionNode : public sigc::notifiable
{
public:
/** @param slot The signal handler for the glib signal.
* This callback is registered in the slot.
* @param data The SignalProxyConnectionNode object (@p this).
*/
- static void* notify(void* data);
+ static void notify(sigc::notifiable* data);
/** Callback that is executed when the glib closure is destroyed.
* @param data The SignalProxyConnectionNode object (@p this).
+++ /dev/null
-#ifndef _GLIBMM_SLISTHANDLE_H
-#define _GLIBMM_SLISTHANDLE_H
-
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmmconfig.h>
-#include <glibmm/containerhandle_shared.h>
-#include <glib.h>
-
-namespace Glib
-{
-
-namespace Container_Helpers
-{
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/* Create and fill a GSList as efficient as possible.
- * This requires bidirectional iterators.
- */
-template <class Bi, class Tr>
-GSList*
-create_slist(Bi pbegin, Bi pend, Tr)
-{
- GSList* head = nullptr;
-
- while (pend != pbegin)
- {
- // Use & to force a warning if the iterator returns a temporary object.
- const void* const item = Tr::to_c_type(*&*--pend);
- head = g_slist_prepend(head, const_cast<void*>(item));
- }
-
- return head;
-}
-
-/* Create a GSList from a 0-terminated input sequence.
- * Build it in reverse order and reverse the whole list afterwards,
- * because appending to the list would be horribly inefficient.
- */
-template <class For, class Tr>
-GSList*
-create_slist(For pbegin, Tr)
-{
- GSList* head = nullptr;
-
- while (*pbegin)
- {
- // Use & to force a warning if the iterator returns a temporary object.
- const void* const item = Tr::to_c_type(*&*pbegin);
- head = g_slist_prepend(head, const_cast<void*>(item));
- ++pbegin;
- }
-
- return g_slist_reverse(head);
-}
-
-/* Convert from any container that supports bidirectional iterators.
- */
-template <class Tr, class Cont>
-struct SListSourceTraits
-{
- static GSList* get_data(const Cont& cont)
- {
- return Glib::Container_Helpers::create_slist(cont.begin(), cont.end(), Tr());
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-/* Convert from a 0-terminated array. The Cont
- * argument must be a pointer to the first element.
- */
-template <class Tr, class Cont>
-struct SListSourceTraits<Tr, Cont*>
-{
- static GSList* get_data(const Cont* array)
- {
- return (array) ? Glib::Container_Helpers::create_slist(array, Tr()) : nullptr;
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-template <class Tr, class Cont>
-struct SListSourceTraits<Tr, const Cont*> : SListSourceTraits<Tr, Cont*>
-{
-};
-
-/* Convert from a 0-terminated array. The Cont argument must be a pointer
- * to the first element. For consistency, the array must be 0-terminated,
- * even though the array size is known at compile time.
- */
-template <class Tr, class Cont, std::size_t N>
-struct SListSourceTraits<Tr, Cont[N]>
-{
- static GSList* get_data(const Cont* array)
- {
- return Glib::Container_Helpers::create_slist(array, array + (N - 1), Tr());
- }
-
- static const Glib::OwnershipType initial_ownership = Glib::OWNERSHIP_SHALLOW;
-};
-
-template <class Tr, class Cont, std::size_t N>
-struct SListSourceTraits<Tr, const Cont[N]> : SListSourceTraits<Tr, Cont[N]>
-{
-};
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-/**
- * @ingroup ContHelpers
- */
-template <class Tr>
-class SListHandleIterator
-{
-public:
- using CppType = typename Tr::CppType;
- using CType = typename Tr::CType;
-
- using iterator_category = std::forward_iterator_tag;
- using value_type = CppType;
- using difference_type = std::ptrdiff_t;
- using reference = value_type;
- using pointer = void;
-
- explicit inline SListHandleIterator(const GSList* node);
-
- inline value_type operator*() const;
- inline SListHandleIterator<Tr>& operator++();
- inline const SListHandleIterator<Tr> operator++(int);
-
- inline bool operator==(const SListHandleIterator<Tr>& rhs) const;
- inline bool operator!=(const SListHandleIterator<Tr>& rhs) const;
-
-private:
- const GSList* node_;
-};
-
-} // namespace Container_Helpers
-
-// TODO: Remove this when we can break glibmm API.
-/** 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.
- *
- * However, this is not used in new API. We now prefer to just use std::vector,
- * which is less flexibile, but makes the API clearer.
- * @ingroup ContHandles
- */
-template <class T, class Tr = Glib::Container_Helpers::TypeTraits<T>>
-class SListHandle
-{
-public:
- using CppType = typename Tr::CppType;
- using CType = typename Tr::CType;
-
- using value_type = CppType;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- using const_iterator = Glib::Container_Helpers::SListHandleIterator<Tr>;
- using iterator = Glib::Container_Helpers::SListHandleIterator<Tr>;
-
- template <class Cont>
- inline SListHandle(const Cont& container);
-
- // Take over ownership of a GSList created by GTK+ functions.
- inline SListHandle(GSList* glist, Glib::OwnershipType ownership);
-
- // Copying clears the ownership flag of the source handle.
- inline SListHandle(const SListHandle<T, Tr>& other);
-
- ~SListHandle() noexcept;
-
- inline const_iterator begin() const;
- inline const_iterator end() const;
-
- template <class U>
- inline operator std::vector<U>() const;
- template <class U>
- inline operator std::deque<U>() const;
- template <class U>
- inline operator std::list<U>() const;
-
- template <class Cont>
- inline void assign_to(Cont& container) const;
- template <class Out>
- inline void copy(Out pdest) const;
-
- inline GSList* data() const;
- inline std::size_t size() const;
- inline bool empty() const;
-
-private:
- GSList* pslist_;
- mutable Glib::OwnershipType ownership_;
-
- // No copy assignment.
- SListHandle<T, Tr>& operator=(const SListHandle<T, Tr>&);
-};
-
-/***************************************************************************/
-/* Inline implementation */
-/***************************************************************************/
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-namespace Container_Helpers
-{
-
-/**** Glib::Container_Helpers::SListHandleIterator<> ***********************/
-
-template <class Tr>
-inline SListHandleIterator<Tr>::SListHandleIterator(const GSList* node) : node_(node)
-{
-}
-
-template <class Tr>
-inline typename SListHandleIterator<Tr>::value_type SListHandleIterator<Tr>::operator*() const
-{
- return Tr::to_cpp_type(static_cast<typename Tr::CTypeNonConst>(node_->data));
-}
-
-template <class Tr>
-inline SListHandleIterator<Tr>& SListHandleIterator<Tr>::operator++()
-{
- node_ = node_->next;
- return *this;
-}
-
-template <class Tr>
-inline const SListHandleIterator<Tr> SListHandleIterator<Tr>::operator++(int)
-{
- const SListHandleIterator<Tr> tmp(*this);
- node_ = node_->next;
- return tmp;
-}
-
-template <class Tr>
-inline bool
-SListHandleIterator<Tr>::operator==(const SListHandleIterator<Tr>& rhs) const
-{
- return (node_ == rhs.node_);
-}
-
-template <class Tr>
-inline bool
-SListHandleIterator<Tr>::operator!=(const SListHandleIterator<Tr>& rhs) const
-{
- return (node_ != rhs.node_);
-}
-
-} // namespace Container_Helpers
-
-/**** Glib::SListHandle<> **************************************************/
-
-template <class T, class Tr>
-template <class Cont>
-inline SListHandle<T, Tr>::SListHandle(const Cont& container)
-: pslist_(Glib::Container_Helpers::SListSourceTraits<Tr, Cont>::get_data(container)),
- ownership_(Glib::Container_Helpers::SListSourceTraits<Tr, Cont>::initial_ownership)
-{
-}
-
-template <class T, class Tr>
-inline SListHandle<T, Tr>::SListHandle(GSList* gslist, Glib::OwnershipType ownership)
-: pslist_(gslist), ownership_(ownership)
-{
-}
-
-template <class T, class Tr>
-inline SListHandle<T, Tr>::SListHandle(const SListHandle<T, Tr>& other)
-: pslist_(other.pslist_), ownership_(other.ownership_)
-{
- other.ownership_ = Glib::OWNERSHIP_NONE;
-}
-
-template <class T, class Tr>
-SListHandle<T, Tr>::~SListHandle() noexcept
-{
- if (ownership_ != Glib::OWNERSHIP_NONE)
- {
- if (ownership_ != Glib::OWNERSHIP_SHALLOW)
- {
- // Deep ownership: release each container element.
- for (GSList* node = pslist_; node != nullptr; node = node->next)
- Tr::release_c_type(static_cast<typename Tr::CTypeNonConst>(node->data));
- }
- g_slist_free(pslist_);
- }
-}
-
-template <class T, class Tr>
-inline typename SListHandle<T, Tr>::const_iterator
-SListHandle<T, Tr>::begin() const
-{
- return Glib::Container_Helpers::SListHandleIterator<Tr>(pslist_);
-}
-
-template <class T, class Tr>
-inline typename SListHandle<T, Tr>::const_iterator
-SListHandle<T, Tr>::end() const
-{
- return Glib::Container_Helpers::SListHandleIterator<Tr>(nullptr);
-}
-
-template <class T, class Tr>
-template <class U>
-inline SListHandle<T, Tr>::operator std::vector<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::vector<U>(this->begin(), this->end());
-#else
- std::vector<U> temp;
- temp.reserve(this->size());
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class U>
-inline SListHandle<T, Tr>::operator std::deque<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::deque<U>(this->begin(), this->end());
-#else
- std::deque<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class U>
-inline SListHandle<T, Tr>::operator std::list<U>() const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- return std::list<U>(this->begin(), this->end());
-#else
- std::list<U> temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- return temp;
-#endif
-}
-
-template <class T, class Tr>
-template <class Cont>
-inline void
-SListHandle<T, Tr>::assign_to(Cont& container) const
-{
-#ifdef GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS
- container.assign(this->begin(), this->end());
-#else
- Cont temp;
- Glib::Container_Helpers::fill_container(temp, this->begin(), this->end());
- container.swap(temp);
-#endif
-}
-
-template <class T, class Tr>
-template <class Out>
-inline void
-SListHandle<T, Tr>::copy(Out pdest) const
-{
- std::copy(this->begin(), this->end(), pdest);
-}
-
-template <class T, class Tr>
-inline GSList*
-SListHandle<T, Tr>::data() const
-{
- return pslist_;
-}
-
-template <class T, class Tr>
-inline std::size_t
-SListHandle<T, Tr>::size() const
-{
- return g_slist_length(pslist_);
-}
-
-template <class T, class Tr>
-inline bool
-SListHandle<T, Tr>::empty() const
-{
- return (pslist_ == nullptr);
-}
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-} // namespace Glib
-
-#endif /* _GLIBMM_SLISTHANDLE_H */
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmm/streamiochannel.h>
-#include <glibmm/main.h> //For Source
-#include <glib.h>
-#include <fstream>
-#include <iostream>
-
-namespace Glib
-{
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
-
-// static
-Glib::RefPtr<StreamIOChannel>
-StreamIOChannel::create(std::istream& stream)
-{
- return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(&stream, nullptr));
-}
-
-// static
-Glib::RefPtr<StreamIOChannel>
-StreamIOChannel::create(std::ostream& stream)
-{
- return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(nullptr, &stream));
-}
-
-// static
-Glib::RefPtr<StreamIOChannel>
-StreamIOChannel::create(std::iostream& stream)
-{
- return Glib::RefPtr<StreamIOChannel>(new StreamIOChannel(&stream, &stream));
-}
-
-StreamIOChannel::StreamIOChannel(std::istream* stream_in, std::ostream* stream_out)
-: stream_in_(stream_in), stream_out_(stream_out)
-{
- get_flags_vfunc(); // initialize GIOChannel flag bits
-}
-
-StreamIOChannel::~StreamIOChannel() noexcept
-{
-}
-
-IOStatus
-StreamIOChannel::read_vfunc(char* buf, gsize count, gsize& bytes_read)
-{
- g_return_val_if_fail(stream_in_ != nullptr, IO_STATUS_ERROR);
-
- stream_in_->clear();
- stream_in_->read(buf, count);
- bytes_read = stream_in_->gcount();
-
- if (stream_in_->eof())
- return IO_STATUS_EOF;
-
- if (stream_in_->fail())
- {
- throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Reading from stream failed");
- }
-
- return IO_STATUS_NORMAL;
-}
-
-IOStatus
-StreamIOChannel::write_vfunc(const char* buf, gsize count, gsize& bytes_written)
-{
- g_return_val_if_fail(stream_out_ != nullptr, IO_STATUS_ERROR);
-
- bytes_written = 0;
-
- stream_out_->clear();
- stream_out_->write(buf, count);
-
- if (stream_out_->fail())
- {
- throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Writing to stream failed");
- }
-
- bytes_written = count; // all or nothing ;)
-
- return IO_STATUS_NORMAL;
-}
-
-IOStatus
-StreamIOChannel::seek_vfunc(gint64 offset, SeekType type)
-{
- std::ios::seekdir direction = std::ios::beg;
-
- switch (type)
- {
- case SEEK_TYPE_SET:
- direction = std::ios::beg;
- break;
- case SEEK_TYPE_CUR:
- direction = std::ios::cur;
- break;
- case SEEK_TYPE_END:
- direction = std::ios::end;
- break;
- }
-
- bool failed = false;
-
- if (stream_in_)
- {
- stream_in_->clear();
- stream_in_->seekg(offset, direction);
- failed = stream_in_->fail();
- }
- if (stream_out_)
- {
- stream_out_->clear();
- stream_out_->seekp(offset, direction);
- failed = (failed || stream_out_->fail());
- }
-
- if (failed)
- {
- throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Seeking into stream failed");
- }
-
- return Glib::IO_STATUS_NORMAL;
-}
-
-IOStatus
-StreamIOChannel::close_vfunc()
-{
- bool failed = false;
-
- if (std::fstream* const fstream = dynamic_cast<std::fstream*>(stream_in_))
- {
- fstream->clear();
- fstream->close();
- failed = fstream->fail();
- }
- else if (std::ifstream* const ifstream = dynamic_cast<std::ifstream*>(stream_in_))
- {
- ifstream->clear();
- ifstream->close();
- failed = ifstream->fail();
- }
- else if (std::ofstream* const ofstream = dynamic_cast<std::ofstream*>(stream_out_))
- {
- ofstream->clear();
- ofstream->close();
- failed = ofstream->fail();
- }
- else
- {
- throw Glib::Error(
- G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Attempt to close non-file stream");
- }
-
- if (failed)
- {
- throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Failed to close stream");
- }
-
- return IO_STATUS_NORMAL;
-}
-
-IOStatus StreamIOChannel::set_flags_vfunc(IOFlags)
-{
- return IO_STATUS_NORMAL;
-}
-
-IOFlags
-StreamIOChannel::get_flags_vfunc()
-{
- gobj()->is_seekable = 1;
- gobj()->is_readable = (stream_in_ != nullptr);
- gobj()->is_writeable = (stream_out_ != nullptr);
-
- IOFlags flags = IO_FLAG_IS_SEEKABLE;
-
- if (stream_in_)
- flags |= IO_FLAG_IS_READABLE;
- if (stream_out_)
- flags |= IO_FLAG_IS_WRITEABLE;
-
- return flags;
-}
-
-Glib::RefPtr<Glib::Source> StreamIOChannel::create_watch_vfunc(IOCondition)
-{
- g_warning("Glib::StreamIOChannel::create_watch_vfunc() not implemented");
- return Glib::RefPtr<Glib::Source>();
-}
-
-#endif // GLIBMM_DISABLE_DEPRECATED
-
-} // namespace Glib
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _GLIBMM_STREAMIOCHANNEL_H
-#define _GLIBMM_STREAMIOCHANNEL_H
-
-#include <glibmmconfig.h>
-#include <glibmm/iochannel.h>
-#include <iosfwd>
-
-namespace Glib
-{
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
-
-/** @deprecated This whole class was deprecated in glibmm 2.2 - See the Glib::IOChannel
- * documentation for an explanation.
- */
-class StreamIOChannel : public Glib::IOChannel
-{
-public:
- ~StreamIOChannel() noexcept override;
-
- static Glib::RefPtr<StreamIOChannel> create(std::istream& stream);
- static Glib::RefPtr<StreamIOChannel> create(std::ostream& stream);
- static Glib::RefPtr<StreamIOChannel> create(std::iostream& stream);
-
-protected:
- std::istream* stream_in_;
- std::ostream* stream_out_;
-
- StreamIOChannel(std::istream* stream_in, std::ostream* stream_out);
-
- IOStatus read_vfunc(char* buf, gsize count, gsize& bytes_read) override;
- IOStatus write_vfunc(const char* buf, gsize count, gsize& bytes_written) override;
- IOStatus seek_vfunc(gint64 offset, SeekType type) override;
- IOStatus close_vfunc() override;
- IOStatus set_flags_vfunc(IOFlags flags) override;
- IOFlags get_flags_vfunc() override;
- Glib::RefPtr<Glib::Source> create_watch_vfunc(IOCondition cond) override;
-};
-
-#endif //#GLIBMM_DISABLE_DEPRECATED
-
-} // namespace Glib
-
-#endif /* _GLIBMM_STREAMIOCHANNEL_H */
*
* @param str The string to convert to a numeric value.
* @param start_index The index of the first character that should be used in the conversion.
- * @param[out] end_index The index of the character after the last character used in the conversion.
+ * @retval end_index The index of the character after the last character used in the conversion.
* @return The <tt>double</tt> value.
* @throw std::out_of_range Thrown if @a start_index is out of range.
* @throw std::overflow_error Thrown if the correct value would cause overflow.
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmmconfig.h>
-#ifndef GLIBMM_DISABLE_DEPRECATED
-
-#include <glibmm/threadpool.h>
-#include <glibmm/exceptionhandler.h>
-#include <glibmm/threads.h>
-#include <glib.h>
-#include <list>
-
-namespace Glib
-{
-
-// internal
-class ThreadPool::SlotList
-{
-public:
- SlotList();
- ~SlotList() noexcept;
-
- // noncopyable
- SlotList(const ThreadPool::SlotList&) = delete;
- ThreadPool::SlotList& operator=(const ThreadPool::SlotList&) = delete;
-
- sigc::slot<void>* push(const sigc::slot<void>& slot);
- sigc::slot<void> pop(sigc::slot<void>* slot_ptr);
-
- void lock_and_unlock();
-
-private:
- Glib::Threads::Mutex mutex_;
- std::list<sigc::slot<void>> list_;
-};
-
-ThreadPool::SlotList::SlotList()
-{
-}
-
-ThreadPool::SlotList::~SlotList() noexcept
-{
-}
-
-sigc::slot<void>*
-ThreadPool::SlotList::push(const sigc::slot<void>& slot)
-{
- Threads::Mutex::Lock lock(mutex_);
-
- list_.emplace_back(slot);
- return &list_.back();
-}
-
-sigc::slot<void>
-ThreadPool::SlotList::pop(sigc::slot<void>* slot_ptr)
-{
- sigc::slot<void> slot;
-
- {
- Threads::Mutex::Lock lock(mutex_);
-
- std::list<sigc::slot<void>>::iterator pslot = list_.begin();
- while (pslot != list_.end() && slot_ptr != &*pslot)
- ++pslot;
-
- if (pslot != list_.end())
- {
- slot = *pslot;
- list_.erase(pslot);
- }
- }
-
- return slot;
-}
-
-void
-ThreadPool::SlotList::lock_and_unlock()
-{
- mutex_.lock();
- mutex_.unlock();
-}
-
-} // namespace Glib
-
-namespace
-{
-
-static void
-call_thread_entry_slot(void* data, void* user_data)
-{
- try
- {
- Glib::ThreadPool::SlotList* const slot_list =
- static_cast<Glib::ThreadPool::SlotList*>(user_data);
-
- sigc::slot<void> slot(slot_list->pop(static_cast<sigc::slot<void>*>(data)));
-
- slot();
- }
- catch (Glib::Threads::Thread::Exit&)
- {
- // Just exit from the thread. The Thread::Exit exception
- // is our sane C++ replacement of g_thread_exit().
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-}
-
-} // anonymous namespace
-
-namespace Glib
-{
-
-ThreadPool::ThreadPool(int max_threads, bool exclusive)
-: gobject_(nullptr), slot_list_(new SlotList())
-{
- GError* error = nullptr;
-
- gobject_ = g_thread_pool_new(&call_thread_entry_slot, slot_list_, max_threads, exclusive, &error);
-
- if (error)
- {
- delete slot_list_;
- slot_list_ = nullptr;
- Glib::Error::throw_exception(error);
- }
-}
-
-ThreadPool::~ThreadPool() noexcept
-{
- if (gobject_)
- g_thread_pool_free(gobject_, 1, 1);
-
- if (slot_list_)
- {
- slot_list_->lock_and_unlock();
- delete slot_list_;
- }
-}
-
-void
-ThreadPool::push(const sigc::slot<void>& slot)
-{
- sigc::slot<void>* const slot_ptr = slot_list_->push(slot);
-
- GError* error = nullptr;
- g_thread_pool_push(gobject_, slot_ptr, &error);
-
- if (error)
- {
- slot_list_->pop(slot_ptr);
- Glib::Error::throw_exception(error);
- }
-}
-
-void
-ThreadPool::set_max_threads(int max_threads)
-{
- GError* error = nullptr;
- g_thread_pool_set_max_threads(gobject_, max_threads, &error);
-
- if (error)
- Glib::Error::throw_exception(error);
-}
-
-int
-ThreadPool::get_max_threads() const
-{
- return g_thread_pool_get_max_threads(gobject_);
-}
-
-unsigned int
-ThreadPool::get_num_threads() const
-{
- return g_thread_pool_get_num_threads(gobject_);
-}
-
-unsigned int
-ThreadPool::unprocessed() const
-{
- return g_thread_pool_unprocessed(gobject_);
-}
-
-bool
-ThreadPool::get_exclusive() const
-{
- g_return_val_if_fail(gobject_ != nullptr, false);
-
- return gobject_->exclusive;
-}
-
-void
-ThreadPool::shutdown(bool immediately)
-{
- if (gobject_)
- {
- g_thread_pool_free(gobject_, immediately, 1);
- gobject_ = nullptr;
- }
-
- if (slot_list_)
- {
- slot_list_->lock_and_unlock();
- delete slot_list_;
- slot_list_ = nullptr;
- }
-}
-
-// static
-void
-ThreadPool::set_max_unused_threads(int max_threads)
-{
- g_thread_pool_set_max_unused_threads(max_threads);
-}
-
-// static
-int
-ThreadPool::get_max_unused_threads()
-{
- return g_thread_pool_get_max_unused_threads();
-}
-
-// static
-unsigned int
-ThreadPool::get_num_unused_threads()
-{
- return g_thread_pool_get_num_unused_threads();
-}
-
-// static
-void
-ThreadPool::stop_unused_threads()
-{
- g_thread_pool_stop_unused_threads();
-}
-
-} // namespace Glib
-
-#endif // GLIBMM_DISABLE_DEPRECATED
+++ /dev/null
-#ifndef _GLIBMM_THREADPOOL_H
-#define _GLIBMM_THREADPOOL_H
-
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmmconfig.h>
-
-#ifndef GLIBMM_DISABLE_DEPRECATED
-
-#include <sigc++/sigc++.h>
-
-extern "C" {
-using GThreadPool = struct _GThreadPool;
-}
-
-namespace Glib
-{
-
-/** @defgroup ThreadPools Thread Pools
- * Pools of threads to execute work concurrently.
- *
- * @deprecated This is deprecated in favor of the standard C++ concurrency API in C++11 and C++14.
- *
- * @{
- */
-
-// TODO: Is std::async() an appropriate replacement to mention for this deprecated API?
-
-/** A pool of threads to execute work concurrently.
- *
- * @deprecated This is deprecated in favor of the standard C++ concurrency API in C++11 and C++14.
- */
-class ThreadPool
-{
-public:
- /** Constructs a new thread pool.
- * Whenever you call ThreadPool::push(), either a new thread is created or an
- * unused one is reused. At most @a max_threads threads are running
- * concurrently for this thread pool. @a max_threads = -1 allows
- * unlimited threads to be created for this thread pool.
- *
- * The parameter @a exclusive determines, whether the thread pool owns all
- * threads exclusive or whether the threads are shared globally. If @a
- * exclusive is <tt>true</tt>, @a max_threads threads are started immediately
- * and they will run exclusively for this thread pool until it is destroyed
- * by ~ThreadPool(). If @a exclusive is <tt>false</tt>, threads are created
- * when needed and shared between all non-exclusive thread pools. This
- * implies that @a max_threads may not be -1 for exclusive thread pools.
- *
- * @param max_threads The maximal number of threads to execute concurrently
- * in the new thread pool, -1 means no limit.
- * @param exclusive Should this thread pool be exclusive?
- * @throw Glib::ThreadError An error can only occur when @a exclusive is
- * set to <tt>true</tt> and not all @a max_threads threads could be created.
- */
- explicit ThreadPool(int max_threads = -1, bool exclusive = false);
- virtual ~ThreadPool() noexcept;
-
- // See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
- // TODO: At the next ABI break, consider changing const sigc::slot<void>& slot
- // to const std::function<void()>& func, if it can be assumed that all supported
- // compilers understand the C++11 template class std::function<>.
- /** Inserts @a slot into the list of tasks to be executed by the pool.
- * When the number of currently running threads is lower than the maximal
- * allowed number of threads, a new thread is started (or reused). Otherwise
- * @a slot stays in the queue until a thread in this pool finishes its
- * previous task and processes @a slot.
- *
- * Because sigc::trackable is not thread-safe, if the slot represents a
- * non-static class method and is created by sigc::mem_fun(), the class concerned
- * should not derive from sigc::trackable. You can use, say, boost::bind() or,
- * in C++11, std::bind() or a C++11 lambda expression instead of sigc::mem_fun().
- *
- * @param slot A new task for the thread pool.
- * @throw Glib::ThreadError An error can only occur when a new thread
- * couldn't be created. In that case @a slot is simply appended to the
- * queue of work to do.
- */
- void push(const sigc::slot<void>& slot);
-
- /** Sets the maximal allowed number of threads for the pool.
- * A value of -1 means that the maximal number of threads is unlimited.
- * Setting @a max_threads to 0 means stopping all work for pool. It is
- * effectively frozen until @a max_threads is set to a non-zero value again.
- *
- * A thread is never terminated while it is still running. Instead the
- * maximal number of threads only has effect for the allocation of new
- * threads in ThreadPool::push(). A new thread is allocated whenever the
- * number of currently running threads in the pool is smaller than the
- * maximal number.
- *
- * @param max_threads A new maximal number of threads for the pool.
- * @throw Glib::ThreadError An error can only occur when a new thread
- * couldn't be created.
- */
- void set_max_threads(int max_threads);
-
- /** Returns the maximal number of threads for the pool.
- * @return The maximal number of threads.
- */
- int get_max_threads() const;
-
- /** Returns the number of threads currently running in the pool.
- * @return The number of threads currently running.
- */
- unsigned int get_num_threads() const;
-
- /** Returns the number of tasks still unprocessed in the pool.
- * @return The number of unprocessed tasks.
- */
- unsigned int unprocessed() const;
-
- /** Returns whether all threads are exclusive to this pool.
- * @return Whether all threads are exclusive to this pool.
- */
- bool get_exclusive() const;
-
- /** Frees all resources allocated for the pool.
- * If @a immediately is <tt>true</tt>, no new task is processed. Otherwise the
- * pool is not freed before the last task is processed. Note however, that no
- * thread of this pool is interrupted while processing a task. Instead at least
- * all still running threads can finish their tasks before the pool is freed.
- *
- * This method does not return before all tasks to be processed (dependent on
- * @a immediately, whether all or only the currently running) are ready.
- * After calling shutdown() the pool must not be used anymore.
- *
- * @param immediately Should the pool shut down immediately?
- */
- void shutdown(bool immediately = false);
-
- /** Sets the maximal number of unused threads to @a max_threads.
- * If @a max_threads is -1, no limit is imposed on the number of unused threads.
- * @param max_threads Maximal number of unused threads.
- */
- static void set_max_unused_threads(int max_threads);
-
- /** Returns the maximal allowed number of unused threads.
- * @return The maximal number of unused threads.
- */
- static int get_max_unused_threads();
-
- /** Returns the number of currently unused threads.
- * @return The number of currently unused threads.
- */
- static unsigned int get_num_unused_threads();
-
- /** Stops all currently unused threads.
- * This does not change the maximal number of unused threads. This function can
- * be used to regularly stop all unused threads e.g. from Glib::signal_timeout().
- */
- static void stop_unused_threads();
-
- GThreadPool* gobj() { return gobject_; }
- const GThreadPool* gobj() const { return gobject_; }
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- class SlotList;
-#endif
-
-private:
- GThreadPool* gobject_;
- SlotList* slot_list_;
-
- ThreadPool(const ThreadPool&);
- ThreadPool& operator=(const ThreadPool&);
-};
-
-/** @} group ThreadPools */
-
-/***************************************************************************/
-/* inline implementation */
-/***************************************************************************/
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/**** Glib::Private ********************************************************/
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-} // namespace Glib
-
-#endif // GLIBMM_DISABLE_DEPRECATED
-
-#endif /* _GLIBMM_THREADPOOL_H */
return (is_valid != 0);
}
+ustring
+ustring::make_valid() const
+{
+ return ustring(g_utf8_make_valid(string_.data(), string_.size()));
+}
+
bool
ustring::is_ascii() const
{
// static
ustring
-ustring::compose_argv(const Glib::ustring& fmt, int argc, const ustring* const* argv)
+ustring::compose_private(const Glib::ustring& fmt, std::initializer_list<const ustring*> const ilist)
{
std::string::size_type result_size = fmt.raw().size();
// Guesstimate the final string size.
- for (int i = 0; i < argc; ++i)
- result_size += argv[i]->raw().size();
+ for (auto const it: ilist)
+ result_size += it->raw().size();
std::string result;
result.reserve(result_size);
else
{
const int index = Ascii::digit_value(stop[1]) - 1;
+ const int size = ilist.size();
- if (index >= 0 && index < argc)
+ if (index >= 0 && index < size)
{
result.append(start, stop - start);
- result += argv[index]->raw();
+ result += (*(ilist.begin() + index))->raw();
start = stop + 2;
}
else
#include <glibmm/unicode.h>
#include <glib.h>
+#include <cstddef> // for std::size_t and optionally std::ptrdiff_t
+#include <initializer_list>
#include <iosfwd>
#include <iterator>
#include <sstream>
#include <string>
-#ifndef GLIBMM_HAVE_STD_ITERATOR_TRAITS
-#include <cstddef> /* for std::ptrdiff_t */
-#endif
namespace Glib
{
* If you're using std::ostringstream to build strings for display in the
* user interface, you must convert the result back to UTF-8 as shown below:
* @code
- * std::locale::global(std::locale("")); // set the global locale to the user's preferred locale
+ * std::locale::global(std::locale("")); // Set the global locale to the user's preferred locale.
+ * // Usually unnecessary here, because Glib::init()
+ * // does it for you.
* std::ostringstream output;
* output << percentage << " % done";
* label->set_text(Glib::locale_to_utf8(output.str()));
/*! Check whether the string is valid UTF-8. */
bool validate(const_iterator& first_invalid) const;
+ /*! Return a copy that is a valid UTF-8 string replacing invalid bytes in the
+ * original with Unicode replacement character (U+FFFD).
+ * If the string is valid - return it's copy.
+ */
+ ustring make_valid() const;
+
/*! Check whether the string is plain 7-bit ASCII. @par
* Unlike any other ustring method, is_ascii() is safe to use on invalid
* UTF-8 strings. If the string isn't valid UTF-8, it cannot be valid
bool is_ascii() const;
/*! "Normalize" the %Unicode character representation of the string. */
- ustring normalize(NormalizeMode mode = NORMALIZE_DEFAULT_COMPOSE) const;
+ ustring normalize(NormalizeMode mode = NormalizeMode::DEFAULT_COMPOSE) const;
//! @}
//! @name Character case conversion.
/* Returns fmt as is, but checks for invalid references in the format string.
* @newin{2,18}
*/
- template <class T1>
static inline ustring compose(const ustring& fmt);
/*! Substitute placeholders in a format string with the referenced arguments.
- * The template string should be in <tt>qt-format</tt>, that is
- * <tt>"%1"</tt>, <tt>"%2"</tt>, ..., <tt>"%9"</tt> are used as placeholders
- * and <tt>"%%"</tt> denotes a literal <tt>"%"</tt>. Substitutions may be
- * reordered.
+ *
+ * The template string uses a similar format to Qt’s QString class, in that
+ * <tt>%1</tt>, <tt>%2</tt>, and so on to <tt>%9</tt> are used as placeholders
+ * to be substituted with the string representation of the @a args 1–9, while
+ * <tt>%%</tt> inserts a literal <tt>%</tt> in the output. Placeholders do not
+ * have to appear in the same order as their corresponding function arguments.
+ *
* @par Example:
* @code
* using Glib::ustring;
* const int percentage = 50;
* const ustring text = ustring::compose("%1%% done", percentage);
* @endcode
- * @param fmt A template string in <tt>qt-format</tt>.
- * @param a1 The argument to substitute for <tt>"%1"</tt>.
+ *
+ * @param fmt The template string, in the format described above.
+ * @param args 1 to 9 arguments to substitute for <tt>%1</tt> to <tt>%9</tt>
+ * respectively.
+ *
* @return The substituted message string.
+ *
* @throw Glib::ConvertError
*
- * @newin{2,16}
- */
- template <class T1>
- static inline ustring compose(const ustring& fmt, const T1& a1);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2>
- static inline ustring compose(const ustring& fmt, const T1& a1, const T2& a2);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2, class T3>
- static inline ustring compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4>
- static inline ustring compose(
- const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5>
- static inline ustring compose(
- const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
+ * @newin{2,58}
*/
- template <class T1, class T2, class T3, class T4, class T5, class T6>
- static inline ustring compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3,
- const T4& a4, const T5& a5, const T6& a6);
+ template <class... Ts>
+ static inline ustring compose(const ustring& fmt, const Ts&... args);
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
- static inline ustring compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3,
- const T4& a4, const T5& a5, const T6& a6, const T7& a7);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
- static inline ustring compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3,
- const T4& a4, const T5& a5, const T6& a6, const T7& a7, const T8& a8);
-
- /* See the documentation for compose(const ustring& fmt, const T1& a1).
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8,
- class T9>
- static inline ustring compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3,
- const T4& a4, const T5& a5, const T6& a6, const T7& a7, const T8& a8, const T9& a9);
-
- /*! Format the argument to its string representation.
+ /*! Format the argument(s) to a string representation.
+ *
* Applies the arguments in order to an std::wostringstream and returns the
* resulting string. I/O manipulators may also be used as arguments. This
* greatly simplifies the common task of converting a number to a string, as
* demonstrated by the example below. The format() methods can also be used
* in conjunction with compose() to facilitate localization of user-visible
* messages.
+ *
* @code
* using Glib::ustring;
* double value = 22.0 / 7.0;
* ustring text = ustring::format(std::fixed, std::setprecision(2), value);
* @endcode
+ *
* @note The use of a wide character stream in the implementation of format()
* is almost completely transparent. However, one of the instances where the
* use of wide streams becomes visible is when the std::setfill() stream
* manipulator is used. In order for std::setfill() to work the argument
* must be of type <tt>wchar_t</tt>. This can be achieved by using the
* <tt>L</tt> prefix with a character literal, as shown in the example.
+ *
* @code
* using Glib::ustring;
* // Insert leading zeroes to fill in at least six digits
* ustring text = ustring::format(std::setfill(L'0'), std::setw(6), 123);
* @endcode
*
- * @param a1 A streamable value or an I/O manipulator.
- * @return The string representation of the argument stream.
- * @throw Glib::ConvertError
- *
- * @newin{2,16}
- */
- template <class T1>
- static inline ustring format(const T1& a1);
-
- /* See the documentation for format(const T1& a1).
- *
- * @newin{2,16}
- */
- template <class T1, class T2>
- static inline ustring format(const T1& a1, const T2& a2);
-
- /* See the documentation for format(const T1& a1).
+ * @param args One or more streamable values or I/O manipulators.
*
- * @newin{2,16}
- */
- template <class T1, class T2, class T3>
- static inline ustring format(const T1& a1, const T2& a2, const T3& a3);
-
- /* See the documentation for format(const T1& a1).
- *
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4>
- static inline ustring format(const T1& a1, const T2& a2, const T3& a3, const T4& a4);
-
- /* See the documentation for format(const T1& a1).
- *
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5>
- static inline ustring format(
- const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5);
-
- /* See the documentation for format(const T1& a1).
+ * @return The string representation of the argument stream.
*
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5, class T6>
- static inline ustring format(
- const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5, const T6& a6);
-
- /* See the documentation for format(const T1& a1).
+ * @throw Glib::ConvertError
*
- * @newin{2,16}
+ * @newin{2,58}
*/
- template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
- static inline ustring format(const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5,
- const T6& a6, const T7& a7);
+ template <class... Ts>
+ static inline ustring format(const Ts&... args);
- /* See the documentation for format(const T1& a1).
- *
- * @newin{2,16}
- */
- template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
- static inline ustring format(const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5,
- const T6& a6, const T7& a7, const T8& a8);
//! @}
private:
template <class T>
class Stringify;
- class FormatStream;
- static ustring compose_argv(const ustring& fmt, int argc, const ustring* const* argv);
+ static ustring compose_private(const ustring& fmt, std::initializer_list<const ustring*> ilist);
+
+ class FormatStream;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
return string_;
}
-template <class T1>
-inline // static
- ustring
- ustring::format(const T1& a1)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- return buf.to_string();
-}
-
-template <class T1, class T2>
-inline // static
- ustring
- ustring::format(const T1& a1, const T2& a2)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- return buf.to_string();
-}
-
-template <class T1, class T2, class T3>
-inline // static
- ustring
- ustring::format(const T1& a1, const T2& a2, const T3& a3)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- buf.stream(a3);
- return buf.to_string();
-}
-
-template <class T1, class T2, class T3, class T4>
-inline // static
- ustring
- ustring::format(const T1& a1, const T2& a2, const T3& a3, const T4& a4)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- buf.stream(a3);
- buf.stream(a4);
- return buf.to_string();
-}
-
-template <class T1, class T2, class T3, class T4, class T5>
+template <class... Ts>
inline // static
ustring
- ustring::format(const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5)
+ ustring::format(const Ts&... args)
{
ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- buf.stream(a3);
- buf.stream(a4);
- buf.stream(a5);
- return buf.to_string();
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6>
-inline // static
- ustring
- ustring::format(
- const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5, const T6& a6)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- buf.stream(a3);
- buf.stream(a4);
- buf.stream(a5);
- buf.stream(a6);
- return buf.to_string();
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
-inline // static
- ustring
- ustring::format(const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5,
- const T6& a6, const T7& a7)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- buf.stream(a3);
- buf.stream(a4);
- buf.stream(a5);
- buf.stream(a6);
- buf.stream(a7);
- return buf.to_string();
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
-inline // static
- ustring
- ustring::format(const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5,
- const T6& a6, const T7& a7, const T8& a8)
-{
- ustring::FormatStream buf;
- buf.stream(a1);
- buf.stream(a2);
- buf.stream(a3);
- buf.stream(a4);
- buf.stream(a5);
- buf.stream(a6);
- buf.stream(a7);
- buf.stream(a8);
+ (buf.stream(args), ...);
return buf.to_string();
}
class ustring::Stringify
{
private:
- ustring string_;
+ const ustring string_;
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<T>&) = delete;
Stringify<T>& operator=(const ustring::Stringify<T>&) = delete;
- inline const ustring* ptr() const { return &string_; }
+ inline const ustring& ref() const { return string_; }
};
/// A template specialization for Stringify<ustring>:
Stringify(const ustring::Stringify<ustring>&) = delete;
Stringify<ustring>& operator=(const ustring::Stringify<ustring>&) = delete;
- inline const ustring* ptr() const { return &string_; }
+ inline const ustring& ref() const { return string_; }
};
/** A template specialization for Stringify<const char*>,
Stringify(const ustring::Stringify<const char*>&) = delete;
Stringify<ustring>& operator=(const ustring::Stringify<const char*>&) = delete;
- inline const ustring* ptr() const { return &string_; }
+ inline const ustring& ref() const { return string_; }
};
/** A template specialization for Stringify<char[N]> (for string literals),
Stringify(const ustring::Stringify<char[N]>&) = delete;
Stringify<ustring>& operator=(const ustring::Stringify<char[N]>&) = delete;
- inline const ustring* ptr() const { return &string_; }
+ inline const ustring& ref() const { return string_; }
};
/** A template specialization for Stringify<const char[N]> (for string literals),
Stringify(const ustring::Stringify<const char[N]>&) = delete;
Stringify<ustring>& operator=(const ustring::Stringify<const char[N]>&) = delete;
- inline const ustring* ptr() const { return &string_; }
+ inline const ustring& ref() const { return string_; }
};
-template <class T1>
inline // static
ustring
ustring::compose(const ustring& fmt)
{
- return ustring::compose_argv(fmt, 0, nullptr);
+ return ustring::compose_private(fmt, {});
}
-template <class T1>
+template <class... Ts>
inline // static
ustring
- ustring::compose(const ustring& fmt, const T1& a1)
+ ustring::compose(const ustring& fmt, const Ts&... args)
{
- const ustring::Stringify<T1> s1(a1);
+ static_assert(sizeof...(Ts) <= 9,
+ "ustring::compose only supports up to 9 placeholders.");
- const ustring* const argv[] = { s1.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3, class T4>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
- const ustring::Stringify<T4> s4(a4);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr(), s4.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3, class T4, class T5>
-inline // static
- ustring
- ustring::compose(
- const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4, const T5& a5)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
- const ustring::Stringify<T4> s4(a4);
- const ustring::Stringify<T5> s5(a5);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr(), s4.ptr(), s5.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4,
- const T5& a5, const T6& a6)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
- const ustring::Stringify<T4> s4(a4);
- const ustring::Stringify<T5> s5(a5);
- const ustring::Stringify<T6> s6(a6);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr(), s4.ptr(), s5.ptr(), s6.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4,
- const T5& a5, const T6& a6, const T7& a7)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
- const ustring::Stringify<T4> s4(a4);
- const ustring::Stringify<T5> s5(a5);
- const ustring::Stringify<T6> s6(a6);
- const ustring::Stringify<T7> s7(a7);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr(), s4.ptr(), s5.ptr(), s6.ptr(),
- s7.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4,
- const T5& a5, const T6& a6, const T7& a7, const T8& a8)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
- const ustring::Stringify<T4> s4(a4);
- const ustring::Stringify<T5> s5(a5);
- const ustring::Stringify<T6> s6(a6);
- const ustring::Stringify<T7> s7(a7);
- const ustring::Stringify<T8> s8(a8);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr(), s4.ptr(), s5.ptr(), s6.ptr(),
- s7.ptr(), s8.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
-}
-
-template <class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9>
-inline // static
- ustring
- ustring::compose(const ustring& fmt, const T1& a1, const T2& a2, const T3& a3, const T4& a4,
- const T5& a5, const T6& a6, const T7& a7, const T8& a8, const T9& a9)
-{
- const ustring::Stringify<T1> s1(a1);
- const ustring::Stringify<T2> s2(a2);
- const ustring::Stringify<T3> s3(a3);
- const ustring::Stringify<T4> s4(a4);
- const ustring::Stringify<T5> s5(a5);
- const ustring::Stringify<T6> s6(a6);
- const ustring::Stringify<T7> s7(a7);
- const ustring::Stringify<T8> s8(a8);
- const ustring::Stringify<T9> s9(a9);
-
- const ustring* const argv[] = { s1.ptr(), s2.ptr(), s3.ptr(), s4.ptr(), s5.ptr(), s6.ptr(),
- s7.ptr(), s8.ptr(), s9.ptr() };
- return ustring::compose_argv(fmt, G_N_ELEMENTS(argv), argv);
+ return compose_private(fmt, {&Stringify<Ts>(args).ref()...});
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-#ifndef GLIBMM_DISABLE_DEPRECATED
-/* Occasionally, a struct variable has to be initialized after its definition,
- * i.e. when using structs as class member data. For convenience, the macro
- * GLIBMM_INITIALIZE_STRUCT(Var, Type) is provided. It even avoids creating
- * a temporary if the compiler is GCC.
- *
- * @deprecated Use e.g. std::memset() instead.
- * It's not used any more in the code generated by _CLASS_BOXEDTYPE_STATIC.
- * It generates compiler warnings if __STRICT_ANSI__ is defined.
- */
-#if ((__GNUC__ >= 3) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) && !defined(__STRICT_ANSI__)
-
-#define GLIBMM_INITIALIZE_STRUCT(Var, Type) __builtin_memset(&(Var), 0, sizeof(Type))
-
-#else
-
-// TODO: This causes warnings like this:
-//"missing initializer for member"
-#define GLIBMM_INITIALIZE_STRUCT(Var, Type) \
- G_STMT_START \
- { \
- Type const temp_initializer__ = { \
- 0, \
- }; \
- (Var) = temp_initializer__; \
- } \
- G_STMT_END
-
-#endif
-#endif // GLIBMM_DISABLE_DEPRECATED
-
namespace Glib
{
// These are used by gmmproc-generated type conversions:
-#ifndef GLIBMM_DISABLE_DEPRECATED
-/** Helper to deal with memory allocated
- * by GLib functions in an exception-safe manner.
- *
- * @deprecated Use make_unique_ptr_gfree() instead.
- */
-template <typename T>
-class ScopedPtr
-{
-private:
- T* ptr_;
- ScopedPtr(const ScopedPtr<T>&);
- ScopedPtr<T>& operator=(const ScopedPtr<T>&);
-
-public:
- ScopedPtr() : ptr_(nullptr) {}
- explicit ScopedPtr(T* ptr) : ptr_(ptr) {}
- ~ScopedPtr() noexcept { g_free(ptr_); }
- T* get() const { return ptr_; }
- T** addr() { return &ptr_; }
-};
-#endif // GLIBMM_DISABLE_DEPRECATED
-
/** Helper to deal with memory allocated
* by GLib functions in an exception-safe manner.
*
return std::unique_ptr<T[], decltype(&g_free)>(p, &g_free);
}
-// TODO: Deprecate this? We don't use it ourselves.
-/** Removes the const nature of a ptr
- *
- */
-template <class T>
-inline T*
-unconst(const T* t)
-{
- return const_cast<T*>(t);
-}
-
// Convert const gchar* to ustring, while treating NULL as empty string.
inline Glib::ustring
convert_const_gchar_ptr_to_ustring(const char* str)
ValueBase_Object::get_object_copy() const
{
GObject* const data = static_cast<GObject*>(g_value_get_object(&gobject_));
- return Glib::RefPtr<Glib::ObjectBase>(Glib::wrap_auto(data, true));
+ return Glib::make_refptr_for_instance<Glib::ObjectBase>(Glib::wrap_auto(data, true));
}
GParamSpec*
class ValueBase_Enum : public ValueBase
{
public:
- using CType = gint;
static GType value_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class ValueBase_Flags : public ValueBase
{
public:
- using CType = guint;
static GType value_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class ValueBase_String : public ValueBase
{
public:
- using CType = const gchar*;
static GType value_type() G_GNUC_CONST;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
{
public:
using CppType = T;
- using CType = typename T::BaseObjectType*;
static GType value_type() { return T::get_type(); }
void set(const CppType& data) { set_boxed(data.gobj()); }
- CppType get() const { return CppType(static_cast<CType>(get_boxed())); }
+ CppType get() const { return CppType(static_cast<typename T::BaseObjectType*>(get_boxed())); }
};
// More spec-compliant compilers (such as Tru64) need this to be near Glib::Object instead.
#ifdef GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
+namespace Traits {
+
+template<typename, typename>
+struct HasGetBaseType;
+
+template<typename T, typename Ret, typename... Args>
+struct HasGetBaseType<T, Ret(Args...)> {
+ template<typename U, U>
+ struct Check;
+
+ template<typename U>
+ static std::true_type
+ Test(Check<Ret(*)(Args...), &U::get_base_type>*);
+
+ template<typename U>
+ static std::false_type Test(...);
+
+ static const bool value = decltype(Test<T>(0))::value;
+ //using type = decltype(Test<T>(0));
+};
+
+} // namespace Traits
+
/** Partial specialization for RefPtr<> to Glib::Object.
* @ingroup glibmmValue
*/
template <class T>
-class Value<Glib::RefPtr<T>> : public ValueBase_Object
+class Value<Glib::RefPtr<T>, typename std::enable_if<Glib::Traits::HasGetBaseType<T, GType()>::value>::type>
+: public ValueBase_Object
{
public:
using CppType = Glib::RefPtr<T>;
- using CType = typename T::BaseObjectType*;
static GType value_type() { return T::get_base_type(); }
- void set(const CppType& data) { set_object(data.operator->()); }
- CppType get() const { return Glib::RefPtr<T>::cast_dynamic(get_object_copy()); }
+ void set(const CppType& data) { set_object(const_cast<std::remove_const_t<T>*>(data.get())); }
+ CppType get() const { return std::dynamic_pointer_cast<T>(get_object_copy()); }
};
// The SUN Forte Compiler has a problem with this:
/** Partial specialization for RefPtr<> to const Glib::Object.
* @ingroup glibmmValue
*/
+/*
template <class T>
-class Value<Glib::RefPtr<const T>> : public ValueBase_Object
+class Value<Glib::RefPtr<const T>, typename std::enable_if<std::is_base_of<Glib::ObjectBase, T>::value>::type> : public ValueBase_Object
{
public:
using CppType = Glib::RefPtr<const T>;
- using CType = typename T::BaseObjectType*;
static GType value_type() { return T::get_base_type(); }
- void set(const CppType& data) { set_object(const_cast<T*>(data.operator->())); }
- CppType get() const { return Glib::RefPtr<T>::cast_dynamic(get_object_copy()); }
+ void set(const CppType& data) { set_object(const_cast<T*>(data.get())); }
+ CppType get() const { return std::dynamic_pointer_cast<T>(get_object_copy()); }
};
+*/
#endif // GLIBMM_HAVE_DISAMBIGUOUS_CONST_TEMPLATE_SPECIALIZATIONS
#endif // GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
public:
using CppType = T;
- void set(CppType data) { set_enum(data); }
+ void set(CppType data) { set_enum(static_cast<int>(data)); }
CppType get() const { return CppType(get_enum()); }
};
public:
using CppType = T;
- void set(CppType data) { set_flags(data); }
+ void set(CppType data) { set_flags(static_cast<unsigned int>(data)); }
CppType get() const { return CppType(get_flags()); }
};
/**
* @ingroup glibmmValue
*/
-template <class T, class PtrT>
+template <class PtrT>
class Value_Pointer : public ValueBase_Object
{
public:
+ using T = std::remove_cv_t<std::remove_pointer_t<PtrT>>;
using CppType = PtrT;
- using CType = void*;
static inline GType value_type() G_GNUC_CONST;
* cannot ensure that no exceptions will be thrown, consider using either
* a normal pointer or a smart pointer to hold your objects indirectly.
*/
-template <class T>
+template <class T, typename Enable = void>
class Value : public ValueBase_Boxed
{
public:
using CppType = T;
- using CType = T*;
static GType value_type() G_GNUC_CONST;
* No attempt is made to manage the memory associated with the
* pointer, you must take care of that yourself.
*/
-template <class T>
-class Value<T*> : public Value_Pointer<T, T*>
+template <class T, typename Enable>
+class Value<T*, Enable> : public Value_Pointer<T*>
{
};
* No attempt is made to manage the memory associated with the
* pointer, you must take care of that yourself.
*/
-template <class T>
-class Value<const T*> : public Value_Pointer<T, const T*>
+template <class T, typename Enable>
+class Value<const T*, Enable> : public Value_Pointer<const T*>
{
};
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-/**** Glib::Value_Pointer<T, PtrT> *****************************************/
+/**** Glib::Value_Pointer<PtrT> *****************************************/
/** Implementation for Glib::Object pointers **/
// static
-template <class T, class PtrT>
+template <class PtrT>
inline GType
-Value_Pointer<T, PtrT>::value_type_(Glib::Object*)
+Value_Pointer<PtrT>::value_type_(Glib::Object*)
{
return T::get_base_type();
}
-template <class T, class PtrT>
+template <class PtrT>
inline void
-Value_Pointer<T, PtrT>::set_(PtrT data, Glib::Object*)
+Value_Pointer<PtrT>::set_(PtrT data, Glib::Object*)
{
set_object(const_cast<T*>(data));
}
// More spec-compliant compilers (such as Tru64) need this to be near Glib::Object instead.
#ifdef GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
-template <class T, class PtrT>
+template <class PtrT>
inline PtrT
-Value_Pointer<T, PtrT>::get_(Glib::Object*) const
+Value_Pointer<PtrT>::get_(Glib::Object*) const
{
return dynamic_cast<T*>(get_object());
}
/** Implementation for custom pointers **/
// static
-template <class T, class PtrT>
+template <class PtrT>
GType
-Value_Pointer<T, PtrT>::value_type_(void*)
+Value_Pointer<PtrT>::value_type_(void*)
{
static GType custom_type = 0;
return custom_type;
}
-template <class T, class PtrT>
+template <class PtrT>
inline void
-Value_Pointer<T, PtrT>::set_(PtrT data, void*)
+Value_Pointer<PtrT>::set_(PtrT data, void*)
{
gobject_.data[0].v_pointer = const_cast<T*>(data);
}
-template <class T, class PtrT>
+template <class PtrT>
inline PtrT
-Value_Pointer<T, PtrT>::get_(void*) const
+Value_Pointer<PtrT>::get_(void*) const
{
return static_cast<T*>(gobject_.data[0].v_pointer);
}
/** Public forwarding interface **/
// static
-template <class T, class PtrT>
+template <class PtrT>
inline GType
-Value_Pointer<T, PtrT>::value_type()
+Value_Pointer<PtrT>::value_type()
{
// Dispatch to the specific value_type_() overload.
- return Value_Pointer<T, PtrT>::value_type_(static_cast<T*>(nullptr));
+ return Value_Pointer<PtrT>::value_type_(static_cast<T*>(nullptr));
}
-template <class T, class PtrT>
+template <class PtrT>
inline void
-Value_Pointer<T, PtrT>::set(PtrT data)
+Value_Pointer<PtrT>::set(PtrT data)
{
// Dispatch to the specific set_() overload.
this->set_(data, static_cast<T*>(nullptr));
}
-template <class T, class PtrT>
+template <class PtrT>
inline PtrT
-Value_Pointer<T, PtrT>::get() const
+Value_Pointer<PtrT>::get() const
{
// Dispatch to the specific get_() overload.
return this->get_(static_cast<T*>(nullptr));
/**** Glib::Value<T> *******************************************************/
// Static data, specific to each template instantiation.
-template <class T>
-GType Value<T>::custom_type_ = 0;
+template <class T, typename Enable>
+GType Value<T, Enable>::custom_type_ = 0;
-template <class T>
+template <class T, typename Enable>
inline void
-Value<T>::set(const typename Value<T>::CppType& data)
+Value<T, Enable>::set(const typename Value<T, Enable>::CppType& data)
{
// Assume the value is already default-initialized. See value_init_func().
*static_cast<T*>(gobject_.data[0].v_pointer) = data;
}
-template <class T>
-inline typename Value<T>::CppType
-Value<T>::get() const
+template <class T, typename Enable>
+inline typename Value<T, Enable>::CppType
+Value<T, Enable>::get() const
{
// Assume the pointer is not NULL. See value_init_func().
return *static_cast<T*>(gobject_.data[0].v_pointer);
}
// static
-template <class T>
+template <class T, typename Enable>
GType
-Value<T>::value_type()
+Value<T, Enable>::value_type()
{
if (!custom_type_)
{
}
// static
-template <class T>
+template <class T, typename Enable>
void
-Value<T>::value_init_func(GValue* value)
+Value<T, Enable>::value_init_func(GValue* value)
{
// Never store a NULL pointer (unless we're out of memory).
value->data[0].v_pointer = new (std::nothrow) T();
}
// static
-template <class T>
+template <class T, typename Enable>
void
-Value<T>::value_free_func(GValue* value)
+Value<T, Enable>::value_free_func(GValue* value)
{
delete static_cast<T*>(value->data[0].v_pointer);
}
// static
-template <class T>
+template <class T, typename Enable>
void
-Value<T>::value_copy_func(const GValue* src_value, GValue* dest_value)
+Value<T, Enable>::value_copy_func(const GValue* src_value, GValue* dest_value)
{
// Assume the source is not NULL. See value_init_func().
const T& source = *static_cast<T*>(src_value->data[0].v_pointer);
+++ /dev/null
-#ifndef _GLIBMM_WEAKREF_H
-#define _GLIBMM_WEAKREF_H
-
-/* Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <glib-object.h>
-#include <glibmm/refptr.h>
-#include <glibmm/objectbase.h>
-#include <type_traits> // std::is_base_of<>
-#include <utility> // std::swap<>, std::forward<>
-
-namespace Glib
-{
-
-/** WeakRef<> is a weak reference smartpointer.
- *
- * WeakRef can store a pointer to any class that is derived from Glib::ObjectBase,
- * and whose reference() method is noexcept.
- * In glibmm and gtkmm, that is anything derived from Glib::ObjectBase.
- *
- * Unlike a RefPtr, a WeakRef does not contribute to the reference counting of
- * the underlying object.
- *
- * @newin{2,46}
- */
-template <typename T_CppObject>
-class WeakRef
-{
- static_assert(std::is_base_of<Glib::ObjectBase, T_CppObject>::value,
- "Glib::WeakRef can be used only for classes derived from Glib::ObjectBase.");
-
-public:
- /** Default constructor.
- *
- * Create an empty weak reference.
- */
- inline WeakRef() noexcept;
-
- /// Copy constructor.
- inline WeakRef(const WeakRef& src) noexcept;
-
- /// Move constructor.
- inline WeakRef(WeakRef&& src) noexcept;
-
- /// Copy constructor from different, but castable type.
- template <typename T_CastFrom>
- inline WeakRef(const WeakRef<T_CastFrom>& src) noexcept;
-
- /// Move constructor from different, but castable type.
- template <typename T_CastFrom>
- inline WeakRef(WeakRef<T_CastFrom>&& src) noexcept;
-
- /** Constructor from a RefPtr of the same or a castable type.
- *
- * Create a weak reference from a RefPtr of the same or a castable type.
- * If the RefPtr references nothing, an empty weak reference will be constructed.
- */
- template <typename T_CastFrom>
- inline WeakRef(const RefPtr<T_CastFrom>& src) noexcept;
-
- /// Destructor.
- inline ~WeakRef() noexcept;
-
- /// Swap the contents of two WeakRef<>.
- inline void swap(WeakRef& other) noexcept;
-
- /// Copy assignment operator.
- inline WeakRef& operator=(const WeakRef& src) noexcept;
-
- /// Move assignment operator.
- inline WeakRef& operator=(WeakRef&& src) noexcept;
-
- /// Copy assignment from different, but castable type.
- template <typename T_CastFrom>
- inline WeakRef& operator=(const WeakRef<T_CastFrom>& src) noexcept;
-
- /// Move assignment from different, but castable type.
- template <typename T_CastFrom>
- inline WeakRef& operator=(WeakRef<T_CastFrom>&& src) noexcept;
-
- /// Assignment from a RefPtr of the same or a castable type.
- template <typename T_CastFrom>
- inline WeakRef& operator=(const RefPtr<T_CastFrom>& src) noexcept;
-
- /** Test whether the WeakRef<> points to any underlying instance.
- *
- * Mimics usage of ordinary pointers:
- * @code
- * if (ptr)
- * do_something();
- * @endcode
- *
- * In a multi-threaded program a <tt>true</tt> return value can become
- * obsolete at any time, even before the caller has a chance to test it,
- * because the underlying instance may lose its last reference in another
- * thread. Use get() if this is not acceptable.
- */
- inline explicit operator bool() const noexcept;
-
- /** Create a strong reference to the underlying object.
- *
- * This is a thread-safe way to acquire a strong reference to the underlying
- * object. If the WeakRef is empty, the returned RefPtr will reference nothing.
- */
- inline RefPtr<T_CppObject> get() const noexcept;
-
- /// Make this WeakRef empty.
- inline void reset() noexcept;
-
- /** Dynamic cast to derived class.
- *
- * The WeakRef can't be cast with the usual notation so instead you can use
- * @code
- * ptr_derived = Glib::WeakRef<Derived>::cast_dynamic(ptr_base);
- * @endcode
- */
- template <typename T_CastFrom>
- static inline WeakRef cast_dynamic(const WeakRef<T_CastFrom>& src) noexcept;
-
- /** Static cast to derived class.
- *
- * The WeakRef can't be cast with the usual notation so instead you can use
- * @code
- * ptr_derived = Glib::WeakRef<Derived>::cast_static(ptr_base);
- * @endcode
- */
- template <typename T_CastFrom>
- static inline WeakRef cast_static(const WeakRef<T_CastFrom>& src) noexcept;
-
- /** Cast to non-const.
- *
- * The WeakRef can't be cast with the usual notation so instead you can use
- * @code
- * ptr_nonconst = Glib::WeakRef<NonConstType>::cast_const(ptr_const);
- * @endcode
- */
- template <typename T_CastFrom>
- static inline WeakRef cast_const(const WeakRef<T_CastFrom>& src) noexcept;
-
-private:
- // Let all instantiations of WeakRef access private data.
- template <typename T_CastFrom>
- friend class WeakRef;
-
- // If pCppObject != nullptr && gobject == nullptr,
- // then the caller holds a strong reference.
- void set(T_CppObject* pCppObject, GWeakRef* gobject) noexcept;
-
- // WeakRef owns *gobject_, but it does not own *pCppObject_.
- // Invariant: (!pCppObject_ || gobject_),
- // i.e. if pCppObject_ != nullptr then also gobject_ != nullptr.
- T_CppObject* pCppObject_;
- GWeakRef* gobject_;
-
- // Some methods would be simpler if gobject_ were a GWeakRef instead of
- // a GWeakRef*, but then the move constructor and the move assignment
- // operation would not be efficient.
-
-}; // end class WeakRef
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-template <typename T_CppObject>
-WeakRef<T_CppObject>::WeakRef() noexcept : pCppObject_(nullptr), gobject_(nullptr)
-{
-}
-
-template <typename T_CppObject>
-WeakRef<T_CppObject>::WeakRef(const WeakRef& src) noexcept : pCppObject_(src.pCppObject_),
- gobject_(nullptr)
-{
- if (pCppObject_)
- {
- // We must own a strong reference to the underlying GObject while
- // calling g_weak_ref_init().
- gpointer ptr = g_weak_ref_get(src.gobject_);
- if (ptr)
- {
- gobject_ = new GWeakRef;
- g_weak_ref_init(gobject_, pCppObject_->gobj());
- g_object_unref(ptr);
- }
- else
- pCppObject_ = nullptr;
- }
-}
-
-template <typename T_CppObject>
-WeakRef<T_CppObject>::WeakRef(WeakRef&& src) noexcept : pCppObject_(src.pCppObject_),
- gobject_(src.gobject_)
-{
- src.pCppObject_ = nullptr;
- src.gobject_ = nullptr;
-}
-
-// The templated ctor allows copy construction from any object that's
-// castable. Thus, it does downcasts:
-// base_ref = derived_ref
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>::WeakRef(const WeakRef<T_CastFrom>& src) noexcept
- : pCppObject_(src.pCppObject_),
- gobject_(nullptr)
-{
- if (pCppObject_)
- {
- // We must own a strong reference to the underlying GObject while
- // calling g_weak_ref_init().
- gpointer ptr = g_weak_ref_get(src.gobject_);
- if (ptr)
- {
- gobject_ = new GWeakRef;
- g_weak_ref_init(gobject_, pCppObject_->gobj());
- g_object_unref(ptr);
- }
- else
- pCppObject_ = nullptr;
- }
-}
-
-// The templated ctor allows move construction from any object that's
-// castable. Thus, it does downcasts:
-// base_ref = std::move(derived_ref)
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>::WeakRef(WeakRef<T_CastFrom>&& src) noexcept : pCppObject_(src.pCppObject_),
- gobject_(src.gobject_)
-{
- src.pCppObject_ = nullptr;
- src.gobject_ = nullptr;
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>::WeakRef(const RefPtr<T_CastFrom>& src) noexcept
- : pCppObject_(src.operator->()),
- gobject_(nullptr)
-{
- if (pCppObject_)
- {
- gobject_ = new GWeakRef;
- g_weak_ref_init(gobject_, pCppObject_->gobj());
- }
-}
-
-template <typename T_CppObject>
-WeakRef<T_CppObject>::~WeakRef() noexcept
-{
- if (gobject_)
- {
- g_weak_ref_clear(gobject_);
- delete gobject_;
- }
-}
-
-template <class T_CppObject>
-void
-WeakRef<T_CppObject>::swap(WeakRef& other) noexcept
-{
- std::swap(pCppObject_, other.pCppObject_);
- std::swap(gobject_, other.gobject_);
-}
-
-template <typename T_CppObject>
-WeakRef<T_CppObject>&
-WeakRef<T_CppObject>::operator=(const WeakRef& src) noexcept
-{
- set(src.pCppObject_, src.gobject_);
- return *this;
-}
-
-template <typename T_CppObject>
-WeakRef<T_CppObject>&
-WeakRef<T_CppObject>::operator=(WeakRef&& src) noexcept
-{
- // See RefPtr for an explanation of the swap() technique to implement
- // copy assignment and move assignment.
- // This technique is inefficient for copy assignment of WeakRef,
- // because it involves copy construction + destruction, i.e. in a typical
- // case g_weak_ref_init() + g_weak_ref_clear(), when a g_weak_ref_set()
- // would be enough. For move assignment, the swap technique is fine.
- WeakRef<T_CppObject> temp(std::forward<WeakRef<T_CppObject>>(src));
- this->swap(temp);
- return *this;
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>&
-WeakRef<T_CppObject>::operator=(const WeakRef<T_CastFrom>& src) noexcept
-{
- set(src.pCppObject_, src.gobject_);
- return *this;
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>&
-WeakRef<T_CppObject>::operator=(WeakRef<T_CastFrom>&& src) noexcept
-{
- WeakRef<T_CppObject> temp(std::forward<WeakRef<T_CastFrom>>(src));
- this->swap(temp);
- return *this;
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>&
-WeakRef<T_CppObject>::operator=(const RefPtr<T_CastFrom>& src) noexcept
-{
- T_CppObject* pCppObject = src.operator->();
- set(pCppObject, nullptr);
- return *this;
-}
-
-template <class T_CppObject>
-WeakRef<T_CppObject>::operator bool() const noexcept
-{
- if (!pCppObject_)
- return false;
-
- gpointer ptr = g_weak_ref_get(gobject_);
- if (!ptr)
- return false;
-
- g_object_unref(ptr);
- return true;
-}
-
-template <typename T_CppObject>
-RefPtr<T_CppObject>
-WeakRef<T_CppObject>::get() const noexcept
-{
- RefPtr<T_CppObject> ret;
-
- if (!pCppObject_)
- return ret;
-
- gpointer ptr = g_weak_ref_get(gobject_);
- if (!ptr)
- return ret;
-
- // A RefPtr constructed from pointer expects reference to be done externally.
- pCppObject_->reference();
- ret = RefPtr<T_CppObject>(pCppObject_);
-
- g_object_unref(ptr);
-
- return ret;
-}
-
-template <typename T_CppObject>
-void
-WeakRef<T_CppObject>::reset() noexcept
-{
- set(nullptr, nullptr);
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>
-WeakRef<T_CppObject>::cast_dynamic(const WeakRef<T_CastFrom>& src) noexcept
-{
- WeakRef<T_CppObject> ret;
-
- if (!src.pCppObject_)
- return ret;
-
- gpointer ptr = g_weak_ref_get(src.gobject_);
- if (!ptr)
- return ret;
-
- // Don't call dynamic_cast<>() unless we know that the referenced object
- // still exists.
- T_CppObject* const pCppObject = dynamic_cast<T_CppObject*>(src.pCppObject_);
- ret.set(pCppObject, nullptr);
- g_object_unref(ptr);
-
- return ret;
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>
-WeakRef<T_CppObject>::cast_static(const WeakRef<T_CastFrom>& src) noexcept
-{
- T_CppObject* const pCppObject = static_cast<T_CppObject*>(src.pCppObject_);
-
- WeakRef<T_CppObject> ret;
- ret.set(pCppObject, src.gobject_);
- return ret;
-}
-
-template <typename T_CppObject>
-template <typename T_CastFrom>
-WeakRef<T_CppObject>
-WeakRef<T_CppObject>::cast_const(const WeakRef<T_CastFrom>& src) noexcept
-{
- T_CppObject* const pCppObject = const_cast<T_CppObject*>(src.pCppObject_);
-
- WeakRef<T_CppObject> ret;
- ret.set(pCppObject, src.gobject_);
- return ret;
-}
-
-template <typename T_CppObject>
-void
-WeakRef<T_CppObject>::set(T_CppObject* pCppObject, GWeakRef* gobject) noexcept
-{
- // We must own a strong reference to the underlying GObject while
- // calling g_weak_ref_init() or g_weak_ref_set().
- // If pCppObject != nullptr && gobject == nullptr,
- // then the caller holds a strong reference.
-
- // An aim with this moderately complicated method is to keep the same
- // GWeakRef, calling g_weak_ref_set() when possible, instead of using swap(),
- // which implies creating a new WeakRef, swapping with *this, and deleting
- // the new WeakRef.
-
- gpointer ptr = nullptr;
- if (pCppObject && gobject)
- ptr = g_weak_ref_get(gobject);
-
- pCppObject_ = (ptr || !gobject) ? pCppObject : nullptr;
- if (pCppObject_ && !gobject_)
- {
- gobject_ = new GWeakRef;
- g_weak_ref_init(gobject_, pCppObject_->gobj());
- }
- else if (gobject_)
- g_weak_ref_set(gobject_, pCppObject_ ? pCppObject_->gobj() : nullptr);
-
- if (ptr)
- g_object_unref(ptr);
-}
-
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
-/** Swap the contents of two WeakRef<>.
- * @relates Glib::WeakRef
- */
-template <class T_CppObject>
-inline void
-swap(WeakRef<T_CppObject>& lhs, WeakRef<T_CppObject>& rhs) noexcept
-{
- lhs.swap(rhs);
-}
-
-} // namespace Glib
-
-#endif // _GLIBMM_WEAKREF_H
Glib::RefPtr<Object>
wrap(GObject* object, bool take_copy /* = false */)
{
- return Glib::RefPtr<Object>(dynamic_cast<Object*>(wrap_auto(object, take_copy)));
+ return Glib::make_refptr_for_instance<Object>(dynamic_cast<Object*>(wrap_auto(object, take_copy)));
}
} /* namespace Glib */
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/error.h>
-#include <glibmm/arrayhandle.h>
+#include <sigc++/slot.h>
+#include <sigc++/bind.h>
#include <glib.h>
namespace Glib
{
_CLASS_GENERIC(BalancedTree, GTree)
public:
- using TraverseFunc = sigc::slot<bool, const K&, const V&>;
- using CompareFunc = sigc::slot<int, const K&, const K&>;
+ using TraverseFunc = sigc::slot<bool(const K&, const V&)>;
+ using CompareFunc = sigc::slot<int(const K&, const K&)>;
protected:
BalancedTree() :
gobject_ = g_tree_new_full(on_compare_tree, &key_compare_slot, on_destroy_key, on_destroy_value);
}
- BalancedTree(const CompareFunc &key_compare_slot_) :
+ explicit BalancedTree(const CompareFunc &key_compare_slot_) :
key_compare_slot(key_compare_slot_)
{
gobject_ = g_tree_new_full(on_compare_tree, &key_compare_slot, on_destroy_key, on_destroy_value);
public:
static Glib::RefPtr< BalancedTree<K, V> > create()
{
- return Glib::RefPtr< BalancedTree<K, V> >(new BalancedTree());
+ return Glib::make_refptr_for_instance< BalancedTree<K, V> >(new BalancedTree());
}
static Glib::RefPtr< BalancedTree<K, V> > create(const CompareFunc &key_compare_slot)
{
- return Glib::RefPtr< BalancedTree<K, V> >(new BalancedTree(key_compare_slot));
+ return Glib::make_refptr_for_instance< BalancedTree<K, V> >(new BalancedTree(key_compare_slot));
}
~BalancedTree()
*/
V* search(const CompareFunc &search_func, const K& key)
{
- sigc::slot<int, const K&, const CompareFunc&, const K&> real_slot = sigc::ptr_fun(on_compare_key);
- sigc::slot<int, const K&> bound_slot = sigc::bind(real_slot, search_func, key);
+ sigc::slot<int(const K&, const CompareFunc&, const K&)> real_slot = sigc::ptr_fun(on_compare_key);
+ sigc::slot<int(const K&)> bound_slot = sigc::bind(real_slot, search_func, key);
gpointer value = g_tree_search(gobj(), c_callback_search, reinterpret_cast<gconstpointer>(&bound_slot));
return reinterpret_cast<V*>(value);
/// Wrapper for invoking GCompareFunc.
static gint c_callback_search(gconstpointer a, gconstpointer b)
{
- const sigc::slot<int, const K&>* slot = reinterpret_cast<const sigc::slot<int, const K&> *>(b);
+ const auto slot = reinterpret_cast<const sigc::slot<int(const K&)> *>(b);
return (*slot)(*reinterpret_cast<const K*>(a));
}
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+using Flags = Glib::Binding::Flags;
+
#include <glibmm/binding.h>
#include <glib.h>
// static
Glib::RefPtr<Binding>
Binding::bind_property_value(const PropertyProxy_Base& source_property,
- const PropertyProxy_Base& target_property, BindingFlags flags, const SlotTransform& transform_to,
+ const PropertyProxy_Base& target_property, Flags flags, const SlotTransform& transform_to,
const SlotTransform& transform_from)
{
GBinding* binding = nullptr;
// 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<Binding>(new Binding(binding));
+ return Glib::make_refptr_for_instance<Binding>(new Binding(binding));
}
void
namespace Glib
{
-_WRAP_ENUM(BindingFlags, GBindingFlags, newin "2,44")
/** Bind two object properties.
*
_CLASS_GOBJECT(Binding, GBinding, G_BINDING, Glib::Object, GObject)
public:
+ _WRAP_ENUM(Flags, GBindingFlags, newin "2,44")
+
/** For instance,<br>
* bool on_transform_to(const GValue* from_value, GValue* to_value);
*
* @return <tt>true</tt> if the transformation was successful, and <tt>false</tt> otherwise.
*/
- using SlotTransform = sigc::slot<bool, const GValue*, GValue*>;
+ using SlotTransform = sigc::slot<bool(const GValue*, GValue*)>;
/** Creates a binding between @a source_property and @a target_property,
* allowing you to set the transformation functions to be used by the binding.
static Glib::RefPtr<Binding> bind_property_value(
const PropertyProxy_Base& source_property,
const PropertyProxy_Base& target_property,
- BindingFlags flags = BINDING_DEFAULT,
+ Flags flags = Flags::DEFAULT,
const SlotTransform& transform_to = SlotTransform(),
const SlotTransform& transform_from = SlotTransform());
static Glib::RefPtr<Binding> bind_property(
const PropertyProxy_Base& source_property,
const PropertyProxy_Base& target_property,
- BindingFlags flags = BINDING_DEFAULT)
+ Flags flags = Flags::DEFAULT)
{
return bind_property_value(source_property, target_property, flags);
}
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
static Glib::RefPtr<Binding> bind_property(
const PropertyProxy<T_source>& source_property,
const PropertyProxy<T_target>& target_property,
- BindingFlags flags,
+ Flags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
static Glib::RefPtr<Binding> bind_property(
const PropertyProxy<T_source>& source_property,
const PropertyProxy_WriteOnly<T_target>& target_property,
- BindingFlags flags,
+ Flags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
static Glib::RefPtr<Binding> bind_property(
const PropertyProxy_ReadOnly<T_source>& source_property,
const PropertyProxy<T_target>& target_property,
- BindingFlags flags,
+ Flags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
*
* @see bind_property_value()
*
static Glib::RefPtr<Binding> bind_property(
const PropertyProxy_ReadOnly<T_source>& source_property,
const PropertyProxy_WriteOnly<T_target>& target_property,
- BindingFlags flags,
+ Flags flags,
const T_functor_to& transform_to)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to));
* stored in a Glib::Value<T_target> object.
* @tparam T_functor_to Type of functor that translates from the source to the target.
* Must be convertible to<br>
- * sigc::slot<bool, const T_source&, T_target&>.
+ * sigc::slot<bool(const T_source&, T_target&)>.
* @tparam T_functor_from Type of functor that translates from the target to the source.
* Must be convertible to<br>
- * sigc::slot<bool, const T_target&, T_source&>.
+ * sigc::slot<bool(const T_target&, T_source&)>.
*
* @see bind_property_value()
*
static Glib::RefPtr<Binding> bind_property(
const PropertyProxy<T_source>& source_property,
const PropertyProxy<T_target>& target_property,
- BindingFlags flags,
+ Flags flags,
const T_functor_to& transform_to,
const T_functor_from& transform_from)
{
- sigc::slot<bool, const T_source&, T_target&> slot_transform_to = transform_to;
- sigc::slot<bool, const T_target&, T_source&> slot_transform_from = transform_from;
+ sigc::slot<bool(const T_source&, T_target&)> slot_transform_to = transform_to;
+ sigc::slot<bool(const T_target&, T_source&)> slot_transform_from = transform_from;
return bind_property_value(source_property, target_property, flags,
slot_transform_to.empty() ? SlotTransform() : TransformProp<T_source, T_target>(slot_transform_to),
_WRAP_METHOD(Glib::RefPtr<Glib::ObjectBase> get_target(), g_binding_get_target, refreturn, newin "2,44")
_WRAP_METHOD(Glib::RefPtr<const Glib::ObjectBase> 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")
+ _WRAP_METHOD(Flags 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.
void unbind();
_IGNORE(g_binding_unbind)
- _WRAP_PROPERTY("flags", Glib::BindingFlags, newin "2,44")
+ _WRAP_PROPERTY("flags", Flags, newin "2,44")
_WRAP_PROPERTY("source", Glib::RefPtr<Glib::ObjectBase>, newin "2,44")
_WRAP_PROPERTY("source-property", Glib::ustring, newin "2,44")
_WRAP_PROPERTY("target", Glib::RefPtr<Glib::ObjectBase>, newin "2,44")
// The functor TransformProp can be implicitly converted to a SlotTransform
// and used in a call to bind_property_value().
template <typename T_from, typename T_to>
- class TransformProp : public sigc::functor_base
+ class TransformProp
{
public:
- using result_type = bool;
- using SlotTypedTransform = sigc::slot<bool, const T_from&, T_to&>;
+ using SlotTypedTransform = sigc::slot<bool(const T_from&, T_to&)>;
- TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {}
+ explicit TransformProp(const SlotTypedTransform& slot) : typed_transform(slot) {}
bool operator()(const GValue* from_value, GValue* to_value)
{
* int compare(const guint8* first, const guint8* second);
* </code>
*/
- using SlotCompare = sigc::slot<int, const guint8*, const guint8*>;
+ using SlotCompare = sigc::slot<int(const guint8*, const guint8*)>;
_WRAP_METHOD(static Glib::RefPtr<ByteArray> create(), g_byte_array_new)
public:
static GType value_type() { return Glib::ByteArray::get_type(); }
void set(const Glib::RefPtr<Glib::ByteArray>& array) { set_boxed(Glib::unwrap(array)); }
- Glib::RefPtr<Glib::ByteArray> get() { return Glib::RefPtr<Glib::ByteArray>(reinterpret_cast<Glib::ByteArray*>(get_boxed())); }
+ Glib::RefPtr<Glib::ByteArray> get() { return make_refptr_for_instance<Glib::ByteArray>(reinterpret_cast<Glib::ByteArray*>(get_boxed())); }
};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/error.h>
-#include <glibmm/arrayhandle.h>
#include <glib.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
-Checksum::Checksum(ChecksumType type) : gobject_(g_checksum_new((GChecksumType)type))
+Checksum::Checksum(Type type) : gobject_(g_checksum_new((GChecksumType)type))
{
}
}
gssize
-Checksum::get_length(ChecksumType checksum_type)
+Checksum::get_length(Type checksum_type)
{
return g_checksum_type_get_length((GChecksumType)checksum_type);
}
std::string
-Checksum::compute_checksum(ChecksumType checksum_type, const std::string& data)
+Checksum::compute_checksum(Type checksum_type, const std::string& data)
{
return Glib::convert_return_gchar_ptr_to_ustring(
g_compute_checksum_for_string(((GChecksumType)checksum_type), data.c_str(), data.size()));
_IGNORE(g_checksum_copy, g_checksum_free)
public:
- _WRAP_ENUM(ChecksumType, GChecksumType, NO_GTYPE)
+ _WRAP_ENUM(Type, GChecksumType, NO_GTYPE)
-#m4 _CONVERSION(`ChecksumType', `GChecksumType', `(($2)$3)')
+#m4 _CONVERSION(`Type', `GChecksumType', `(static_cast<$2>($3))')
/** Creates a new Checksum, using the checksum algorithm @a checksum_type.
* If the checksum_type is not known, then operator bool() will return false.
*
* @param checksum_type Checksum type, one of defined above.
*/
- explicit Checksum(ChecksumType checksum_type);
+ explicit Checksum(Type checksum_type);
/** Returns true if the Checksum object is valid.
* This will return false, for instance, if an unsupported checksum type was provided to the constructor.
_WRAP_METHOD(void reset(), g_checksum_reset)
- //TODO: length should really be gssize, not gsize, when we can break ABI:
-#m4 _CONVERSION(`gsize',`gssize',`(gssize)($3)')
- _WRAP_METHOD(void update(const guchar* data, gsize length), g_checksum_update)
+ _WRAP_METHOD(void update(const guchar* data, gssize length), g_checksum_update)
/** Feeds data into an existing Checksum.
* The checksum must still be open, that is get_string() or get_digest() must not have been called on the checksum.
_WRAP_METHOD(std::string get_string() const, g_checksum_get_string)
- _WRAP_METHOD(static std::string compute_checksum(ChecksumType checksum_type, const guchar* data, gsize length), g_compute_checksum_for_data)
+ _WRAP_METHOD(static std::string compute_checksum(Type checksum_type, const guchar* data, gsize length), g_compute_checksum_for_data)
/** Computes the checksum of a string.
*
- * @param checksum_type A ChecksumType
+ * @param checksum_type A Type
* @param str The string to compute the checksum of.
* @result The checksum as a hexadecimal string.
*/
- static std::string compute_checksum(ChecksumType checksum_type, const std::string& str);
+ static std::string compute_checksum(Type checksum_type, const std::string& str);
_IGNORE(g_compute_checksum_for_string)
//We don't use _WRAP_METHOD because this is not really a GCheckSum function:
/** Gets the length in bytes of digests of type @a checksum_type.
*
- * @param checksum_type A ChecksumType.
+ * @param checksum_type A Type.
* @result The checksum length, or -1 if @a checksum_type is not supported.
*/
- static gssize get_length(ChecksumType checksum_type);
+ static gssize get_length(Type checksum_type);
};
} //namespace Glib
-
g_date_set_parse(&gobject_, str.c_str());
}
-_DEPRECATE_IFDEF_START
-
-// Avoid a build problem in the case that std::time_t is equivalent to gint32 (GTime is also gint32)
-// That would make the set_time() method overload impossible.
-#ifdef GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
-void
-Date::set_time(GTime time)
-{
- // This method, and the C function g_date_set_time() that it wraps, are deprecated.
- //(::time_t is used here instead of std::time_t, since the C function is declared
- // with ::time_t. It's not important. The C++ standard requires that ::time_t
- // and std::time_t shall be identical when both are defined.)
- g_date_set_time_t(&gobject_, static_cast<time_t>(time));
-}
-#endif // GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
-
-_DEPRECATE_IFDEF_END
-
void
Date::set_time(std::time_t timet)
{
return (Date::Weekday)g_date_get_weekday(&gobject_);
}
+int Date::get_weekday_as_int() const
+{
+ return g_date_get_weekday(&gobject_);
+}
+
Date::Month
Date::get_month() const
{
return (Date::Month)g_date_get_month(&gobject_);
}
+int Date::get_month_as_int() const
+{
+ return g_date_get_month(&gobject_);
+}
+
Date::Year
Date::get_year() const
{
using Day = guint8 ;
using Year = guint16;
- _WRAP_ENUM(Month, GDateMonth, s#^DATE_##, NO_GTYPE, get_type_func=)
- _WRAP_ENUM(Weekday, GDateWeekday, s#^DATE_##, NO_GTYPE)
- _WRAP_ENUM(DMY, GDateDMY, s#^DATE_##, NO_GTYPE)
+ _WRAP_ENUM(Month, GDateMonth, NO_GTYPE)
+ _WRAP_ENUM(Weekday, GDateWeekday, NO_GTYPE)
+ _WRAP_ENUM(DMY, GDateDMY, NO_GTYPE)
static const Day BAD_DAY = 0;
static const Year BAD_YEAR = 0;
*/
void set_parse (const Glib::ustring& str);
-
- _DEPRECATE_IFDEF_START
-
- //Avoid a build problem in the case that std::time_t is equivalent to gint32 (GTime is also gint32)
- //That would make the set_time() method overload impossible.
- #ifdef GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
- /** Sets the value of a date from a GTime value.
- *
- * @param time GTime value to set.
- *
- * @deprecated Please use set_time(std::time_t) or set_time(const GTimeVal&).
- */
- void set_time(GTime time);
- #endif //GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32
-
- _DEPRECATE_IFDEF_END
-
-
/** Sets the value of a date from a <type>std::time_t</type> value.
*
* @param timet std::time_t value to set
*/
Weekday get_weekday() const;
+ /** Returns the day of the week for a Date. The date must be valid.
+ * @return Day of the week as an int. Monday=1 .. Sunday=7.
+ */
+ int get_weekday_as_int() const;
+
/** Returns the month of the year. The date must be valid.
* @return Month of the year as a Date::Month.
*/
Month get_month() const;
+ /** Returns the month of the year. The date must be valid.
+ * @return Month of the year as an int. January=1 .. December=12.
+ */
+ int get_month_as_int() const;
+
/** Returns the year of a Date. The date must be valid.
* @return Year in which the date falls.
*/
regex.hg \
shell.hg \
spawn.hg \
- thread.hg \
- threads.hg \
timezone.hg \
unicode.hg \
uriutils.hg \
- valuearray.hg \
variant.hg \
variantdict.hg \
variantiter.hg \
s#^PERM$#NOT_OWNER#
)
-/** @enum FileError::Code
- * Values corresponding to <tt>errno</tt> codes returned from file operations
- * on UNIX.
- * Unlike <tt>errno</tt> codes, FileError::Code values are available on all
- * systems, even Windows. The exact meaning of each code depends on what sort
- * of file operation you were performing; the UNIX documentation gives more
- * details. The following error code descriptions come from the GNU C Library
- * manual, and are under the copyright of that manual.
- *
- * It's not very portable to make detailed assumptions about exactly which
- * errors will be returned from a given operation. Some errors don't occur on
- * some systems, etc., sometimes there are subtle differences in when a system
- * will report a given error, etc.
- */
-
/** @var FileError::Code FileError::EXISTS
- * <tt>(EEXIST)</tt> Operation not permitted; only the owner of the file (or
- * other resource) or processes with special privileges can perform the operation.
- * <br><br>
- */
-/** @var FileError::Code FileError::IS_DIRECTORY
- * <tt>(EISDIR)</tt> File is a directory; you cannot open a directory for writing,
- * or create or remove hard links to it.
- * <br><br>
- */
-/** @var FileError::Code FileError::ACCESS_DENIED
- * <tt>(EACCES)</tt> Permission denied; the file permissions do not allow the
- * attempted operation.
- * <br><br>
- */
-/** @var FileError::Code FileError::NAME_TOO_LONG
- * <tt>(ENAMETOOLONG)</tt> Filename too long.
- * <br><br>
- */
-/** @var FileError::Code FileError::NO_SUCH_ENTITY
- * <tt>(ENOENT)</tt> No such file or directory. This is a "file doesn't exist"
- * error for ordinary files that are referenced in contexts where they are expected
- * to already exist.
- * <br><br>
- */
-/** @var FileError::Code FileError::NOT_DIRECTORY
- * <tt>(ENOTDIR)</tt> A file that isn't a directory was specified when a directory
- * is required.
- * <br><br>
- */
-/** @var FileError::Code FileError::NO_SUCH_DEVICE
- * <tt>(ENXIO)</tt> No such device or address. The system tried to use the device
- * represented by a file you specified, and it couldn't find the device. This can
- * mean that the device file was installed incorrectly, or that the physical device
- * is missing or not correctly attached to the computer.
- * <br><br>
- */
-/** @var FileError::Code FileError::NOT_DEVICE
- * <tt>(ENODEV)</tt> This file is of a type that doesn't support mapping.
- * <br><br>
- */
-/** @var FileError::Code FileError::READONLY_FILESYSTEM
- * <tt>(EROFS)</tt> The directory containing the new link can't be modified
- * because it's on a read-only file system.
- * <br><br>
- */
-/** @var FileError::Code FileError::TEXT_FILE_BUSY
- * <tt>(ETXTBSY)</tt> Text file busy.
- * <br><br>
- */
-/** @var FileError::Code FileError::FAULTY_ADDRESS
- * <tt>(EFAULT)</tt> You passed in a pointer to bad memory. (Glib won't
- * reliably return this, don't pass in pointers to bad memory.)
- * <br><br>
- */
-/** @var FileError::Code FileError::SYMLINK_LOOP
- * <tt>(ELOOP)</tt> Too many levels of symbolic links were encountered in
- * looking up a file name. This often indicates a cycle of symbolic links.
- * <br><br>
- */
-/** @var FileError::Code FileError::NO_SPACE_LEFT
- * <tt>(ENOSPC)</tt> No space left on device; write operation on a file failed
- * because the disk is full.
- * <br><br>
- */
-/** @var FileError::Code FileError::NOT_ENOUGH_MEMORY
- * <tt>(ENOMEM)</tt> No memory available. The system cannot allocate more
- * virtual memory because its capacity is full.
- * <br><br>
- */
-/** @var FileError::Code FileError::TOO_MANY_OPEN_FILES
- * <tt>(EMFILE)</tt> The current process has too many files open and can't
- * open any more. Duplicate descriptors do count toward this limit.
- * <br><br>
- */
-/** @var FileError::Code FileError::FILE_TABLE_OVERFLOW
- * <tt>(ENFILE)</tt> There are too many distinct file openings in the
- * entire system.
- * <br><br>
- */
-/** @var FileError::Code FileError::BAD_FILE_DESCRIPTOR
- * <tt>(EBADF)</tt> Bad file descriptor; for example, I/O on a descriptor
- * that has been closed or reading from a descriptor open only for writing
- * (or vice versa).
- * <br><br>
- */
-/** @var FileError::Code FileError::INVALID_ARGUMENT
- * <tt>(EINVAL)</tt> Invalid argument. This is used to indicate various kinds
- * of problems with passing the wrong argument to a library function.
- * <br><br>
- */
-/** @var FileError::Code FileError::BROKEN_PIPE
- * <tt>(EPIPE)</tt> Broken pipe; there is no process reading from the other
- * end of a pipe. Every library function that returns this error code also
- * generates a <tt>SIGPIPE</tt> signal; this signal terminates the program
- * if not handled or blocked. Thus, your program will never actually see
- * this code unless it has handled or blocked <tt>SIGPIPE</tt>.
- * <br><br>
- */
-/** @var FileError::Code FileError::TRYAGAIN
- * <tt>(EAGAIN)</tt> Resource temporarily unavailable; the call might work
- * if you try again later.
- * We used TRYAGAIN instead of TRY_AGAIN, because that is a defined as a macro by a Unix header.
- * <br><br>
- */
-/** @var FileError::Code FileError::INTERRUPTED
- * <tt>(EINTR)</tt> Interrupted function call; an asynchronous signal occurred
- * and prevented completion of the call. When this happens, you should try
- * the call again.
- * <br><br>
- */
-/** @var FileError::Code FileError::IO_ERROR
- * <tt>(EIO)</tt> Input/output error; usually used for physical read or write
- * errors. I.e. the disk or other physical device hardware is returning errors.
- * <br><br>
- */
-/** @var FileError::Code FileError::NOT_OWNER
- * <tt>(EPERM)</tt> Operation not permitted; only the owner of the file (or other
- * resource) or processes with special privileges can perform the operation.
- * <br><br>
- */
-/** @var FileError::Code FileError::FAILED
- * Does not correspond to a UNIX error code; this is the standard "failed for
- * unspecified reason" error code present in all Glib::Error error code
- * enumerations. Returned if no specific code applies.
+ * <tt>(EEXIST)</tt>
+ *
+ * @var FileError::Code FileError::IS_DIRECTORY
+ * <tt>(EISDIR)</tt>
+ *
+ * @var FileError::Code FileError::ACCESS_DENIED
+ * <tt>(EACCES)</tt>
+ *
+ * @var FileError::Code FileError::NAME_TOO_LONG
+ * <tt>(ENAMETOOLONG)</tt>
+ *
+ * @var FileError::Code FileError::NO_SUCH_ENTITY
+ * <tt>(ENOENT)</tt>
+ *
+ * @var FileError::Code FileError::NOT_DIRECTORY
+ * <tt>(ENOTDIR)</tt>
+ *
+ * @var FileError::Code FileError::NO_SUCH_DEVICE
+ * <tt>(ENXIO)</tt>
+ *
+ * @var FileError::Code FileError::NOT_DEVICE
+ * <tt>(ENODEV)</tt>
+ *
+ * @var FileError::Code FileError::READONLY_FILESYSTEM
+ * <tt>(EROFS)</tt>
+ *
+ * @var FileError::Code FileError::TEXT_FILE_BUSY
+ * <tt>(ETXTBSY)</tt>
+ *
+ * @var FileError::Code FileError::FAULTY_ADDRESS
+ * <tt>(EFAULT)</tt>
+ *
+ * @var FileError::Code FileError::SYMLINK_LOOP
+ * <tt>(ELOOP)</tt>
+ *
+ * @var FileError::Code FileError::NO_SPACE_LEFT
+ * <tt>(ENOSPC)</tt>
+ *
+ * @var FileError::Code FileError::NOT_ENOUGH_MEMORY
+ * <tt>(ENOMEM)</tt>
+ *
+ * @var FileError::Code FileError::TOO_MANY_OPEN_FILES
+ * <tt>(EMFILE)</tt>
+ *
+ * @var FileError::Code FileError::FILE_TABLE_OVERFLOW
+ * <tt>(ENFILE)</tt>
+ *
+ * @var FileError::Code FileError::BAD_FILE_DESCRIPTOR
+ * <tt>(EBADF)</tt>
+ *
+ * @var FileError::Code FileError::INVALID_ARGUMENT
+ * <tt>(EINVAL)</tt>
+ *
+ * @var FileError::Code FileError::BROKEN_PIPE
+ * <tt>(EPIPE)</tt>
+ *
+ * @var FileError::Code FileError::TRYAGAIN
+ * <tt>(EAGAIN)</tt>
+ *
+ * We use TRYAGAIN instead of TRY_AGAIN, because that is defined as a macro by a Unix header.
+ *
+ * @var FileError::Code FileError::INTERRUPTED
+ * <tt>(EINTR)</tt>
+ *
+ * @var FileError::Code FileError::IO_ERROR
+ * <tt>(EIO)</tt>
+ *
+ * @var FileError::Code FileError::NOT_OWNER
+ * <tt>(EPERM)</tt>
+ *
+ * @var FileError::Code FileError::FAILED
+ * Returned if no specific code applies.
*/
class Dir;
*
* The actual name used is returned in @a name_used.
*
- * @param[out] name_used The actual name used.
* @param prefix Template for file name, basename only.
+ * @retval name_used The actual name used.
* @return A file handle (as from <tt>open()</tt>) to the file opened for reading
* and writing. The file is opened in binary mode on platforms where there is a
* difference. The file handle should be closed with <tt>close()</tt>.
* This function works like file_open_tmp(std::string&, const std::string&)
* but uses a default basename prefix.
*
- * @param[out] name_used The actual name used.
+ * @retval name_used The actual name used.
* @return A file handle (as from <tt>open()</tt>) to the file opened for reading
* and writing. The file is opened in binary mode on platforms where there is a
* difference. The file handle should be closed with <tt>close()</tt>.
<signal name="GObject::notify">
<description>
-The notify signal is emitted on an object when one of its
-properties has been changed. Note that getting this signal
-doesn't guarantee that the value of the property has actually
-changed, it may also be emitted when the setter for the property
-is called to reinstate the previous value.
+The notify signal is emitted on an object when one of its properties has
+its value set through g_object_set_property(), g_object_set(), et al.
+
+Note that getting this signal doesn’t itself guarantee that the value of
+the property has actually changed. When it is emitted is determined by the
+derived GObject class. If the implementor did not create the property with
+%G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results
+in ::notify being emitted, even if the new value is the same as the old.
+If they did pass %G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only
+when they explicitly call g_object_notify() or g_object_notify_by_pspec(),
+and common practice is to do that only when the value has actually changed.
This signal is typically used to obtain change notification for a
single property, by specifying the property name as a detail in the
text_view)
]|
It is important to note that you must use
-[canonical][canonical-parameter-name] parameter names as
+[canonical parameter names][canonical-parameter-names] as
detail strings for the notify signal.
</description>
<parameter_description> Zanabazar Square. Since: 2.54
</parameter_description>
</parameter>
+<parameter name="G_UNICODE_SCRIPT_DOGRA">
+<parameter_description> Dogra. Since: 2.58
+</parameter_description>
+</parameter>
+<parameter name="G_UNICODE_SCRIPT_GUNJALA_GONDI">
+<parameter_description> Gunjala Gondi. Since: 2.58
+</parameter_description>
+</parameter>
+<parameter name="G_UNICODE_SCRIPT_HANIFI_ROHINGYA">
+<parameter_description> Hanifi Rohingya. Since: 2.58
+</parameter_description>
+</parameter>
+<parameter name="G_UNICODE_SCRIPT_MAKASAR">
+<parameter_description> Makasar. Since: 2.58
+</parameter_description>
+</parameter>
+<parameter name="G_UNICODE_SCRIPT_MEDEFAIDRIN">
+<parameter_description> Medefaidrin. Since: 2.58
+</parameter_description>
+</parameter>
+<parameter name="G_UNICODE_SCRIPT_OLD_SOGDIAN">
+<parameter_description> Old Sogdian. Since: 2.58
+</parameter_description>
+</parameter>
+<parameter name="G_UNICODE_SCRIPT_SOGDIAN">
+<parameter_description> Sogdian. Since: 2.58
+</parameter_description>
+</parameter>
</parameters>
</enum>
<function name="g_array_free">
<description>
Frees the memory allocated for the #GArray. If @free_segment is
-%TRUE it frees the memory block holding the elements as well and
-also each element if @array has a @element_free_func set. Pass
+%TRUE it frees the memory block holding the elements as well. Pass
%FALSE if you want to free the #GArray wrapper but preserve the
-underlying array for use elsewhere. If the reference count of @array
-is greater than one, the #GArray wrapper is preserved but the size
-of @array will be set to zero.
+underlying array for use elsewhere. If the reference count of
+@array is greater than one, the #GArray wrapper is preserved but
+the size of @array will be set to zero.
-If array elements contain dynamically-allocated memory, they should
-be freed separately.
+If array contents point to dynamically-allocated memory, they should
+be freed separately if @free_seg is %TRUE and no @clear_func
+function has been set for @array.
This function is not thread-safe. If using a #GArray from multiple
threads, use only the atomic g_array_ref() and g_array_unref()
<description>
Inserts @len elements into a #GArray at the given index.
+If @index_ is greater than the array’s current length, the array is expanded.
+The elements between the old end of the array and the newly inserted elements
+will be initialised to zero if the array was configured to clear elements;
+otherwise their values will be undefined.
+
+@data may be %NULL if (and only if) @len is zero. If @len is zero, this
+function is a no-op.
+
</description>
<parameters>
<description>
Adds @len elements onto the start of the array.
+@data may be %NULL if (and only if) @len is zero. If @len is zero, this
+function is a no-op.
+
This operation is slower than g_array_append_vals() since the
existing elements in the array have to be moved to make space for
the new elements.
</parameter_description>
</parameter>
<parameter name="len">
-<parameter_description> the number of elements to prepend
+<parameter_description> the number of elements to prepend, which may be zero
</parameter_description>
</parameter>
</parameters>
The macro can be turned off in final releases of code by defining
`G_DISABLE_ASSERT` when compiling the application, so code must
-not depend on any side effects from @expr.
+not depend on any side effects from @expr. Similarly, it must not be used
+in unit tests, otherwise the unit tests will be ineffective if compiled with
+`G_DISABLE_ASSERT`. Use g_assert_true() and related macros in unit tests
+instead.
</description>
<parameters>
<return></return>
</function>
+<function name="g_assert_cmpfloat_with_epsilon">
+<description>
+Debugging macro to compare two floating point numbers within an epsilon.
+
+The effect of `g_assert_cmpfloat_with_epsilon (n1, n2, epsilon)` is
+the same as `g_assert_true (abs (n1 - n2) < epsilon)`. The advantage
+of this macro is that it can produce a message that includes the
+actual values of @n1 and @n2.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="n1">
+<parameter_description> an floating point number
+</parameter_description>
+</parameter>
+<parameter name="n2">
+<parameter_description> another floating point number
+</parameter_description>
+</parameter>
+<parameter name="epsilon">
+<parameter_description> a numeric value that expresses the expected tolerance
+between @n1 and @n2
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_assert_cmphex">
<description>
Debugging macro to compare to unsigned integers.
an error message is logged and the application is either
terminated or the testcase marked as failed.
+Note that unlike g_assert(), this macro is unaffected by whether
+`G_DISABLE_ASSERT` is defined. Hence it should only be used in tests and,
+conversely, g_assert() should not be used in tests.
+
See g_test_set_nonfatal_assertions().
Since: 2.38
an error message is logged and the application is either
terminated or the testcase marked as failed.
+Note that unlike g_assert(), this macro is unaffected by whether
+`G_DISABLE_ASSERT` is defined. Hence it should only be used in tests and,
+conversely, g_assert() should not be used in tests.
+
See g_test_set_nonfatal_assertions().
Since: 2.40
application is terminated.
The macro can be turned off in final releases of code by defining
-`G_DISABLE_ASSERT` when compiling the application.
+`G_DISABLE_ASSERT` when compiling the application. Hence, it should not be
+used in unit tests, where assertions should always be effective.
</description>
<parameters>
an error message is logged and the application is either
terminated or the testcase marked as failed.
+Note that unlike g_assert(), this macro is unaffected by whether
+`G_DISABLE_ASSERT` is defined. Hence it should only be used in tests and,
+conversely, g_assert() should not be used in tests.
+
See g_test_set_nonfatal_assertions().
Since: 2.38
an error message is logged and the application is either
terminated or the testcase marked as failed.
+Note that unlike g_assert(), this macro is unaffected by whether
+`G_DISABLE_ASSERT` is defined. Hence it should only be used in tests and,
+conversely, g_assert() should not be used in tests.
+
See g_test_set_nonfatal_assertions().
Since: 2.38
</return>
</function>
+<function name="g_atomic_rc_box_acquire">
+<description>
+Atomically acquires a reference on the data pointed by @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the data,
+with its reference count increased
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_alloc">
+<description>
+Allocates @block_size bytes of memory, and adds atomic
+reference counting semantics to it.
+
+The data will be freed when its reference count drops to
+zero.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="block_size">
+<parameter_description> the size of the allocation, must be greater than 0
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated memory
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_alloc0">
+<description>
+Allocates @block_size bytes of memory, and adds atomic
+referenc counting semantics to it.
+
+The contents of the returned data is set to zero.
+
+The data will be freed when its reference count drops to
+zero.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="block_size">
+<parameter_description> the size of the allocation, must be greater than 0
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated memory
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_dup">
+<description>
+Allocates a new block of data with atomit reference counting
+semantics, and copies @block_size bytes of @mem_block
+into it.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="block_size">
+<parameter_description> the number of bytes to copy, must be greater than 0
+</parameter_description>
+</parameter>
+<parameter name="mem_block">
+<parameter_description> the memory to copy
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated
+memory
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_get_size">
+<description>
+Retrieves the size of the reference counted data pointed by @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+</parameters>
+<return> the size of the data, in bytes
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_new">
+<description>
+A convenience macro to allocate atomically reference counted
+data with the size of the given @type.
+
+This macro calls g_atomic_rc_box_alloc() with `sizeof (@type)` and
+casts the returned pointer to a pointer of the given @type,
+avoiding a type cast in the source code.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="type">
+<parameter_description> the type to allocate, typically a structure name
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated
+memory, cast to a pointer for the given @type
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_new0">
+<description>
+A convenience macro to allocate atomically reference counted
+data with the size of the given @type, and set its contents
+to zero.
+
+This macro calls g_atomic_rc_box_alloc0() with `sizeof (@type)` and
+casts the returned pointer to a pointer of the given @type,
+avoiding a type cast in the source code.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="type">
+<parameter_description> the type to allocate, typically a structure name
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated
+memory, cast to a pointer for the given @type
+
+</return>
+</function>
+
+<function name="g_atomic_rc_box_release">
+<description>
+Atomically releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will free the
+resources allocated for @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_atomic_rc_box_release_full">
+<description>
+Atomically releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will call @clear_func
+to clear the contents of @mem_block, and then will free the
+resources allocated for @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+<parameter name="clear_func">
+<parameter_description> a function to call when clearing the data
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_atomic_ref_count_compare">
+<description>
+Atomically compares the current value of @arc with @val.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="arc">
+<parameter_description> the address of an atomic reference count variable
+</parameter_description>
+</parameter>
+<parameter name="val">
+<parameter_description> the value to compare
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the reference count is the same
+as the given value
+
+</return>
+</function>
+
+<function name="g_atomic_ref_count_dec">
+<description>
+Atomically decreases the reference count.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="arc">
+<parameter_description> the address of an atomic reference count variable
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the reference count reached 0, and %FALSE otherwise
+
+</return>
+</function>
+
+<function name="g_atomic_ref_count_inc">
+<description>
+Atomically increases the reference count.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="arc">
+<parameter_description> the address of an atomic reference count variable
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_atomic_ref_count_init">
+<description>
+Atomically initializes a reference count variable.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="arc">
+<parameter_description> the address of an atomic reference count variable
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_auto">
<description>
Helper to declare a variable with automatic cleanup.
<function name="g_bookmark_file_get_app_info">
<description>
-Gets the registration informations of @app_name for the bookmark for
-@uri. See g_bookmark_file_set_app_info() for more informations about
+Gets the registration information of @app_name for the bookmark for
+@uri. See g_bookmark_file_set_app_info() for more information about
the returned data.
The string returned in @app_exec must be freed.
This function looks for a desktop bookmark file named @file in the
paths returned from g_get_user_data_dir() and g_get_system_data_dirs(),
loads the file into @bookmark and returns the file's full path in
-@full_path. If the file could not be loaded then an %error is
+@full_path. If the file could not be loaded then @error is
set to either a #GFileError or #GBookmarkFileError.
Since: 2.12
<description>
Compares the two #GBytes values.
-This function can be used to sort GBytes instances in lexographical order.
+This function can be used to sort GBytes instances in lexicographical order.
+
+If @bytes1 and @bytes2 have different length but the shorter one is a
+prefix of the longer one then the shorter one is considered to be less than
+the longer one. Otherwise the first byte where both differ is used for
+comparison. If @bytes1 has a smaller value at that position it is
+considered less, otherwise greater than @bytes2.
Since: 2.32
</parameter_description>
</parameter>
</parameters>
-<return> a negative value if bytes2 is lesser, a positive value if bytes2 is
-greater, and zero if bytes2 is equal to bytes1
+<return> a negative value if @bytes1 is less than @bytes2, a positive value
+if @bytes1 is greater than @bytes2, and zero if @bytes1 is equal to
+@bytes2
+
</return>
</function>
<return></return>
</function>
+<function name="g_canonicalize_filename">
+<description>
+Gets the canonical file name from @filename. All triple slashes are turned into
+single slashes, and all `..` and `.`s resolved against @relative_to.
+
+Symlinks are not followed, and the returned path is guaranteed to be absolute.
+
+If @filename is an absolute path, @relative_to is ignored. Otherwise,
+@relative_to will be prepended to @filename to make it absolute. @relative_to
+must be an absolute path, or %NULL. If @relative_to is %NULL, it'll fallback
+to g_get_current_dir().
+
+This function never fails, and will canonicalize file paths even if they don't
+exist.
+
+No file system I/O is done.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="filename">
+<parameter_description> the name of the file
+</parameter_description>
+</parameter>
+<parameter name="relative_to">
+<parameter_description> the relative directory, or %NULL
+to use the current working directory
+</parameter_description>
+</parameter>
+</parameters>
+<return> a newly allocated string with the
+canonical file path
+</return>
+</function>
+
<function name="g_cclosure_marshal_BOOLEAN__BOXED_BOXED">
<description>
A #GClosureMarshal function for use with signals with handlers that
Creates a new closure which invokes @callback_func with @user_data as
the last parameter.
+@destroy_data will be called as a finalize notifier on the #GClosure.
+
</description>
<parameters>
Creates a new closure which invokes @callback_func with @user_data as
the first parameter.
+@destroy_data will be called as a finalize notifier on the #GClosure.
+
</description>
<parameters>
pointer is set to %NULL.
A macro is also included that allows this function to be used without
-pointer casts.
+pointer casts. This will mask any warnings about incompatible function types
+or calling conventions, so you must ensure that your @destroy function is
+compatible with being called as `GDestroyNotify` using the standard calling
+convention for the platform that GLib was compiled for; otherwise the program
+will experience undefined behaviour.
Since: 2.34
</description>
<parameters>
<parameter name="closure">
-<parameter_description> GClosure to invalidate
+<parameter_description> #GClosure to invalidate
</parameter_description>
</parameter>
</parameters>
<function name="g_critical">
<description>
Logs a "critical warning" (#G_LOG_LEVEL_CRITICAL).
-It's more or less application-defined what constitutes
-a critical vs. a regular warning. You could call
-g_log_set_always_fatal() to make critical warnings exit
-the program, then use g_critical() for fatal errors, for
-example.
-You can also make critical warnings fatal at runtime by
+Critical warnings are intended to be used in the event of an error
+that originated in the current process (a programmer error).
+Logging of a critical error is by definition an indication of a bug
+somewhere in the current program (or its libraries).
+
+g_return_if_fail(), g_return_val_if_fail(), g_return_if_reached() and
+g_return_val_if_reached() log at %G_LOG_LEVEL_CRITICAL.
+
+You can make critical warnings fatal at runtime by
setting the `G_DEBUG` environment variable (see
[Running GLib Applications](glib-running.html)):
G_DEBUG=fatal-warnings gdb ./my-program
]|
+You can also use g_log_set_always_fatal().
+
Any unrelated failures can be skipped over in
[gdb](https://www.gnu.org/software/gdb/) using the `continue` command.
To set the value of a date to the current day, you could write:
|[<!-- language="C" -->
-g_date_set_time_t (date, time (NULL));
+time_t now = time (NULL);
+if (now == (time_t) -1)
+// handle the error
+g_date_set_time_t (date, now);
]|
Since: 2.10
</return>
</function>
+<function name="g_date_time_get_timezone">
+<description>
+Get the time zone for this @datetime.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="datetime">
+<parameter_description> a #GDateTime
+</parameter_description>
+</parameter>
+</parameters>
+<return> the time zone
+</return>
+</function>
+
<function name="g_date_time_get_timezone_abbreviation">
<description>
Determines the time zone abbreviation to be used at the time and in
preferred for that instead, as it allows calling functions to perform actions
conditional on the type of error.
-Error messages are always fatal, resulting in a call to
-abort() to terminate the application. This function will
+Error messages are always fatal, resulting in a call to G_BREAKPOINT()
+to terminate the application. This function will
result in a core dump; don't use it for errors you expect.
Using this function indicates a bug in your program, i.e.
an assertion failure.
lists, metadata etc. may be lost. If @filename is a symbolic link,
the link itself will be replaced, not the linked file.
+- On UNIX, if @filename already exists and is non-empty, and if the system
+supports it (via a journalling filesystem or equivalent), the fsync()
+call (or equivalent) will be used to ensure atomic replacement: @filename
+will contain either its old contents or @contents, even in the face of
+system power loss, the disk being unsafely removed, etc.
+
+- On UNIX, if @filename does not already exist or is empty, there is a
+possibility that system power loss etc. after calling this function will
+leave @filename empty or full of NUL bytes, depending on the underlying
+filesystem.
+
- On Windows renaming a file will not remove an existing file with the
new name, so on Windows there is a race condition between the existing
file being removed and the temporary file being renamed.
</parameter_description>
</parameter>
</parameters>
-<return> a %NULL-terminated array of strings owned by GLib
-that must not be modified or freed.
+<return> a %NULL-terminated array of strings owned by
+the thread g_get_language_names_with_category was called from.
+It must not be modified or freed. It must be copied if planned to be used in another thread.
</return>
</function>
<return></return>
</function>
+<function name="g_hash_table_steal_extended">
+<description>
+Looks up a key in the #GHashTable, stealing the original key and the
+associated value and returning %TRUE if the key was found. If the key was
+not found, %FALSE is returned.
+
+If found, the stolen key and value are removed from the hash table without
+calling the key and value destroy functions, and ownership is transferred to
+the caller of this method; as with g_hash_table_steal().
+
+You can pass %NULL for @lookup_key, provided the hash and equal functions
+of @hash_table are %NULL-safe.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="hash_table">
+<parameter_description> a #GHashTable
+</parameter_description>
+</parameter>
+<parameter name="lookup_key">
+<parameter_description> the key to look up
+</parameter_description>
+</parameter>
+<parameter name="stolen_key">
+<parameter_description> return location for the
+original key
+</parameter_description>
+</parameter>
+<parameter name="stolen_value">
+<parameter_description> return location
+for the value associated with the key
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the key was found in the #GHashTable
+</return>
+</function>
+
<function name="g_hash_table_thaw">
<description>
This function is deprecated and will be removed in the next major
container itself.
@func, as a #GCopyFunc, takes two arguments, the data to be copied
-and a @user_data pointer. It's safe to pass %NULL as user_data,
-if the copy function takes only one argument.
+and a @user_data pointer. On common processor architectures, it's safe to
+pass %NULL as @user_data if the copy function takes only one argument. You
+may get compiler warnings from this though if compiling with GCC’s
+`-Wcast-function-type` warning.
For instance, if @list holds a list of GObjects, you can do:
|[<!-- language="C" -->
<description>
Logs an error or debugging message.
-If the log level has been set as fatal, the abort()
-function is called to terminate the program.
+If the log level has been set as fatal, G_BREAKPOINT() is called
+to terminate the program. See the documentation for G_BREAKPOINT() for
+details of the debugging options this provides.
If g_log_default_handler() is used as the log handler function, a new-line
character will automatically be appended to @..., and need not be entered
allows to install an alternate default log handler.
This is used if no log handler has been set for the particular log
domain and log level combination. It outputs the message to stderr
-or stdout and if the log level is fatal it calls abort(). It automatically
+or stdout and if the log level is fatal it calls G_BREAKPOINT(). It automatically
prints a new-line character after the message, so one does not need to be
manually included in @message.
g_log_set_writer_func(). See
[Using Structured Logging][using-structured-logging].
+This function is mostly intended to be used with
+%G_LOG_LEVEL_CRITICAL. You should typically not set
+%G_LOG_LEVEL_WARNING, %G_LOG_LEVEL_MESSAGE, %G_LOG_LEVEL_INFO or
+%G_LOG_LEVEL_DEBUG as fatal except inside of test programs.
+
</description>
<parameters>
Log a message with structured data. The message will be passed through to
the log writer set by the application using g_log_set_writer_func(). If the
message is fatal (i.e. its log level is %G_LOG_LEVEL_ERROR), the program will
-be aborted at the end of this function. If the log writer returns
+be aborted by calling G_BREAKPOINT() at the end of this function. If the log writer returns
%G_LOG_WRITER_UNHANDLED (failure), no other fallback writers will be tried.
See the documentation for #GLogWriterFunc for information on chaining
writers.
<description>
Logs an error or debugging message.
-If the log level has been set as fatal, the abort()
-function is called to terminate the program.
+If the log level has been set as fatal, G_BREAKPOINT() is called
+to terminate the program. See the documentation for G_BREAKPOINT() for
+details of the debugging options this provides.
If g_log_default_handler() is used as the log handler function, a new-line
character will automatically be appended to @..., and need not be entered
<description>
Tries to become the owner of the specified context,
as with g_main_context_acquire(). But if another thread
-is the owner, atomically drop @mutex and wait on @cond until
+is the owner, atomically drop @mutex and wait on @cond until
that owner releases ownership or until @cond is signaled, then
try again (once) to become the owner.
+Deprecated: 2.58: Use g_main_context_is_owner() and separate locking instead.
</description>
<parameters>
</description>
<parameters>
<parameter name="object">
-<parameter_description> GObject restricting lifetime of @closure
+<parameter_description> #GObject restricting lifetime of @closure
</parameter_description>
</parameter>
<parameter name="closure">
-<parameter_description> GClosure to watch
+<parameter_description> #GClosure to watch
</parameter_description>
</parameter>
</parameters>
</parameter_description>
</parameter>
</parameters>
-<return> a #GoptionGroup
+<return> a #GOptionGroup
</return>
</function>
<function name="g_path_get_dirname">
<description>
-Gets the directory components of a file name.
+Gets the directory components of a file name. For example, the directory
+component of `/usr/bin/test` is `/usr/bin`. The directory component of `/`
+is `/`.
If the file name has no directory components "." is returned.
The returned string should be freed when no longer needed.
Removes the pointer at the given index from the pointer array.
The following elements are moved down one place. If @array has
a non-%NULL #GDestroyNotify function it is called for the removed
-element.
+element. If so, the return value from this function will potentially point
+to freed memory (depending on the #GDestroyNotify implementation).
</description>
The last element in the array is used to fill in the space, so
this function does not preserve the order of the array. But it
is faster than g_ptr_array_remove_index(). If @array has a non-%NULL
-#GDestroyNotify function it is called for the removed element.
+#GDestroyNotify function it is called for the removed element. If so, the
+return value from this function will potentially point to freed memory
+(depending on the #GDestroyNotify implementation).
</description>
<return></return>
</function>
+<function name="g_ptr_array_steal_index">
+<description>
+Removes the pointer at the given index from the pointer array.
+The following elements are moved down one place. The #GDestroyNotify for
+@array is *not* called on the removed element; ownership is transferred to
+the caller of this function.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="array">
+<parameter_description> a #GPtrArray
+</parameter_description>
+</parameter>
+<parameter name="index_">
+<parameter_description> the index of the pointer to steal
+</parameter_description>
+</parameter>
+</parameters>
+<return> the pointer which was removed
+</return>
+</function>
+
+<function name="g_ptr_array_steal_index_fast">
+<description>
+Removes the pointer at the given index from the pointer array.
+The last element in the array is used to fill in the space, so
+this function does not preserve the order of the array. But it
+is faster than g_ptr_array_steal_index(). The #GDestroyNotify for @array is
+*not* called on the removed element; ownership is transferred to the caller
+of this function.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="array">
+<parameter_description> a #GPtrArray
+</parameter_description>
+</parameter>
+<parameter name="index_">
+<parameter_description> the index of the pointer to steal
+</parameter_description>
+</parameter>
+</parameters>
+<return> the pointer which was removed
+</return>
+</function>
+
<function name="g_ptr_array_unref">
<description>
Atomically decrements the reference count of @array by one. If the
<return></return>
</function>
+<function name="g_rc_box_acquire">
+<description>
+Acquires a reference on the data pointed by @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the data,
+with its reference count increased
+
+</return>
+</function>
+
+<function name="g_rc_box_alloc">
+<description>
+Allocates @block_size bytes of memory, and adds reference
+counting semantics to it.
+
+The data will be freed when its reference count drops to
+zero.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="block_size">
+<parameter_description> the size of the allocation, must be greater than 0
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated memory
+
+</return>
+</function>
+
+<function name="g_rc_box_alloc0">
+<description>
+Allocates @block_size bytes of memory, and adds reference
+counting semantics to it.
+
+The contents of the returned data is set to zero.
+
+The data will be freed when its reference count drops to
+zero.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="block_size">
+<parameter_description> the size of the allocation, must be greater than 0
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated memory
+
+</return>
+</function>
+
+<function name="g_rc_box_dup">
+<description>
+Allocates a new block of data with reference counting
+semantics, and copies @block_size bytes of @mem_block
+into it.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="block_size">
+<parameter_description> the number of bytes to copy, must be greater than 0
+</parameter_description>
+</parameter>
+<parameter name="mem_block">
+<parameter_description> the memory to copy
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the allocated
+memory
+
+</return>
+</function>
+
+<function name="g_rc_box_get_size">
+<description>
+Retrieves the size of the reference counted data pointed by @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+</parameters>
+<return> the size of the data, in bytes
+
+</return>
+</function>
+
+<function name="g_rc_box_new">
+<description>
+A convenience macro to allocate reference counted data with
+the size of the given @type.
+
+This macro calls g_rc_box_alloc() with `sizeof (@type)` and
+casts the returned pointer to a pointer of the given @type,
+avoiding a type cast in the source code.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="type">
+<parameter_description> the type to allocate, typically a structure name
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the
+allocated memory, cast to a pointer for the given @type
+
+</return>
+</function>
+
+<function name="g_rc_box_new0">
+<description>
+A convenience macro to allocate reference counted data with
+the size of the given @type, and set its contents to zero.
+
+This macro calls g_rc_box_alloc0() with `sizeof (@type)` and
+casts the returned pointer to a pointer of the given @type,
+avoiding a type cast in the source code.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="type">
+<parameter_description> the type to allocate, typically a structure name
+</parameter_description>
+</parameter>
+</parameters>
+<return> a pointer to the
+allocated memory, cast to a pointer for the given @type
+
+</return>
+</function>
+
+<function name="g_rc_box_release">
+<description>
+Releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will free the
+resources allocated for @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_rc_box_release_full">
+<description>
+Releases a reference on the data pointed by @mem_block.
+
+If the reference was the last one, it will call @clear_func
+to clear the contents of @mem_block, and then will free the
+resources allocated for @mem_block.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="mem_block">
+<parameter_description> a pointer to reference counted data
+</parameter_description>
+</parameter>
+<parameter name="clear_func">
+<parameter_description> a function to call when clearing the data
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_realloc">
<description>
Reallocates the memory pointed to by @mem, so that it now has space for
<return></return>
</function>
+<function name="g_ref_count_compare">
+<description>
+Compares the current value of @rc with @val.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="rc">
+<parameter_description> the address of a reference count variable
+</parameter_description>
+</parameter>
+<parameter name="val">
+<parameter_description> the value to compare
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the reference count is the same
+as the given value
+
+</return>
+</function>
+
+<function name="g_ref_count_dec">
+<description>
+Decreases the reference count.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="rc">
+<parameter_description> the address of a reference count variable
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the reference count reached 0, and %FALSE otherwise
+
+</return>
+</function>
+
+<function name="g_ref_count_inc">
+<description>
+Increases the reference count.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="rc">
+<parameter_description> the address of a reference count variable
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_ref_count_init">
+<description>
+Initializes a reference count variable.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="rc">
+<parameter_description> the address of a reference count variable
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_ref_string_acquire">
+<description>
+Acquires a reference on a string.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a reference counted string
+</parameter_description>
+</parameter>
+</parameters>
+<return> the given string, with its reference count increased
+
+</return>
+</function>
+
+<function name="g_ref_string_length">
+<description>
+Retrieves the length of @str.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a reference counted string
+</parameter_description>
+</parameter>
+</parameters>
+<return> the length of the given string, in bytes
+
+</return>
+</function>
+
+<function name="g_ref_string_new">
+<description>
+Creates a new reference counted string and copies the contents of @str
+into it.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a NUL-terminated string
+</parameter_description>
+</parameter>
+</parameters>
+<return> the newly created reference counted string
+
+</return>
+</function>
+
+<function name="g_ref_string_new_intern">
+<description>
+Creates a new reference counted string and copies the content of @str
+into it.
+
+If you call this function multiple times with the same @str, or with
+the same contents of @str, it will return a new reference, instead of
+creating a new string.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a NUL-terminated string
+</parameter_description>
+</parameter>
+</parameters>
+<return> the newly created reference
+counted string, or a new reference to an existing string
+
+</return>
+</function>
+
+<function name="g_ref_string_new_len">
+<description>
+Creates a new reference counted string and copies the contents of @str
+into it, up to @len bytes.
+
+Since this function does not stop at nul bytes, it is the caller's
+responsibility to ensure that @str has at least @len addressable bytes.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a string
+</parameter_description>
+</parameter>
+<parameter name="len">
+<parameter_description> length of @str to use, or -1 if @str is nul-terminated
+</parameter_description>
+</parameter>
+</parameters>
+<return> the newly created reference counted string
+
+</return>
+</function>
+
+<function name="g_ref_string_release">
+<description>
+Releases a reference on a string; if it was the last reference, the
+resources allocated by the string are freed as well.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a reference counted string
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_regex_check_replacement">
<description>
Checks whether @replacement is a valid replacement string
</parameter_description>
</parameter>
<parameter name="length">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
</parameters>
<function name="g_regex_match">
<description>
-Scans for a match in string for the pattern in @regex.
+Scans for a match in @string for the pattern in @regex.
The @match_options are combined with the match options specified
when the @regex structure was created, letting you have more
flexibility in reusing #GRegex structures.
+Unless %G_REGEX_RAW is specified in the options, @string must be valid UTF-8.
+
A #GMatchInfo structure, used to get information on the match,
is stored in @match_info if not %NULL. Note that if @match_info
is not %NULL then it is created even if the function returns %FALSE,
<function name="g_regex_match_all_full">
<description>
Using the standard algorithm for regular expression matching only
-the longest match in the string is retrieved, it is not possible
+the longest match in the @string is retrieved, it is not possible
to obtain all the available matches. For instance matching
"<a> <b> <c>" against the pattern "<.*>"
you get "<a> <b> <c>".
string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
that begins with any kind of lookbehind assertion, such as "\b".
+Unless %G_REGEX_RAW is specified in the options, @string must be valid UTF-8.
+
A #GMatchInfo structure, used to get information on the match, is
stored in @match_info if not %NULL. Note that if @match_info is
not %NULL then it is created even if the function returns %FALSE,
</parameter_description>
</parameter>
<parameter name="string_len">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
<parameter name="start_position">
<function name="g_regex_match_full">
<description>
-Scans for a match in string for the pattern in @regex.
+Scans for a match in @string for the pattern in @regex.
The @match_options are combined with the match options specified
when the @regex structure was created, letting you have more
flexibility in reusing #GRegex structures.
string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
that begins with any kind of lookbehind assertion, such as "\b".
+Unless %G_REGEX_RAW is specified in the options, @string must be valid UTF-8.
+
A #GMatchInfo structure, used to get information on the match, is
stored in @match_info if not %NULL. Note that if @match_info is
not %NULL then it is created even if the function returns %FALSE,
</parameter_description>
</parameter>
<parameter name="string_len">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
<parameter name="start_position">
</parameter_description>
</parameter>
<parameter name="string_len">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
<parameter name="start_position">
</parameter_description>
</parameter>
<parameter name="string_len">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
<parameter name="start_position">
</parameter_description>
</parameter>
<parameter name="string_len">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
<parameter name="start_position">
</parameter_description>
</parameter>
<parameter name="string_len">
-<parameter_description> the length of @string, or -1 if @string is nul-terminated
+<parameter_description> the length of @string, in bytes, or -1 if @string is nul-terminated
</parameter_description>
</parameter>
<parameter name="start_position">
<function name="g_sequence_insert_sorted">
<description>
-Inserts @data into @sequence using @func to determine the new
+Inserts @data into @seq using @cmp_func to determine the new
position. The sequence must already be sorted according to @cmp_func;
otherwise the new position of @data is undefined.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value
if the first item comes before the second, and a positive value
-if the second item comes before the first.
+if the second item comes before the first.
Note that when adding a large amount of data to a #GSequence,
it is more efficient to do unsorted insertions and then call
value if the first iterator comes before the second, and a
positive value if the second iterator comes before the first.
-It is called with two iterators pointing into @seq. It should
-return 0 if the iterators are equal, a negative value if the
-first iterator comes before the second, and a positive value
-if the second iterator comes before the first.
-
Note that when adding a large amount of data to a #GSequence,
it is more efficient to do unsorted insertions and then call
g_sequence_sort() or g_sequence_sort_iter().
</parameter_description>
</parameter>
<parameter name="cmp_data">
-<parameter_description> user data passed to @cmp_func
+<parameter_description> user data passed to @iter_cmp
</parameter_description>
</parameter>
</parameters>
returned. In that case, you can use g_sequence_iter_next() and
g_sequence_iter_prev() to get others.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
</parameter>
</parameters>
<return> an #GSequenceIter pointing to the position of
-the first item found equal to @data according to @cmp_func
+the first item found equal to @data according to @iter_cmp
and @cmp_data, or %NULL if no such item exists
</return>
<function name="g_sequence_move_range">
<description>
-Inserts the (@begin, @end) range at the destination pointed to by ptr.
+Inserts the (@begin, @end) range at the destination pointed to by @dest.
The @begin and @end iters must point into the same sequence. It is
allowed for @dest to point to a different sequence than the one pointed
into by @begin and @end.
-If @dest is NULL, the range indicated by @begin and @end is
-removed from the sequence. If @dest iter points to a place within
+If @dest is %NULL, the range indicated by @begin and @end is
+removed from the sequence. If @dest points to a place within
the (@begin, @end) range, the range does not move.
Since: 2.14
Returns an iterator pointing to the position where @data would
be inserted according to @cmp_func and @cmp_data.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
<function name="g_sequence_sort_changed">
<description>
-Moves the data pointed to a new position as indicated by @cmp_func. This
+Moves the data pointed to by @iter to a new position as indicated by
+@cmp_func. This
function should be called for items in a sequence already sorted according
to @cmp_func whenever some aspect of an item changes so that @cmp_func
may return different values for that item.
-@cmp_func is called with two items of the @seq and @user_data.
+@cmp_func is called with two items of the @seq, and @cmp_data.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as
the compare function.
-@iter_cmp is called with two iterators pointing into @seq. It should
+@iter_cmp is called with two iterators pointing into the #GSequence that
+@iter points into. It should
return 0 if the iterators are equal, a negative value if the first
iterator comes before the second, and a positive value if the second
iterator comes before the first.
<function name="g_sequence_sort_iter">
<description>
Like g_sequence_sort(), but uses a #GSequenceIterCompareFunc instead
-of a GCompareDataFunc as the compare function
+of a #GCompareDataFunc as the compare function
@cmp_func is called with two iterators pointing into @seq. It should
return 0 if the iterators are equal, a negative value if the first
Creates a new signal. (This is usually done in the class initializer.)
This is a variant of g_signal_new() that takes a C callback instead
-off a class offset for the signal's class handler. This function
+of a class offset for the signal's class handler. This function
doesn't need a function pointer exposed in the class structure of
an object definition, instead the function pointer is passed
directly and can be overriden by derived classes with
In contrast with g_slist_copy(), this function uses @func to make a copy of
each list element, in addition to copying the list container itself.
-@func, as a #GCopyFunc, takes two arguments, the data to be copied and a user
-pointer. It's safe to pass #NULL as user_data, if the copy function takes only
-one argument.
+@func, as a #GCopyFunc, takes two arguments, the data to be copied
+and a @user_data pointer. On common processor architectures, it's safe to
+pass %NULL as @user_data if the copy function takes only one argument. You
+may get compiler warnings from this though if compiling with GCC’s
+`-Wcast-function-type` warning.
For instance, if @list holds a list of GObjects, you can do:
|[<!-- language="C" -->
</parameter_description>
</parameter>
</parameters>
-<return> a full copy of @list, use #g_slist_free_full to free it
+<return> a full copy of @list, use g_slist_free_full() to free it
</return>
</function>
context. The reverse
mapping from ID to source is done by g_main_context_find_source_by_id().
+You can only call this function while the source is associated to a
+#GMainContext instance; calling this function before g_source_attach()
+or after g_source_destroy() yields undefined behavior. The ID returned
+is unique within the #GMainContext instance passed to g_source_attach().
+
</description>
<parameters>
The exact type of @func depends on the type of source; ie. you
should not count on @func being called with @data as its first
-parameter.
+parameter. Cast @func with G_SOURCE_FUNC() to avoid warnings about
+incompatible function types.
See [memory management of sources][mainloop-memory-management] for details
on how to handle memory management of @data.
Typically, you won't use this function. Instead use functions specific
-to the type of source you are using.
+to the type of source you are using, such as g_idle_add() or g_timeout_add().
+
+It is safe to call this function multiple times on a source which has already
+been attached to a context. The changes will take effect for the next time
+the source is dispatched after this call returns.
</description>
<parameters>
@callback_funcs->unref will eventually be called once more
than @callback_funcs->ref.
+It is safe to call this function multiple times on a source which has already
+been attached to a context. The changes will take effect for the next time
+the source is dispatched after this call returns.
+
</description>
<parameters>
<parameter name="source">
</return>
</function>
+<function name="g_spawn_async_with_fds">
+<description>
+Identical to g_spawn_async_with_pipes() but instead of
+creating pipes for the stdin/stdout/stderr, you can pass existing
+file descriptors into this function through the @stdin_fd,
+@stdout_fd and @stderr_fd parameters. The following @flags
+also have their behaviour slightly tweaked as a result:
+
+%G_SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output
+will be discarded, instead of going to the same location as the parent's
+standard output. If you use this flag, @standard_output must be -1.
+%G_SPAWN_STDERR_TO_DEV_NULL means that the child's standard error
+will be discarded, instead of going to the same location as the parent's
+standard error. If you use this flag, @standard_error must be -1.
+%G_SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's
+standard input (by default, the child's standard input is attached to
+/dev/null). If you use this flag, @standard_input must be -1.
+
+It is valid to pass the same fd in multiple parameters (e.g. you can pass
+a single fd for both stdout and stderr).
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="working_directory">
+<parameter_description> child's current working directory, or %NULL to inherit parent's, in the GLib file name encoding
+</parameter_description>
+</parameter>
+<parameter name="argv">
+<parameter_description> child's argument vector, in the GLib file name encoding
+</parameter_description>
+</parameter>
+<parameter name="envp">
+<parameter_description> child's environment, or %NULL to inherit parent's, in the GLib file name encoding
+</parameter_description>
+</parameter>
+<parameter name="flags">
+<parameter_description> flags from #GSpawnFlags
+</parameter_description>
+</parameter>
+<parameter name="child_setup">
+<parameter_description> function to run in the child just before exec()
+</parameter_description>
+</parameter>
+<parameter name="user_data">
+<parameter_description> user data for @child_setup
+</parameter_description>
+</parameter>
+<parameter name="child_pid">
+<parameter_description> return location for child process ID, or %NULL
+</parameter_description>
+</parameter>
+<parameter name="stdin_fd">
+<parameter_description> file descriptor to use for child's stdin, or -1
+</parameter_description>
+</parameter>
+<parameter name="stdout_fd">
+<parameter_description> file descriptor to use for child's stdout, or -1
+</parameter_description>
+</parameter>
+<parameter name="stderr_fd">
+<parameter_description> file descriptor to use for child's stderr, or -1
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> return location for error
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE on success, %FALSE if an error was set
+
+</return>
+</function>
+
<function name="g_spawn_async_with_pipes">
<description>
Executes a child program asynchronously (your program will not
is equivalent to calling CloseHandle() on the process handle returned
in @child_pid). See g_child_watch_add().
-%G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
-descriptors will be inherited by the child; otherwise all descriptors
-except stdin/stdout/stderr will be closed before calling exec() in
-the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
+Open UNIX file descriptors marked as `FD_CLOEXEC` will be automatically
+closed in the child process. %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that
+other open file descriptors will be inherited by the child; otherwise all
+descriptors except stdin/stdout/stderr will be closed before calling exec()
+in the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
absolute path, it will be looked for in the `PATH` environment
variable. %G_SPAWN_SEARCH_PATH_FROM_ENVP means need not be an
absolute path, it will be looked for in the `PATH` variable from
If @child_pid is not %NULL and an error does not occur then the returned
process reference must be closed using g_spawn_close_pid().
+On modern UNIX platforms, GLib can use an efficient process launching
+codepath driven internally by posix_spawn(). This has the advantage of
+avoiding the fork-time performance costs of cloning the parent process
+address space, and avoiding associated memory overcommit checks that are
+not relevant in the context of immediately executing a distinct process.
+This optimized codepath will be used provided that the following conditions
+are met:
+
+1. %G_SPAWN_DO_NOT_REAP_CHILD is set
+2. %G_SPAWN_LEAVE_DESCRIPTORS_OPEN is set
+3. %G_SPAWN_SEARCH_PATH_FROM_ENVP is not set
+4. @working_directory is %NULL
+5. @child_setup is %NULL
+6. The program is of a recognised binary format, or has a shebang. Otherwise, GLib will have to execute the program through the shell, which is not done using the optimized codepath.
+
If you are writing a GTK+ application, and the program you are spawning is a
graphical application too, then to ensure that the spawned program opens its
windows on the right screen, you may want to use #GdkAppLaunchContext,
@key_equal_func parameter, when using non-%NULL strings as keys in a
#GHashTable.
-Note that this function is primarily meant as a hash table comparison
-function. For a general-purpose, %NULL-safe string comparison function,
-see g_strcmp0().
+This function is typically used for hash table comparisons, but can be used
+for general purpose comparisons of non-%NULL strings. For a %NULL-safe string
+comparison function, see g_strcmp0().
</description>
If the source language of @str is known, it can used to improve the
accuracy of the translation by passing it as @from_locale. It should
be a valid POSIX locale string (of the form
-"language[_territory][.codeset][@modifier]").
+`language[_territory][.codeset][@modifier]`).
If @from_locale is %NULL then the current locale is used.
If you want to do translation for no specific locale, and you want it
-to be done independently of the currently locale, specify "C" for
+to be done independently of the currently locale, specify `"C"` for
@from_locale.
Since: 2.40
<function name="g_strv_length">
<description>
Returns the length of the given %NULL-terminated
-string array @str_array.
+string array @str_array. @str_array must not be %NULL.
Since: 2.6
- `--debug-log`: Debug test logging output.
+Since 2.58, if tests are compiled with `G_DISABLE_ASSERT` defined,
+g_test_init() will print an error and exit. This is to prevent no-op tests
+from being executed, as g_assert() is commonly (erroneously) used in unit
+tests, and is a no-op when compiled with `G_DISABLE_ASSERT`. Ensure your
+tests are compiled without `G_DISABLE_ASSERT` defined.
+
Since: 2.16
</description>
particular code runs before or after a given test case, use
g_test_add(), which lets you specify setup and teardown functions.
-If all tests are skipped, this function will return 0 if
-producing TAP output, or 77 (treated as "skip test" by Automake) otherwise.
+If all tests are skipped or marked as incomplete (expected failures),
+this function will return 0 if producing TAP output, or 77 (treated
+as "skip test" by Automake) otherwise.
Since: 2.16
<parameters>
</parameters>
<return> 0 on success, 1 on failure (assuming it returns at all),
-0 or 77 if all tests were skipped with g_test_skip()
+0 or 77 if all tests were skipped with g_test_skip() and/or
+g_test_incomplete()
</return>
</function>
zone indicator. (In the absence of any time zone indication, the
timestamp is assumed to be in local time.)
+Any leading or trailing space in @iso_date is ignored.
+
Since: 2.12
</description>
variation of ISO 8601 format is required.
If @time_ represents a date which is too large to fit into a `struct tm`,
-%NULL will be returned. This is platform dependent, but it is safe to assume
-years up to 3000 are supported. The return value of g_time_val_to_iso8601()
-has been nullable since GLib 2.54; before then, GLib would crash under the
-same conditions.
+%NULL will be returned. This is platform dependent. Note also that since
+`GTimeVal` stores the number of seconds as a `glong`, on 32-bit systems it
+is subject to the year 2038 problem.
+
+The return value of g_time_val_to_iso8601() has been nullable since GLib
+2.54; before then, GLib would crash under the same conditions.
Since: 2.12
</return>
</function>
+<function name="g_time_zone_get_identifier">
+<description>
+Get the identifier of this #GTimeZone, as passed to g_time_zone_new().
+If the identifier passed at construction time was not recognised, `UTC` will
+be returned. If it was %NULL, the identifier of the local timezone at
+construction time will be returned.
+
+The identifier will be returned in the same format as provided at
+construction time: if provided as a time offset, that will be returned by
+this function.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="tz">
+<parameter_description> a #GTimeZone
+</parameter_description>
+</parameter>
+</parameters>
+<return> identifier for this timezone
+</return>
+</function>
+
<function name="g_time_zone_get_offset">
<description>
Determines the offset to UTC in effect during a particular @interval
</return>
</function>
+<function name="g_time_zone_new_offset">
+<description>
+Creates a #GTimeZone corresponding to the given constant offset from UTC,
+in seconds.
+
+This is equivalent to calling g_time_zone_new() with a string in the form
+`[+|-]hh[:mm[:ss]]`.
+
+Since: 2.58
+
+</description>
+<parameters>
+<parameter name="seconds">
+<parameter_description> offset to UTC, in seconds
+</parameter_description>
+</parameter>
+</parameters>
+<return> a timezone at the given offset from UTC
+</return>
+</function>
+
<function name="g_time_zone_new_utc">
<description>
Creates a #GTimeZone corresponding to UTC.
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.
+The interval given is in terms of monotonic time, not wall clock time.
See g_get_monotonic_time().
The scheduling granularity/accuracy of this timeout source will be
in seconds.
-The interval given in terms of monotonic time, not wall clock time.
+The interval given is in terms of monotonic time, not wall clock time.
See g_get_monotonic_time().
Since: 2.14
]|
Since: 2.4
+Deprecated: 2.58: Use the G_ADD_PRIVATE() macro with the `G_DEFINE_*`
+family of macros to add instance private data to a type
</description>
<parameters>
</return>
</function>
+<function name="g_utf8_validate_len">
+<description>
+Validates UTF-8 encoded text.
+
+As with g_utf8_validate(), but @max_len must be set, and hence this function
+will always return %FALSE if any of the bytes of @str are nul.
+
+Since: 2.60
+
+</description>
+<parameters>
+<parameter name="str">
+<parameter_description> a pointer to character data
+</parameter_description>
+</parameter>
+<parameter name="max_len">
+<parameter_description> max bytes to validate
+</parameter_description>
+</parameter>
+<parameter name="end">
+<parameter_description> return location for end of valid data
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the text was valid UTF-8
+</return>
+</function>
+
<function name="g_utime">
<description>
A wrapper for the POSIX utime() function. The utime() function
</parameter_description>
</parameter>
</parameters>
-<return> a #guchar
+<return> a #guint8
</return>
</function>
The returned value is never floating. You should free it with
g_variant_unref() when you're done with it.
+There may be implementation specific restrictions on deeply nested values,
+which would result in the unit tuple being returned as the child value,
+instead of further nested children. #GVariant is guaranteed to handle
+nesting up to at least 64 levels.
+
This function is O(1).
Since: 2.24
the appropriate type:
- %G_VARIANT_TYPE_INT16 (etc.): #gint16 (etc.)
- %G_VARIANT_TYPE_BOOLEAN: #guchar (not #gboolean!)
-- %G_VARIANT_TYPE_BYTE: #guchar
+- %G_VARIANT_TYPE_BYTE: #guint8
- %G_VARIANT_TYPE_HANDLE: #guint32
- %G_VARIANT_TYPE_DOUBLE: #gdouble
being trusted. If the value was already marked as being trusted then
this function will immediately return %TRUE.
+There may be implementation specific restrictions on deeply nested values.
+GVariant is guaranteed to handle nesting up to at least 64 levels.
+
Since: 2.24
</description>
should ensure that a string is a valid D-Bus object path before
passing it to g_variant_new_object_path().
-A valid object path starts with '/' followed by zero or more
-sequences of characters separated by '/' characters. Each sequence
-must contain only the characters "[A-Z][a-z][0-9]_". No sequence
-(including the one following the final '/' character) may be empty.
+A valid object path starts with `/` followed by zero or more
+sequences of characters separated by `/` characters. Each sequence
+must contain only the characters `[A-Z][a-z][0-9]_`. No sequence
+(including the one following the final `/` character) may be empty.
Since: 2.24
preferred for that instead, as it allows calling functions to perform actions
conditional on the type of error.
+Warning messages are intended to be used in the event of unexpected
+external conditions (system misconfiguration, missing files,
+other trusted programs violating protocol, invalid contents in
+trusted files, etc.)
+
+If attempting to deal with programmer errors (for example, incorrect function
+parameters) then you should use %G_LOG_LEVEL_CRITICAL instead.
+
+g_warn_if_reached() and g_warn_if_fail() log at %G_LOG_LEVEL_WARNING.
+
You can make warnings fatal at runtime by setting the `G_DEBUG`
environment variable (see
[Running GLib Applications](glib-running.html)):
</return>
</function>
+<function name="gatomicrefcount">
+<description>
+A type for implementing atomic reference count semantics.
+
+Use g_atomic_ref_count_init() to initialize it; g_atomic_ref_count_inc()
+to increase the counter, and g_atomic_ref_count_dec() to decrease it.
+
+It is safe to use #gatomicrefcount if you're expecting to operate on the
+reference counter from multiple threads.
+
+See also: #grefcount
+
+Since: 2.58
+
+</description>
+<parameters>
+</parameters>
+<return></return>
+</function>
+
<function name="gboolean">
<description>
A standard boolean type.
<return></return>
</function>
+<function name="grefcount">
+<description>
+A type for implementing non-atomic reference count semantics.
+
+Use g_ref_count_init() to initialize it; g_ref_count_inc() to
+increase the counter, and g_ref_count_dec() to decrease it.
+
+It is safe to use #grefcount only if you're expecting to operate
+on the reference counter from a single thread. It is entirely up
+to you to ensure that all reference count changes happen in the
+same thread.
+
+See also: #gatomicrefcount
+
+Since: 2.58
+
+</description>
+<parameters>
+</parameters>
+<return></return>
+</function>
+
<function name="gshort">
<description>
Corresponds to the standard C short type.
<root>
+ <substitute_type_name from="GBindingFlags" to="Glib::Binding::Flags" />
+ <substitute_type_name from="GChecksumType" to="Glib::Checksum::Type" />
<substitute_type_name from="GDateMonth" to="Glib::Date::Month" />
<substitute_type_name from="GDateWeekday" to="Glib::Date::Weekday" />
<substitute_type_name from="GDateDMY" to="Glib::Date::DMY" />
-
+ <substitute_type_name from="GKeyFileFlags" to="Glib::KeyFile::Flags" />
+ <substitute_type_name from="GMarkupParseFlags" to="Glib::Markup::ParseFlags" />
+ <substitute_type_name from="GModuleFlags" to="Glib::Module::Flags" />
+ <substitute_type_name from="GRegexCompileFlags" to="Glib::Regex::CompileFlags" />
+ <substitute_type_name from="GRegexMatchFlags" to="Glib::Regex::MatchFlags" />
+
+ <substitute_enumerator_name from_prefix="G_BINDING_" to_prefix="Glib::Binding::Flags::" />
+ <substitute_enumerator_name from_prefix="G_DATE_" to_prefix="Glib::Date::" />
+ <substitute_enumerator_name from_prefix="G_PARAM_" to_prefix="Glib::ParamFlags::" />
+ <substitute_enumerator_name from_prefix="G_REGEX_MATCH_" to_prefix="Glib::Regex::MatchFlags::" />
+ <substitute_enumerator_name from_prefix="G_REGEX_" to_prefix="Glib::Regex::CompileFlags::" />
+ <substitute_enumerator_name from_prefix="G_SPAWN_ERROR_" to_prefix="Glib::SpawnError::" />
+ <substitute_enumerator_name from_prefix="G_TIME_TYPE_" to_prefix="Glib::TimeType::" />
+ <substitute_enumerator_name from_prefix="G_UNICODE_BREAK_" to_prefix="Glib::UnicodeBreakType::" />
+ <substitute_enumerator_name from_prefix="G_NORMALIZE_" to_prefix="Glib::NormalizeMode::" />
+ <substitute_enumerator_name from="G_FILE_ERROR" to="Glib::FileError" />
+ <substitute_enumerator_name from="G_KEY_FILE_ERROR" to="Glib::KeyFileError" />
+ <substitute_enumerator_name from_prefix="G_KEY_FILE_ERROR_" to_prefix="Glib::KeyFileError::" />
<!-- enum GOptionArg is not wrapped. Don't substitute. -->
<substitute_enumerator_name from_prefix="G_OPTION_ARG_" to_prefix="G_OPTION_ARG_" />
<!-- These are preprocessor defines. Don't substitute. -->
;; G_UNICODE_SCRIPT_MASARAM_GONDI, /* Gonm */
;; G_UNICODE_SCRIPT_NUSHU, /* Nshu */
;; G_UNICODE_SCRIPT_SOYOMBO, /* Soyo */
-;; G_UNICODE_SCRIPT_ZANABAZAR_SQUARE /* Zanb */
+;; G_UNICODE_SCRIPT_ZANABAZAR_SQUARE, /* Zanb */
+;;
+;; /* Unicode 11.0 additions */
+;; G_UNICODE_SCRIPT_DOGRA, /* Dogr */
+;; G_UNICODE_SCRIPT_GUNJALA_GONDI, /* Gong */
+;; G_UNICODE_SCRIPT_HANIFI_ROHINGYA, /* Rohg */
+;; G_UNICODE_SCRIPT_MAKASAR, /* Maka */
+;; G_UNICODE_SCRIPT_MEDEFAIDRIN, /* Medf */
+;; G_UNICODE_SCRIPT_OLD_SOGDIAN, /* Sogo */
+;; G_UNICODE_SCRIPT_SOGDIAN /* Sogd */
;; } GUnicodeScript;
(define-enum-extended UnicodeScript
'("nushu" "G_UNICODE_SCRIPT_NUSHU" "139")
'("soyombo" "G_UNICODE_SCRIPT_SOYOMBO" "140")
'("zanabazar-square" "G_UNICODE_SCRIPT_ZANABAZAR_SQUARE" "141")
+ '("dogra" "G_UNICODE_SCRIPT_DOGRA" "142")
+ '("gunjala-gondi" "G_UNICODE_SCRIPT_GUNJALA_GONDI" "143")
+ '("hanifi-rohingya" "G_UNICODE_SCRIPT_HANIFI_ROHINGYA" "144")
+ '("makasar" "G_UNICODE_SCRIPT_MAKASAR" "145")
+ '("medefaidrin" "G_UNICODE_SCRIPT_MEDEFAIDRIN" "146")
+ '("old-sogdian" "G_UNICODE_SCRIPT_OLD_SOGDIAN" "147")
+ '("sogdian" "G_UNICODE_SCRIPT_SOGDIAN" "148")
)
)
(gtype-id "G_TYPE_MATCH_INFO")
)
+(define-object NodeTree
+ (in-module "Glib")
+ (c-name "GNode")
+)
+
(define-object Object
(in-module "Glib")
(c-name "GObject")
(c-name "GTimeZone")
)
+(define-object Tree
+ (in-module "Glib")
+ (c-name "GTree")
+)
+
(define-object Variant
(in-module "Glib")
(c-name "GVariant")
'("nushu" "G_UNICODE_SCRIPT_NUSHU")
'("soyombo" "G_UNICODE_SCRIPT_SOYOMBO")
'("zanabazar-square" "G_UNICODE_SCRIPT_ZANABAZAR_SQUARE")
+ '("dogra" "G_UNICODE_SCRIPT_DOGRA")
+ '("gunjala-gondi" "G_UNICODE_SCRIPT_GUNJALA_GONDI")
+ '("hanifi-rohingya" "G_UNICODE_SCRIPT_HANIFI_ROHINGYA")
+ '("makasar" "G_UNICODE_SCRIPT_MAKASAR")
+ '("medefaidrin" "G_UNICODE_SCRIPT_MEDEFAIDRIN")
+ '("old-sogdian" "G_UNICODE_SCRIPT_OLD_SOGDIAN")
+ '("sogdian" "G_UNICODE_SCRIPT_SOGDIAN")
)
)
)
)
+(define-method steal_index
+ (of-object "GPtrArray")
+ (c-name "g_ptr_array_steal_index")
+ (return-type "gpointer")
+ (parameters
+ '("guint" "index_")
+ )
+)
+
+(define-method steal_index_fast
+ (of-object "GPtrArray")
+ (c-name "g_ptr_array_steal_index_fast")
+ (return-type "gpointer")
+ (parameters
+ '("guint" "index_")
+ )
+)
+
(define-method remove
(of-object "GPtrArray")
(c-name "g_ptr_array_remove")
(c-name "g_get_filename_charsets")
(return-type "gboolean")
(parameters
- '("const-gchar***" "charsets")
+ '("const-gchar***" "filename_charsets")
)
)
(return-type "GTimeSpan")
)
+(define-method get_timezone
+ (of-object "GDateTime")
+ (c-name "g_date_time_get_timezone")
+ (return-type "GTimeZone*")
+)
+
(define-method get_timezone_abbreviation
(of-object "GDateTime")
(c-name "g_date_time_get_timezone_abbreviation")
)
)
+(define-function g_canonicalize_filename
+ (c-name "g_canonicalize_filename")
+ (return-type "gchar*")
+ (parameters
+ '("const-gchar*" "filename")
+ '("const-gchar*" "relative_to")
+ )
+)
+
;; From ggettext.h
)
)
+(define-method steal_extended
+ (of-object "GHashTable")
+ (c-name "g_hash_table_steal_extended")
+ (return-type "gboolean")
+ (parameters
+ '("gconstpointer" "lookup_key")
+ '("gpointer*" "stolen_key")
+ '("gpointer*" "stolen_value")
+ )
+)
+
(define-method steal_all
(of-object "GHashTable")
(c-name "g_hash_table_steal_all")
-;; From glibconfig.h
-
-
-
;; From glib.h
(return-type "none")
)
+(define-function g_console_win32_init
+ (c-name "g_console_win32_init")
+ (return-type "none")
+)
+
(define-function g_clock_win32_init
(c-name "g_clock_win32_init")
(return-type "none")
+;; From grcbox.h
+
+(define-function g_rc_box_alloc
+ (c-name "g_rc_box_alloc")
+ (return-type "gpointer")
+ (parameters
+ '("gsize" "block_size")
+ )
+)
+
+(define-function g_rc_box_alloc0
+ (c-name "g_rc_box_alloc0")
+ (return-type "gpointer")
+ (parameters
+ '("gsize" "block_size")
+ )
+)
+
+(define-function g_rc_box_dup
+ (c-name "g_rc_box_dup")
+ (return-type "gpointer")
+ (parameters
+ '("gsize" "block_size")
+ '("gconstpointer" "mem_block")
+ )
+)
+
+(define-function g_rc_box_acquire
+ (c-name "g_rc_box_acquire")
+ (return-type "gpointer")
+ (parameters
+ '("gpointer" "mem_block")
+ )
+)
+
+(define-function g_rc_box_release
+ (c-name "g_rc_box_release")
+ (return-type "none")
+ (parameters
+ '("gpointer" "mem_block")
+ )
+)
+
+(define-function g_rc_box_release_full
+ (c-name "g_rc_box_release_full")
+ (return-type "none")
+ (parameters
+ '("gpointer" "mem_block")
+ '("GDestroyNotify" "clear_func")
+ )
+)
+
+(define-function g_rc_box_get_size
+ (c-name "g_rc_box_get_size")
+ (return-type "gsize")
+ (parameters
+ '("gpointer" "mem_block")
+ )
+)
+
+(define-function g_atomic_rc_box_alloc
+ (c-name "g_atomic_rc_box_alloc")
+ (return-type "gpointer")
+ (parameters
+ '("gsize" "block_size")
+ )
+)
+
+(define-function g_atomic_rc_box_alloc0
+ (c-name "g_atomic_rc_box_alloc0")
+ (return-type "gpointer")
+ (parameters
+ '("gsize" "block_size")
+ )
+)
+
+(define-function g_atomic_rc_box_dup
+ (c-name "g_atomic_rc_box_dup")
+ (return-type "gpointer")
+ (parameters
+ '("gsize" "block_size")
+ '("gconstpointer" "mem_block")
+ )
+)
+
+(define-function g_atomic_rc_box_acquire
+ (c-name "g_atomic_rc_box_acquire")
+ (return-type "gpointer")
+ (parameters
+ '("gpointer" "mem_block")
+ )
+)
+
+(define-function g_atomic_rc_box_release
+ (c-name "g_atomic_rc_box_release")
+ (return-type "none")
+ (parameters
+ '("gpointer" "mem_block")
+ )
+)
+
+(define-function g_atomic_rc_box_release_full
+ (c-name "g_atomic_rc_box_release_full")
+ (return-type "none")
+ (parameters
+ '("gpointer" "mem_block")
+ '("GDestroyNotify" "clear_func")
+ )
+)
+
+(define-function g_atomic_rc_box_get_size
+ (c-name "g_atomic_rc_box_get_size")
+ (return-type "gsize")
+ (parameters
+ '("gpointer" "mem_block")
+ )
+)
+
+
+
+;; From grefcount.h
+
+(define-method init
+ (of-object "grefcount")
+ (c-name "g_ref_count_init")
+ (return-type "none")
+)
+
+(define-method inc
+ (of-object "grefcount")
+ (c-name "g_ref_count_inc")
+ (return-type "none")
+)
+
+(define-method dec
+ (of-object "grefcount")
+ (c-name "g_ref_count_dec")
+ (return-type "gboolean")
+)
+
+(define-method compare
+ (of-object "grefcount")
+ (c-name "g_ref_count_compare")
+ (return-type "gboolean")
+ (parameters
+ '("gint" "val")
+ )
+)
+
+(define-method init
+ (of-object "gatomicrefcount")
+ (c-name "g_atomic_ref_count_init")
+ (return-type "none")
+)
+
+(define-method inc
+ (of-object "gatomicrefcount")
+ (c-name "g_atomic_ref_count_inc")
+ (return-type "none")
+)
+
+(define-method dec
+ (of-object "gatomicrefcount")
+ (c-name "g_atomic_ref_count_dec")
+ (return-type "gboolean")
+)
+
+(define-method compare
+ (of-object "gatomicrefcount")
+ (c-name "g_atomic_ref_count_compare")
+ (return-type "gboolean")
+ (parameters
+ '("gint" "val")
+ )
+)
+
+
+
+;; From grefstring.h
+
+(define-function g_ref_string_new
+ (c-name "g_ref_string_new")
+ (is-constructor-of "GRefString")
+ (return-type "char*")
+ (parameters
+ '("const-char*" "str")
+ )
+)
+
+(define-function g_ref_string_new_len
+ (c-name "g_ref_string_new_len")
+ (return-type "char*")
+ (parameters
+ '("const-char*" "str")
+ '("gssize" "len")
+ )
+)
+
+(define-function g_ref_string_new_intern
+ (c-name "g_ref_string_new_intern")
+ (return-type "char*")
+ (parameters
+ '("const-char*" "str")
+ )
+)
+
+(define-function g_ref_string_acquire
+ (c-name "g_ref_string_acquire")
+ (return-type "char*")
+ (parameters
+ '("char*" "str")
+ )
+)
+
+(define-function g_ref_string_release
+ (c-name "g_ref_string_release")
+ (return-type "none")
+ (parameters
+ '("char*" "str")
+ )
+)
+
+(define-function g_ref_string_length
+ (c-name "g_ref_string_length")
+ (return-type "gsize")
+ (parameters
+ '("char*" "str")
+ )
+)
+
+
+
;; From gregex.h
(define-function g_regex_error_quark
)
)
+(define-function g_spawn_async_with_fds
+ (c-name "g_spawn_async_with_fds")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "working_directory")
+ '("gchar**" "argv")
+ '("gchar**" "envp")
+ '("GSpawnFlags" "flags")
+ '("GSpawnChildSetupFunc" "child_setup")
+ '("gpointer" "user_data")
+ '("GPid*" "child_pid")
+ '("gint" "stdin_fd")
+ '("gint" "stdout_fd")
+ '("gint" "stderr_fd")
+ '("GError**" "error")
+ )
+)
+
(define-function g_spawn_sync
(c-name "g_spawn_sync")
(return-type "gboolean")
(return-type "GTimeZone*")
)
+(define-function g_time_zone_new_offset
+ (c-name "g_time_zone_new_offset")
+ (return-type "GTimeZone*")
+ (parameters
+ '("gint32" "seconds")
+ )
+)
+
(define-method ref
(of-object "GTimeZone")
(c-name "g_time_zone_ref")
)
)
+(define-method get_identifier
+ (of-object "GTimeZone")
+ (c-name "g_time_zone_get_identifier")
+ (return-type "const-gchar*")
+)
+
;; From gtranslit-data.h
)
)
+(define-function g_utf8_validate_len
+ (c-name "g_utf8_validate_len")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "str")
+ '("gsize" "max_len")
+ '("const-gchar**" "end")
+ )
+)
+
(define-function g_utf8_strup
(c-name "g_utf8_strup")
(return-type "gchar*")
+;; From gvalgrind.h
+
+
+
;; From gvariant-core.h
(define-function g_variant_new_from_children
(c-name "g_variant_new_byte")
(return-type "GVariant*")
(parameters
- '("guchar" "value")
+ '("guint8" "value")
)
)
(define-method get_byte
(of-object "GVariant")
(c-name "g_variant_get_byte")
- (return-type "guchar")
+ (return-type "guint8")
)
(define-method get_int16
)
)
+(define-function g_variant_type_string_get_depth_
+ (c-name "g_variant_type_string_get_depth_")
+ (return-type "gsize")
+ (parameters
+ '("const-gchar*" "type_string")
+ )
+)
+
;; From gvarianttypeinfo.h
)
)
+(define-method query_depth
+ (of-object "GVariantTypeInfo")
+ (c-name "g_variant_type_info_query_depth")
+ (return-type "gsize")
+)
+
(define-method element
(of-object "GVariantTypeInfo")
(c-name "g_variant_type_info_element")
)
-;; From gmoduleconf.h
-
-
-
;; From gmodule.h
(define-function g_module_supported
(c-name "g_clear_object")
(return-type "none")
(parameters
- '("volatile-GObject**" "object_ptr")
+ '("GObject**" "object_ptr")
)
)
// g_io_channel_new_file(). Neither is there a way to hook up a wrapper
// object in an existing GIOChannel, nor exists any destroy notification.
//
-// So that means: If the IOChannel is implemented in C++ -- that is, our
-// GlibmmIOChannel backend is used -- we use the GIOChannel reference
-// counting mechanism. If the IOChannel backend is unknown, then the
+// So that means: If the IOChannel backend is unknown (normal case), then the
// wrapper instance holds always exactly one reference to the GIOChannel.
// The wrapper object itself is then managed via our own refcounting
// mechanism. To do that a utility class ForeignIOChannel is introduced to
namespace Glib
{
-class GlibmmIOChannel
-{
-public:
- GIOChannel base;
- Glib::IOChannel* wrapper;
-
- static const GIOFuncs vfunc_table;
-
- static GIOStatus io_read(
- GIOChannel* channel, char* buf, gsize count, gsize* bytes_read, GError** err);
-
- static GIOStatus io_write(
- GIOChannel* channel, const char* buf, gsize count, gsize* bytes_written, GError** err);
-
- static GIOStatus io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err);
- static GIOStatus io_close(GIOChannel* channel, GError** err);
-
- static GSource* io_create_watch(GIOChannel* channel, GIOCondition condition);
- static void io_free(GIOChannel* channel);
-
- static GIOStatus io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err);
- static GIOFlags io_get_flags(GIOChannel* channel);
-};
-
-// static
-const GIOFuncs GlibmmIOChannel::vfunc_table = {
- &GlibmmIOChannel::io_read, &GlibmmIOChannel::io_write, &GlibmmIOChannel::io_seek,
- &GlibmmIOChannel::io_close, &GlibmmIOChannel::io_create_watch, &GlibmmIOChannel::io_free,
- &GlibmmIOChannel::io_set_flags, &GlibmmIOChannel::io_get_flags,
-};
-
/**** GLib::IOChannel ******************************************************/
-/* Construct a custom C++-implemented IOChannel. GlibmmIOChannel is an
- * extended GIOChannel struct which allows us to hook up a pointer to this
- * persistent wrapper instance.
- */
-IOChannel::IOChannel() : gobject_(static_cast<GIOChannel*>(g_malloc(sizeof(GlibmmIOChannel))))
-{
- g_io_channel_init(gobject_);
- gobject_->funcs = const_cast<GIOFuncs*>(&GlibmmIOChannel::vfunc_table);
-
- reinterpret_cast<GlibmmIOChannel*>(gobject_)->wrapper = this;
-}
-
IOChannel::IOChannel(IOChannel&& other) noexcept : sigc::trackable(std::move(other)),
gobject_(std::move(other.gobject_))
{
*/
IOChannel::IOChannel(GIOChannel* gobject, bool take_copy) : gobject_(gobject)
{
- // This ctor should never be called for GlibmmIOChannel instances.
g_assert(gobject != nullptr);
- g_assert(gobject->funcs != &GlibmmIOChannel::vfunc_table);
if (take_copy)
g_io_channel_ref(gobject_);
{
if (gobject_)
{
- // Check whether this IOChannel is implemented in C++, i.e. whether it
- // uses our GlibmmIOChannel forwarding backend. Normally, this will never
- // be true because the wrapper should only be deleted in the io_free()
- // callback, which clears gobject_ before deleting. But in case the ctor
- // of a derived class threw an exception the GIOChannel must be destroyed
- // prematurely.
- //
- if (gobject_->funcs == &GlibmmIOChannel::vfunc_table)
- {
- // Disconnect the wrapper object so that it won't be deleted twice.
- reinterpret_cast<GlibmmIOChannel*>(gobject_)->wrapper = nullptr;
- }
-
const auto tmp_gobject = gobject_;
gobject_ = nullptr;
Glib::RefPtr<IOSource>
IOChannel::create_watch(IOCondition condition)
{
- // The corresponding unreference() takes place in the dtor
- // of the Glib::RefPtr<IOChannel> object below.
- reference();
- return IOSource::create(Glib::RefPtr<IOChannel>(this), condition);
-}
-
-IOStatus
-IOChannel::read_vfunc(char*, gsize, gsize&)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOStatus
-IOChannel::write_vfunc(const char*, gsize, gsize&)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOStatus IOChannel::seek_vfunc(gint64, SeekType)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOStatus
-IOChannel::close_vfunc()
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-Glib::RefPtr<Glib::Source> IOChannel::create_watch_vfunc(IOCondition)
-{
- g_assert_not_reached();
- return Glib::RefPtr<Glib::Source>();
-}
-
-IOStatus IOChannel::set_flags_vfunc(IOFlags)
-{
- g_assert_not_reached();
- return IO_STATUS_ERROR;
-}
-
-IOFlags
-IOChannel::get_flags_vfunc()
-{
- g_assert_not_reached();
- return IOFlags(0);
+ return IOSource::create(gobj(), condition);
}
void
if (gobject)
{
- if (gobject->funcs == &GlibmmIOChannel::vfunc_table)
- {
- cpp_object = reinterpret_cast<GlibmmIOChannel*>(gobject)->wrapper;
-
- if (take_copy && cpp_object)
- cpp_object->reference();
- }
- else
- {
- cpp_object = new ForeignIOChannel(gobject, take_copy);
- cpp_object->reference(); // the refcount is initially 0
- }
- }
-
- return Glib::RefPtr<IOChannel>(cpp_object);
-}
-
-/**** Glib::GlibmmIOChannel ************************************************/
-
-GIOStatus
-GlibmmIOChannel::io_read(
- GIOChannel* channel, char* buf, gsize count, gsize* bytes_read, GError** err)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus)wrapper->read_vfunc(buf, count, *bytes_read);
- }
- catch (Glib::Error& error)
- {
- error.propagate(err);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-GIOStatus
-GlibmmIOChannel::io_write(
- GIOChannel* channel, const char* buf, gsize count, gsize* bytes_written, GError** err)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus)wrapper->write_vfunc(buf, count, *bytes_written);
- }
- catch (Glib::Error& error)
- {
- error.propagate(err);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-GIOStatus
-GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus)wrapper->seek_vfunc(offset, (SeekType)type);
- }
- catch (Glib::Error& error)
- {
- error.propagate(err);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-GIOStatus
-GlibmmIOChannel::io_close(GIOChannel* channel, GError** err)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus)wrapper->close_vfunc();
- }
- catch (Glib::Error& error)
- {
- error.propagate(err);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-// static
-GSource*
-GlibmmIOChannel::io_create_watch(GIOChannel* channel, GIOCondition condition)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- const auto source = wrapper->create_watch_vfunc((IOCondition)condition);
- return (source) ? source->gobj_copy() : nullptr;
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return nullptr;
-}
-
-// static
-void
-GlibmmIOChannel::io_free(GIOChannel* channel)
-{
- if (IOChannel* const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper)
- {
- wrapper->gobject_ = nullptr;
- delete wrapper;
- }
-
- g_free(channel);
-}
-
-GIOStatus
-GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOStatus)wrapper->set_flags_vfunc((IOFlags)flags);
- }
- catch (Glib::Error& error)
- {
- error.propagate(err);
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return G_IO_STATUS_ERROR;
-}
-
-// static
-GIOFlags
-GlibmmIOChannel::io_get_flags(GIOChannel* channel)
-{
- const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
-
- try
- {
- return (GIOFlags)wrapper->get_flags_vfunc();
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
+ cpp_object = new ForeignIOChannel(gobject, take_copy);
+ cpp_object->reference(); // the refcount is initially 0
}
- return GIOFlags(0);
+ return Glib::make_refptr_for_instance<IOChannel>(cpp_object);
}
} // namespace Glib
_DEFS(glibmm,glib)
#include <glibmmconfig.h>
-#include <glib.h> //For the GIOChannel enum values.
+#include <glib.h> //For the GIOCondition enum values.
#include <glibmm/error.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
class Source;
class IOSource;
-_WRAP_ENUM(SeekType, GSeekType, NO_GTYPE, s#^SEEK_#SEEK_TYPE_#)
-_WRAP_ENUM(IOStatus, GIOStatus, NO_GTYPE)
+_WRAP_ENUM(SeekType, GSeekType, NO_GTYPE)
+_WRAP_ENUM(IOStatus, GIOStatus, NO_GTYPE, s#^EOF$#ENDOFFILE#)
_WRAP_ENUM(IOFlags, GIOFlags, NO_GTYPE)
-/** A bitwise combination representing an I/O condition to watch for on an
+// Glib::IOCondition::IN and Glib::IOCondition::OUT would be problematic.
+// IN and OUT can be preprocessor macros.
+// See https://bugzilla.gnome.org/show_bug.cgi?id=786717
+/** @enum IOCondition
+ * A bitwise combination representing an I/O condition to watch for on an
* event source.
* The flags correspond to those used by the <tt>%poll()</tt> system call
* on UNIX (see <tt>man 2 poll</tt>). To test for individual flags, do
* something like this:
* @code
- * if((condition & Glib::IO_OUT) != 0)
+ * if ((condition & Glib::IOCondition::IO_OUT) == Glib::IOCondition::IO_OUT)
* do_some_output();
* @endcode
*/
-_WRAP_ENUM(IOCondition, GIOCondition, NO_GTYPE)
+_WRAP_ENUM(IOCondition, GIOCondition, NO_GTYPE,
+ s#^IN$#IO_IN#,
+ s#^OUT$#IO_OUT#,
+ s#^PRI$#IO_PRI#,
+ s#^ERR$#IO_ERR#,
+ s#^HUP$#IO_HUP#,
+ s#^NVAL$#IO_NVAL#)
/** Exception class for IOChannel errors.
*/
#endif /* G_OS_WIN32 */
/** Read a single UCS-4 character.
- * @param[out] thechar The Unicode character.
+ * @retval thechar The Unicode character.
* @return The status of the operation.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
* @param count The size of the buffer in bytes. Note that the buffer may
* not be complelely filled even if there is data in the buffer if the
* remaining data is not a complete character.
- * @param[out] bytes_read The number of bytes read. This may be zero even on
+ * @retval bytes_read The number of bytes read. This may be zero even on
* success if @a count < 6 and the channel's encoding is not <tt>""</tt>.
* This indicates that the next UTF-8 character is too wide for the buffer.
* @return The status of the operation.
g_io_channel_read_chars, errthrow)
/** Read a maximum of @a count bytes into @a str.
- * @param[out] str The characters that have been read.
* @param count The maximum number of bytes to read.
+ * @retval str The characters that have been read.
* @return The status of the operation.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
/** Read a whole line.
* Reads until the line separator is found, which is included
* in the result string.
- * @param[out] line The line that was read.
+ * @retval line The line that was read.
* @return The status of the operation.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
_IGNORE(g_io_channel_read_line, g_io_channel_read_line_string)
/** Reads all the remaining data from the file.
- * @param[out] str The resulting string.
- * @return Glib::IO_STATUS_NORMAL on success. This function never
- * returns Glib::IO_STATUS_EOF.
+ * @retval str The resulting string.
+ * @return Glib::IOStatus::NORMAL on success. This function never
+ * returns Glib::IOStatus::ENDOFFILE.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
*/
/** Write a string to the I/O channel.
* Note that this method does not return the number of characters written.
* If the channel is blocking and the returned value is
- * Glib::IO_STATUS_NORMAL, the whole string was written.
+ * Glib::IOStatus::NORMAL, the whole string was written.
* @param str the string to write.
* @return The status of the operation.
* @throw Glib::IOChannelError
/** Write a memory area of @a count bytes to the I/O channel.
* @param buf The start of the memory area.
* @param count The number of bytes to write.
- * @param[out] bytes_written The number of bytes written to the channel.
+ * @retval bytes_written The number of bytes written to the channel.
* @return The status of the operation.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
/** Seek the I/O channel to a specific position.
* @param offset The offset in bytes from the position specified by @a type.
- * @param type A SeekType. The type Glib::SEEK_TYPE_CUR is only allowed in
+ * @param type A SeekType. The type Glib::SeekType::CUR is only allowed in
* those cases where a call to set_encoding() is allowed. See the
* documentation for set_encoding() for details.
* @return The status of the operation.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
*/
- _WRAP_METHOD(IOStatus seek(gint64 offset, SeekType type = SEEK_TYPE_SET),
+ _WRAP_METHOD(IOStatus seek(gint64 offset, SeekType type = SeekType::SET),
g_io_channel_seek_position, errthrow)
/** Flush the buffers of the I/O channel.
*
* A buffered channel can only be set unbuffered if the channel's internal
* buffers have been flushed. Newly created channels or channels which have
- * returned Glib::IO_STATUS_EOF not require such a flush. For write-only
+ * returned Glib::IOStatus::ENDOFFILE not require such a flush. For write-only
* channels, a call to flush() is sufficient. For all other channels, the
* buffers may be flushed by a call to seek(). This includes the possibility
- * of seeking with seek type Glib::SEEK_TYPE_CUR and an offset of zero. Note
+ * of seeking with seek type Glib::SeekType::CUR and an offset of zero. Note
* that this means that socket-based channels cannot be set unbuffered once
* they have had data read from them.
*
* -# The channel is a file, and the file pointer was just repositioned by a
* call to seek_position(). (This flushes all the internal buffers.)
* -# The current encoding is <tt>""</tt> or UTF-8.
- * -# One of the read methods has just returned Glib::IO_STATUS_EOF (or, in
- * the case of read_to_end(), Glib::IO_STATUS_NORMAL).
- * -# The read() method has returned Glib::IO_STATUS_AGAIN or thrown
+ * -# One of the read methods has just returned Glib::IOStatus::ENDOFFILE (or, in
+ * the case of read_to_end(), Glib::IOStatus::NORMAL).
+ * -# The read() method has returned Glib::IOStatus::AGAIN or thrown
* a Glib::Error exception. This may be useful in the case of
* ConvertError::ILLEGAL_SEQUENCE. Returning one of these statuses
* from read_line() or read_to_end() does <em>not</em> guarantee that
* the encoding can be changed.
*
* Channels which do not meet one of the above conditions cannot call
- * seek_position() with a seek type of Glib::SEEK_TYPE_CUR and, if they
+ * seek_position() with a seek type of Glib::SeekType::CUR and, if they
* are "seekable", cannot call write() after calling one of the API
* "read" methods.
*
* @param encoding The encoding name, or <tt>""</tt> for binary.
- * @return Glib::IO_STATUS_NORMAL if the encoding was successfully set.
+ * @return Glib::IOStatus::NORMAL if the encoding was successfully set.
* @throw Glib::IOChannelError
*/
IOStatus set_encoding(const std::string& encoding = std::string());
protected:
GIOChannel* gobject_;
- /** Constructor that should be used by derived classes.
- * Use this constructor if you want to inherit from IOChannel.
- * It will set up a GIOChannel that will call the vfuncs of your
- * class even if it is being used from C code, and it will keep
- * a reference to the C++ code while the GIOChannel exists.
- */
- IOChannel();
_IGNORE(g_io_channel_init)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
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<Glib::Source> create_watch_vfunc(IOCondition cond);
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- friend class Glib::GlibmmIOChannel;
-#endif
-
private:
void release_gobject();
};
}
bool
-KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
+KeyFile::load_from_data(const Glib::ustring& data, Flags flags)
{
GError* gerror = nullptr;
}
bool
-KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags)
+KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, Flags flags)
{
GError* gerror = nullptr;
char* full_path_c = nullptr;
}
bool
-KeyFile::load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs,
- std::string& full_path, KeyFileFlags flags)
+KeyFile::load_from_dirs(const std::string& file, const std::vector<std::string>& search_dirs,
+ std::string& full_path, Flags flags)
{
GError* gerror = nullptr;
char* full_path_c = nullptr;
const gboolean result =
- g_key_file_load_from_dirs(gobj(), file.c_str(), const_cast<const gchar**>(search_dirs.data()),
+ g_key_file_load_from_dirs(gobj(), file.c_str(), const_cast<const gchar**>(Glib::ArrayHandler<std::string>::vector_to_array(search_dirs).data()),
&full_path_c, static_cast<GKeyFileFlags>(unsigned(flags)), &gerror);
if (gerror)
return Glib::convert_return_gchar_ptr_to_ustring(str);
}
-Glib::ArrayHandle<Glib::ustring>
+std::vector<Glib::ustring>
KeyFile::get_groups() const
{
gsize length = 0;
char** const array = g_key_file_get_groups(const_cast<GKeyFile*>(gobj()), &length);
- return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
}
-Glib::ArrayHandle<Glib::ustring>
+std::vector<Glib::ustring>
KeyFile::get_keys(const Glib::ustring& group_name) const
{
gsize length = 0;
if (gerror)
Glib::Error::throw_exception(gerror);
- return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
}
Glib::ustring
if (err) \
Glib::Error::throw_exception(err)
-Glib::ArrayHandle<Glib::ustring>
+std::vector<Glib::ustring>
KeyFile::get_string_list(
const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
{
GLIBMM_THROW(gerror);
- return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
}
-Glib::ArrayHandle<Glib::ustring>
+std::vector<Glib::ustring>
KeyFile::get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
const Glib::ustring& locale GLIBMM_ERROR_ARG) const
{
GLIBMM_THROW(gerror);
- return Glib::ArrayHandle<Glib::ustring>(array, length, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<Glib::ustring>::array_to_vector(array, length, Glib::OWNERSHIP_DEEP);
}
-Glib::ArrayHandle<bool>
+std::vector<bool>
KeyFile::get_boolean_list(
const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
{
GLIBMM_THROW(gerror);
- return Glib::ArrayHandle<bool>(array, length, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<bool>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
}
-Glib::ArrayHandle<int>
+std::vector<int>
KeyFile::get_integer_list(
const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
{
GLIBMM_THROW(gerror);
- return Glib::ArrayHandle<int>(array, length, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<int>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
}
-Glib::ArrayHandle<double>
+std::vector<double>
KeyFile::get_double_list(
const Glib::ustring& group_name, const Glib::ustring& key GLIBMM_ERROR_ARG) const
{
const_cast<GKeyFile*>(gobj()), group_name.c_str(), key.c_str(), &length, &gerror);
GLIBMM_THROW(gerror);
- return Glib::ArrayHandle<double>(array, length, Glib::OWNERSHIP_SHALLOW);
+ return Glib::ArrayHandler<double>::array_to_vector(array, length, Glib::OWNERSHIP_SHALLOW);
}
void
KeyFile::set_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
- const Glib::ArrayHandle<Glib::ustring>& list)
+ const std::vector<Glib::ustring>& list)
{
g_key_file_set_string_list(
- gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(), list.data(), list.size());
+ gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(), Glib::ArrayHandler<Glib::ustring>::vector_to_array(list).data(), list.size());
}
void
KeyFile::set_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key,
- const Glib::ustring& locale, const Glib::ArrayHandle<Glib::ustring>& list)
+ const Glib::ustring& locale, const std::vector<Glib::ustring>& list)
{
g_key_file_set_locale_string_list(gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(),
- locale.c_str(), list.data(), list.size());
+ locale.c_str(), Glib::ArrayHandler<Glib::ustring>::vector_to_array(list).data(), list.size());
}
void
KeyFile::set_integer_list(
- const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<int>& list)
+ const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<int>& list)
{
g_key_file_set_integer_list(gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(),
- const_cast<int*>(list.data()), list.size());
+ const_cast<int*>(Glib::ArrayHandler<int>::vector_to_array(list).data()), list.size());
}
void
KeyFile::set_double_list(
- const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<double>& list)
+ const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<double>& list)
{
g_key_file_set_double_list(
- gobj(), group_name.c_str(), key.c_str(), const_cast<double*>(list.data()), list.size());
+ gobj(), group_name.c_str(), key.c_str(), const_cast<double*>(Glib::ArrayHandler<double>::vector_to_array(list).data()), list.size());
}
void
KeyFile::set_boolean_list(
- const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<bool>& list)
+ const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<bool>& list)
{
g_key_file_set_boolean_list(gobj(), Glib::c_str_or_nullptr(group_name), key.c_str(),
- const_cast<gboolean*>(list.data()), list.size());
+ const_cast<gboolean*>(Glib::ArrayHandler<bool>::vector_to_array(list).data()), list.size());
}
Glib::ustring
#include <glibmmconfig.h>
#include <glibmm/ustring.h>
-#include <glibmm/arrayhandle.h>
#include <glibmm/error.h>
#include <glibmm/utility.h>
#include <glib.h>
+#include <vector>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { typedef struct _GKeyFile GKeyFile; }
namespace Glib
{
- _WRAP_ENUM(KeyFileFlags, GKeyFileFlags, NO_GTYPE)
-
/** Exception class for KeyFile errors.
*/
_WRAP_GERROR(KeyFileError, GKeyFileError, G_KEY_FILE_ERROR, NO_GTYPE)
_CLASS_GENERIC(KeyFile, GKeyFile)
public:
+ _WRAP_ENUM(Flags, GKeyFileFlags, NO_GTYPE)
+
//TODO: GKeyFile now seems to be a reference-counted type.
//TODO: Maybe replace all the get_*/set_* methods with some generic get/set
KeyFile(GKeyFile* castitem, bool takes_ownership = false);
public:
- _WRAP_METHOD(bool load_from_file(const std::string& file, KeyFileFlags flags = Glib::KEY_FILE_NONE), g_key_file_load_from_file, errthrow)
+ _WRAP_METHOD(bool load_from_file(const std::string& file, Flags flags = Flags::NONE), g_key_file_load_from_file, errthrow)
/** Loads a KeyFile from memory
* @param data The data to use as a KeyFile
* @return true if the KeyFile was successfully loaded, false otherwise
* @throw Glib::KeyFileError
*/
- bool load_from_data(const Glib::ustring& data, KeyFileFlags flags = Glib::KEY_FILE_NONE);
+ bool load_from_data(const Glib::ustring& data, Flags flags = Flags::NONE);
_IGNORE(g_key_file_load_from_data)
-#m4 _CONVERSION(`const Glib::ArrayHandle<std::string>&', `const gchar**', `const_cast<const gchar**>($3.data())')
-#m4 _CONVERSION(`Glib::ArrayHandle<std::string>&', `gchar**', `const_cast<gchar**>($3.data())')
+#m4 _CONVERSION(`const std::vector<std::string>& ', `const gchar**', `const_cast<const gchar**>($3.data())')
- _WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE),
- g_key_file_load_from_dirs, errthrow "Glib::KeyFileError, Glib::FileError", errthrow, deprecated "Use the load_from_dirs() method that takes a std::string& full_path.")
+ _IGNORE(g_key_file_load_from_dirs)
_WRAP_METHOD_DOCS_ONLY(g_key_file_load_from_dirs, errthrow "Glib::KeyFileError, Glib::FileError")
- bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, std::string& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE);
+ bool load_from_dirs(const std::string& file, const std::vector<std::string>& search_dirs, std::string& full_path, Flags flags = Flags::NONE);
/** Looks for a KeyFile named @a file in the paths returned from
* g_get_user_data_dir() and g_get_system_data_dirs() and loads them
* @throw Glib::KeyFileError
* @throw Glib::FileError
*/
- bool load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE);
+ bool load_from_data_dirs(const std::string& file, std::string& full_path, Flags flags = Flags::NONE);
_IGNORE(g_key_file_load_from_data_dirs)
/** Outputs the KeyFile as a string
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 "Glib::FileError", errthrow)
+ _WRAP_METHOD(bool save_to_file(const std::string& filename), g_key_file_save_to_file, errthrow "Glib::FileError")
_WRAP_METHOD(Glib::ustring get_start_group() const, g_key_file_get_start_group)
/** Gets a list of all groups in the KeyFile
* @returns A list containing the names of the groups
*/
- Glib::ArrayHandle<Glib::ustring> get_groups() const;
+ std::vector<Glib::ustring> get_groups() const;
_IGNORE(g_key_file_get_groups)
/** Gets a list of all keys from the group @a group_name.
* @returns A list containing the names of the keys in @a group_name
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<Glib::ustring> get_keys(const Glib::ustring& group_name) const;
+ std::vector<Glib::ustring> get_keys(const Glib::ustring& group_name) const;
_IGNORE(g_key_file_get_keys)
_WRAP_METHOD(bool has_group(const Glib::ustring& group_name) const, g_key_file_has_group)
*/
gint64 get_int64(const Glib::ustring& key) const;
- _WRAP_METHOD(gint64 get_int64(const Glib::ustring& group_name, const Glib::ustring& key) const, g_key_file_get_int64, errthrow "Glib::KeyFileError", errthrow)
+ _WRAP_METHOD(gint64 get_int64(const Glib::ustring& group_name, const Glib::ustring& key) const, g_key_file_get_int64, errthrow "Glib::KeyFileError")
/** Gets the value in the first group, under @a key, interpreting it as
* an unsigned 64-bit integer. This is similar to get_integer() but can
*/
guint64 get_uint64(const Glib::ustring& key) const;
- _WRAP_METHOD(guint64 get_uint64(const Glib::ustring& group_name, const Glib::ustring& key) const, g_key_file_get_uint64, errthrow "Glib::KeyFileError", errthrow)
+ _WRAP_METHOD(guint64 get_uint64(const Glib::ustring& group_name, const Glib::ustring& key) const, g_key_file_get_uint64, errthrow "Glib::KeyFileError")
/** Gets the value in the first group, under @a key, interpreting it as
* a double.
* @return A list containing the values requested
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<Glib::ustring> get_string_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
+ std::vector<Glib::ustring> get_string_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
_IGNORE(g_key_file_get_string_list)
/** Returns the values associated with @a key under @a group_name
* @return A list containing the values requested
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<Glib::ustring> get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
+ std::vector<Glib::ustring> get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
/** Returns the values associated with @a key under @a group_name
* translated into @a locale, if available.
* @return A list containing the values requested
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<Glib::ustring> get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale) const;
+ std::vector<Glib::ustring> get_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale) const;
_IGNORE(g_key_file_get_locale_string_list)
/** Returns the values associated with @a key under @a group_name
* @return A list of booleans
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<bool> get_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
+ std::vector<bool> get_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
_IGNORE(g_key_file_get_boolean_list)
/** Returns the values associated with @a key under @a group_name
* @return A list of integers
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<int> get_integer_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
+ std::vector<int> get_integer_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
_IGNORE(g_key_file_get_integer_list)
/** Returns the values associated with @a key under @a group_name
* @return A list of doubles
* @throw Glib::KeyFileError
*/
- Glib::ArrayHandle<double> get_double_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
+ std::vector<double> get_double_list(const Glib::ustring& group_name, const Glib::ustring& key) const;
_IGNORE(g_key_file_get_double_list)
/** Get comment from top of file
* @param key The name of a key
* @param list A list holding objects of type Glib::ustring
*/
- void set_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<Glib::ustring>& list);
+ void set_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<Glib::ustring>& list);
_IGNORE(g_key_file_set_string_list)
/** Sets a list of string values for the @a key under @a group_name and marks
* @param locale A locale
* @param list A list holding objects of type Glib::ustring
*/
- void set_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale, const Glib::ArrayHandle<Glib::ustring>& list);
+ void set_locale_string_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ustring& locale, const std::vector<Glib::ustring>& list);
_IGNORE(g_key_file_set_locale_string_list)
/** Sets a list of booleans for the @a key under @a group_name.
* @param key The name of a key
* @param list A list holding object of type bool
*/
- void set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<bool>& list);
+ void set_boolean_list(const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<bool>& list);
_IGNORE(g_key_file_set_boolean_list)
/** Sets a list of integers for the @a key under @a group_name.
* @param key The name of a key
* @param list A list holding object of type int
*/
- void set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<int>& list);
+ void set_integer_list(const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<int>& list);
_IGNORE(g_key_file_set_integer_list)
/** Sets a list of doubles for the @a key under @a group_name.
*
* @newin{2,14}
*/
- void set_double_list(const Glib::ustring& group_name, const Glib::ustring& key, const Glib::ArrayHandle<double>& list);
+ void set_double_list(const Glib::ustring& group_name, const Glib::ustring& key, const std::vector<double>& list);
_IGNORE(g_key_file_set_double_list)
*/
Glib::ustring escape_text(const Glib::ustring& text);
-
-/** There are no flags right now. Pass <tt>Glib::Markup::ParseFlags(0)</tt> for
- * the flags argument to all functions (this should be the default argument
- * anyway).
- */
-_WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE, s#^MARKUP_##)
-
-/*! @var Markup::ParseFlags DO_NOT_USE_THIS_UNSUPPORTED_FLAG
- * Flag you should not use.
- */
-
+_WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE)
/** Binary predicate used by Markup::Parser::AttributeMap.
* @ingroup Markup
g_unsetenv(variable.c_str());
}
-Glib::ArrayHandle<std::string>
+std::vector<std::string>
listenv()
{
- char** value = g_listenv();
- char** end = value;
- while (*end)
- {
- ++end;
- }
- return Glib::ArrayHandle<std::string>(value, end - value, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<std::string>::array_to_vector(g_listenv(), Glib::OWNERSHIP_DEEP);
}
std::string
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)
{
std::vector<std::string>
get_system_data_dirs()
{
- // TODO: Use a utility function:
- std::vector<std::string> result;
- const char* const* cresult = g_get_system_data_dirs();
- if (!cresult)
- return result;
-
- for (const gchar* const* iter = cresult; *iter != nullptr; ++iter)
- {
- result.emplace_back(convert_const_gchar_ptr_to_stdstring(*iter));
- }
-
- return result;
+ return Glib::ArrayHandler<std::string>::array_to_vector(g_get_system_data_dirs(), Glib::OWNERSHIP_NONE);
}
std::vector<std::string>
get_system_config_dirs()
{
- // TODO: Use a utility function:
- std::vector<std::string> result;
- const char* const* cresult = g_get_system_config_dirs();
- if (!cresult)
- return result;
-
- for (const gchar* const* iter = cresult; *iter != nullptr; ++iter)
- {
- result.emplace_back(convert_const_gchar_ptr_to_stdstring(*iter));
- }
-
- return result;
+ return Glib::ArrayHandler<std::string>::array_to_vector(g_get_system_config_dirs(), Glib::OWNERSHIP_NONE);
}
std::string
}
std::string
-build_filename(const Glib::ArrayHandle<std::string>& elements)
+build_filename(const std::vector<std::string>& elements)
{
return convert_return_gchar_ptr_to_stdstring(
- g_build_filenamev(const_cast<char**>(elements.data())));
+ g_build_filenamev(const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(elements).data())));
}
std::string
}
std::string
-build_path(const std::string& separator, const Glib::ArrayHandle<std::string>& elements)
+build_path(const std::string& separator, const std::vector<std::string>& elements)
{
return convert_return_gchar_ptr_to_stdstring(
- g_build_pathv(separator.c_str(), const_cast<char**>(elements.data())));
+ g_build_pathv(separator.c_str(), const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(elements).data())));
}
std::string
_DEFS(glibmm,glib)
-#include <glibmm/arrayhandle.h>
#include <glibmm/ustring.h>
+#include <vector>
namespace Glib
{
-_WRAP_ENUM(UserDirectory, GUserDirectory, NO_GTYPE)
+_WRAP_ENUM(UserDirectory, GUserDirectory, NO_GTYPE, s#^DIRECTORY_##)
_WRAP_ENUM(FormatSizeFlags, GFormatSizeFlags, NO_GTYPE)
/** @defgroup MiscUtils Miscellaneous Utility Functions
* @return Array of environment names (The generic ArrayHandle will be
* implicitly converted to any STL compatible container type).
*/
-Glib::ArrayHandle<std::string> listenv();
+std::vector<std::string> listenv();
/** Gets the user name of the current user.
*
*/
std::string get_current_dir();
-#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.
- *
- * @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.
* Any STL compatible container type is accepted.
* @return The resulting path.
*/
-std::string build_filename(const Glib::ArrayHandle<std::string>& elements);
+std::string build_filename(const std::vector<std::string>& 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.
* @return The resulting path.
*/
std::string build_path(const std::string& separator,
- const Glib::ArrayHandle<std::string>& elements);
+ const std::vector<std::string>& elements);
/** Locates the first executable named @a program in the user's path, in the
* same way that <tt>execvp()</tt> would locate it.
* 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.
+ * Glib::FormatSizeFlags::IEC_UNITS flag is set.
*
* @param size A size in bytes.
* @param flags Flags to modify the output.
*
* @newin{2,46}
*/
-Glib::ustring format_size(guint64 size, FormatSizeFlags flags = FORMAT_SIZE_DEFAULT);
+Glib::ustring format_size(guint64 size, FormatSizeFlags flags = FormatSizeFlags::DEFAULT);
/** @} group MiscUtils */
namespace Glib
{
-Module::Module(const std::string& file_name, ModuleFlags flags)
+Module::Module(const std::string& file_name, Flags flags)
: gobject_(g_module_open(file_name.c_str(), (GModuleFlags)flags))
{
}
namespace Glib
{
-_WRAP_ENUM(ModuleFlags, GModuleFlags, NO_GTYPE)
-
//TODO: Replace get_last_error() with exceptions?
//Provide operator()?
public:
+ _WRAP_ENUM(Flags, GModuleFlags, NO_GTYPE)
+
/** Opens a module.
*
* First of all it tries to open file_name as a module. If that
* @param file_name The library filename to open
* @param flags Flags to configure the load process
*/
- explicit Module(const std::string& file_name, ModuleFlags flags = ModuleFlags(0));
+ explicit Module(const std::string& file_name, Flags flags = Flags(0));
Module(const Module&) = delete;
Module& operator=(const Module&) = delete;
#include <stack>
#include <deque>
+#include <sigc++/bind.h>
+#include <sigc++/slot.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/error.h>
-#include <glibmm/arrayhandle.h>
#include <glib.h>
namespace Glib
{
-//Hand-written, instead of using _WRAP_ENUM,
-//because the C enum values don't have a prefix.
-
-/** Specifies the type of traveral performed by methods such as NodeTree::_traverse() and NodeTree::find().
- *
- * @ingroup glibmmEnums
- */
-enum TraverseType
-{
- TRAVERSE_IN_ORDER = G_IN_ORDER, /*!< Visits a node's left child first, then the node itself, then its right child. This is the one to use if you want the output sorted according to the compare function. */
- TRAVERSE_PRE_ORDER = G_PRE_ORDER, /*!< Visits a node, then its children. */
- TRAVERSE_POST_ORDER = G_POST_ORDER, /*!< Visits the node's children, then the node itself. */
- TRAVERSE_LEVEL_ORDER = G_LEVEL_ORDER /*!< For NodeTree, it vists the root node first, then its children, then its grandchildren, and so on. Note that this is less efficient than the other orders. This is not implemented for Glib::Tree. */
-};
-
/** N-ary Trees - trees of data with any number of branches
* The NodeTree class and its associated functions provide an N-ary tree data structure, in which nodes in the tree can contain arbitrary data.
*
{
_CLASS_GENERIC(NodeTree, GNode)
public:
- using TraverseFunc = sigc::slot<bool, NodeTree<T>&>;
- using ForeachFunc = sigc::slot<void, NodeTree<T>&>;
+ _WRAP_ENUM(TraverseType, GTraverseType, NO_GTYPE)
+
+ using TraverseFunc = sigc::slot<bool(NodeTree<T>&)>;
+ using ForeachFunc = sigc::slot<void(NodeTree<T>&)>;
private:
static NodeTree<T>* wrap(GNode* node)
}
_IGNORE(g_node_get_root)
-
+ // Can't use _WRAP_ENUM for a Flags-type enum in a template class.
+ // gmmproc would get the bitwise operators wrong.
/** Specifies which nodes are visited during several of the NodeTree methods,
* including traverse() and find().
*
* @ingroup glibmmEnums
*/
- enum TraverseFlags
+ enum class TraverseFlags
{
- TRAVERSE_LEAVES = G_TRAVERSE_LEAVES, /*!< Only leaf nodes should be visited. */
- TRAVERSE_NON_LEAVES = G_TRAVERSE_NON_LEAVES, /*!< Only non-leaf nodes should be visited. */
- TRAVERSE_ALL = G_TRAVERSE_ALL, /*!< All nodes should be visited. */
- TRAVERSE_MASK = G_TRAVERSE_MASK /*!< A mask of all traverse flags. */
+ LEAVES = G_TRAVERSE_LEAVES, /*!< Only leaf nodes should be visited. */
+ NON_LEAVES = G_TRAVERSE_NON_LEAVES, /*!< Only non-leaf nodes should be visited. */
+ ALL = G_TRAVERSE_ALL, /*!< All nodes should be visited. */
+ MASK = G_TRAVERSE_MASK /*!< A mask of all traverse flags. */
};
/** Traverses a tree starting at the current node.
* If max_depth is 2, the root and its children are visited. And so on.
* @param func the slot to invoke for each visited child
*/
- void traverse(const TraverseFunc& func, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL, int max_depth = -1)
+ void traverse(const TraverseFunc& func, TraverseType order = TraverseType::IN_ORDER, TraverseFlags flags = TraverseFlags::ALL, int max_depth = -1)
{
TraverseFunc func_copy = func;
g_node_traverse(gobj(), (GTraverseType)order, (GTraverseFlags)flags, max_depth, c_callback_traverse, reinterpret_cast<gpointer>(&func_copy));
* @param flags Wwhich types of children are to be visited.
* @param func The slot to invoke for each visited node.
*/
- void foreach(const ForeachFunc& func, TraverseFlags flags = TRAVERSE_ALL)
+ void foreach(const ForeachFunc& func, TraverseFlags flags = TraverseFlags::ALL)
{
ForeachFunc func_copy = func;
g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach, reinterpret_cast<gpointer>(&func_copy));
/** Finds the first child of a NodeTree with the given data.
*
- * @param flags Which types of children are to be visited, one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES.
+ * @param flags Which types of children are to be visited, one of TraverseFlags::ALL, TraverseFlags::LEAVES or TraverseFlags::NON_LEAVES.
* @param the_data The data for which to search.
* @return the found child, or <tt>nullptr</tt> if the data is not found
*/
- NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TRAVERSE_ALL)
+ NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TraverseFlags::ALL)
{
- sigc::slot<void, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_child);
+ sigc::slot<void(GNode*, const T&, GNode**)> real_slot = sigc::ptr_fun(on_compare_child);
GNode* child = nullptr;
- using type_foreach_gnode_slot = sigc::slot<void, GNode*>;
+ using type_foreach_gnode_slot = sigc::slot<void(GNode*)>;
type_foreach_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child);
g_node_children_foreach(gobj(), (GTraverseFlags)flags, c_callback_foreach_compare_child, reinterpret_cast<gpointer>(&bound_slot));
/** Finds the first child of a NodeTree with the given data.
*
- * @param flags Which types of children are to be visited, one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES.
+ * @param flags Which types of children are to be visited, one of TraverseFlags::ALL, TraverseFlags::LEAVES or TraverseFlags::NON_LEAVES.
* @param the_data The data for which to search.
* @return the found child, or <tt>nullptr</tt> if the data is not found
*/
- const NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TRAVERSE_ALL) const
+ const NodeTree<T>* find_child(const T& the_data, TraverseFlags flags = TraverseFlags::ALL) const
{
return const_cast<NodeTree<T>*>(this)->find_child(flags, the_data);
}
/** Finds a node in a tree.
*
- * @param order The order in which nodes are visited: IN_ORDER, TRAVERSE_PRE_ORDER, TRAVERSE_POST_ORDER, or TRAVERSE_LEVEL_ORDER
- * @param flags Which types of children are to be visited: one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES.
+ * @param order The order in which nodes are visited: TraverseType::IN_ORDER, TraverseType::PRE_ORDER, TraverseType::POST_ORDER, or TraverseType::LEVEL_ORDER
+ * @param flags Which types of children are to be visited: one of TraverseFlags::ALL, TraverseFlags::LEAVES or TraverseFlags::NON_LEAVES.
* @param the_data The data for which to search.
* @return The found node, or <tt>nullptr</tt> if the data is not found.
*/
- NodeTree<T>* find(const T& the_data, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL)
+ NodeTree<T>* find(const T& the_data, TraverseType order = TraverseType::IN_ORDER, TraverseFlags flags = TraverseFlags::ALL)
{
//We use a sigc::slot for the C callback, so we can bind some extra data.
- sigc::slot<gboolean, GNode*, const T&, GNode**> real_slot = sigc::ptr_fun(on_compare_node);
+ sigc::slot<gboolean(GNode*, const T&, GNode**)> real_slot = sigc::ptr_fun(on_compare_node);
GNode* child = nullptr;
- using type_traverse_gnode_slot = sigc::slot<gboolean, GNode*>;
+ using type_traverse_gnode_slot = sigc::slot<gboolean(GNode*)>;
type_traverse_gnode_slot bound_slot = sigc::bind(real_slot, the_data, &child);
g_node_traverse(const_cast<GNode*>(gobj()), (GTraverseType)order, (GTraverseFlags)flags, -1, c_callback_traverse_compare_node, reinterpret_cast<gpointer>(&bound_slot));
* @param the_data The data for which to search.
* @return The found node, or <tt>nullptr</tt> if the data is not found.
*/
- const NodeTree<T>* find(const T& the_data, TraverseType order = TRAVERSE_IN_ORDER, TraverseFlags flags = TRAVERSE_ALL) const
+ const NodeTree<T>* find(const T& the_data, TraverseType order = TraverseType::IN_ORDER, TraverseFlags flags = TraverseFlags::ALL) const
{
return const_cast<NodeTree<T>*>(this)->find(order, flags, the_data);
}
/** Gets the number of nodes in a tree.
*
- * @param flags Which types of children are to be counted: one of TRAVERSE_ALL, TRAVERSE_LEAVES and TRAVERSE_NON_LEAVES
+ * @param flags Which types of children are to be counted: one of TraverseFlags::ALL, TraverseFlags::LEAVES or TraverseFlags::NON_LEAVES
* @return The number of nodes in the tree.
*/
- guint node_count(TraverseFlags flags = TRAVERSE_ALL) const
+ guint node_count(TraverseFlags flags = TraverseFlags::ALL) const
{
return g_node_n_nodes(const_cast<GNode*>(gobj()), (GTraverseFlags)flags);
}
}
}
- /// Wrapper for invoking a sigc::slot<void,GNode*> (Internal use).
+ /// Wrapper for invoking a sigc::slot<void(GNode*)> (Internal use).
static void c_callback_foreach_compare_child(GNode* node, gpointer data)
{
const ForeachFunc* slot = reinterpret_cast<const ForeachFunc*>(data);
return FALSE;
}
- /// Wrapper for invoking a sigc::slot<gboolean,GNode*> (Internal use).
+ /// Wrapper for invoking a sigc::slot<gboolean(GNode*)> (Internal use).
static gboolean c_callback_traverse_compare_node(GNode* node, gpointer data)
{
const TraverseFunc* slot = reinterpret_cast<const TraverseFunc*>(data);
void
OptionContext::add_group(OptionGroup& group)
{
- // Strangely, GObjectContext actually takes ownership of the GOptionGroup, deleting it later.
- g_option_context_add_group(gobj(), (group).gobj_give_ownership());
+ // GObjectContext takes ownership of the GOptionGroup, unrefing it later.
+ g_option_context_add_group(gobj(), group.gobj_copy());
}
void
OptionContext::set_main_group(OptionGroup& group)
{
- // Strangely, GObjectContext actually takes ownership of the GOptionGroup, deleting it later.
- g_option_context_set_main_group(gobj(), (group).gobj_give_ownership());
+ // GObjectContext takes ownership of the GOptionGroup, unrefing it later.
+ g_option_context_set_main_group(gobj(), group.gobj_copy());
}
/*
//so it should be used carefully. For instance you could not access data in a derived class via this second instance.
explicit OptionContext(GOptionContext* castitem, bool take_ownership = false);
- //TODO?:
- //OptionContext(const OptionContext& other) = delete;
- //OptionContext& operator=(const OptionContext& other) = delete;
+ OptionContext(const OptionContext& other) = delete;
+ OptionContext& operator=(const OptionContext& other) = delete;
OptionContext(OptionContext&& other) noexcept;
OptionContext& operator=(OptionContext&& other) noexcept;
_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 "Glib::OptionError, Glib::ConvertError", errthrow)
+ _WRAP_METHOD(bool parse(int& argc, char**& argv), g_option_context_parse, errthrow "Glib::OptionError, Glib::ConvertError")
/** Parses the command line arguments.
*
* This function is used to translate user-visible strings, for --help output.
* The function takes an untranslated string and returns a translated string
*/
- using SlotTranslate = sigc::slot<Glib::ustring, const Glib::ustring&>;
+ using SlotTranslate = sigc::slot<Glib::ustring(const Glib::ustring&)>;
/**
* Sets the function which is used to translate user-visible
namespace Glib
{
+using Flags = OptionEntry::Flags;
+
OptionEntry::OptionEntry()
{
gobject_ = g_new0(GOptionEntry, 1);
return *this;
}
-void
-OptionEntry::set_long_name(const Glib::ustring& value)
-{
- if (gobject_->long_name)
- {
- g_free((gchar*)(gobject_->long_name));
- gobject_->long_name = nullptr;
- }
-
- // Note that we do not use nullptr for an empty string,
- // because G_OPTION_REMAINING is actually a "", so it actually has a distinct meaning:
- // TODO: Wrap G_OPTION_REMAINING in C++ somehow, maybe as an explicit set_long_name(void) or
- // set_is_remaining()? murrayc.
- gobj()->long_name = (value).c_str() ? g_strdup((value).c_str()) : nullptr;
-}
-
-void
-OptionEntry::set_description(const Glib::ustring& value)
-{
- if (gobject_->description)
- {
- g_free((gchar*)(gobject_->description));
- gobject_->description = nullptr;
- }
-
- gobj()->description = (value).empty() ? nullptr : g_strdup((value).c_str());
-}
-
-void
-OptionEntry::set_arg_description(const Glib::ustring& value)
-{
- if (gobject_->arg_description)
- {
- g_free((gchar*)(gobject_->arg_description));
- gobject_->arg_description = nullptr;
- }
-
- gobj()->arg_description = (value).empty() ? nullptr : g_strdup((value).c_str());
-}
-
} // namespace Glib
extern "C" { typedef struct _GOptionEntry GOptionEntry; }
#endif
-
namespace Glib
{
_CLASS_GENERIC(OptionEntry, GOptionEntry)
public:
- //Copied from goption.h, instead of generated, so that we can put it inside the class.
- enum Flags
- {
- FLAG_HIDDEN = 1 << 0,
- FLAG_IN_MAIN = 1 << 1,
- FLAG_REVERSE = 1 << 2,
- FLAG_NO_ARG = 1 << 3,
- FLAG_FILENAME = 1 << 4,
- FLAG_OPTIONAL_ARG = 1 << 5,
- FLAG_NOALIAS = 1 << 6
- } GOptionFlags;
+ _WRAP_ENUM(Flags, GOptionFlags, NO_GTYPE)
OptionEntry();
OptionEntry(const OptionEntry& src);
OptionEntry& operator=(const OptionEntry& src);
- //#m4 _CONVERSION(`Glib::ustring',`const gchar*',`($3).empty() ? nullptr : g_strdup(($3).c_str())')
-
+ // We do not use nullptr for an empty string in set_long_name(),
+ // because G_OPTION_REMAINING is actually a "", so it has a distinct meaning.
+ // TODO: Wrap G_OPTION_REMAINING in C++ somehow, maybe as an overloaded
+ // set_long_name(void) or set_is_remaining()? murrayc.
+ #m4 _CONVERSION(`Glib::ustring',`const char*',`($3).c_str()')
_MEMBER_GET(long_name, long_name, Glib::ustring, const char*)
-
- void set_long_name(const Glib::ustring& value);
+ _MEMBER_SET_STR(long_name, long_name, Glib::ustring, const char*)
_MEMBER_GET(short_name, short_name, gchar, gchar)
_MEMBER_SET(short_name, short_name, gchar, gchar)
- _MEMBER_GET(flags, flags, int, int)
+#m4 _CONVERSION(`int',`Flags',`static_cast<Flags>($3)')
+ _MEMBER_GET(flags, flags, Flags, int)
+#m4 _CONVERSION(`Flags',`int',`static_cast<int>($3)')
/** Set one or more OptionEntry::Flags.
- * Do not set FLAG_FILENAME. Character encoding is chosen when the OptionEntry
+ * Do not set Flags::FILENAME. Character encoding is chosen when the OptionEntry
* is added to an OptionGroup.
*/
- _MEMBER_SET(flags, flags, int, int)
+ _MEMBER_SET(flags, flags, Flags, int)
+ // We use nullptr for an empty string in set_description() and set_arg_description().
+ #m4 _CONVERSION(`Glib::ustring',`const char*',`Glib::c_str_or_nullptr($3)')
_MEMBER_GET(description, description, Glib::ustring, const char*)
-
- void set_description(const Glib::ustring& value);
+ _MEMBER_SET_STR(description, description, Glib::ustring, const char*)
_MEMBER_GET(arg_description, arg_description, Glib::ustring, const char*)
-
- void set_arg_description(const Glib::ustring& value);
+ _MEMBER_SET_STR(arg_description, arg_description, Glib::ustring, const char*)
GOptionEntry* gobj() { return gobject_; }
const GOptionEntry* gobj() const { return gobject_; }
void release_gobject() noexcept;
protected:
-
GOptionEntry* gobject_;
};
#include <glibmm/optioncontext.h>
#include <glibmm/utility.h>
#include <glibmm/exceptionhandler.h>
-//#include <glibmm/containers.h>
#include <glib.h> // g_malloc
#include <cstring> // std::memset()
try
{
- return option_group->on_pre_parse(cppContext, *option_group);
+ return option_group->on_pre_parse(cppContext);
}
catch (Glib::Error& err)
{
static void
g_callback_error(
- GOptionContext* context, GOptionGroup* /* group */, gpointer data, GError** /* TODO error */)
+ GOptionContext* context, GOptionGroup* /* group */, gpointer data, GError** error)
{
- // TODO GError** error is input data containing information on an error that
- // has occurred before this function is called. When API can be broken,
- // the function prototype of on_error ought to be changed to
- // void on_error(OptionContext& context, Error& error).
+ // GError** error is input data containing information on an error that
+ // has occurred before this function is called.
OptionContext cppContext(context, false /* take_ownership */);
auto option_group = static_cast<OptionGroup*>(data);
- if (option_group)
- return option_group->on_error(cppContext, *option_group);
+ if (option_group && error && *error)
+ {
+ try
+ {
+ Error::throw_exception(g_error_copy(*error));
+ }
+ catch (const Error& err)
+ {
+ return option_group->on_error(cppContext, err);
+ }
+ }
}
const gchar*
try
{
- return option_group->on_post_parse(cppContext, *option_group);
+ return option_group->on_post_parse(cppContext);
}
catch (Glib::Error& err)
{
OptionGroup::OptionGroup(const Glib::ustring& name, const Glib::ustring& description,
const Glib::ustring& help_description)
: gobject_(g_option_group_new(name.c_str(), description.c_str(), help_description.c_str(),
- this /* user_data */, nullptr /* destroy_func */)),
- has_ownership_(true)
+ this /* user_data */, nullptr /* destroy_func */))
{
// g_callback_pre_parse(), post_parse_callback(), g_callback_error(), and
// option_arg_callback() depend on user_data being this. The first three
g_option_group_set_error_hook(gobj(), &g_callback_error);
}
-OptionGroup::OptionGroup(GOptionGroup* castitem) : gobject_(castitem), has_ownership_(true)
+OptionGroup::OptionGroup(GOptionGroup* castitem) : gobject_(castitem)
{
// Always takes ownership - never takes copy.
}
-OptionGroup::OptionGroup(OptionGroup&& other) noexcept
- : map_entries_(std::move(other.map_entries_)),
- gobject_(std::move(other.gobject_)),
- has_ownership_(std::move(other.has_ownership_))
-{
- other.gobject_ = nullptr;
- other.has_ownership_ = false;
-}
-
-OptionGroup&
-OptionGroup::operator=(OptionGroup&& other) noexcept
-{
- release_gobject();
-
- map_entries_ = std::move(other.map_entries_);
- gobject_ = std::move(other.gobject_);
- has_ownership_ = std::move(other.has_ownership_);
-
- other.gobject_ = nullptr;
- other.has_ownership_ = false;
-
- return *this;
-}
-
void
OptionGroup::release_gobject() noexcept
{
cpp_entry.release_c_arg();
}
- if (has_ownership_ && gobject_)
+ if (gobject_)
{
g_option_group_unref(gobj());
gobject_ = nullptr;
}
// When the command argument value is to be parsed by a user-supplied function
-// (indicated by G_OPTION_ARG_CALLBACK), the FLAG_FILENAME in 'entry' is ignored.
+// (indicated by G_OPTION_ARG_CALLBACK), the OptionEntry::Flags::FILENAME in 'entry' is ignored.
// set_c_arg_default() clears or sets it as required in a copy of 'entry'.
//
// The glib API is inconsistent here. The choice between UTF-8 and filename
// G_OPTION_ARG_STRING_ARRAY, and G_OPTION_ARG_FILENAME_ARRAY, which in glibmm
// are set by OptionGroup::add_entry[_filename]. But when a callback function
// is chosen, there is only G_OPTION_ARG_CALLBACK, and the encoding is chosen
-// with G_OPTION_FLAG_FILENAME. We do this automatiically in set_c_arg_default().
+// with OptionEntry::Flags::FILENAME. We do this automatiically in set_c_arg_default().
// Other option flags are set by OptionEntry::set_flags().
void
}
bool
-OptionGroup::on_pre_parse(OptionContext& /* context */, OptionGroup& /* group */)
+OptionGroup::on_pre_parse(OptionContext& /* context */)
{
return true;
}
bool
-OptionGroup::on_post_parse(OptionContext& /* context */, OptionGroup& /* group */)
+OptionGroup::on_post_parse(OptionContext& /* context */)
{
return true;
}
void
-OptionGroup::on_error(OptionContext& /* context */, OptionGroup& /* group */)
+OptionGroup::on_error(OptionContext& /* context */, const Error& /* error */)
{
}
{
// No value to set here. The arg pointer is a function pointer.
- // Set or clear FLAG_FILENAME in *entry_.
+ // Set or clear OptionEntry::Flags::FILENAME in *entry_.
const OptionArgCallback* const option_arg = static_cast<const OptionArgCallback*>(cpp_arg);
if (option_arg->is_filename_option())
{
- entry_->set_flags(entry_->get_flags() | OptionEntry::FLAG_FILENAME);
+ entry_->set_flags(entry_->get_flags() | OptionEntry::Flags::FILENAME);
}
else
{
- entry_->set_flags(entry_->get_flags() & ~OptionEntry::FLAG_FILENAME);
+ entry_->set_flags(entry_->get_flags() & ~OptionEntry::Flags::FILENAME);
}
break;
}
typed_cpp_arg->clear();
// The C array is null-terminated.
- // Glib::StringArrayHandle array_handle(*typed_arg, Glib::OWNERSHIP_NONE);
+ // std::vector<Glib::ustring> array_handle(*typed_arg, Glib::OWNERSHIP_NONE);
// The SUN Forte compiler complains about this:
// "optiongroup.cc", line 354: Error: Cannot assign Glib::ArrayHandle<Glib::ustring,
// of a pointer dynamic_cast must be a pointer to a complete class type
// return dynamic_cast<CppType>(Glib::wrap_auto(cobj, false /* take_copy */));
- // for(Glib::StringArrayHandle::iterator iter = array_handle.begin(); iter !=
+ // for(auto iter = array_handle.begin(); iter !=
// array_handle.end(); ++iter)
//{
// typed_cpp_arg->emplace_back(*iter);
}
GOptionGroup*
-OptionGroup::gobj_give_ownership()
+OptionGroup::gobj_copy() const
{
- has_ownership_ = false;
- return gobj();
+ return g_option_group_ref(gobject_);
}
} // namespace Glib
_DEFS(glibmm,glib)
+#include <glibmm/error.h>
#include <glibmm/ustring.h>
#include <sigc++/slot.h>
#include <map>
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?
+// GOptionGroup is now refcounted. See https://bugzilla.gnome.org/show_bug.cgi?id=743349
+// But Glib::OptionGroup can't be a _CLASS_OPAQUE_REFCOUNTED, because it has
+// other data members than gobject_. The memory management would be more involved
+// if Glib::OptionGroup were refcounted. It would need a separate refcount for the
+// wrapper, like in Glib::IOChannel and Glib::Source. It's easier and good enough
+// to let Glib::OptionGroup remain non-refcounted. GOptionGroup's refcount still helps.
+// E.g. when GOptionContext takes ownership of a GOptionGroup, it's given a ref.
+// A drawback with this approach is that it's possible to have more than one wrapper
+// for one GOptionGroup, each wrapper with its own ref.
+
/** 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.
public:
/** For example Glib::ustring on_translate(const Glib::ustring& original);.
*/
- using SlotTranslate = sigc::slot<Glib::ustring, const Glib::ustring&>;
+ using SlotTranslate = sigc::slot<Glib::ustring(const Glib::ustring&)>;
/** For example bool on_option_arg_string(const Glib::ustring& option_name,
* const Glib::ustring& value, bool has_value);.
*/
- using SlotOptionArgString = sigc::slot<bool, const Glib::ustring&, const Glib::ustring&, bool>;
+ using SlotOptionArgString = sigc::slot<bool(const Glib::ustring&, const Glib::ustring&, bool)>;
/** For example bool on_option_arg_filename(const Glib::ustring& option_name,
* const std::string& value, bool has_value);.
*/
- using SlotOptionArgFilename = sigc::slot<bool, const Glib::ustring&, const std::string&, bool>;
+ using SlotOptionArgFilename = sigc::slot<bool(const Glib::ustring&, const std::string&, bool)>;
OptionGroup(const Glib::ustring& name, const Glib::ustring& description, const Glib::ustring& help_description = Glib::ustring());
explicit OptionGroup(GOptionGroup* castitem);
_IGNORE(g_option_group_new, g_option_group_ref)
- OptionGroup(OptionGroup&& other) noexcept;
- OptionGroup& operator=(OptionGroup&& other) noexcept;
+ // OptionGroup can't be copied or moved. The underlying GOptionGroup contains
+ // a pointer to the wrapper, set in the call to g_option_group_new().
+ // That pointer can't be changed.
+ OptionGroup(const OptionGroup& other) = delete;
+ OptionGroup& operator=(const OptionGroup& other) = delete;
+ OptionGroup(OptionGroup&& other) = delete;
+ OptionGroup& operator=(OptionGroup&& other) = delete;
virtual ~OptionGroup();
_IGNORE(g_option_group_free, g_option_group_unref)
- virtual bool on_pre_parse(OptionContext& context, OptionGroup& group);
- virtual bool on_post_parse(OptionContext& context, OptionGroup& group);
- virtual void on_error(OptionContext& context, OptionGroup& group);
+ virtual bool on_pre_parse(OptionContext& context);
+ virtual bool on_post_parse(OptionContext& context);
+ virtual void on_error(OptionContext& context, const Error& error);
_IGNORE(g_option_group_set_parse_hooks, g_option_group_set_error_hook)
void add_entry(const OptionEntry& entry);
_WRAP_METHOD(void set_translation_domain(const Glib::ustring& domain), g_option_group_set_translation_domain)
+ /// Provides access to the underlying C instance.
GOptionGroup* gobj() { return gobject_; }
+
+ /// Provides access to the underlying C instance.
const GOptionGroup* gobj() const { return gobject_; }
- GOptionGroup* gobj_give_ownership();
+
+ /// Provides access to the underlying C instance. The caller is responsible for unrefing it.
+ GOptionGroup* gobj_copy() const;
protected:
gpointer data, GError** error);
//Map of entry names to CppOptionEntry:
- typedef std::map<Glib::ustring, CppOptionEntry> type_map_entries;
+ using type_map_entries = std::map<Glib::ustring, CppOptionEntry>;
type_map_entries map_entries_;
GOptionGroup* gobject_;
- bool has_ownership_; //Whether the gobject_ belongs to this C++ instance.
#endif //DOXYGEN_SHOULD_SKIP_THIS
private:
#include <glibmm/utility.h>
+using CompileFlags = Glib::Regex::CompileFlags;
+using MatchFlags = Glib::Regex::MatchFlags;
+
namespace Glib
{
Glib::RefPtr<Glib::Regex>
Regex::create(
- const Glib::ustring& pattern, RegexCompileFlags compile_options, RegexMatchFlags match_options)
+ const Glib::ustring& pattern, CompileFlags compile_options, MatchFlags match_options)
{
GError* gerror = nullptr;
auto regex = g_regex_new(
bool
Regex::match(
- const Glib::ustring& string, Glib::MatchInfo& match_info, RegexMatchFlags match_options)
+ const Glib::ustring& string, Glib::MatchInfo& match_info, MatchFlags match_options)
{
GMatchInfo* ginfo = nullptr;
bool const result = static_cast<bool>(
}
bool
-Regex::match(const Glib::ustring& string, RegexMatchFlags match_options)
+Regex::match(const Glib::ustring& string, MatchFlags match_options)
{
return g_regex_match(gobj(), string.c_str(), (GRegexMatchFlags)(match_options), nullptr);
}
bool
Regex::match(const Glib::ustring& string, int start_position, Glib::MatchInfo& match_info,
- RegexMatchFlags match_options)
+ MatchFlags match_options)
{
GError* gerror = nullptr;
GMatchInfo* ginfo = nullptr;
bool
Regex::match(const Glib::ustring& string, gssize string_len, int start_position,
- Glib::MatchInfo& match_info, RegexMatchFlags match_options)
+ Glib::MatchInfo& match_info, MatchFlags match_options)
{
GError* gerror = nullptr;
GMatchInfo* ginfo = nullptr;
}
bool
-Regex::match(const Glib::ustring& string, int start_position, RegexMatchFlags match_options)
+Regex::match(const Glib::ustring& string, int start_position, MatchFlags match_options)
{
GError* gerror = nullptr;
bool retvalue = g_regex_match_full(gobj(), string.c_str(), -1, start_position,
bool
Regex::match(
- const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options)
+ const Glib::ustring& string, gssize string_len, int start_position, MatchFlags match_options)
{
GError* gerror = nullptr;
bool retvalue = g_regex_match_full(gobj(), string.c_str(), string_len, start_position,
bool
Regex::match_all(
- const Glib::ustring& string, Glib::MatchInfo& match_info, RegexMatchFlags match_options)
+ const Glib::ustring& string, Glib::MatchInfo& match_info, MatchFlags match_options)
{
GMatchInfo* ginfo = nullptr;
bool const result = static_cast<bool>(g_regex_match_all(
}
bool
-Regex::match_all(const Glib::ustring& string, RegexMatchFlags match_options)
+Regex::match_all(const Glib::ustring& string, MatchFlags match_options)
{
return g_regex_match_all(gobj(), string.c_str(), ((GRegexMatchFlags)(match_options)), nullptr);
}
bool
Regex::match_all(const Glib::ustring& string, int start_position, Glib::MatchInfo& match_info,
- RegexMatchFlags match_options)
+ MatchFlags match_options)
{
GError* gerror = nullptr;
GMatchInfo* ginfo = nullptr;
bool
Regex::match_all(const Glib::ustring& string, gssize string_len, int start_position,
- Glib::MatchInfo& match_info, RegexMatchFlags match_options)
+ Glib::MatchInfo& match_info, MatchFlags match_options)
{
GError* gerror = nullptr;
GMatchInfo* ginfo = nullptr;
}
bool
-Regex::match_all(const Glib::ustring& string, int start_position, RegexMatchFlags match_options)
+Regex::match_all(const Glib::ustring& string, int start_position, MatchFlags match_options)
{
GError* gerror = nullptr;
bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), -1, start_position,
bool
Regex::match_all(
- const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options)
+ const Glib::ustring& string, gssize string_len, int start_position, MatchFlags match_options)
{
GError* gerror = nullptr;
bool retvalue = g_regex_match_all_full(gobj(), string.c_str(), string_len, start_position,
Glib::ustring
Regex::replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement,
- RegexMatchFlags match_options)
+ MatchFlags match_options)
{
GError* gerror = nullptr;
auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(),
Glib::ustring
Regex::replace_literal(const Glib::ustring& string, int start_position,
- const Glib::ustring& replacement, RegexMatchFlags match_options)
+ const Glib::ustring& replacement, MatchFlags match_options)
{
GError* gerror = nullptr;
auto retvalue =
return retvalue;
}
-Glib::StringArrayHandle
-Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options,
+std::vector<Glib::ustring>
+Regex::split(const Glib::ustring& string, int start_position, MatchFlags match_options,
int max_tokens) const
{
GError* gerror = nullptr;
- auto retvalue = Glib::StringArrayHandle(
+ auto retvalue = Glib::ArrayHandler<Glib::ustring>::array_to_vector(
g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position,
((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)),
Glib::OWNERSHIP_DEEP);
return retvalue;
}
-MatchInfo::MatchInfo() : gobject_(nullptr), take_ownership(false)
+MatchInfo::MatchInfo() : gobject_(nullptr), take_ownership_(false)
{
}
-MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_the_ownership)
-: gobject_(castitem), take_ownership(take_the_ownership)
+MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_ownership)
+: gobject_(castitem), take_ownership_(take_ownership)
{
}
MatchInfo::MatchInfo(MatchInfo&& other) noexcept : gobject_(std::move(other.gobject_)),
- take_ownership(std::move(other.take_ownership))
+ take_ownership_(std::move(other.take_ownership_))
{
other.gobject_ = nullptr;
- other.take_ownership = false;
+ other.take_ownership_ = false;
}
MatchInfo&
MatchInfo::operator=(MatchInfo&& other) noexcept
{
- if (take_ownership && gobject_)
+ if (take_ownership_ && gobject_)
g_match_info_free(gobject_);
gobject_ = std::move(other.gobject_);
- take_ownership = std::move(other.take_ownership);
+ take_ownership_ = std::move(other.take_ownership_);
other.gobject_ = nullptr;
- other.take_ownership = false;
+ other.take_ownership_ = false;
return *this;
}
void
-MatchInfo::set_gobject(GMatchInfo* castitem, bool take_the_ownership)
+MatchInfo::set_gobject(GMatchInfo* castitem, bool take_ownership)
{
- if (gobject_ && this->take_ownership)
+ if (gobject_ && this->take_ownership_)
g_match_info_free(gobject_);
gobject_ = castitem;
- this->take_ownership = take_the_ownership;
+ this->take_ownership_ = take_ownership;
}
MatchInfo::~MatchInfo()
{
- if (take_ownership && gobject_)
+ if (take_ownership_ && gobject_)
g_match_info_free(gobject_);
}
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <glibmm/error.h>
-#include <glibmm/arrayhandle.h>
#include <glib.h>
+#include <vector>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GRegex GRegex;
namespace Glib
{
-_WRAP_ENUM(RegexCompileFlags, GRegexCompileFlags, NO_GTYPE)
-_WRAP_ENUM(RegexMatchFlags, GRegexMatchFlags, NO_GTYPE)
/** Exception class for Regex
*/
_IGNORE(g_regex_ref, g_regex_unref)
public:
+ _WRAP_ENUM(CompileFlags, GRegexCompileFlags, NO_GTYPE)
+ _WRAP_ENUM(MatchFlags, GRegexMatchFlags, NO_GTYPE)
+
/// @throws Glib::RegexError
- static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0));
+ static Glib::RefPtr<Glib::Regex> create(const Glib::ustring& pattern, CompileFlags compile_options = static_cast<CompileFlags>(0), MatchFlags match_options = static_cast<MatchFlags>(0));
_WRAP_METHOD(Glib::ustring get_pattern() const, g_regex_get_pattern)
_WRAP_METHOD(int get_max_backref() const, g_regex_get_max_backref)
_WRAP_METHOD(bool get_has_cr_or_lf() const, g_regex_get_has_cr_or_lf)
_WRAP_METHOD(int get_max_lookbehind() const, g_regex_get_max_lookbehind)
_WRAP_METHOD(int get_string_number(const Glib::ustring& name) const, g_regex_get_string_number)
- _WRAP_METHOD(RegexCompileFlags get_compile_flags() const, g_regex_get_compile_flags)
- _WRAP_METHOD(RegexMatchFlags get_match_flags() const, g_regex_get_match_flags)
+ _WRAP_METHOD(CompileFlags get_compile_flags() const, g_regex_get_compile_flags)
+ _WRAP_METHOD(MatchFlags get_match_flags() const, g_regex_get_match_flags)
static Glib::ustring escape_string(const Glib::ustring& string);
- _WRAP_METHOD(static bool match_simple(const Glib::ustring& pattern, const Glib::ustring& string, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_match_simple)
+ _WRAP_METHOD(static bool match_simple(const Glib::ustring& pattern, const Glib::ustring& string, CompileFlags compile_options = static_cast<CompileFlags>(0), MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_match_simple)
_WRAP_METHOD_DOCS_ONLY(g_regex_match)
bool match(
const Glib::ustring& string,
Glib::MatchInfo& match_info,
- RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
+ MatchFlags match_options = static_cast<MatchFlags>(0)
);
/// A match() method not requiring a Glib::MatchInfo.
- bool match(const Glib::ustring& string, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0));
+ bool match(const Glib::ustring& string, MatchFlags match_options = static_cast<MatchFlags>(0));
/** A match() method with a start position and a Glib::MatchInfo.
* @throws Glib::RegexError
const Glib::ustring& string,
int start_position,
Glib::MatchInfo& match_info,
- RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
+ MatchFlags match_options = static_cast<MatchFlags>(0)
);
_WRAP_METHOD_DOCS_ONLY(g_regex_match_full, errthrow "Glib::RegexError")
gssize string_len,
int start_position,
Glib::MatchInfo& match_info,
- RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
+ MatchFlags match_options = static_cast<MatchFlags>(0)
);
/** A match() method with a start position not requiring a Glib::MatchInfo.
* @throws Glib::RegexError
*/
- bool match(const Glib::ustring& string, int start_position, RegexMatchFlags match_options);
+ bool match(const Glib::ustring& string, int start_position, MatchFlags match_options);
/** A match() method with a string length and start position not requiring a
* Glib::MatchInfo.
*/
- bool match(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options);
+ bool match(const Glib::ustring& string, gssize string_len, int start_position, MatchFlags match_options);
_WRAP_METHOD_DOCS_ONLY(g_regex_match_all)
bool match_all(
const Glib::ustring& string,
Glib::MatchInfo& match_info,
- RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
+ MatchFlags match_options = static_cast<MatchFlags>(0)
);
/// A match_all() method not requiring a Glib::MatchInfo.
- bool match_all(const Glib::ustring& string, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0));
+ bool match_all(const Glib::ustring& string, MatchFlags match_options = static_cast<MatchFlags>(0));
/** A match_all() method with a start positon and a Glib::MatchInfo.
* @throws Glib::RegexError
const Glib::ustring& string,
int start_position,
Glib::MatchInfo& match_info,
- RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
+ MatchFlags match_options = static_cast<MatchFlags>(0)
);
_WRAP_METHOD_DOCS_ONLY(g_regex_match_all_full, errthrow "Glib::RegexError")
gssize string_len,
int start_position,
Glib::MatchInfo& match_info,
- RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)
+ MatchFlags match_options = static_cast<MatchFlags>(0)
);
/** A match_all() method with a start position not requiring a Glib::MatchInfo.
* @throws Glib::RegexError
*/
- bool match_all(const Glib::ustring& string, int start_position, RegexMatchFlags match_options);
+ bool match_all(const Glib::ustring& string, int start_position, MatchFlags match_options);
/** A match_all() method with a start position and a string length not
* requiring a Glib::MatchInfo.
* @throws Glib::RegexError
*/
- bool match_all(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options);
-
-#m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
+ bool match_all(const Glib::ustring& string, gssize string_len, int start_position, MatchFlags match_options);
- _WRAP_METHOD(static Glib::StringArrayHandle split_simple(const Glib::ustring& pattern, const Glib::ustring& string, RegexCompileFlags compile_options = static_cast<RegexCompileFlags>(0), RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_split_simple)
- _WRAP_METHOD(Glib::StringArrayHandle split(const Glib::ustring& string, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_split)
+#m4 _CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_DEEP)')
+ _WRAP_METHOD(static std::vector<Glib::ustring> split_simple(const Glib::ustring& pattern, const Glib::ustring& string, CompileFlags compile_options = static_cast<CompileFlags>(0), MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_split_simple)
+ _WRAP_METHOD(std::vector<Glib::ustring> split(const Glib::ustring& string, MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_split)
- _WRAP_METHOD(Glib::StringArrayHandle split(const gchar* string, gssize string_len, int start_position, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0), int max_tokens = 0) const, g_regex_split_full, errthrow "Glib::RegexError", errthrow)
+ _WRAP_METHOD(std::vector<Glib::ustring> split(const gchar* string, gssize string_len, int start_position, MatchFlags match_options = static_cast<MatchFlags>(0), int max_tokens = 0) const, g_regex_split_full, errthrow "Glib::RegexError")
/// @throws Glib::RegexError
- Glib::StringArrayHandle split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const;
+ std::vector<Glib::ustring> split(const Glib::ustring& string, int start_position, MatchFlags match_options, int max_tokens) const;
- _WRAP_METHOD(Glib::ustring replace(const gchar* string, gssize string_len, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_replace, errthrow "Glib::RegexError", errthrow)
+ _WRAP_METHOD(Glib::ustring replace(const gchar* string, gssize string_len, int start_position, const Glib::ustring& replacement, MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_replace, errthrow "Glib::RegexError")
/// @throws Glib::RegexError
- Glib::ustring replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options);
+ Glib::ustring replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, MatchFlags match_options);
- _WRAP_METHOD(Glib::ustring replace_literal(const gchar *string, gssize string_len, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options = static_cast<RegexMatchFlags>(0)), g_regex_replace_literal, errthrow "Glib::RegexError", errthrow)
+ _WRAP_METHOD(Glib::ustring replace_literal(const gchar *string, gssize string_len, int start_position, const Glib::ustring& replacement, MatchFlags match_options = static_cast<MatchFlags>(0)), g_regex_replace_literal, errthrow "Glib::RegexError")
/// @throws Glib::RegexError
- Glib::ustring replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options);
+ Glib::ustring replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, MatchFlags match_options);
- _WRAP_METHOD(Glib::ustring replace_eval(const Glib::ustring& string, gssize string_len, int start_position, RegexMatchFlags match_options, GRegexEvalCallback eval, gpointer user_data), g_regex_replace_eval, errthrow "Glib::RegexError", errthrow)
- _WRAP_METHOD(static bool check_replacement(const Glib::ustring& replacement, gboolean* has_references), g_regex_check_replacement, errthrow "Glib::RegexError", errthrow)
+ _WRAP_METHOD(Glib::ustring replace_eval(const Glib::ustring& string, gssize string_len, int start_position, MatchFlags match_options, GRegexEvalCallback eval, gpointer user_data), g_regex_replace_eval, errthrow "Glib::RegexError")
+ _WRAP_METHOD(static bool check_replacement(const Glib::ustring& replacement, gboolean* has_references), g_regex_check_replacement, errthrow "Glib::RegexError")
};
//TODO: Add C++ iterator like functionality for this class.
/** C object constructor.
* @param castitem The C object.
- * @param take_the_ownership Whether to destroy the C object with the wrapper or
- * not.
+ * @param take_ownership Whether to destroy the C object with the wrapper or not.
*/
- explicit MatchInfo(GMatchInfo* castitem, bool take_the_ownership = true); //TODO: Rename to take_ownership when we can rename the member variable.
+ explicit MatchInfo(GMatchInfo* castitem, bool take_ownership = true);
MatchInfo(const MatchInfo& other) = delete;
MatchInfo& operator=(const MatchInfo& other) = delete;
_WRAP_METHOD(Glib::ustring get_string() const, g_match_info_get_string)
_WRAP_METHOD(bool matches() const, g_match_info_matches)
- _WRAP_METHOD(bool next(), g_match_info_next, errthrow "Glib::RegexError", errthrow)
+ _WRAP_METHOD(bool next(), g_match_info_next, errthrow "Glib::RegexError")
_WRAP_METHOD(int get_match_count() const, g_match_info_get_match_count)
_WRAP_METHOD(bool is_partial_match() const, g_match_info_is_partial_match)
- _WRAP_METHOD(Glib::ustring expand_references(const Glib::ustring& string_to_expand), g_match_info_expand_references, errthrow "Glib::RegexError", errthrow)
+ _WRAP_METHOD(Glib::ustring expand_references(const Glib::ustring& string_to_expand), g_match_info_expand_references, errthrow "Glib::RegexError")
_WRAP_METHOD(Glib::ustring fetch(int match_num), g_match_info_fetch)
_WRAP_METHOD(bool fetch_named_pos(const Glib::ustring& name, int& start_pos, int& end_pos), g_match_info_fetch_named_pos)
- _WRAP_METHOD(Glib::StringArrayHandle fetch_all(), g_match_info_fetch_all)
+ _WRAP_METHOD(std::vector<Glib::ustring> fetch_all(), g_match_info_fetch_all)
protected:
GMatchInfo* gobject_; // The C object.
- bool take_ownership; // Bool signaling ownership. //TODO: Give this a _ suffix when we can break API.
+ bool take_ownership_; // Bool signaling ownership.
protected:
// So that Glib::Regex::match() can set the C object.
/**** shell utility functions **********************************************/
-Glib::ArrayHandle<std::string>
+std::vector<std::string>
shell_parse_argv(const std::string& command_line)
{
char** argv = nullptr;
if (error)
Glib::Error::throw_exception(error);
- return Glib::ArrayHandle<std::string>(argv, argc, Glib::OWNERSHIP_DEEP);
+ return Glib::ArrayHandler<std::string>::array_to_vector(argv, argc, Glib::OWNERSHIP_DEEP);
}
std::string
_DEFS(glibmm,glib)
-#include <glibmm/arrayhandle.h>
#include <glibmm/error.h>
#include <glib.h>
#include <string>
+#include <vector>
namespace Glib
{
* converted to any STL compatible container type).
* @throw Glib::ShellError
*/
-Glib::ArrayHandle<std::string> shell_parse_argv(const std::string& command_line);
+std::vector<std::string> shell_parse_argv(const std::string& command_line);
/** Quotes a string so that the shell (/bin/sh) will interpret the quoted
* string to mean @a unquoted_string. If you pass a filename to the shell,
void
spawn_async_with_pipes(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv, const Glib::ArrayHandle<std::string>& envp,
+ const std::vector<std::string>& argv, const std::vector<std::string>& envp,
SpawnFlags flags, const SlotSpawnChildSetup& child_setup, Pid* child_pid, int* standard_input,
int* standard_output, int* standard_error)
{
GError* gerror = nullptr;
g_spawn_async_with_pipes(Glib::c_str_or_nullptr(working_directory),
- const_cast<char**>(argv.data()), const_cast<char**>(envp.data()),
+ const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()), const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(envp).data()),
static_cast<GSpawnFlags>(unsigned(flags)), (setup_slot) ? &child_setup_callback : nullptr,
(setup_slot) ? &child_setup_ : nullptr, child_pid, standard_input, standard_output,
standard_error, &gerror);
void
spawn_async_with_pipes(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv, SpawnFlags flags,
+ const std::vector<std::string>& argv, SpawnFlags flags,
const SlotSpawnChildSetup& child_setup, Pid* child_pid, int* standard_input, int* standard_output,
int* standard_error)
{
GError* gerror = nullptr;
g_spawn_async_with_pipes(Glib::c_str_or_nullptr(working_directory),
- const_cast<char**>(argv.data()), nullptr, static_cast<GSpawnFlags>(unsigned(flags)),
+ const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()), nullptr, static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : nullptr, (setup_slot) ? &child_setup_ : nullptr,
child_pid, standard_input, standard_output, standard_error, &gerror);
}
void
-spawn_async(const std::string& working_directory, const Glib::ArrayHandle<std::string>& argv,
- const Glib::ArrayHandle<std::string>& envp, SpawnFlags flags,
+spawn_async(const std::string& working_directory, const std::vector<std::string>& argv,
+ const std::vector<std::string>& envp, SpawnFlags flags,
const SlotSpawnChildSetup& child_setup, Pid* child_pid)
{
const bool setup_slot = !child_setup.empty();
auto child_setup_ = child_setup;
GError* gerror = nullptr;
- g_spawn_async(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(argv.data()),
- const_cast<char**>(envp.data()), static_cast<GSpawnFlags>(unsigned(flags)),
+ g_spawn_async(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()),
+ const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(envp).data()), static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : nullptr, (setup_slot) ? &child_setup_ : nullptr,
child_pid, &gerror);
}
void
-spawn_async(const std::string& working_directory, const Glib::ArrayHandle<std::string>& argv,
+spawn_async(const std::string& working_directory, const std::vector<std::string>& argv,
SpawnFlags flags, const SlotSpawnChildSetup& child_setup, Pid* child_pid)
{
const bool setup_slot = !child_setup.empty();
auto child_setup_ = child_setup;
GError* gerror = nullptr;
- g_spawn_async(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(argv.data()), nullptr,
+ g_spawn_async(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()), nullptr,
static_cast<GSpawnFlags>(unsigned(flags)), (setup_slot) ? &child_setup_callback : nullptr,
(setup_slot) ? &child_setup_ : nullptr, child_pid, &gerror);
}
void
-spawn_sync(const std::string& working_directory, const Glib::ArrayHandle<std::string>& argv,
- const Glib::ArrayHandle<std::string>& envp, SpawnFlags flags,
+spawn_sync(const std::string& working_directory, const std::vector<std::string>& argv,
+ const std::vector<std::string>& envp, SpawnFlags flags,
const SlotSpawnChildSetup& child_setup, std::string* standard_output, std::string* standard_error,
int* exit_status)
{
GError* gerror = nullptr;
char* pch_buf_standard_output = nullptr;
char* pch_buf_standard_error = nullptr;
- g_spawn_sync(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(argv.data()),
- const_cast<char**>(envp.data()), static_cast<GSpawnFlags>(unsigned(flags)),
+ g_spawn_sync(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()),
+ const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(envp).data()), static_cast<GSpawnFlags>(unsigned(flags)),
(setup_slot) ? &child_setup_callback : nullptr, (setup_slot) ? &child_setup_ : nullptr,
(standard_output) ? &pch_buf_standard_output : nullptr,
(standard_error) ? &pch_buf_standard_error : nullptr, exit_status, &gerror);
}
void
-spawn_sync(const std::string& working_directory, const Glib::ArrayHandle<std::string>& argv,
+spawn_sync(const std::string& working_directory, const std::vector<std::string>& argv,
SpawnFlags flags, const SlotSpawnChildSetup& child_setup, std::string* standard_output,
std::string* standard_error, int* exit_status)
{
char* pch_buf_standard_error = nullptr;
GError* gerror = nullptr;
- g_spawn_sync(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(argv.data()), nullptr,
+ g_spawn_sync(Glib::c_str_or_nullptr(working_directory), const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()), nullptr,
static_cast<GSpawnFlags>(unsigned(flags)), (setup_slot) ? &child_setup_callback : nullptr,
(setup_slot) ? &child_setup_ : nullptr, (standard_output) ? &pch_buf_standard_output : nullptr,
(standard_error) ? &pch_buf_standard_error : nullptr, exit_status, &gerror);
_DEFS(glibmm,glib)
#include <glibmmconfig.h>
-#include <glibmm/arrayhandle.h>
#include <glibmm/error.h>
#include <sigc++/sigc++.h>
#include <string>
+#include <vector>
namespace Glib
{
/** For instance,<br>
* void on_child_setup();
*/
-using SlotSpawnChildSetup = sigc::slot<void>;
+using SlotSpawnChildSetup = sigc::slot<void()>;
/** Executes a child program asynchronously (your program will not
* block waiting for the child to exit). The child program is
* The first string in @a argv is of
* course the name of the program to execute. By default, the name of
* the program must be a full path; the PATH shell variable
- * will only be searched if you pass the SPAWN_SEARCH_PATH flag.
+ * will only be searched if you pass the SpawnFlags::SEARCH_PATH flag.
*
* On Windows, note that all the string or string vector arguments to
* this function and the other spawn*() functions are in UTF-8, the
* the child's environment.
*
* @a flags should be the bitwise OR of any flags you want to affect the
- * function's behaviour. The SPAWN_DO_NOT_REAP_CHILD flags means that
+ * function's behaviour. The SpawnFlags::DO_NOT_REAP_CHILD flags means that
* the child will not automatically be reaped; you must use a
* ChildWatch source to be notified about the death of the child
* process. Eventually you must call spawn_close_pid() on the
* PAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
* descriptors will be inherited by the child; otherwise all
* descriptors except stdin/stdout/stderr will be closed before
- * calling exec() in the child. SPAWN_SEARCH_PATH
+ * calling exec() in the child. SpawnFlags::SEARCH_PATH
* means that argv[0] need not be an absolute path, it
* will be looked for in the user's PATH.
- * SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output will
+ * SpawnFlags::STDOUT_TO_DEV_NULL means that the child's standard output will
* be discarded, instead of going to the same location as the parent's
* standard output. If you use this flag, @a standard_output must be nullptr.
- * SPAWN_STDERR_TO_DEV_NULL means that the child's standard error
+ * SpawnFlags::STDERR_TO_DEV_NULL means that the child's standard error
* will be discarded, instead of going to the same location as the parent's
* standard error. If you use this flag, @a standard_error must be nullptr.
- * SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's
+ * SpawnFlags::CHILD_INHERITS_STDIN means that the child will inherit the parent's
* standard input (by default, the child's standard input is attached to
* /dev/null). If you use this flag, @a standard_input must be nullptr.
- * G_SPAWN_FILE_AND_ARGV_ZERO means that the first element of @a argv is
+ * SpawnFlags::FILE_AND_ARGV_ZERO means that the first element of @a argv is
* the file to execute, while the remaining elements are the
* actual argument vector to pass to the file. Normally
* spawn_async_with_pipes() uses argv[0] as the file to execute, and
* If non-nullptr, @a child_pid will on Unix be filled with the child's
* process ID. You can use the process ID to send signals to the
* child, or to use child_watch_add() (or waitpid()) if you specified the
- * SPAWN_DO_NOT_REAP_CHILD flag. On Windows, @a child_pid will be
+ * SpawnFlags::DO_NOT_REAP_CHILD flag. On Windows, @a child_pid will be
* filled with a handle to the child process only if you specified the
- * SPAWN_DO_NOT_REAP_CHILD flag. You can then access the child
+ * SpawnFlags::DO_NOT_REAP_CHILD flag. You can then access the child
* process using the Win32 API, for example wait for its termination
* with the WaitFor*() functions, or examine its
* exit code with GetExitCodeProcess(). You should close the handle
* pipe won't be created.
*
* If @a standard_input is nullptr, the child's standard input is attached to
- * /dev/null unless SPAWN_CHILD_INHERITS_STDIN is set.
+ * /dev/null unless SpawnFlags::CHILD_INHERITS_STDIN is set.
*
* If @a standard_error is nullptr, the child's standard error goes to the same
- * location as the parent's standard error unless SPAWN_STDERR_TO_DEV_NULL
+ * location as the parent's standard error unless SpawnFlags::STDERR_TO_DEV_NULL
* is set.
*
* If @a standard_output is nullptr, the child's standard output goes to the same
- * location as the parent's standard output unless SPAWN_STDOUT_TO_DEV_NULL
+ * location as the parent's standard output unless SpawnFlags::STDOUT_TO_DEV_NULL
* is set.
*
* If @a child_pid is not nullptr and an error does not occur then the returned
* and @a standard_error will not be filled with valid values.
*/
void spawn_async_with_pipes(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv,
- const Glib::ArrayHandle<std::string>& envp,
- SpawnFlags flags = SPAWN_DEFAULT,
+ const std::vector<std::string>& argv,
+ const std::vector<std::string>& envp,
+ SpawnFlags flags = SpawnFlags::DEFAULT,
const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
Pid* child_pid = nullptr,
int* standard_input = nullptr,
* and @a standard_error will not be filled with valid values.
*/
void spawn_async_with_pipes(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv,
- SpawnFlags flags = SPAWN_DEFAULT,
+ const std::vector<std::string>& argv,
+ SpawnFlags flags = SpawnFlags::DEFAULT,
const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
Pid* child_pid = nullptr,
int* standard_input = nullptr,
* to users.
*/
void spawn_async(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv,
- const Glib::ArrayHandle<std::string>& envp,
- SpawnFlags flags = SPAWN_DEFAULT,
+ const std::vector<std::string>& argv,
+ const std::vector<std::string>& envp,
+ SpawnFlags flags = SpawnFlags::DEFAULT,
const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
Pid* child_pid = nullptr);
* to users.
*/
void spawn_async(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv,
- SpawnFlags flags = SPAWN_DEFAULT,
+ const std::vector<std::string>& argv,
+ SpawnFlags flags = SpawnFlags::DEFAULT,
const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
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,
* if those parameters are non-nullptr. Note that you must set the
- * SPAWN_STDOUT_TO_DEV_NULL and SPAWN_STDERR_TO_DEV_NULL flags when
+ * SpawnFlags::STDOUT_TO_DEV_NULL and SpawnFlags::STDERR_TO_DEV_NULL flags when
* passing nullptr for @a standard_output and @a standard_error.
* If @a exit_status is non-nullptr, the exit status of the child is stored
* there as it would be returned by waitpid(); standard UNIX macros such
* as WIFEXITED() and WEXITSTATUS() must be used to evaluate the exit status.
* Note that this function calls waitpid() even if @a exit_status is nullptr, and
- * does not accept the SPAWN_DO_NOT_REAP_CHILD flag.
+ * does not accept the SpawnFlags::DO_NOT_REAP_CHILD flag.
* If an error occurs, no data is returned in @a standard_output,
* @a standard_error, or @a exit_status.
*
* and @a standard_error will not be filled with valid values.
*/
void spawn_sync(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv,
- const Glib::ArrayHandle<std::string>& envp,
- SpawnFlags flags = SPAWN_DEFAULT,
+ const std::vector<std::string>& argv,
+ const std::vector<std::string>& envp,
+ SpawnFlags flags = SpawnFlags::DEFAULT,
const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
std::string* standard_output = nullptr,
std::string* standard_error = nullptr,
* and @a standard_error will not be filled with valid values.
*/
void spawn_sync(const std::string& working_directory,
- const Glib::ArrayHandle<std::string>& argv,
- SpawnFlags flags = SPAWN_DEFAULT,
+ const std::vector<std::string>& argv,
+ SpawnFlags flags = SpawnFlags::DEFAULT,
const SlotSpawnChildSetup& child_setup = SlotSpawnChildSetup(),
std::string* standard_output = nullptr,
std::string* standard_error = 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
* command line in the background. Unlike spawn_async(), the
- * SPAWN_SEARCH_PATH flag is enabled, other flags are not. Note
- * that SPAWN_SEARCH_PATH can have security implications, so
+ * SpawnFlags::SEARCH_PATH flag is enabled, other flags are not. Note
+ * that SpawnFlags::SEARCH_PATH can have security implications, so
* consider using spawn_async() directly if appropriate.
*
* The same concerns on Windows apply as for spawn_command_line_sync().
/** A simple version of spawn_sync() with little-used parameters
* removed, taking a command line instead of an argument vector. See
* spawn_sync() for full details. @a command_line will be parsed by
- * shell_parse_argv(). Unlike spawn_sync(), the SPAWN_SEARCH_PATH flag
- * is enabled. Note that SPAWN_SEARCH_PATH can have security
+ * shell_parse_argv(). Unlike spawn_sync(), the SpawnFlags::SEARCH_PATH flag
+ * is enabled. Note that SpawnFlags::SEARCH_PATH can have security
* implications, so consider using spawn_sync() directly if
* appropriate.
*
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmm/exceptionhandler.h>
-#include <glib.h>
-
-namespace
-{
-
-extern "C" {
-
-static void*
-call_thread_entry_slot(void* data)
-{
- const auto slot = reinterpret_cast<sigc::slot_base*>(data);
-
- try
- {
- // Recreate the specific slot, and drop the reference obtained by create().
- (*static_cast<sigc::slot<void>*>(slot))();
- }
- catch (Glib::Thread::Exit&)
- {
- // Just exit from the thread. The Thread::Exit exception
- // is our sane C++ replacement of g_thread_exit().
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- delete slot;
- return nullptr;
-}
-
-} // extern "C"
-
-} // anonymous namespace
-
-namespace Glib
-{
-
-// This was always meant as an internal method. It is no longer called,
-// and no longer needs to be called. We are keeping it just to avoid
-// breaking ABI, though hopefully nobody is using it anyway.
-// TODO: Remove this when we can break ABI.
-void
-thread_init_impl()
-{
- // Make sure the exception map is initialized before creating any thread.
- Glib::Error::register_init();
-}
-
-/**** Glib::Thread *********************************************************/
-
-// static
-Thread*
-Thread::create(const sigc::slot<void>& slot, bool /* joinable */)
-{
- // Make a copy of slot on the heap
- const auto slot_copy = new sigc::slot<void>(slot);
-
- GError* error = nullptr;
-
- const auto thread = g_thread_try_new(nullptr, &call_thread_entry_slot, slot_copy, &error);
-
- if (error)
- {
- delete slot_copy;
- // Glib::Error::throw_exception() will probably wrap G_THREAD_ERROR in a
- // Glib::Threads::ThreadError instance, but we want a Glib::ThreadError.
- if (error->domain == G_THREAD_ERROR)
- throw Glib::ThreadError(error);
- else
- Glib::Error::throw_exception(error);
- }
-
- return reinterpret_cast<Thread*>(thread);
-}
-
-// static
-Thread*
-Thread::create(const sigc::slot<void>& slot, unsigned long stack_size, bool joinable, bool bound,
- ThreadPriority priority)
-{
- // Make a copy of slot on the heap
- const auto slot_copy = new sigc::slot<void>(slot);
-
- GError* error = nullptr;
-
- const auto thread = g_thread_create_full(&call_thread_entry_slot, slot_copy, stack_size, joinable,
- bound, (GThreadPriority)priority, &error);
-
- if (error)
- {
- delete slot_copy;
- // Glib::Error::throw_exception() will probably wrap G_THREAD_ERROR in a
- // Glib::Threads::ThreadError instance, but we want a Glib::ThreadError.
- if (error->domain == G_THREAD_ERROR)
- throw Glib::ThreadError(error);
- else
- Glib::Error::throw_exception(error);
- }
-
- return reinterpret_cast<Thread*>(thread);
-}
-
-// static
-Thread*
-Thread::self()
-{
- return reinterpret_cast<Thread*>(g_thread_self());
-}
-
-void
-Thread::join()
-{
- g_thread_join(&gobject_);
-}
-
-bool
-Thread::joinable() const
-{
- return true; // An appropriate result now that this is deprecated because all threads are now
- // joinable.
-}
-
-void
-Thread::set_priority(ThreadPriority priority)
-{
- g_thread_set_priority(&gobject_, (GThreadPriority)priority);
-}
-
-ThreadPriority
-Thread::get_priority() const
-{
- return THREAD_PRIORITY_NORMAL; // An appropriate result now that this is deprecated because the
- // priority concept has been removed.
-}
-
-void
-thread_init(GThreadFunctions* /* vtable */)
-{
- // g_thread_init() is deprecated and now does nothing,
- // so we do not even call it. That avoids a need to link to gthread-2.0,
- // which contains the empty g_thread_init() implementation.
- // g_thread_init(vtable);
-
- Glib::thread_init_impl();
-}
-
-bool
-thread_supported()
-{
- // MSVC++ needs the != 0 to avoid an int -> bool cast warning.
- return (g_thread_supported() != 0);
-}
-
-// static
-void
-Thread::yield()
-{
- g_thread_yield();
-}
-
-Thread*
-wrap(GThread* gobject)
-{
- return reinterpret_cast<Thread*>(gobject);
-}
-
-/**** Glib::StaticMutex ****************************************************/
-
-void
-StaticMutex::lock()
-{
- g_static_mutex_lock(&gobject_);
-}
-
-bool
-StaticMutex::trylock()
-{
- return g_static_mutex_trylock(&gobject_);
-}
-
-void
-StaticMutex::unlock()
-{
- g_static_mutex_unlock(&gobject_);
-}
-
-StaticMutex::operator Mutex&()
-{
- // If GStaticMutex is implemented as struct (e.g. on Linux), its first struct
- // member (runtime_mutex) is a GMutex pointer. If the gthread implementation
- // is native (i.e. the vtable pointer passed to g_thread_init() was 0), then
- // the runtime_mutex pointer is unused, and the rest of the GStaticMutex
- // struct resembles the mutex data.
- //
- // On Win32, GStaticMutex is just a typedef to struct _GMutex*. Either way,
- // the first sizeof(GMutex*) bytes of GStaticMutex always resemble a GMutex
- // pointer. The gthread implementation relies on that, and we'll also do so.
-
- GMutex*& runtime_mutex = reinterpret_cast<GMutex*&>(gobject_);
-
- // Fortunately, it cannot hurt if we set this to the GMutex pointer returned
- // by g_static_mutex_get_mutex(). Either we just overwrite it with the same
- // value, or it was unused anyway. Doing that allows casting the pointer
- // location to a Glib::Mutex reference (its only data member is a GMutex*).
-
- runtime_mutex = g_static_mutex_get_mutex(&gobject_);
-
- return reinterpret_cast<Mutex&>(runtime_mutex);
-}
-
-/**** Glib::Mutex **********************************************************/
-
-Mutex::Mutex()
-: gobject_(g_mutex_new()) // TODO: Use a statically-allocated GMutext instead, with g_mutex_init().
-{
-}
-
-Mutex::~Mutex()
-{
- g_mutex_free(gobject_);
-}
-
-void
-Mutex::lock()
-{
- g_mutex_lock(gobject_);
-}
-
-bool
-Mutex::trylock()
-{
- return g_mutex_trylock(gobject_);
-}
-
-void
-Mutex::unlock()
-{
- g_mutex_unlock(gobject_);
-}
-
-/**** Glib::StaticRecMutex *************************************************/
-
-void
-StaticRecMutex::lock()
-{
- g_static_rec_mutex_lock(&gobject_);
-}
-
-bool
-StaticRecMutex::trylock()
-{
- return g_static_rec_mutex_trylock(&gobject_);
-}
-
-void
-StaticRecMutex::unlock()
-{
- g_static_rec_mutex_unlock(&gobject_);
-}
-
-void
-StaticRecMutex::lock_full(unsigned int depth)
-{
- g_static_rec_mutex_lock_full(&gobject_, depth);
-}
-
-unsigned int
-StaticRecMutex::unlock_full()
-{
- return g_static_rec_mutex_unlock_full(&gobject_);
-}
-
-StaticRecMutex::operator RecMutex&()
-{
- return static_cast<RecMutex&>(*this);
-}
-
-/**** Glib::RecMutex *******************************************************/
-
-RecMutex::RecMutex()
-{
- g_static_rec_mutex_init(&gobject_);
-}
-
-RecMutex::~RecMutex()
-{
- g_static_rec_mutex_free(&gobject_);
-}
-
-/**** Glib::StaticRWLock ***************************************************/
-
-void
-StaticRWLock::reader_lock()
-{
- g_static_rw_lock_reader_lock(&gobject_);
-}
-
-bool
-StaticRWLock::reader_trylock()
-{
- return g_static_rw_lock_reader_trylock(&gobject_);
-}
-
-void
-StaticRWLock::reader_unlock()
-{
- g_static_rw_lock_reader_unlock(&gobject_);
-}
-
-void
-StaticRWLock::writer_lock()
-{
- g_static_rw_lock_writer_lock(&gobject_);
-}
-
-bool
-StaticRWLock::writer_trylock()
-{
- return g_static_rw_lock_writer_trylock(&gobject_);
-}
-
-void
-StaticRWLock::writer_unlock()
-{
- g_static_rw_lock_writer_unlock(&gobject_);
-}
-
-StaticRWLock::operator RWLock&()
-{
- return static_cast<RWLock&>(*this);
-}
-
-/**** Glib::RWLock *********************************************************/
-
-RWLock::RWLock()
-{
- g_static_rw_lock_init(&gobject_);
-
- // GLib doesn't have GRWLock, only GStaticRWLock. Force initialization
- // of the mutex and the condition variables now, to mimic the behaviour
- // of a (hypothetical) GRWLock.
-
- if (g_static_mutex_get_mutex(&gobject_.mutex))
- {
- gobject_.read_cond = g_cond_new();
- gobject_.write_cond = g_cond_new();
- }
-}
-
-RWLock::~RWLock()
-{
- g_static_rw_lock_free(&gobject_);
-}
-
-/**** Glib::Cond ***********************************************************/
-
-Cond::Cond() : gobject_(g_cond_new())
-{
-}
-
-Cond::~Cond()
-{
- g_cond_free(gobject_);
-}
-
-void
-Cond::signal()
-{
- g_cond_signal(gobject_);
-}
-
-void
-Cond::broadcast()
-{
- g_cond_broadcast(gobject_);
-}
-
-void
-Cond::wait(Mutex& mutex)
-{
- g_cond_wait(gobject_, mutex.gobj());
-}
-
-bool
-Cond::timed_wait(Mutex& mutex, const Glib::TimeVal& abs_time)
-{
- return g_cond_timed_wait(gobject_, mutex.gobj(), const_cast<Glib::TimeVal*>(&abs_time));
-}
-
-void*
-StaticPrivate_get_helper(GStaticPrivate* private_key)
-{
- return g_static_private_get(private_key);
-}
-
-void
-StaticPrivate_set_helper(GStaticPrivate* private_key, gpointer data, GDestroyNotify notify)
-{
- return g_static_private_set(private_key, data, notify);
-}
-
-GPrivate*
-GPrivate_new_helper(GDestroyNotify notify)
-{
- return g_private_new(notify);
-}
-
-} // namespace Glib
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-_DEFS(glibmm,glib)
-_CONFIGINCLUDE(glibmmconfig.h)
-
-_IS_DEPRECATED // This whole file is deprecated.
-
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-//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
-#define GLIBMM_G_DISABLE_DEPRECATED_UNDEFED 1
-#endif
-
-#include <glib.h>
-
-// 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 GLIBMM_G_DISABLE_DEPRECATED_UNDEFED
-#endif
-
-
-#include <glibmm/error.h>
-#include <glibmm/timeval.h>
-#include <sigc++/sigc++.h>
-
-#include <cstddef>
-
-/* Shadow THREAD_PRIORITY_NORMAL macro (from winbase.h).
- */
-#if defined(THREAD_PRIORITY_NORMAL) && !defined(GLIBMM_MACRO_SHADOW_THREAD_PRIORITY_NORMAL)
-enum { GLIBMM_MACRO_DEFINITION_THREAD_PRIORITY_NORMAL = THREAD_PRIORITY_NORMAL };
-#undef THREAD_PRIORITY_NORMAL
-enum { THREAD_PRIORITY_NORMAL = GLIBMM_MACRO_DEFINITION_THREAD_PRIORITY_NORMAL };
-#define THREAD_PRIORITY_NORMAL THREAD_PRIORITY_NORMAL
-#define GLIBMM_MACRO_SHADOW_THREAD_PRIORITY_NORMAL 1
-#endif
-
-
-/** Initializer macro for Glib::StaticRecMutex.
- * @relates Glib::StaticRecMutex
- * @hideinitializer
- *
- * @deprecated Glib::StaticRecMutex is deprecated in favour of Glib::Threads::RecMutex, which can be used statically.
- */
-#define GLIBMM_STATIC_REC_MUTEX_INIT { G_STATIC_REC_MUTEX_INIT }
-
-/** Initializer macro for Glib::StaticRWLock.
- * @relates Glib::StaticRWLock
- * @hideinitializer
- *
- * @deprecated Glib::StaticRWLock is deprecated in favour of Glib::Threads::RWLock, which can be used statically.
- */
-#define GLIBMM_STATIC_RW_LOCK_INIT { G_STATIC_RW_LOCK_INIT }
-
-/** Initializer macro for Glib::StaticPrivate.
- * @relates Glib::StaticPrivate
- * @hideinitializer
- *
- * @deprecated Glib::StaticPrivate is deprecated in favour of Glib::Threads::Private, which can be used statically.
- */
-#define GLIBMM_STATIC_PRIVATE_INIT { G_STATIC_PRIVATE_INIT }
-
-namespace Glib
-{
-
-/** @deprecated Thread priorities no longer have any effect.
- */
-_WRAP_ENUM(ThreadPriority, GThreadPriority, NO_GTYPE)
-
-/*! @var ThreadPriority THREAD_PRIORITY_LOW
- * A priority lower than normal.
- */
-/*! @var ThreadPriority THREAD_PRIORITY_NORMAL
- * The default priority.
- */
-/*! @var ThreadPriority THREAD_PRIORITY_HIGH
- * A priority higher than normal.
- */
-/*! @var ThreadPriority THREAD_PRIORITY_URGENT
- * The highest priority.
- */
-
-/** Initializes the GLib thread system.
- * @deprecated Calling thread_init() is no longer necessary and no longer has any effect.
- */
-void thread_init(GThreadFunctions* vtable = nullptr);
-
-/** Returns whether the thread system is initialized.
- * @return @c true, if the thread system is initialized.
- * @deprecated This is no longer useful, because the thread system is always initialized.
- */
-bool thread_supported();
-
-/**
- * @deprecated Use Glib::Threads::NotLock instead.
- */
-enum NotLock { NOT_LOCK };
-
-/**
- * @deprecated Use Glib::Threads::TryLock instead.
- */
-enum TryLock { TRY_LOCK };
-
-class Mutex;
-class RecMutex;
-class RWLock;
-
-struct StaticRecMutex;
-struct StaticRWLock;
-
-
-/** Exception class for thread-related errors.
- * @deprecated Use Glib::Threads::ThreadError instead.
- */
-_WRAP_GERROR(ThreadError, GThreadError, G_THREAD_ERROR, NO_GTYPE)
-
-
-/** Represents a running thread.
- * An instance of this class can only be obtained with create(), self(),
- * or wrap(GThread*). It's not possible to delete a Thread object. If the
- * thread is @em not joinable, its resources will be freed automatically
- * when it exits. Otherwise, if the thread @em is joinable, you must call
- * join() to avoid a memory leak.
- *
- * @note g_thread_exit() is not wrapped, because that function exits a thread
- * without any cleanup. That's especially dangerous in C++ code, since the
- * destructors of automatic objects won't be invoked. Instead, you can throw
- * a 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
- * you can pass an additional output argument to the thread's entry slot.
- *
- * @deprecated Use Glib::Threads::Thread instead.
- */
-class Thread
-{
-public:
-
- Thread(const Thread&) = delete;
- Thread& operator=(const Thread&) = delete;
-
- class Exit;
-
- //See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
- /** Creates a new thread with the priority <tt>THREAD_PRIORITY_NORMAL</tt>.
- * If @a joinable is @c true, you can wait for this thread's termination by
- * calling join(). Otherwise the thread will just disappear, when ready.
- *
- * The new thread executes the function or method @a slot points to. You can
- * pass additional arguments using sigc::bind(). If the thread was created
- * successfully, it is returned, otherwise a ThreadError exception is thrown.
- *
- * Because sigc::trackable is not thread safe, if the slot represents a
- * non-static class method (that is, it is created by sigc::mem_fun()), the
- * class concerned should not derive from sigc::trackable.
- *
- * @param slot A slot to execute in the new thread.
- * @param joinable This parameter is now ignored because Threads are now always joinable.
- * @return The new Thread* on success.
- * @throw Glib::ThreadError
- */
- static Thread* create(const sigc::slot<void>& slot, bool joinable = true);
-
- /** Returns the Thread* corresponding to the calling thread.
- * @return The current thread.
- */
- static Thread* self();
-
- /** Waits until the thread finishes.
- * Waits until the thread finishes, i.e. the slot, as given to create(),
- * returns or g_thread_exit() is called by the thread. (Calling
- * g_thread_exit() in a C++ program should be avoided.) All resources of
- * the thread including the Glib::Thread object are released. The thread
- * must have been created with <tt>joinable = true</tt>.
- */
- void join();
-
- //See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
- /** Creates a new thread with the priority @a priority. The stack gets the
- * size @a stack_size or the default value for the current platform, if
- * @a stack_size is <tt>0</tt>.
- *
- * If @a joinable is @c true, you can wait for this thread's termination by
- * calling join(). Otherwise the thread will just disappear, when ready.
- * If @a bound is @c true, this thread will be scheduled in the system scope,
- * otherwise the implementation is free to do scheduling in the process
- * scope. The first variant is more expensive resource-wise, but generally
- * faster. On some systems (e.g. Linux) all threads are bound.
- *
- * The new thread executes the function or method @a slot points to. You can
- * pass additional arguments using sigc::bind(). If the thread was created
- * successfully, it is returned.
- *
- * Because sigc::trackable is not thread safe, if the slot represents a
- * non-static class method (that is, it is created by sigc::mem_fun()), the
- * class concerned should not derive from sigc::trackable.
- *
- * @note It is not guaranteed, that threads with different priorities really
- * behave accordingly. On some systems (e.g. Linux) only root can increase
- * priorities. On other systems (e.g. Solaris) there doesn't seem to be
- * different scheduling for different priorities. All in all try to avoid
- * being dependent on priorities. Use <tt>Glib::THREAD_PRIORITY_NORMAL</tt>
- * here as a default.
- *
- * @note Only use the extended
- * create(const sigc::slot<void>&, unsigned long, bool, bool, ThreadPriority)
- * function, when you really can't use the simple
- * create(const sigc::slot<void>&, bool)
- * instead. The latter overload does not take @a stack_size, @a bound and
- * @a priority as arguments, as they should only be used for cases, where
- * it is inevitable.
- *
- * @param slot A slot to execute in the new thread.
- * @param stack_size A stack size for the new thread, or <tt>0</tt>.
- * @param joinable Should this thread be joinable?
- * @param bound Should this thread be bound to a system thread?
- * @param priority A priority for the thread.
- * @return The new Thread* on success.
- * @throw Glib::ThreadError
- *
- * @deprecated Use the simpler create() method instead, because all Threads
- * are now joinable, and bounds and priority parameters now have no effect.
- */
- static Thread* create(const sigc::slot<void>& slot, unsigned long stack_size,
- bool joinable, bool bound, ThreadPriority priority);
-
- /** Returns whether the thread is joinable.
- * @return Whether the thread is joinable.
- *
- * @deprecated All threads are now joinable.
- */
- bool joinable() const;
-
- /** Changes the priority of the thread to @a priority.
- * @note It is not guaranteed, that threads with different priorities really
- * behave accordingly. On some systems (e.g. Linux) only @c root can
- * increase priorities. On other systems (e.g. Solaris) there doesn't seem
- * to be different scheduling for different priorities. All in all try to
- * avoid being dependent on priorities.
- * @param priority A new priority for the thread.
- *
- * @deprecated Thread priorities no longer have any effect.
- */
- void set_priority(ThreadPriority priority);
-
- /** Returns the priority of the thread.
- * @return The thread's priority.
- *
- * @deprecated Thread priorities no longer have any effect.
- */
- ThreadPriority get_priority() const;
-
- /** Gives way to other threads waiting to be scheduled.
- * This function is often used as a method to make busy wait less evil. But
- * in most cases, you will encounter, there are better methods to do that.
- * So in general you shouldn't use this function.
- */
- static void yield();
-
- GThread* gobj() { return &gobject_; }
- const GThread* gobj() const { return &gobject_; }
-
-private:
- GThread gobject_;
-
- // Glib::Thread can neither be constructed nor deleted.
- Thread();
- void operator delete(void*, std::size_t);
-};
-
-/** %Exception class used to exit from a thread.
- * @code
- * throw Glib::Thread::Exit();
- * @endcode
- * Write this if you want to exit from a thread created by Thread::create().
- * Of course you must make sure not to catch Thread::Exit by accident, i.e.
- * when using <tt>catch(...)</tt> somewhere in your code.
- *
- * @deprecated Use Glib::Threads::Thread::Exit instead.
- */
-class Thread::Exit
-{};
-
-
-//TODO: Make sure that Glib::wrap() uses Glib::Threads::wrap() instead.
-
-/** @relates Glib::Thread
- *
- * @deprecated Use Glib::Threads::wrap(GThread*) instead.
- */
-Thread* wrap(GThread* gobject);
-
-struct StaticMutex;
-
-/** Like Glib::Mutex, but can be defined at compile time.
- * Use @c GLIBMM_STATIC_MUTEX_INIT to initialize a StaticMutex:
- * @code
- * Glib::StaticMutex mutex = GLIBMM_STATIC_MUTEX_INIT;
- * @endcode
- *
- * A StaticMutex can be used without calling Glib::thread_init(), it will
- * silently do nothing then. That will also work when using the implicit
- * conversion to Mutex&, thus you can safely use Mutex::Lock with a
- * StaticMutex.
- *
- * @deprecated Use Glib::Threads::Mutex instead, which can be used statically.
- */
-struct StaticMutex
-{
- void lock();
- bool trylock();
- void unlock();
-
- operator Mutex&();
-
- GStaticMutex* gobj() { return &gobject_; }
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Must be public to allow initialization at compile time.
- GStaticMutex gobject_;
-#endif
-};
-
-/** Initializer macro for Glib::StaticMutex.
- * @relates Glib::StaticMutex
- * @hideinitializer
- *
- * @deprecated Glib::StaticMutex is deprecated in favour of Glib::Threads::Mutex, which can be used statically.
- */
-#define GLIBMM_STATIC_MUTEX_INIT { G_STATIC_MUTEX_INIT }
-
-/** Represents a mutex (mutual exclusion).
- * It can be used to protect data against shared access. Try to use
- * 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
- * instead, if you need recursive mutexes.
- *
- * @deprecated Use Glib::Threads::Mutex instead.
- */
-class Mutex
-{
-public:
- class Lock;
-
- Mutex();
-
- Mutex(const Mutex&) = delete;
- Mutex& operator=(const Mutex&) = delete;
-
- ~Mutex();
-
- /** Locks the mutex.
- * If mutex is already locked by another thread, the current thread will
- * block until mutex is unlocked by the other thread.
- * @see Mutex::Lock
- */
- void lock();
-
- /** Tries to lock the mutex.
- * If the mutex is already locked by another thread, it immediately returns
- * @c false. Otherwise it locks the mutex and returns @c true.
- * @return Whether the mutex could be locked.
- * @see Mutex::Lock
- */
- bool trylock();
-
- /** Unlocks the mutex.
- * If another thread is blocked in a lock() call for this mutex, it will be
- * woken and can lock the mutex itself.
- * @see Mutex::Lock
- */
- void unlock();
-
- GMutex* gobj() { return gobject_; }
-
-private:
- GMutex* gobject_;
-};
-
-/** Utility class for exception-safe mutex locking.
- * @par Usage example:
- * @code
- * {
- * Glib::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
- * <tt>return</tt> while still holding the lock and it will be released
- * properly.
- *
- * @deprecated Use Glib::Threads::Mutex::Lock instead.
- */
-class Mutex::Lock
-{
-public:
- explicit inline Lock(Mutex& mutex);
- inline Lock(Mutex& mutex, NotLock);
- inline Lock(Mutex& mutex, TryLock);
- inline ~Lock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- Mutex& mutex_;
- bool locked_;
-
-
-};
-
-
-/** Like Glib::RecMutex, but can be defined at compile time.
- * Use @c GLIBMM_STATIC_REC_MUTEX_INIT to initialize a StaticRecMutex:
- * @code
- * Glib::StaticRecMutex mutex = GLIBMM_STATIC_REC_MUTEX_INIT;
- * @endcode
- * A StaticRecMutex can be used without calling Glib::thread_init(), it will
- * silently do nothing then. That will also work when using the implicit
- * conversion to RecMutex&, thus you can safely use RecMutex::Lock with a
- * StaticRecMutex.
- *
- * @deprecated Use Glib::Threads::RecMutex instead, which can be used statically.
- */
-struct StaticRecMutex
-{
- void lock();
- bool trylock();
- void unlock();
-
- void lock_full(unsigned int depth);
- unsigned int unlock_full();
-
- operator RecMutex&();
-
- GStaticRecMutex* gobj() { return &gobject_; }
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Must be public to allow initialization at compile time.
- GStaticRecMutex gobject_;
-#endif
-};
-
-/**
- *
- * @deprecated Use Glib::Threads::RecMutex instead.
- */
-class RecMutex : public StaticRecMutex
-{
-public:
- class Lock;
-
- RecMutex();
- ~RecMutex();
-
-private:
- // noncopyable
- RecMutex(const RecMutex&);
- RecMutex& operator=(const RecMutex&);
-};
-
-/** Utility class for exception-safe locking of recursive mutexes.
- *
- * @deprecated Use Glib::Threads::RecMutex instead.
- */
-class RecMutex::Lock
-{
-public:
- explicit inline Lock(RecMutex& mutex);
- inline Lock(RecMutex& mutex, NotLock);
- inline Lock(RecMutex& mutex, TryLock);
-
- Lock(const RecMutex::Lock&) = delete;
- RecMutex::Lock& operator=(const RecMutex::Lock&) = delete;
-
- inline ~Lock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- RecMutex& mutex_;
- bool locked_;
-};
-
-
-/** Like Glib::RWLock, but can be defined at compile time.
- * Use @c GLIBMM_STATIC_RW_LOCK_INIT to initialize a StaticRWLock:
- * @code
- * Glib::StaticRWLock rw_lock = GLIBMM_STATIC_RW_LOCK_INIT;
- * @endcode
- * A StaticRWLock can be used without calling Glib::thread_init(), it will
- * silently do nothing then. That will also work when using the implicit
- * conversion to RWLock&, thus you can safely use RWLock::ReaderLock and
- * RWLock::WriterLock with a StaticRWLock.
- *
- * @deprecated Use Glib::Threads::RWLock instead, which can be used statically.
- */
-struct StaticRWLock
-{
- void reader_lock();
- bool reader_trylock();
- void reader_unlock();
-
- void writer_lock();
- bool writer_trylock();
- void writer_unlock();
-
- operator RWLock&();
-
- GStaticRWLock* gobj() { return &gobject_; }
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Must be public to allow initialization at compile time.
- GStaticRWLock gobject_;
-#endif
-};
-
-/**
- *
- * @deprecated Use Glib::Threads::RWLock instead.
- */
-class RWLock : public StaticRWLock
-{
-public:
- class ReaderLock;
- class WriterLock;
-
- RWLock();
-
- RWLock(const RWLock&) = delete;
- RWLock& operator=(const RWLock&) = delete;
-
- ~RWLock();
-};
-
-/** Utility class for exception-safe locking of read/write locks.
- *
- * @deprecated Use Glib::Threads::RWLock::ReaderLock instead.
- */
-class RWLock::ReaderLock
-{
-public:
- explicit inline ReaderLock(RWLock& rwlock);
- inline ReaderLock(RWLock& rwlock, NotLock);
- inline ReaderLock(RWLock& rwlock, TryLock);
-
- ReaderLock(const RWLock::ReaderLock&) = delete;
- RWLock::ReaderLock& operator=(const RWLock::ReaderLock&) = delete;
-
- inline ~ReaderLock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- RWLock& rwlock_;
- bool locked_;
-};
-
-/** Utility class for exception-safe locking of read/write locks.
- *
- * @deprecated Use Glib::Threads::RWLock::WriterLock instead.
- */
-class RWLock::WriterLock
-{
-public:
- explicit inline WriterLock(RWLock& rwlock);
- inline WriterLock(RWLock& rwlock, NotLock);
- inline WriterLock(RWLock& rwlock, TryLock);
-
- WriterLock(const RWLock::WriterLock&) = delete;
- RWLock::WriterLock& operator=(const RWLock::WriterLock&) = delete;
-
- inline ~WriterLock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- RWLock& rwlock_;
- bool locked_;
-};
-
-/** An opaque data structure to represent a condition.
- * A @a Cond is an object that threads can block on, if they find a certain
- * condition to be false. If other threads change the state of this condition
- * 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;
- * void* current_data = nullptr;
- *
- * void push_data(void* data)
- * {
- * Glib::Mutex::Lock lock (data_mutex);
- *
- * current_data = data;
- * data_cond.signal();
- * }
- *
- * void* pop_data()
- * {
- * Glib::Mutex::Lock lock (data_mutex);
- *
- * while (!current_data)
- * data_cond.wait(data_mutex);
- *
- * void *const data = current_data;
- * current_data = nullptr;
- *
- * return data;
- * }
- * @endcode
- *
- * @deprecated Use Glib::Threads::Cond instead.
- */
-class Cond
-{
-public:
- Cond();
-
- Cond(const Cond&) = delete;
- Cond& operator=(const Cond&) = delete;
-
- ~Cond();
-
- /** 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
- * this method, though not required.
- */
- void broadcast();
-
- /** 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.
- *
- * @note It is important to use the @a wait() and @a timed_wait() methods
- * only inside a loop, which checks for the condition to be true as it is not
- * guaranteed that the waiting thread will find it fulfilled, even if the signaling
- * thread left the condition in that state. This is because another thread can have
- * altered the condition, before the waiting thread got the chance to be woken up,
- * even if the condition itself is protected by a @a Mutex.
- */
- 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 abs_time.
- * The mutex is unlocked before falling asleep and locked again before resuming.
- *
- * @param mutex a @a Mutex that is currently locked.
- * @param abs_time a max time to wait.
- *
- * @note It is important to use the @a wait() and @a timed_wait() methods
- * only inside a loop, which checks for the condition to be true as it is not
- * guaranteed that the waiting thread will find it fulfilled, even if the signaling
- * thread left the condition in that state. This is because another thread can have
- * altered the condition, before the waiting thread got the chance to be woken up,
- * even if the condition itself is protected by a @a Mutex.
- */
- bool timed_wait(Mutex& mutex, const Glib::TimeVal& abs_time);
-
- GCond* gobj() { return gobject_; }
-
-private:
- GCond* gobject_;
-};
-
-
-/** Thread-local data pointer.
- *
- * @deprecated Use Glib::Threads::Private instead, which can be used statically.
- */
-template <class T>
-struct StaticPrivate
-{
- using DestroyNotifyFunc = void (*) (void*);
-
- static void delete_ptr(void* data);
-
- inline T* get();
- inline void set(T* data, DestroyNotifyFunc notify_func = &StaticPrivate<T>::delete_ptr);
-
- GStaticPrivate* gobj() { return &gobject_; }
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Must be public to allow initialization at compile time.
- GStaticPrivate gobject_;
-#endif
-};
-
-/** Thread-local data pointer.
- *
- * @deprecated Use Glib::Threads::Private instead.
- */
-template <class T>
-class Private
-{
-public:
-
- Private(const Private<T>&) = delete;
- Private<T>& operator=(const Private<T>&) = delete;
-
- using DestructorFunc = void (*) (void*);
-
- static void delete_ptr(void* data);
-
- explicit inline Private(DestructorFunc destructor_func = &Private<T>::delete_ptr);
- inline T* get();
- inline void set(T* data);
-
- GPrivate* gobj() { return gobject_; }
-
-private:
- GPrivate* gobject_;
-};
-
-/** @} group Threads */
-
-/*! A glibmm thread example.
- * @example thread/thread.cc
- */
-
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/***************************************************************************/
-/* inline implementation */
-/***************************************************************************/
-
-// internal
-/** @deprecated This was always for internal glibmm use and is now unecessary even inside glibmm.
- */
-void thread_init_impl();
-
-/**** Glib::Mutex::Lock ****************************************************/
-
-inline
-Mutex::Lock::Lock(Mutex& mutex)
-:
- mutex_ (mutex),
- locked_ (true)
-{
- mutex_.lock();
-}
-
-inline
-Mutex::Lock::Lock(Mutex& mutex, NotLock)
-:
- mutex_ (mutex),
- locked_ (false)
-{}
-
-inline
-Mutex::Lock::Lock(Mutex& mutex, TryLock)
-:
- mutex_ (mutex),
- locked_ (mutex.trylock())
-{}
-
-inline
-Mutex::Lock::~Lock()
-{
- if(locked_)
- mutex_.unlock();
-}
-
-inline
-void Mutex::Lock::acquire()
-{
- mutex_.lock();
- locked_ = true;
-}
-
-inline
-bool Mutex::Lock::try_acquire()
-{
- locked_ = mutex_.trylock();
- return locked_;
-}
-
-inline
-void Mutex::Lock::release()
-{
- mutex_.unlock();
- locked_ = false;
-}
-
-inline
-bool Mutex::Lock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::RecMutex::Lock *************************************************/
-
-inline
-RecMutex::Lock::Lock(RecMutex& mutex)
-:
- mutex_ (mutex),
- locked_ (true)
-{
- mutex_.lock();
-}
-
-inline
-RecMutex::Lock::Lock(RecMutex& mutex, NotLock)
-:
- mutex_ (mutex),
- locked_ (false)
-{}
-
-inline
-RecMutex::Lock::Lock(RecMutex& mutex, TryLock)
-:
- mutex_ (mutex),
- locked_ (mutex.trylock())
-{}
-
-inline
-RecMutex::Lock::~Lock()
-{
- if(locked_)
- mutex_.unlock();
-}
-
-inline
-void RecMutex::Lock::acquire()
-{
- mutex_.lock();
- locked_ = true;
-}
-
-inline
-bool RecMutex::Lock::try_acquire()
-{
- locked_ = mutex_.trylock();
- return locked_;
-}
-
-inline
-void RecMutex::Lock::release()
-{
- mutex_.unlock();
- locked_ = false;
-}
-
-inline
-bool RecMutex::Lock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::RWLock::ReaderLock *********************************************/
-
-inline
-RWLock::ReaderLock::ReaderLock(RWLock& rwlock)
-:
- rwlock_ (rwlock),
- locked_ (true)
-{
- rwlock_.reader_lock();
-}
-
-inline
-RWLock::ReaderLock::ReaderLock(RWLock& rwlock, NotLock)
-:
- rwlock_ (rwlock),
- locked_ (false)
-{}
-
-inline
-RWLock::ReaderLock::ReaderLock(RWLock& rwlock, TryLock)
-:
- rwlock_ (rwlock),
- locked_ (rwlock.reader_trylock())
-{}
-
-inline
-RWLock::ReaderLock::~ReaderLock()
-{
- if(locked_)
- rwlock_.reader_unlock();
-}
-
-inline
-void RWLock::ReaderLock::acquire()
-{
- rwlock_.reader_lock();
- locked_ = true;
-}
-
-inline
-bool RWLock::ReaderLock::try_acquire()
-{
- locked_ = rwlock_.reader_trylock();
- return locked_;
-}
-
-inline
-void RWLock::ReaderLock::release()
-{
- rwlock_.reader_unlock();
- locked_ = false;
-}
-
-inline
-bool RWLock::ReaderLock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::RWLock::WriterLock *********************************************/
-
-inline
-RWLock::WriterLock::WriterLock(RWLock& rwlock)
-:
- rwlock_ (rwlock),
- locked_ (true)
-{
- rwlock_.writer_lock();
-}
-
-inline
-RWLock::WriterLock::WriterLock(RWLock& rwlock, NotLock)
-:
- rwlock_ (rwlock),
- locked_ (false)
-{}
-
-inline
-RWLock::WriterLock::WriterLock(RWLock& rwlock, TryLock)
-:
- rwlock_ (rwlock),
- locked_ (rwlock.writer_trylock())
-{}
-
-inline
-RWLock::WriterLock::~WriterLock()
-{
- if(locked_)
- rwlock_.writer_unlock();
-}
-
-inline
-void RWLock::WriterLock::acquire()
-{
- rwlock_.writer_lock();
- locked_ = true;
-}
-
-inline
-bool RWLock::WriterLock::try_acquire()
-{
- locked_ = rwlock_.writer_trylock();
- return locked_;
-}
-
-inline
-void RWLock::WriterLock::release()
-{
- rwlock_.writer_unlock();
- locked_ = false;
-}
-
-inline
-bool RWLock::WriterLock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::StaticPrivate **************************************************/
-
-// static
-template <class T>
-void StaticPrivate<T>::delete_ptr(void* data)
-{
- delete static_cast<T*>(data);
-}
-
-/** This is only for use by glibmm itself.
- */
-void* StaticPrivate_get_helper(GStaticPrivate *private_key);
-
-template <class T> inline
-T* StaticPrivate<T>::get()
-{
- return static_cast<T*>(StaticPrivate_get_helper(&gobject_));
-}
-
-/** This is only for use by glibmm itself.
- */
-void StaticPrivate_set_helper(GStaticPrivate *private_key, gpointer data, GDestroyNotify notify);
-
-template <class T> inline
-void StaticPrivate<T>::set(T* data, typename StaticPrivate<T>::DestroyNotifyFunc notify_func)
-{
- StaticPrivate_set_helper(&gobject_, data, notify_func);
-}
-
-
-/**** Glib::Private ********************************************************/
-
-// static
-template <class T>
-void Private<T>::delete_ptr(void* data)
-{
- delete static_cast<T*>(data);
-}
-
-/** This is only for use by glibmm itself.
- */
-GPrivate* GPrivate_new_helper(GDestroyNotify notify);
-
-template <class T> inline
-Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
-:
- gobject_ (GPrivate_new_helper(destructor_func))
-{}
-
-template <class T> inline
-T* Private<T>::get()
-{
- return static_cast<T*>(g_private_get(gobject_));
-}
-
-template <class T> inline
-void Private<T>::set(T* data)
-{
- g_private_set(gobject_, data);
-}
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-} // namespace Glib
-
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmm/exceptionhandler.h>
-#include <glib.h>
-
-/* Why reinterpret_cast<Thread*>(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
-{
-
-extern "C" {
-
-static void*
-call_thread_entry_slot(void* data)
-{
- const auto slot = reinterpret_cast<sigc::slot_base*>(data);
-
- try
- {
- // Recreate the specific slot.
- (*static_cast<sigc::slot<void>*>(slot))();
- }
- 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 (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- delete slot;
- return nullptr;
-}
-
-} // extern "C"
-
-} // anonymous namespace
-
-namespace Glib
-{
-
-namespace Threads
-{
-
-/**** Glib::Threads::Thread ************************************************/
-
-// static
-Thread*
-Thread::create(const sigc::slot<void>& slot, const std::string& name)
-{
- // Make a copy of slot on the heap.
- const auto slot_copy = new sigc::slot<void>(slot);
-
- GError* error = nullptr;
- auto thread = g_thread_try_new(
- name.empty() ? nullptr : name.c_str(), &call_thread_entry_slot, slot_copy, &error);
-
- if (error)
- {
- delete slot_copy;
- Glib::Error::throw_exception(error);
- }
- if (!thread)
- {
- delete slot_copy;
- }
- return reinterpret_cast<Thread*>(thread);
-}
-
-// static
-Thread*
-Thread::create(const sigc::slot<void>& slot)
-{
- return create(slot, std::string());
-}
-
-// static
-Thread*
-Thread::self()
-{
- return reinterpret_cast<Thread*>(g_thread_self());
-}
-
-void
-Thread::join()
-{
- g_thread_join(reinterpret_cast<GThread*>(this));
-}
-
-// static
-void
-Thread::yield()
-{
- g_thread_yield();
-}
-
-GThread*
-Thread::gobj()
-{
- return reinterpret_cast<GThread*>(this);
-}
-
-const GThread*
-Thread::gobj() const
-{
- return reinterpret_cast<const GThread*>(this);
-}
-
-Thread*
-wrap(GThread* gobject)
-{
- return reinterpret_cast<Thread*>(gobject);
-}
-
-/**** Glib::Threads::Mutex *************************************************/
-
-Mutex::Mutex()
-{
- g_mutex_init(&gobject_);
-}
-
-Mutex::~Mutex()
-{
- g_mutex_clear(&gobject_);
-}
-
-void
-Mutex::lock()
-{
- g_mutex_lock(&gobject_);
-}
-
-bool
-Mutex::trylock()
-{
- return g_mutex_trylock(&gobject_);
-}
-
-void
-Mutex::unlock()
-{
- g_mutex_unlock(&gobject_);
-}
-
-Mutex*
-wrap(GMutex* gobject)
-{
- return reinterpret_cast<Mutex*>(gobject);
-}
-
-/**** Glib::Threads::RecMutex **********************************************/
-
-RecMutex::RecMutex()
-{
- g_rec_mutex_init(&gobject_);
-}
-
-RecMutex::~RecMutex()
-{
- g_rec_mutex_clear(&gobject_);
-}
-
-void
-RecMutex::lock()
-{
- g_rec_mutex_lock(&gobject_);
-}
-
-bool
-RecMutex::trylock()
-{
- return g_rec_mutex_trylock(&gobject_);
-}
-
-void
-RecMutex::unlock()
-{
- g_rec_mutex_unlock(&gobject_);
-}
-
-RecMutex*
-wrap(GRecMutex* gobject)
-{
- return reinterpret_cast<RecMutex*>(gobject);
-}
-
-/**** Glib::Threads::RWLock ************************************************/
-
-void
-RWLock::reader_lock()
-{
- g_rw_lock_reader_lock(&gobject_);
-}
-
-bool
-RWLock::reader_trylock()
-{
- return g_rw_lock_reader_trylock(&gobject_);
-}
-
-void
-RWLock::reader_unlock()
-{
- g_rw_lock_reader_unlock(&gobject_);
-}
-
-void
-RWLock::writer_lock()
-{
- g_rw_lock_writer_lock(&gobject_);
-}
-
-bool
-RWLock::writer_trylock()
-{
- return g_rw_lock_writer_trylock(&gobject_);
-}
-
-void
-RWLock::writer_unlock()
-{
- g_rw_lock_writer_unlock(&gobject_);
-}
-
-RWLock::RWLock()
-{
- g_rw_lock_init(&gobject_);
-}
-
-RWLock::~RWLock()
-{
- g_rw_lock_clear(&gobject_);
-}
-
-/**** Glib::Threads::Cond **************************************************/
-
-Cond::Cond()
-{
- g_cond_init(&gobject_);
-}
-
-Cond::~Cond()
-{
- g_cond_clear(&gobject_);
-}
-
-void
-Cond::signal()
-{
- g_cond_signal(&gobject_);
-}
-
-void
-Cond::broadcast()
-{
- g_cond_broadcast(&gobject_);
-}
-
-void
-Cond::wait(Mutex& mutex)
-{
- g_cond_wait(&gobject_, mutex.gobj());
-}
-
-bool
-Cond::wait_until(Mutex& mutex, gint64 end_time)
-{
- return g_cond_wait_until(&gobject_, mutex.gobj(), end_time);
-}
-
-} // namespace Threads
-
-} // namespace Glib
+++ /dev/null
-/* 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, see <http://www.gnu.org/licenses/>.
- */
-
-_DEFS(glibmm,glib)
-_CONFIGINCLUDE(glibmmconfig.h)
-
-_IS_DEPRECATED // This whole file is deprecated.
-
-#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 <glib.h>
-#include <glibmm/error.h>
-#include <sigc++/sigc++.h>
-#include <string>
-#include <cstddef>
-
-namespace Glib
-{
-
-/**
- * @deprecated The entire Glib::Threads API is deprecated in favor of the
- * standard C++ concurrency API in C++11 and C++14.
- */
-namespace Threads
-{
-//The GMMPROC_EXTRA_NAMESPACE() macro is a hint to generate_wrap_init.pl to put it in the Threads sub-namespace
-_GMMPROC_EXTRA_NAMESPACE(Threads)
-
-/** @defgroup Threads Threads
- * %Thread abstraction; including threads, different mutexes,
- * conditions and thread private data.
- *
- * @deprecated The entire Glib::Threads API is deprecated in favor of the
- * standard C++ concurrency API in C++11 and C++14.
- * @{
- */
-
-/// @deprecated Please use std::lock_guard or std::unique_lock instead.
-enum NotLock { NOT_LOCK };
-
-/// @deprecated Please use std::lock_guard or std::unique_lock instead.
-enum TryLock { TRY_LOCK };
-
-class Mutex;
-class RecMutex;
-class RWLock;
-
-/** %Exception class for thread-related errors.
- *
- * @deprecated Please use std::lock_guard or std::unique_lock instead.
- */
-_WRAP_GERROR(ThreadError, GThreadError, G_THREAD_ERROR, NO_GTYPE)
-
-
-/** Represents a running thread.
- * An instance of this class can only be obtained with create(), self(),
- * or wrap(GThread*). It's not possible to delete a Thread object.
- * You must call join() to avoid a memory leak.
- *
- * @note g_thread_exit() is not wrapped, because that function exits a thread
- * without any cleanup. That's especially dangerous in C++ code, since the
- * destructors of automatic objects won't be invoked. Instead, you can throw
- * a Threads::Thread::Exit exception, which will be caught by the internal thread
- * entry function.
- *
- * @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.
- *
- * @deprecated Please use std::thread instead.
- */
-class Thread
-{
-public:
-
- Thread(const Thread&) = delete;
- Thread& operator=(const Thread&) = delete;
-
- class Exit;
-
- //See http://bugzilla.gnome.org/show_bug.cgi?id=512348 about the sigc::trackable issue.
- // TODO: At the next ABI break, consider changing const sigc::slot<void>& slot
- // to const std::function<void()>& func, if it can be assumed that all supported
- // compilers understand the C++11 template class std::function<>.
- /** Creates a new thread.
- * You can wait for this thread's termination by calling join().
- *
- * The new thread executes the function or method @a slot points to. You can
- * pass additional arguments using sigc::bind(). If the thread was created
- * successfully, it is returned, otherwise a Threads::ThreadError exception is thrown.
- *
- * Because sigc::trackable is not thread-safe, if the slot represents a
- * non-static class method and is created by sigc::mem_fun(), the class concerned
- * should not derive from sigc::trackable. You can use, say, boost::bind() or,
- * in C++11, std::bind() or a C++11 lambda expression instead of sigc::mem_fun().
- *
- * @param slot A slot to execute in the new thread.
- * @return The new Thread* on success.
- * @throw Glib::Threads::ThreadError
- */
- static Thread* create(const sigc::slot<void>& slot);
-
- // TODO: At next ABI break, remove the single parameter create
- // method and default name to std::string()
-
- /** Creates a new named thread.
- * You can wait for this thread's termination by calling join().
- *
- * The new thread executes the function or method @a slot points to. You can
- * pass additional arguments using sigc::bind(). If the thread was created
- * successfully, it is returned, otherwise a Threads::ThreadError exception is thrown.
- *
- * Because sigc::trackable is not thread-safe, if the slot represents a
- * non-static class method and is created by sigc::mem_fun(), the class concerned
- * should not derive from sigc::trackable. You can use, say, boost::bind() or,
- * in C++11, std::bind() or a C++11 lambda expression instead of sigc::mem_fun().
- *
- * The @a name can be useful for discriminating threads in a debugger.
- * It is not used for other purposes and does not have to be unique.
- * Some systems restrict the length of @a name to 16 bytes.
- *
- * @param slot A slot to execute in the new thread.
- * @param name A name for the new thread.
- * @return The new Thread* on success.
- * @throw Glib::Threads::ThreadError
- *
- * @newin{2,36}
- */
- static Thread* create(const sigc::slot<void>& slot, const std::string& name);
-
- /** Returns the Thread* corresponding to the calling thread.
- * @return The current thread.
- */
- static Thread* self();
-
- /** Waits until the thread finishes.
- * Waits until the thread finishes, i.e. the slot, as given to create(),
- * returns or g_thread_exit() is called by the thread. (Calling
- * g_thread_exit() in a C++ program should be avoided.) All resources of
- * the thread including the Glib::Threads::Thread object are released.
- */
- void join();
-
- /** Gives way to other threads waiting to be scheduled.
- * This function is often used as a method to make busy wait less evil. But
- * in most cases, you will encounter, there are better methods to do that.
- * So in general you shouldn't use this function.
- */
- static void yield();
-
- GThread* gobj();
- const GThread* gobj() const;
-
-private:
- // Glib::Thread can neither be constructed nor deleted.
- Thread();
- void operator delete(void*, std::size_t);
-};
-
-/** %Exception class used to exit from a thread.
- * @code
- * throw Glib::Threads::Thread::Exit();
- * @endcode
- * Write this if you want to exit from a thread created by Threads::Thread::create().
- * Of course you must make sure not to catch Threads::Thread::Exit by accident, i.e.
- * when using <tt>catch(...)</tt> somewhere in your code.
- *
- * @deprecated Please use std::thread instead.
- */
-class Thread::Exit
-{};
-
-/** A C++ wrapper for the C object.
- *
- * @param gobject The C instance.
- * @return The C++ wrapper.
- *
- * @relates Glib::Threads::Thread
- *
- * @deprecated Please use std::thread instead.
- */
-Thread* wrap(GThread* gobject);
-
-/** Represents a mutex (mutual exclusion).
- * It can be used to protect data against shared access. Try to use
- * Mutex::Lock instead of calling lock() and unlock() directly --
- * it will make your life much easier.
- *
- * @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.
- *
- * @deprecated Please use std::mutex instead.
- */
-class Mutex
-{
-public:
- class Lock;
-
- Mutex();
-
- Mutex(const Mutex&) = delete;
- Mutex& operator=(const Mutex&) = delete;
-
- ~Mutex();
-
- /** Locks the mutex.
- * If mutex is already locked by another thread, the current thread will
- * block until mutex is unlocked by the other thread.
- * @see Mutex::Lock
- */
- void lock();
-
- /** Tries to lock the mutex.
- * If the mutex is already locked by another thread, it immediately returns
- * @c false. Otherwise it locks the mutex and returns @c true.
- * @return Whether the mutex could be locked.
- * @see Mutex::Lock
- */
- bool trylock();
-
- /** Unlocks the mutex.
- * If another thread is blocked in a lock() call for this mutex, it will be
- * woken and can lock the mutex itself.
- * @see Mutex::Lock
- */
- void unlock();
-
- GMutex* gobj() { return &gobject_; }
-
-private:
- GMutex gobject_;
-};
-
-/** Utility class for exception-safe mutex locking.
- * @par Usage example:
- * @code
- * {
- * 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
- * <tt>return</tt> while still holding the lock and it will be released
- * properly.
- *
- * @deprecated Please use std::lock_guard or std::unique_lock instead.
- */
-class Mutex::Lock
-{
-public:
- explicit inline Lock(Mutex& mutex);
- inline Lock(Mutex& mutex, NotLock);
- inline Lock(Mutex& mutex, TryLock);
-
- Lock(const Mutex::Lock&) = delete;
- Mutex::Lock& operator=(const Mutex::Lock&) = delete;
-
- inline ~Lock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- Mutex& mutex_;
- bool locked_;
-};
-
-/** A C++ wrapper for the C object.
- * Do not use operator delete on the returned pointer. If the caller owns the
- * GMutex object, the caller must destroy it in the same way as if this function
- * had not been called.
- *
- * @param gobject The C instance.
- * @result The GMutex* cast to a Glib::Threads::Mutex*.
- *
- * @relates Glib::Threads::Mutex
- */
-Mutex* wrap(GMutex* gobject);
-
-/** This represents a recursive mutex.
- * It is similar to a Mutex with the difference
- * that it is possible to lock a RecMutex multiple times in the same
- * thread without deadlock. When doing so, care has to be taken to
- * unlock the recursive mutex as often as it has been locked.
- *
- * @deprecated Please use std::recursive_mutex instead.
- */
-class RecMutex
-{
-public:
- class Lock;
-
- RecMutex();
-
- RecMutex(const RecMutex&) = delete;
- RecMutex& operator=(const RecMutex&) = delete;
-
- ~RecMutex();
-
- void lock();
- bool trylock();
- void unlock();
-
- GRecMutex* gobj() { return &gobject_; }
-
-private:
- GRecMutex gobject_;
-};
-
-/** Utility class for exception-safe locking of recursive mutexes.
- *
- * @deprecated Please use std::lock_guard or std::unique_lock instead.
- */
-class RecMutex::Lock
-{
-public:
- explicit inline Lock(RecMutex& mutex);
- inline Lock(RecMutex& mutex, NotLock);
- inline Lock(RecMutex& mutex, TryLock);
-
- Lock(const RecMutex::Lock&) = delete;
- RecMutex::Lock& operator=(const RecMutex::Lock&) = delete;
-
- inline ~Lock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- RecMutex& mutex_;
- bool locked_;
-};
-
-/** A C++ wrapper for the C object.
- * Do not use operator delete on the returned pointer. If the caller owns the
- * GRecMutex object, the caller must destroy it in the same way as if this function
- * had not been called.
- *
- * @param gobject The C instance.
- * @result The GRecMutex* cast to a Glib::Threads::RecMutex*.
- *
- * @relates Glib::Threads::RecMutex
- */
-RecMutex* wrap(GRecMutex* gobject);
-
-/** This represents a reader-writer lock.
- * It is similar to a Mutex in that it allows
- * multiple threads to coordinate access to a shared resource.
- *
- * The difference to a mutex is that a reader-writer lock discriminates
- * between read-only ('reader') and full ('writer') access. While only
- * one thread at a time is allowed write access (by holding the 'writer'
- * lock via writer_lock()), multiple threads can gain
- * simultaneous read-only access (by holding the 'reader' lock via
- * reader_lock()).
- *
- * @deprecated Please use std::lock_guard or std::unique_lock instead, with std::shared_timed_mutex.
- */
-class RWLock
-{
-public:
- class ReaderLock;
- class WriterLock;
-
- RWLock();
-
- RWLock(const RWLock&) = delete;
- RWLock& operator=(const RWLock&) = delete;
-
- ~RWLock();
-
- void reader_lock();
- bool reader_trylock();
- void reader_unlock();
-
- void writer_lock();
- bool writer_trylock();
- void writer_unlock();
-
- GRWLock* gobj() { return &gobject_; }
-
-private:
- GRWLock gobject_;
-};
-
-/** Utility class for exception-safe locking of read/write locks.
- *
- * @deprecated Please use std::lock_guard or std::unique_lock instead, with std::shared_timed_mutex.
- */
-class RWLock::ReaderLock
-{
-public:
- explicit inline ReaderLock(RWLock& rwlock);
- inline ReaderLock(RWLock& rwlock, NotLock);
- inline ReaderLock(RWLock& rwlock, TryLock);
-
- ReaderLock(const RWLock::ReaderLock&) = delete;
- RWLock::ReaderLock& operator=(const RWLock::ReaderLock&) = delete;
-
- inline ~ReaderLock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- RWLock& rwlock_;
- bool locked_;
-};
-
-/** Utility class for exception-safe locking of read/write locks.
- *
- * @deprecated Please use std::lock_guard or std::unique_lock instead, with std::shared_timed_mutex.
- */
-class RWLock::WriterLock
-{
-public:
- explicit inline WriterLock(RWLock& rwlock);
- inline WriterLock(RWLock& rwlock, NotLock);
- inline WriterLock(RWLock& rwlock, TryLock);
-
- WriterLock(const RWLock::WriterLock&) = delete;
- RWLock::WriterLock& operator=(const RWLock::WriterLock&) = delete;
-
- inline ~WriterLock();
-
- inline void acquire();
- inline bool try_acquire();
- inline void release();
- inline bool locked() const;
-
-private:
- RWLock& rwlock_;
- bool locked_;
-};
-
-/** An opaque data structure to represent a condition.
- * A @a Cond is an object that threads can block on, if they find a certain
- * condition to be false. If other threads change the state of this condition
- * they can signal the @a Cond, such that the waiting thread is woken up.
- *
- * @deprecated Please use std::condition_variable instead.
- *
- * @par Usage example:
- * @code
- * Glib::Threads::Cond data_cond;
- * Glib::Threads::Mutex data_mutex;
- * void* current_data = nullptr;
- *
- * void push_data(void* data)
- * {
- * Glib::Threads::Mutex::Lock lock(data_mutex);
- *
- * current_data = data;
- * data_cond.signal();
- * }
- *
- * void* pop_data()
- * {
- * Glib::Threads::Mutex::Lock lock(data_mutex);
- *
- * while (!current_data)
- * data_cond.wait(data_mutex);
- *
- * void* const data = current_data;
- * current_data = nullptr;
- *
- * return data;
- * }
- * @endcode
- */
-class Cond
-{
-public:
- Cond();
-
- Cond(const Cond&) = delete;
- Cond& operator=(const Cond&) = delete;
-
- ~Cond();
-
- /** 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 threads, while calling
- * this method, though not required.
- */
- void broadcast();
-
- /** 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.
- *
- * @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
- * guaranteed that the waiting thread will find it fulfilled, even if the signaling
- * thread left the condition in that state. This is because another thread can have
- * altered the condition, before the waiting thread got the chance to be woken up,
- * even if the condition itself is protected by a @a Mutex.
- */
- void wait(Mutex& mutex);
-
- /** 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.
- *
- * @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 nullptr; // timeout
- *
- * void* const data = current_data;
- * current_data = nullptr;
- *
- * 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 <tt>true</tt> if the condition variable was signalled (or in the case
- * of a spurious wakeup), <tt>false</tt> 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
- * guaranteed that the waiting thread will find it fulfilled, even if the signaling
- * thread left the condition in that state. This is because another thread can have
- * altered the condition, before the waiting thread got the chance to be woken up,
- * even if the condition itself is protected by a @a Mutex.
- */
- bool wait_until(Mutex& mutex, gint64 end_time);
-
- GCond* gobj() { return &gobject_; }
-
-private:
- GCond gobject_;
-};
-
-/** Thread-local data pointer.
- *
- * 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)
- * glib allocates a scarce OS resource that cannot be deallocated.
- *
- * @deprecated Please use the thread_local keyword instead.
- */
-template <class T>
-class Private
-{
-public:
- Private(const Private<T>&) = delete;
- Private<T>& operator=(const Private<T>&) = delete;
-
- using DestructorFunc = void (*) (void*);
-
- /** Deletes static_cast<T*>(data)
- */
- static void delete_ptr(void* data);
-
- /** Constructor.
- *
- * @param destructor_func Function pointer, or <tt>nullptr</tt>. If @a destructor_func is not <tt>nullptr</tt>
- * and the stored data pointer is not <tt>nullptr</tt>, this function is called when replace()
- * is called and when the thread exits.
- */
- explicit inline Private(DestructorFunc destructor_func = &Private<T>::delete_ptr);
-
- /** Gets the pointer stored in the calling thread.
- *
- * @return If no value has yet been set in this thread, <tt>nullptr</tt> is returned.
- */
- inline T* get();
-
- /** Sets the pointer in the calling thread without calling <tt>destructor_func()</tt>.
- */
- inline void set(T* data);
-
- /** Sets the pointer in the calling thread and calls <tt>destructor_func()</tt>.
- * If a function pointer (and not <tt>nullptr</tt>) was specified in the constructor, and
- * the stored data pointer before the call to replace() is not <tt>nullptr</tt>, then
- * <tt>destructor_func()</tt> is called with this old pointer value.
- *
- * @newin{2,32}
- */
- inline void replace(T* data);
-
- GPrivate* gobj() { return &gobject_; }
-
-private:
- GPrivate gobject_;
-};
-
-/** @} group Threads */
-
-/*! A glibmm thread example.
- * @example thread/thread.cc
- */
-
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-/***************************************************************************/
-/* inline implementation */
-/***************************************************************************/
-
-/**** Glib::Threads::Mutex::Lock *******************************************/
-
-inline
-Mutex::Lock::Lock(Mutex& mutex)
-:
- mutex_ (mutex),
- locked_ (true)
-{
- mutex_.lock();
-}
-
-inline
-Mutex::Lock::Lock(Mutex& mutex, NotLock)
-:
- mutex_ (mutex),
- locked_ (false)
-{}
-
-inline
-Mutex::Lock::Lock(Mutex& mutex, TryLock)
-:
- mutex_ (mutex),
- locked_ (mutex.trylock())
-{}
-
-inline
-Mutex::Lock::~Lock()
-{
- if(locked_)
- mutex_.unlock();
-}
-
-inline
-void Mutex::Lock::acquire()
-{
- mutex_.lock();
- locked_ = true;
-}
-
-inline
-bool Mutex::Lock::try_acquire()
-{
- locked_ = mutex_.trylock();
- return locked_;
-}
-
-inline
-void Mutex::Lock::release()
-{
- mutex_.unlock();
- locked_ = false;
-}
-
-inline
-bool Mutex::Lock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::Threads::RecMutex::Lock ****************************************/
-
-inline
-RecMutex::Lock::Lock(RecMutex& mutex)
-:
- mutex_ (mutex),
- locked_ (true)
-{
- mutex_.lock();
-}
-
-inline
-RecMutex::Lock::Lock(RecMutex& mutex, NotLock)
-:
- mutex_ (mutex),
- locked_ (false)
-{}
-
-inline
-RecMutex::Lock::Lock(RecMutex& mutex, TryLock)
-:
- mutex_ (mutex),
- locked_ (mutex.trylock())
-{}
-
-inline
-RecMutex::Lock::~Lock()
-{
- if(locked_)
- mutex_.unlock();
-}
-
-inline
-void RecMutex::Lock::acquire()
-{
- mutex_.lock();
- locked_ = true;
-}
-
-inline
-bool RecMutex::Lock::try_acquire()
-{
- locked_ = mutex_.trylock();
- return locked_;
-}
-
-inline
-void RecMutex::Lock::release()
-{
- mutex_.unlock();
- locked_ = false;
-}
-
-inline
-bool RecMutex::Lock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::Threads::RWLock::ReaderLock ************************************/
-
-inline
-RWLock::ReaderLock::ReaderLock(RWLock& rwlock)
-:
- rwlock_ (rwlock),
- locked_ (true)
-{
- rwlock_.reader_lock();
-}
-
-inline
-RWLock::ReaderLock::ReaderLock(RWLock& rwlock, NotLock)
-:
- rwlock_ (rwlock),
- locked_ (false)
-{}
-
-inline
-RWLock::ReaderLock::ReaderLock(RWLock& rwlock, TryLock)
-:
- rwlock_ (rwlock),
- locked_ (rwlock.reader_trylock())
-{}
-
-inline
-RWLock::ReaderLock::~ReaderLock()
-{
- if(locked_)
- rwlock_.reader_unlock();
-}
-
-inline
-void RWLock::ReaderLock::acquire()
-{
- rwlock_.reader_lock();
- locked_ = true;
-}
-
-inline
-bool RWLock::ReaderLock::try_acquire()
-{
- locked_ = rwlock_.reader_trylock();
- return locked_;
-}
-
-inline
-void RWLock::ReaderLock::release()
-{
- rwlock_.reader_unlock();
- locked_ = false;
-}
-
-inline
-bool RWLock::ReaderLock::locked() const
-{
- return locked_;
-}
-
-
-/**** Glib::Threads::RWLock::WriterLock ************************************/
-
-inline
-RWLock::WriterLock::WriterLock(RWLock& rwlock)
-:
- rwlock_ (rwlock),
- locked_ (true)
-{
- rwlock_.writer_lock();
-}
-
-inline
-RWLock::WriterLock::WriterLock(RWLock& rwlock, NotLock)
-:
- rwlock_ (rwlock),
- locked_ (false)
-{}
-
-inline
-RWLock::WriterLock::WriterLock(RWLock& rwlock, TryLock)
-:
- rwlock_ (rwlock),
- locked_ (rwlock.writer_trylock())
-{}
-
-inline
-RWLock::WriterLock::~WriterLock()
-{
- if(locked_)
- rwlock_.writer_unlock();
-}
-
-inline
-void RWLock::WriterLock::acquire()
-{
- rwlock_.writer_lock();
- locked_ = true;
-}
-
-inline
-bool RWLock::WriterLock::try_acquire()
-{
- locked_ = rwlock_.writer_trylock();
- return locked_;
-}
-
-inline
-void RWLock::WriterLock::release()
-{
- rwlock_.writer_unlock();
- locked_ = false;
-}
-
-inline
-bool RWLock::WriterLock::locked() const
-{
- return locked_;
-}
-
-/**** Glib::Threads::Private<T> ********************************************/
-
-// static
-template <class T>
-void Private<T>::delete_ptr(void* data)
-{
- delete static_cast<T*>(data);
-}
-
-template <class T> inline
-Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
-{
- // gobject_ = G_PRIVATE_INIT(destructor_func);
- // does not compile with --enable-warnings=fatal.
- // GPrivate is a struct, and G_PRIVATE_INIT is an initializer of type { ... }.
- // G_PRIVATE_INIT can be used only in initializations.
- const GPrivate temp = G_PRIVATE_INIT(destructor_func);
- gobject_ = temp;
-}
-
-template <class T> inline
-T* Private<T>::get()
-{
- return static_cast<T*>(g_private_get(&gobject_));
-}
-
-template <class T> inline
-void Private<T>::set(T* data)
-{
- g_private_set(&gobject_, data);
-}
-
-template <class T> inline
-void Private<T>::replace(T* data)
-{
- g_private_replace(&gobject_, data);
-}
-
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-
-} //namespace Threads
-
-} // namespace Glib
GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
{
return create_param_spec(name, Glib::ustring(), Glib::ustring(),
- Glib::PARAM_READWRITE);
+ Glib::ParamFlags::READWRITE);
}
GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name, const Glib::ustring& nick,
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)
{
public:
using CppType = $1;
- using CType = g$2;
static GType value_type() G_GNUC_CONST;
namespace Glib
{
GLIB_VALUE_BASIC(bool, boolean)
-#ifndef GLIBMM_DISABLE_DEPRECATED
-/// @deprecated Use Value<signed char> 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)
+++ /dev/null
-/* Copyright (C) 2002-2009 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmm/exceptionhandler.h>
-
-static int
-ValueArray_Compare_glibmm_callback(gconstpointer a, gconstpointer b, gpointer user_data)
-{
- Glib::ValueArray::SlotCompare* the_slot = static_cast<Glib::ValueArray::SlotCompare*>(user_data);
-
- try
- {
- return (*the_slot)(
- *reinterpret_cast<const Glib::ValueBase*>(a), *reinterpret_cast<const Glib::ValueBase*>(b));
- }
- catch (...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return 0;
-}
-
-namespace Glib
-{
-
-ValueArray::ValueArray() : gobject_(g_value_array_new(0))
-{
-}
-
-ValueArray::ValueArray(guint n_preallocated) : gobject_(g_value_array_new(n_preallocated))
-{
-}
-
-bool
-ValueArray::get_nth(guint index, Glib::ValueBase& value)
-{
- const auto g_value = g_value_array_get_nth(gobj(), index);
-
- if (g_value)
- {
- value.init(g_value);
- return true;
- }
- else
- return false;
-}
-
-Glib::ValueArray&
-ValueArray::append(const Glib::ValueBase& value)
-{
- g_value_array_append(gobj(), value.gobj());
- return *this;
-}
-
-Glib::ValueArray&
-ValueArray::prepend(const Glib::ValueBase& value)
-{
- g_value_array_prepend(gobj(), value.gobj());
- return *this;
-}
-
-Glib::ValueArray&
-ValueArray::insert(guint index, const Glib::ValueBase& value)
-{
- g_value_array_insert(gobj(), index, value.gobj());
- return *this;
-}
-
-Glib::ValueArray&
-ValueArray::remove(guint index)
-{
- g_value_array_remove(gobj(), index);
- return *this;
-}
-
-Glib::ValueArray&
-ValueArray::sort(const SlotCompare& compare_func)
-{
- SlotCompare slot_copy(compare_func);
- g_value_array_sort_with_data(gobj(), &ValueArray_Compare_glibmm_callback, &slot_copy);
- return *this;
-}
-
-} // Glib namespace
+++ /dev/null
-/* Copyright (C) 2002-2009 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, see <http://www.gnu.org/licenses/>.
- */
-
-_CONFIGINCLUDE(glibmmconfig.h)
-
-_DEFS(glibmm,glib)
-
-#include <glib-object.h>
-#include <glibmm/value.h>
-#include <sigc++/functors/slot.h>
-
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef G_DISABLE_DEPRECATED
-#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
-#m4 _POP()
-
-_IS_DEPRECATED // This whole file is deprecated.
-
-namespace Glib
-{
-
-/** A container structure to maintain an array of generic values.
- * The prime purpose of a ValueArray is for it to be used as an object property
- * that holds an array of values. A ValueArray wraps an array of ValueBase
- * elements.
- *
- * @newin{2,22}
- *
- * @deprecated Use std::vector<Glib::ValueBase*> or std::vector< Glib::Value<> >
- * instead of Glib::ValueArray.
- */
-class ValueArray
-{
- _CLASS_BOXEDTYPE(ValueArray, GValueArray, NONE, g_value_array_copy, g_value_array_free)
- _IGNORE(g_value_array_copy, g_value_array_free)
- _CUSTOM_DEFAULT_CTOR
-
-public:
- /** For example,
- * int on_compare(const Glib::ValueBase& v1, const Glib::ValueBase& v2);.
- * The compare function should return -1 if v1 < v2, 0 if v1 == v2, and 1 if
- * v1 > v2.
- */
- using SlotCompare = sigc::slot<int, const Glib::ValueBase&, const Glib::ValueBase&>;
-
- /** Default constructor. Constructs a new array with no pre-allocation.
- */
- ValueArray();
-
- /** Constructs a new array with pre-allocation.
- */
- ValueArray(guint n_preallocated);
-
- /** Return the value at @a index contained in the value array.
- * @param index Index of the value of interest.
- * @param value An uninitialized ValueBase in which to store the result. If
- * the get is successful, @a value will be valid, otherwise it will remain
- * uninitialized.
- * @return whether the get was successful or not.
- */
- bool get_nth(guint index, Glib::ValueBase& value);
- _IGNORE(g_value_array_get_nth)
-
- _WRAP_METHOD_DOCS_ONLY(g_value_array_append)
- Glib::ValueArray& append(const Glib::ValueBase& value);
-
- _WRAP_METHOD_DOCS_ONLY(g_value_array_prepend)
- Glib::ValueArray& prepend(const Glib::ValueBase& value);
-
- _WRAP_METHOD_DOCS_ONLY(g_value_array_insert)
- Glib::ValueArray& insert(guint index, const Glib::ValueBase& value);
-
- _WRAP_METHOD_DOCS_ONLY(g_value_array_remove)
- Glib::ValueArray& remove(guint index);
-
- _WRAP_METHOD_DOCS_ONLY(g_value_array_sort)
- Glib::ValueArray& sort(const SlotCompare& compare_func);
- _IGNORE(g_value_array_sort_with_data)
-};
-
-} //namespace Glib
namespace Glib
{
+/****************** VariantBase ***********************************/
+
VariantBase::VariantBase(GVariant* castitem, bool make_a_copy /* = false */)
{
if (castitem)
gobject_ = castitem;
}
+VariantBase::operator bool() const
+{
+ return gobj();
+}
+
+void
+VariantBase::init(const GVariant* cobject, bool take_a_reference)
+{
+ if (gobject_)
+ g_variant_unref(gobject_);
+
+ gobject_ = const_cast<GVariant*>(cobject);
+ if (take_a_reference)
+ g_variant_ref(gobject_);
+}
+
+bool VariantBase::operator==(const VariantBase& other) const
+{
+ return equal(other);
+}
+
+bool VariantBase::operator!=(const VariantBase& other) const
+{
+ return !equal(other);
+}
+
void
VariantBase::get_normal_form(VariantBase& result) const
{
return true;
}
+/****************** VariantStringBase ***********************************/
+
VariantStringBase::VariantStringBase() : VariantBase()
{
}
output.init(result);
}
+/****************** VariantContainerBase ***********************************/
+
VariantContainerBase::VariantContainerBase() : VariantBase()
{
}
/****************** Specializations ***********************************/
-_DEPRECATE_IFDEF_START
-VariantBase::operator const void*() const
-{
- return gobj() ? GINT_TO_POINTER(1) : nullptr;
-}
-_DEPRECATE_IFDEF_END
-
-VariantBase::operator bool() const
-{
- return gobj() != nullptr;
-}
-
-void
-VariantBase::init(const GVariant* cobject, bool take_a_reference)
-{
- if (gobject_)
- g_variant_unref(gobject_);
-
- gobject_ = const_cast<GVariant*>(cobject);
- if (take_a_reference)
- g_variant_ref(gobject_);
-}
-
/*--------------------Variant<VariantBase>---------------------*/
Variant<VariantBase>::Variant() : VariantContainerBase()
return convert_const_gchar_ptr_to_ustring(g_variant_get_string(gobject_, nullptr));
}
-// Variant<Glib::ustring> makes sense for multiple types.
-// See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
-template <>
-Variant<Glib::ustring>
-VariantBase::cast_dynamic<Variant<Glib::ustring>>(const VariantBase& v)
-{
- if (!v.gobj())
- {
- return Variant<Glib::ustring>();
- }
-
- const VariantType vtype = v.get_type();
- if (vtype.equal(VARIANT_TYPE_STRING) || vtype.equal(VARIANT_TYPE_OBJECT_PATH) ||
- vtype.equal(VARIANT_TYPE_SIGNATURE))
- {
- return Variant<Glib::ustring>(const_cast<GVariant*>(v.gobj()), true);
- }
- else
- {
- // std::cerr << "vtype=" << v.get_type_string() << std::endl;
- throw std::bad_cast();
- }
-}
-
/*--------------------Variant<Glib::DBusObjectPathString>---------------------*/
Variant<Glib::DBusObjectPathString>::Variant() : VariantStringBase()
return result;
}
-// Variant<std::string> makes sense for multiple types.
-// See http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#g-variant-get-string
-template <>
-Variant<std::string>
-VariantBase::cast_dynamic<Variant<std::string>>(const VariantBase& v)
-{
- if (!v.gobj())
- {
- return Variant<std::string>();
- }
-
- const VariantType vtype = v.get_type();
- if (vtype.equal(VARIANT_TYPE_STRING) || vtype.equal(VARIANT_TYPE_BYTESTRING) ||
- vtype.equal(VARIANT_TYPE_OBJECT_PATH) || vtype.equal(VARIANT_TYPE_SIGNATURE))
- {
- return Variant<std::string>(const_cast<GVariant*>(v.gobj()), true);
- }
- else
- {
- // std::cerr << "vtype=" << v.get_type_string() << std::endl;
- throw std::bad_cast();
- }
-}
-
std::string
Variant<std::string>::get() const
{
#include <tuple>
#include <stdexcept>
#include <typeinfo>
-#include <cstddef>
namespace Glib
{
g_variant_get, g_variant_get_va)
public:
-_DEPRECATE_IFDEF_START
- /** This typedef is just to make it more obvious that
- * our operator const void* should be used like operator bool().
- *
- * @deprecated Use the explicit operator bool() instead.
- */
- using BoolExpr = const void*;
-
- /** Test whether the Variant has an underlying instance.
- *
- * Mimics usage of pointers:
- * @code
- * if (variant)
- * do_something();
- * @endcode
- *
- * @deprecated Use the explicit operator bool() instead.
- *
- * @newin{2,36}
- */
- operator BoolExpr() const;
-_DEPRECATE_IFDEF_END
-
/** Test whether the Variant has an underlying instance.
*
* @newin{2,50}
_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, deprecated "Use the const version instead.")
_WRAP_METHOD(gconstpointer get_data() const, g_variant_get_data, newin "2,46")
_WRAP_METHOD(Glib::RefPtr<const Glib::Bytes> 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(bool equal(const VariantBase& other) const, g_variant_equal)
+ /** Checks if @a *this and @a other have the same type and value.
+ *
+ * @newin{2,58}
+ *
+ * @param other The Variant to compare with.
+ * @return <tt>true</tt> if @a *this and @a other are equal.
+ */
+ bool operator==(const VariantBase& other) const;
+
+ /** Checks if @a *this and @a other have the same type and value.
+ *
+ * @newin{2,58}
+ *
+ * @param other The Variant to compare with.
+ * @return <tt>true</tt> if @a *this and @a other are not equal.
+ */
+ bool operator!=(const VariantBase& other) const;
+
+ /** Ordering relational operators.
+ * These are explicitly deleted to prevent the compiler from generating
+ * error messages containing long lists of operators that can't be used.
+ */
+ bool operator<(const VariantBase& other) const = delete;
+
+ /// See operator<().
+ bool operator<=(const VariantBase& other) const = delete;
+
+ /// See operator<().
+ bool operator>(const VariantBase& other) const = delete;
+
+ /// See operator<().
+ bool operator>=(const VariantBase& other) const = delete;
+
/** Gets a VariantBase instance that has the same value as this variant and
* is trusted to be in normal form.
*
*/
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*.
- */
- bool operator<(const VariantBase& src) const;
-
- /// See operator<().
- bool operator<=(const VariantBase& src) const;
-
- /// See operator<().
- bool operator>(const VariantBase& src) const;
-
- /// See operator<().
- bool operator>=(const VariantBase& src) const;
-
- /// See operator<().
- bool operator==(const VariantBase& src) const;
-
- /// See operator<().
- bool operator!=(const VariantBase& src) const;
};
template<class V_CastTo>
_IGNORE(g_variant_get_string, g_variant_dup_string)
};
-//TODO: When we can break ABI, remove this template specialization.
-template<>
-Variant<Glib::ustring> VariantBase::cast_dynamic< Variant<Glib::ustring> >(const VariantBase& v);
-
/** Specialization of Variant containing a Glib::DBusObjectPathString,
* for variants of type object path.
* @newin{2,54}
_IGNORE(g_variant_get_bytestring, g_variant_dup_bytestring)
};
-//TODO: When we can break ABI, remove this template specialization.
-template<>
-Variant<std::string> VariantBase::cast_dynamic< Variant<std::string> >(const VariantBase& v);
-
/** Specialization of Variant containing a dictionary entry. See also
* Variant< std::map<K, V> >.
* @newin{2,28}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace detail
{
-// std::index_sequence and std::index_sequence_for are new in C++14,
-// but this version of glibmm requires only C++11.
-// The following code replaces std::index_sequence and std::index_sequence_for
-// until we can require C++14 support.
-// See https://bugzilla.gnome.org/show_bug.cgi?id=787648
-
- /// Class template integer_sequence
- template<typename T, T... Idx>
- struct integer_sequence
- {
- typedef T value_type;
- static constexpr std::size_t size() { return sizeof...(Idx); }
- };
-
- // Concatenates two integer_sequences.
- template<typename Iseq1, typename Iseq2> struct iseq_cat;
-
- template<typename T, std::size_t... Ind1, std::size_t... Ind2>
- struct iseq_cat<integer_sequence<T, Ind1...>, integer_sequence<T, Ind2...>>
- {
- using type = integer_sequence<T, Ind1..., (Ind2 + sizeof...(Ind1))...>;
- };
-
- // Builds an integer_sequence<T, 0, 1, 2, ..., Num-1>.
- template<typename T, std::size_t Num>
- struct make_intseq
- : iseq_cat<typename make_intseq<T, Num / 2>::type,
- typename make_intseq<T, Num - Num / 2>::type>
- { };
-
- template<typename T>
- struct make_intseq<T, 1>
- {
- typedef integer_sequence<T, 0> type;
- };
-
- template<typename T>
- struct make_intseq<T, 0>
- {
- typedef integer_sequence<T> type;
- };
-
- /// Alias template make_integer_sequence
- template<typename T, T Num>
- using make_integer_sequence = typename make_intseq<T, Num>::type;
-
- /// Alias template index_sequence
- template<std::size_t... Idx>
- using index_sequence = integer_sequence<std::size_t, Idx...>;
-
- /// Alias template make_index_sequence
- template<std::size_t Num>
- using make_index_sequence = make_integer_sequence<std::size_t, Num>;
-
- /// Alias template index_sequence_for
- template<typename... Types>
- using index_sequence_for = make_index_sequence<sizeof...(Types)>;
-
-// End of code that replaces std::index_sequence and std::index_sequence_for
-
template <class Tuple, std::size_t... Is>
void expand_tuple(std::vector<VariantBase> &variants, const Tuple & t,
- detail::index_sequence<Is...>)
+ std::index_sequence<Is...>)
{
using swallow = int[]; // ensures left to right order
auto expander = [&variants](const VariantBase &variant) -> int
{
// create a vector containing all tuple values as variants
std::vector<Glib::VariantBase> variants;
- detail::expand_tuple(variants, data, detail::index_sequence_for<Types...>{});
+ detail::expand_tuple(variants, data, std::index_sequence_for<Types...>{});
using var_ptr = GVariant*;
var_ptr* const var_array = new var_ptr[sizeof... (Types)];
{
// swallows any argument
template <class T>
-constexpr int any_arg(T&& /* arg */)
+constexpr int any_arg(T&& arg)
{
+ (void)arg;
return 0;
}
template <class Tuple, std::size_t... Is>
-void assign_tuple(std::vector<VariantBase> &variants, Tuple & t, detail::index_sequence<Is...>)
+void assign_tuple(std::vector<VariantBase> &variants, Tuple & t, std::index_sequence<Is...>)
{
int i = 0;
using swallow = int[]; // ensures left to right order
return i++;
};
(void)swallow{(expander(get_child_variant<Types>(i)))...};
- detail::assign_tuple(variants, data, detail::index_sequence_for<Types...>{});
+ detail::assign_tuple(variants, data, std::index_sequence_for<Types...>{});
return data;
}
namespace Glib
{
-VariantIter::VariantIter(const VariantBase& variant)
+VariantIter::VariantIter(const VariantContainerBase& variant)
: gobject_(g_variant_iter_new(const_cast<GVariant*>(variant.gobj())))
{
}
//because g_iter_value_get_next_value() both gets a value and changes the iterator.
//GtkTextIter allows us to go forward and then separately get the current value.
/** VariantIter - An opaque data structure used to iterate through
- * VariantBase containers such as arrays.
+ * VariantContainerBase containers such as arrays.
* @newin{2,28}
*/
class VariantIter
_CLASS_OPAQUE_COPYABLE(VariantIter, GVariantIter, NONE, g_variant_iter_copy, g_variant_iter_free)
_IGNORE(g_variant_iter_copy, g_variant_iter_free)
public:
- //TODO: The variant parameter should be a VariantContainerBase.
- explicit VariantIter(const VariantBase& variant);
+ explicit VariantIter(const VariantContainerBase& variant);
_WRAP_METHOD(gsize init(const VariantContainerBase& value), g_variant_iter_init)
_WRAP_METHOD(static VariantType create_dict_entry(const VariantType& key, const VariantType& value), g_variant_type_new_dict_entry)
- //TODO: Use something instead of gsize?
- _WRAP_METHOD(gsize _get_string_length() const, g_variant_type_get_string_length)
- dnl wrapped by hand, because g_variant_type_peek_string does not return a C string.
+ _WRAP_METHOD(gsize get_string_length() const, g_variant_type_get_string_length)
+ dnl// wrapped by hand, because g_variant_type_peek_string does not return a nul-terminated C string.
_WRAP_METHOD_DOCS_ONLY(g_variant_type_peek_string)
std::string get_string() const;
_IGNORE(g_variant_type_dup_string)
// g_variant_type_value() because they don't do that already.
#m4 _CONVERSION(`const GVariantType*',`VariantType',`Glib::wrap(const_cast<GVariantType*>($3), true)')
_WRAP_METHOD(VariantType element() const, g_variant_type_element)
- _WRAP_METHOD(VariantType first() const, g_variant_type_first, deprecated "Use get_item_types() instead.")
- _WRAP_METHOD(VariantType next () const, g_variant_type_next, deprecated "Use get_item_types() instead.")
_WRAP_METHOD(gsize n_items() const, g_variant_type_n_items)
_WRAP_METHOD(VariantType key() const, g_variant_type_key)
_WRAP_METHOD(VariantType value() const, g_variant_type_value)
* @return The item types of this %VariantType, or an empty vector.
*/
std::vector<VariantType> get_item_types() const;
+ _IGNORE(g_variant_type_first, g_variant_type_next)
// This function is part of unexposed API in gvarianttypeinfo.{h,c} for an
// also unexposed GVariantTypeInfo structure of glib.
giomm_ioerror_and_iodbuserror/test \
giomm_memoryinputstream/test \
giomm_simple/test \
+ giomm_stream_vfuncs/test \
giomm_asyncresult_sourceobject/test \
giomm_tls_client/test \
giomm_listmodel/test \
glibmm_interface_move/test \
glibmm_mainloop/test \
glibmm_nodetree/test \
+ glibmm_object/test \
glibmm_object_move/test \
+ glibmm_objectbase/test \
glibmm_objectbase_move/test \
glibmm_ustring_compose/test \
glibmm_ustring_format/test \
glibmm_value/test \
- glibmm_valuearray/test \
glibmm_variant/test \
glibmm_vector/test \
glibmm_bool_vector/test \
- glibmm_bool_arrayhandle/test \
glibmm_null_vectorutils/test \
- glibmm_null_containerhandle/test \
glibmm_refptr/test \
glibmm_refptr_sigc_bind/test \
- glibmm_weakref/test \
- glibmm_bytearray/test
+ glibmm_bytearray/test \
+ glibmm_ustring_make_valid/test
TESTS = $(check_PROGRAMS)
giomm_simple_test_SOURCES = giomm_simple/main.cc
giomm_simple_test_LDADD = $(giomm_ldadd)
+giomm_stream_vfuncs_test_SOURCES = giomm_stream_vfuncs/main.cc
+giomm_stream_vfuncs_test_LDADD = $(giomm_ldadd)
+
giomm_asyncresult_sourceobject_test_SOURCES = giomm_asyncresult_sourceobject/main.cc
giomm_asyncresult_sourceobject_test_LDADD = $(giomm_ldadd)
glibmm_interface_move_test_SOURCES = glibmm_interface_move/main.cc
glibmm_mainloop_test_SOURCES = glibmm_mainloop/main.cc
glibmm_nodetree_test_SOURCES = glibmm_nodetree/main.cc
-glibmm_object_move_test_SOURCES = glibmm_object_move/main.cc
-glibmm_objectbase_move_test_SOURCES = glibmm_objectbase_move/main.cc
+glibmm_object_test_SOURCES = glibmm_object/main.cc \
+ glibmm_object/test_derived_object.h
+glibmm_object_move_test_SOURCES = glibmm_object_move/main.cc \
+ glibmm_object/test_derived_object.h
+glibmm_objectbase_test_SOURCES = glibmm_objectbase/main.cc \
+ glibmm_objectbase/test_derived_objectbase.h \
+ glibmm_object/test_derived_object.h
+glibmm_objectbase_move_test_SOURCES = glibmm_objectbase_move/main.cc \
+ glibmm_objectbase/test_derived_objectbase.h \
+ glibmm_object/test_derived_object.h
glibmm_ustring_compose_test_SOURCES = glibmm_ustring_compose/main.cc
glibmm_ustring_format_test_SOURCES = glibmm_ustring_format/main.cc
-glibmm_value_test_SOURCES = glibmm_value/glibmm_value.cc glibmm_value/main.cc
-glibmm_valuearray_test_SOURCES = glibmm_valuearray/main.cc
+glibmm_value_test_SOURCES = glibmm_value/main.cc
glibmm_variant_test_SOURCES = glibmm_variant/main.cc
glibmm_vector_test_SOURCES = glibmm_vector/main.cc
glibmm_vector_test_LDADD = $(giomm_ldadd)
glibmm_bool_vector_test_SOURCES = glibmm_bool_vector/main.cc
-glibmm_bool_arrayhandle_test_SOURCES = glibmm_bool_arrayhandle/main.cc
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_weakref_test_SOURCES = glibmm_weakref/main.cc
-glibmm_weakref_test_LDADD = $(giomm_ldadd)
glibmm_bytearray_test_SOURCES = glibmm_bytearray/main.cc
+glibmm_ustring_make_valid_test_SOURCES = glibmm_ustring_make_valid/main.cc
{
auto store = Gio::ListStore<Gio::MenuItem>::create();
auto item = Gio::MenuItem::create("", "");
- auto weakref_item = Glib::WeakRef<Gio::MenuItem>(item);
+ std::weak_ptr<Gio::MenuItem> weakref_item = item;
// Remove an item from an empty list.
store->remove(0);
store.reset();
item.reset();
- if (weakref_item)
+ if (weakref_item.lock())
{
result = EXIT_FAILURE;
std::cerr << "test_store_boundaries(), 10: weakref_item is not null" << std::endl;
const std::size_t n_items = 10;
std::vector<Glib::RefPtr<Gio::MenuItem>> items;
- std::vector<Glib::WeakRef<Gio::MenuItem>> weakref_items;
+ std::vector<std::weak_ptr<Gio::MenuItem>> weakref_items;
for (std::size_t i = 0; i < n_items; ++i)
{
items.push_back(Gio::MenuItem::create("", ""));
- weakref_items.push_back(Glib::WeakRef<Gio::MenuItem>(items[i]));
+ weakref_items.emplace_back(items[i]);
store->append(items[i]);
}
check_store_refcounts_n_items(2, store, n_items);
- if (store->get_item(3).operator->() != items[3].operator->())
+ if (store->get_item(3).get() != items[3].get())
{
result = EXIT_FAILURE;
std::cerr << "test_store_refcounts(), 3: get_item(3) != items[3]" << std::endl;
for (std::size_t i = 0; i < n_items; ++i)
{
items[i].reset();
- if (!weakref_items[i])
- {
- result = EXIT_FAILURE;
- std::cerr << "test_store_refcounts(), 4: weakref_items[" << i << "] is null" << std::endl;
- }
}
store->remove(4);
- if (weakref_items[4])
- {
- result = EXIT_FAILURE;
- std::cerr << "test_store_refcounts(), 5: weakref_items[4] is not null" << std::endl;
- }
check_store_refcounts_n_items(6, store, n_items-1);
store.reset();
for (std::size_t i = 0; i < n_items; ++i)
{
- if (weakref_items[i])
+ if (weakref_items[i].lock())
{
result = EXIT_FAILURE;
std::cerr << "test_store_refcounts(), 7: weakref_items[" << i << "] is not null" << std::endl;
int compare_items1(const Glib::RefPtr<const Glib::Object>& a,
const Glib::RefPtr<const Glib::Object>& b)
{
- const auto action_a = Glib::RefPtr<const Gio::SimpleAction>::cast_dynamic(a);
- const auto action_b = Glib::RefPtr<const Gio::SimpleAction>::cast_dynamic(b);
+ const auto action_a = std::dynamic_pointer_cast<const Gio::SimpleAction>(a);
+ const auto action_b = std::dynamic_pointer_cast<const Gio::SimpleAction>(b);
if (!action_a || !action_b)
{
result = EXIT_FAILURE;
result = EXIT_FAILURE;
std::cerr << "test_store_sorted1(), 2: i=" << i << ", items are not equal" << std::endl;
}
- if (a.operator->() == b.operator->())
+ if (a.get() == b.get())
{
result = EXIT_FAILURE;
std::cerr << "test_store_sorted1(), 3: i=" << i << ", items are the same" << std::endl;
if (i > 0)
{
auto c = store->get_item(i * 2 - 1);
- if (c.operator->() == a.operator->() || c.operator->() == b.operator->())
+ if (c.get() == a.get() || c.get() == b.get())
{
result = EXIT_FAILURE;
std::cerr << "test_store_sorted1(), 4: i=" << i << ", items are the same" << std::endl;
class MyObject : public Glib::Object
{
protected:
- MyObject(int id) : m_id(id) {}
+ explicit MyObject(int id) : m_id(id) {}
public:
static Glib::RefPtr<MyObject> create(int id)
{
- return Glib::RefPtr<MyObject>(new MyObject(id));
+ return Glib::make_refptr_for_instance<MyObject>(new MyObject(id));
}
int get_id() const { return m_id; }
result = EXIT_FAILURE;
std::cerr << "test_store_sorted2(), 2: i=" << i << ", items are not equal" << std::endl;
}
- if (a.operator->() == b.operator->())
+ if (a.get() == b.get())
{
result = EXIT_FAILURE;
std::cerr << "test_store_sorted2(), 3: i=" << i << ", items are the same" << std::endl;
if (i > 0)
{
auto c = store->get_item(i * 2 - 1);
- if (c.operator->() == a.operator->() || c.operator->() == b.operator->())
+ if (c.get() == a.get() || c.get() == b.get())
{
result = EXIT_FAILURE;
std::cerr << "test_store_sorted2(), 4: i=" << i << ", items are the same" << std::endl;
--- /dev/null
+/* Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <giomm.h>
+#include <iostream>
+#include <string>
+#include <cstdlib>
+
+// A simple custom stream that base64 encodes data.
+// Do not copy it to your code, because it's very slow.
+class Base64OutputStream : public Gio::FilterOutputStream
+{
+public:
+ unsigned get_column_width() const { return column_width; }
+ void set_column_width(unsigned cw) { column_width = cw; }
+ static Glib::RefPtr<Base64OutputStream> create(const Glib::RefPtr<OutputStream>& base_stream)
+ {
+ return Glib::make_refptr_for_instance<Base64OutputStream>(new Base64OutputStream(base_stream));
+ }
+
+protected:
+ explicit Base64OutputStream(const Glib::RefPtr<Gio::OutputStream>& base_stream)
+ : Gio::FilterOutputStream(base_stream), column(0), bit_count(0), bit_buffer(0), column_width(72) {}
+
+ gssize write_vfunc(const void* buffer, gsize count, const Glib::RefPtr<Gio::Cancellable>& cancellable) override
+ {
+ char const *byte = (char const *) buffer;
+ for (unsigned i = 0; i < count; ++i, ++byte)
+ {
+ // kindergarten implementation, because the object is not performance :)
+ bit_buffer <<= 8;
+ bit_buffer |= (*byte & 0xff);
+ bit_count += 8;
+
+ if (bit_count == 24)
+ {
+ clear_pending(); // TODO why is this necessary to avoid an outstanding op. exception?
+ flush(cancellable);
+ set_pending();
+ bit_count = 0;
+ }
+
+ if (cancellable && cancellable->is_cancelled())
+ throw Gio::Error(Gio::Error::CANCELLED, "Operation cancelled");
+ }
+ return count;
+ }
+
+ bool flush_vfunc(const Glib::RefPtr<Gio::Cancellable>& cancellable) override
+ {
+ if (bit_count != 24)
+ return true;
+ char to_write[5];
+ gsize len = 4;
+
+ for (unsigned i=0; i<4; ++i)
+ {
+ unsigned index = (bit_buffer & (0x3f<<(i*6))) >> (i*6);
+ to_write[3-i] = base64_encode_str[index];
+ }
+ column += 4;
+ // Yes, I know this is completely wrong.
+ if (column >= column_width)
+ {
+ column = 0;
+ to_write[4] = '\n';
+ ++len;
+ }
+
+ get_base_stream()->write(&to_write, len, cancellable);
+
+ bit_count = 0;
+ bit_buffer = 0;
+
+ return true;
+ }
+
+ bool close_vfunc(const Glib::RefPtr<Gio::Cancellable>& cancellable) override
+ {
+ char to_write[5] = "====";
+ //get any last bytes (1 or 2) out of the buffer
+ switch (bit_count)
+ {
+ case 16:
+ bit_buffer <<= 2; //pad to make 18 bits
+ to_write[0] = base64_encode_str[(bit_buffer & (0x3f << 12)) >> 12];
+ to_write[1] = base64_encode_str[(bit_buffer & (0x3f << 6)) >> 6];
+ to_write[2] = base64_encode_str[bit_buffer & 0x3f];
+ break;
+
+ case 8:
+ bit_buffer <<= 4; //pad to make 12 bits
+ to_write[0] = base64_encode_str[(bit_buffer & (0x3f << 6)) >> 6];
+ to_write[1] = base64_encode_str[bit_buffer & 0x3f];
+ break;
+ }
+
+ if (bit_count > 0)
+ {
+ get_base_stream()->write(&to_write, 5, cancellable);
+ }
+ else
+ {
+ // null terminate output
+ get_base_stream()->write("", 1, cancellable);
+ }
+ if (get_close_base_stream())
+ get_base_stream()->close(cancellable);
+
+ return true;
+ }
+
+private:
+ static char const *const base64_encode_str;
+ unsigned column;
+ unsigned bit_count;
+ unsigned bit_buffer;
+ unsigned column_width;
+};
+
+char const *const Base64OutputStream::base64_encode_str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+int main(int, char**)
+{
+ Glib::init();
+ Gio::init();
+
+ try
+ {
+ char result[256];
+ Glib::RefPtr<Gio::MemoryOutputStream> memory_chunk = Gio::MemoryOutputStream::create(result, 256, nullptr, nullptr);
+ Glib::RefPtr<Base64OutputStream> base64 = Base64OutputStream::create(memory_chunk);
+
+ std::string data = "Custom GIO streams are cool!";
+
+ base64->set_close_base_stream(true);
+ base64->write(data);
+ base64->close();
+
+ const std::string base64_should_be("Q3VzdG9tIEdJTyBzdHJlYW1zIGFyZSBjb29sIQ==");
+ std::cout << "Original data: " << data << std::endl;
+ std::cout << "base64-encoded data: " << result << std::endl;
+ std::cout << "base64 should be: " << base64_should_be << std::endl;
+ if (base64_should_be != result)
+ {
+ std::cout << "Not correct!" << std::endl;
+ return EXIT_FAILURE;
+ }
+ }
+ catch (const Gio::Error& e)
+ {
+ std::cout << "Gio error: " << e.what() << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
<< std::endl;
auto socket = Gio::Socket::create(
- first_inet_address->get_family(), Gio::SOCKET_TYPE_STREAM, Gio::SOCKET_PROTOCOL_TCP);
+ first_inet_address->get_family(), Gio::Socket::Type::STREAM, Gio::Socket::Protocol::TCP);
auto address = Gio::InetSocketAddress::create(first_inet_address, 443);
<< address->get_port() << "." << std::endl;
}
- auto conn = Glib::RefPtr<Gio::TcpConnection>::cast_dynamic(Gio::SocketConnection::create(socket));
+ auto conn = std::dynamic_pointer_cast<Gio::TcpConnection>(Gio::SocketConnection::create(socket));
if (!conn || !conn->is_connected())
{
{
auto tls_connection = Gio::TlsClientConnection::create(conn, address);
- tls_connection->signal_accept_certificate().connect(sigc::ptr_fun(&on_accept_certificate));
+ tls_connection->signal_accept_certificate().connect(sigc::ptr_fun(&on_accept_certificate), false);
tls_connection->handshake();
+++ /dev/null
-/* Copyright (C) 2011 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 <http://www.gnu.org/licenses/>.
- */
-#include <cstdlib>
-#include <ctime>
-
-#include <iostream>
-
-#include <glibmm.h>
-
-// Use this line if you want debug output:
-// std::ostream& ostr = std::cout;
-
-// This seems nicer and more useful than putting an ifdef around the use of std::cout:
-std::stringstream debug;
-std::ostream& ostr = debug;
-
-const unsigned int magic_limit(5);
-
-void
-setup_rand()
-{
- static bool setup(false);
-
- if (!setup)
- {
- std::srand(std::time(nullptr));
- setup = true;
- }
-}
-
-gboolean*
-c_get_bool_array()
-{
- gboolean* array(static_cast<gboolean*>(g_malloc((magic_limit + 1) * sizeof(gboolean))));
-
- setup_rand();
- for (unsigned int iter(0); iter < magic_limit; ++iter)
- {
- array[iter] = std::rand() % 2 ? TRUE : FALSE;
- }
- array[magic_limit] = FALSE;
- return array;
-}
-
-void
-c_print_bool_array(gboolean* array)
-{
- for (unsigned int iter(0); iter < magic_limit; ++iter)
- {
- ostr << iter << ": " << (array[iter] ? "TRUE" : "FALSE") << "\n";
- }
-}
-
-Glib::ArrayHandle<bool>
-cxx_get_bool_array()
-{
- return Glib::ArrayHandle<bool>(c_get_bool_array(), magic_limit, Glib::OWNERSHIP_SHALLOW);
-}
-
-void
-cxx_print_bool_array(const Glib::ArrayHandle<bool>& array)
-{
- c_print_bool_array(const_cast<gboolean*>(array.data()));
-}
-
-int
-main()
-{
- Glib::init();
-
- std::vector<bool> v(cxx_get_bool_array());
- std::list<bool> l(cxx_get_bool_array());
- std::deque<bool> d(cxx_get_bool_array());
-
- ostr << "vector:\n";
- cxx_print_bool_array(v);
- ostr << "list:\n";
- cxx_print_bool_array(l);
- ostr << "deque:\n";
- cxx_print_bool_array(d);
-
- return EXIT_SUCCESS;
-}
date.subtract_days(1);
date.add_years(1);
- ostr << "The date a year and a month from yesterday will be: " << date.get_month() << "/"
+ ostr << "The date a year and a month from yesterday will be: " << date.get_month_as_int() << "/"
<< (int)date.get_day() << "/" << date.get_year() << "." << std::endl;
Glib::Date copy_date(date);
assigned_date = copy_date;
- ostr << "The copied date is: " << copy_date.get_month() << "/" << (int)copy_date.get_day() << "/"
+ ostr << "The copied date is: " << copy_date.get_month_as_int() << "/" << (int)copy_date.get_day() << "/"
<< copy_date.get_year() << "." << std::endl;
return EXIT_SUCCESS;
protected:
using CppClassType = TestInterface_Class;
- TestInterface() : Glib::Interface(derived_interface_class_.init()) {}
+ TestInterface() : Glib::Interface(derived_interface_class_.init()), i_(0) {}
public:
// A real application would never make the constructor public.
// A real application would never make the constructor public.
// It would instead have a protected constructor and a public create() method.
- DerivedObject(int i)
+ explicit DerivedObject(int i)
: Glib::ObjectBase(nullptr),
Glib::Object(Glib::ConstructParams(derived_object_class_.init())),
i_(i)
int
main()
{
- std::list<std::string> alma;
std::string tstring, cstring;
type_nodetree_string* root;
type_nodetree_string* node;
g_assert(root->depth() == 1);
g_assert(root->get_max_height() == 4);
g_assert(node_G->first_child()->next_sibling()->depth() == 4);
- g_assert(root->node_count(type_nodetree_string::TRAVERSE_LEAVES) == 7);
- g_assert(root->node_count(type_nodetree_string::TRAVERSE_NON_LEAVES) == 4);
- g_assert(root->node_count(type_nodetree_string::TRAVERSE_ALL) == 11);
+ g_assert(root->node_count(type_nodetree_string::TraverseFlags::LEAVES) == 7);
+ g_assert(root->node_count(type_nodetree_string::TraverseFlags::NON_LEAVES) == 4);
+ g_assert(root->node_count(type_nodetree_string::TraverseFlags::ALL) == 11);
g_assert(node_F->get_max_height() == 3);
g_assert(node_G->child_count() == 4);
- g_assert(root->find_child("F", type_nodetree_string::TRAVERSE_ALL) == node_F);
+ g_assert(root->find_child("F", type_nodetree_string::TraverseFlags::ALL) == node_F);
g_assert(
- root->find("I", Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_NON_LEAVES) == NULL);
+ root->find("I", type_nodetree_string::TraverseType::LEVEL_ORDER, type_nodetree_string::TraverseFlags::NON_LEAVES) == NULL);
g_assert(
- root->find("J", Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_LEAVES) == node_J);
+ root->find("J", type_nodetree_string::TraverseType::IN_ORDER, type_nodetree_string::TraverseFlags::LEAVES) == node_J);
for (guint i = 0; i < node_B->child_count(); i++)
{
tstring.clear();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_PRE_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::PRE_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
g_assert(tstring == "ABCDEFGHIJK");
tstring.clear();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_POST_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::POST_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
g_assert(tstring == "CDEBHIJKGFA");
tstring.clear();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::IN_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
g_assert(tstring == "CBDEAHGIJKF");
tstring.clear();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::LEVEL_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
g_assert(tstring == "ABFCDEGHIJK");
tstring.clear();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_LEAVES, -1);
+ type_nodetree_string::TraverseType::LEVEL_ORDER, type_nodetree_string::TraverseFlags::LEAVES, -1);
g_assert(tstring == "CDEHIJK");
tstring.clear();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_PRE_ORDER, type_nodetree_string::TRAVERSE_NON_LEAVES, -1);
+ type_nodetree_string::TraverseType::PRE_ORDER, type_nodetree_string::TraverseFlags::NON_LEAVES, -1);
g_assert(tstring == "ABFG");
tstring.clear();
node_G->reverse_children();
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::LEVEL_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
g_assert(tstring == "ABFEDCGKJIH");
tstring.clear();
node = new type_nodetree_string(*root); // A deep copy.
- g_assert(root->node_count(type_nodetree_string::TRAVERSE_ALL) ==
- node->node_count(type_nodetree_string::TRAVERSE_ALL));
+ g_assert(root->node_count(type_nodetree_string::TraverseFlags::ALL) ==
+ node->node_count(type_nodetree_string::TraverseFlags::ALL));
g_assert(root->get_max_height() == node->get_max_height());
root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
- Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::IN_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
node->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(cstring)),
- Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
+ type_nodetree_string::TraverseType::IN_ORDER, type_nodetree_string::TraverseFlags::ALL, -1);
g_assert(tstring == cstring);
delete node;
node = node->first_child()->next_sibling();
}
g_assert(root->get_max_height() > 100);
- g_assert(root->node_count(type_nodetree_string::TRAVERSE_ALL) == 1 + 2048);
+ g_assert(root->node_count(type_nodetree_string::TraverseFlags::ALL) == 1 + 2048);
delete root;
+++ /dev/null
-/* Copyright (C) 2011 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, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glibmm/arrayhandle.h>
-#include <glibmm/listhandle.h>
-#include <glibmm/slisthandle.h>
-
-#include <giomm/credentials.h>
-#include <giomm/init.h>
-
-int
-main()
-{
- Gio::init();
- using CrePtr = Glib::RefPtr<Gio::Credentials>;
-
- std::vector<CrePtr> v1(Glib::ArrayHandle<CrePtr>(nullptr, Glib::OWNERSHIP_DEEP));
- std::vector<CrePtr> v2(Glib::ArrayHandle<CrePtr>(nullptr, 5, Glib::OWNERSHIP_DEEP));
- std::vector<CrePtr> v3(Glib::ListHandle<CrePtr>(nullptr, Glib::OWNERSHIP_DEEP));
- std::vector<CrePtr> v4(Glib::SListHandle<CrePtr>(nullptr, Glib::OWNERSHIP_DEEP));
- std::vector<bool> v5(Glib::ArrayHandle<bool>(nullptr, Glib::OWNERSHIP_DEEP));
- std::vector<bool> v6(Glib::ArrayHandle<bool>(nullptr, 5, Glib::OWNERSHIP_DEEP));
-
- if (v1.empty() && v2.empty() && v3.empty() && v4.empty() && v5.empty() && v6.empty())
- {
- return 0;
- }
- return 1;
-}
--- /dev/null
+#include "test_derived_object.h"
+#include <glibmm.h>
+#include <iostream>
+#include <stdlib.h>
+
+static void
+test_object()
+{
+ GObject* gobject = G_OBJECT(g_object_new(TEST_TYPE_DERIVED, nullptr));
+ DerivedObject derived(gobject, 5);
+ // std::cout << "debug: gobj(): " << derived.gobj() << std::endl;
+ g_assert(derived.gobj() == gobject);
+}
+
+int
+main(int, char**)
+{
+ Glib::init();
+
+ test_object();
+
+ return EXIT_SUCCESS;
+}
--- /dev/null
+#ifndef _GLIBMM_TEST_DERIVED_OBJECT_H
+#define _GLIBMM_TEST_DERIVED_OBJECT_H
+
+#include <glibmm.h>
+
+// A basic derived GObject, just to test Glib::Object.
+typedef struct
+{
+ GObject parent;
+} TestDerived;
+
+typedef struct
+{
+ GObjectClass parent;
+} TestDerivedClass;
+
+#define TEST_TYPE_DERIVED (test_derived_get_type())
+#define TEST_DERIVED(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_DERIVED, TestDerived))
+#define TEST_DERIVED_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST((cls), TEST_TYPE_DERIVED, TestDerivedClass))
+#define TEST_DERIVED_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_DERIVED, TestDerivedClass))
+
+static void
+test_derived_class_init(TestDerivedClass*)
+{
+}
+static void
+test_derived_init(TestDerived*)
+{
+}
+
+G_DEFINE_TYPE(TestDerived, test_derived, G_TYPE_OBJECT)
+
+class DerivedObject : public Glib::Object
+{
+public:
+ // A real application would never make the constructor public.
+ // It would instead have a protected constructor and a public create() method.
+ DerivedObject(GObject* gobject, int i) : Glib::Object(gobject), i_(i) {}
+
+ DerivedObject(const DerivedObject& src) = delete;
+ DerivedObject& operator=(const DerivedObject& src) = delete;
+
+ DerivedObject(DerivedObject&& src) noexcept : Glib::Object(std::move(src)), i_(std::move(src.i_))
+ {
+ }
+
+ DerivedObject& operator=(DerivedObject&& src) noexcept
+ {
+ Glib::Object::operator=(std::move(src));
+ i_ = std::move(src.i_);
+
+ return *this;
+ }
+
+ int i_;
+};
+
+#endif // _GLIBMM_TEST_DERIVED_OBJECT_H
+#include "../glibmm_object/test_derived_object.h"
#include <glibmm.h>
#include <iostream>
#include <stdlib.h>
-// A basic derived GObject, just to test Glib::Object.
-typedef struct
-{
- GObject parent;
-} TestDerived;
-
-typedef struct
-{
- GObjectClass parent;
-} TestDerivedClass;
-
-#define TEST_TYPE_DERIVED (test_derived_get_type())
-#define TEST_DERIVED(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_DERIVED, TestDerived))
-#define TEST_DERIVED_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST((cls), TEST_TYPE_DERIVED, TestDerivedClass))
-#define TEST_DERIVED_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_DERIVED, TestDerivedClass))
-
-static void
-test_derived_class_init(TestDerivedClass*)
-{
-}
-static void
-test_derived_init(TestDerived*)
-{
-}
-
-G_DEFINE_TYPE(TestDerived, test_derived, G_TYPE_OBJECT)
-
-class DerivedObject : public Glib::Object
-{
-public:
- // A real application would never make the constructor public.
- // It would instead have a protected constructor and a public create() method.
- DerivedObject(GObject* gobject, int i) : Glib::Object(gobject), i_(i) {}
-
- DerivedObject(const DerivedObject& src) = delete;
- DerivedObject& operator=(const DerivedObject& src) = delete;
-
- DerivedObject(DerivedObject&& src) noexcept : Glib::Object(std::move(src)), i_(std::move(src.i_))
- {
- }
-
- DerivedObject& operator=(DerivedObject&& src) noexcept
- {
- Glib::Object::operator=(std::move(src));
- i_ = std::move(src.i_);
-
- return *this;
- }
-
- int i_;
-};
-
static void
test_object_move_constructor()
{
--- /dev/null
+#include "test_derived_objectbase.h"
+#include "../glibmm_object/test_derived_object.h"
+#include <glibmm.h>
+#include <iostream>
+#include <stdlib.h>
+
+static void
+test_objectbase()
+{
+ GObject* gobject = G_OBJECT(g_object_new(TEST_TYPE_DERIVED, nullptr));
+ DerivedObjectBase derived(gobject, 5);
+ // std::cout << "debug: gobj(): " << derived.gobj() << std::endl;
+ g_assert(derived.gobj() == gobject);
+}
+
+int
+main(int, char**)
+{
+ Glib::init();
+
+ test_objectbase();
+
+ return EXIT_SUCCESS;
+}
--- /dev/null
+#ifndef _GLIBMM_TEST_DERIVED_OBJECTBASE_H
+#define _GLIBMM_TEST_DERIVED_OBJECTBASE_H
+
+#include <glibmm.h>
+
+class DerivedObjectBase : public Glib::ObjectBase
+{
+public:
+ // A real application would never make the constructor public.
+ // It would instead have a protected constructor and a public create() method.
+ DerivedObjectBase(GObject* gobject, int i) : Glib::ObjectBase(nullptr), i_(i)
+ {
+ Glib::ObjectBase::initialize(gobject);
+ }
+
+ DerivedObjectBase(const DerivedObjectBase& src) = delete;
+ DerivedObjectBase& operator=(const DerivedObjectBase& src) = delete;
+
+ DerivedObjectBase(DerivedObjectBase&& src) noexcept : Glib::ObjectBase(std::move(src)),
+ i_(std::move(src.i_))
+ {
+ ObjectBase::initialize_move(src.gobject_, &src);
+ }
+
+ DerivedObjectBase& operator=(DerivedObjectBase&& src) noexcept
+ {
+ Glib::ObjectBase::operator=(std::move(src));
+ i_ = std::move(src.i_);
+
+ return *this;
+ }
+
+ int i_;
+};
+
+#endif // _GLIBMM_TEST_DERIVED_OBJECTBASE_H
+#include "../glibmm_objectbase/test_derived_objectbase.h"
+#include "../glibmm_object/test_derived_object.h"
#include <glibmm.h>
#include <iostream>
#include <stdlib.h>
-// A basic derived GObject, just to test Glib::ObjectBase.
-typedef struct
-{
- GObject parent;
-} TestDerived;
-
-typedef struct
-{
- GObjectClass parent;
-} TestDerivedClass;
-
-#define TEST_TYPE_DERIVED (test_derived_get_type())
-#define TEST_DERIVED(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_TYPE_DERIVED, TestDerived))
-#define TEST_DERIVED_CLASS(cls) \
- (G_TYPE_CHECK_CLASS_CAST((cls), TEST_TYPE_DERIVED, TestDerivedClass))
-#define TEST_DERIVED_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_TYPE_DERIVED, TestDerivedClass))
-
-static void
-test_derived_class_init(TestDerivedClass*)
-{
-}
-static void
-test_derived_init(TestDerived*)
-{
-}
-
-G_DEFINE_TYPE(TestDerived, test_derived, G_TYPE_OBJECT)
-
-class DerivedObjectBase : public Glib::ObjectBase
-{
-public:
- // A real application would never make the constructor public.
- // It would instead have a protected constructor and a public create() method.
- DerivedObjectBase(GObject* gobject, int i) : Glib::ObjectBase(nullptr), i_(i)
- {
- Glib::ObjectBase::initialize(gobject);
- }
-
- DerivedObjectBase(const DerivedObjectBase& src) = delete;
- DerivedObjectBase& operator=(const DerivedObjectBase& src) = delete;
-
- DerivedObjectBase(DerivedObjectBase&& src) noexcept : Glib::ObjectBase(std::move(src)),
- i_(std::move(src.i_))
- {
- ObjectBase::initialize_move(src.gobject_, &src);
- }
-
- DerivedObjectBase& operator=(DerivedObjectBase&& src) noexcept
- {
- Glib::ObjectBase::operator=(std::move(src));
- i_ = std::move(src.i_);
-
- return *this;
- }
-
- int i_;
-};
-
static void
test_objectbase_move_constructor()
{
Glib::RefPtr<Something> refSomething(new Something());
g_assert_cmpint(refSomething->ref_count(), ==, 1);
g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
-
- // Test the get() method:
- g_assert_cmpint(refSomething.get()->ref_count(), ==, 1);
- refSomething.reset();
- g_assert(refSomething.get() == nullptr);
}
static void
g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
{
+ //The reference count should not change,
+ //because we only take and release a single reference:
Glib::RefPtr<Something> refSomething2(refSomething);
- g_assert_cmpint(refSomething->ref_count(), ==, 2);
- g_assert_cmpint(refSomething2->ref_count(), ==, 2);
- g_assert_cmpint(refSomething->max_ref_count(), ==, 2);
+ g_assert_cmpint(refSomething->ref_count(), ==, 1);
+ g_assert_cmpint(refSomething2->ref_count(), ==, 1);
+ g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
}
// 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);
+ g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
}
static void
g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
{
+ //The reference count should not change,
+ //because we only take and release a single reference:
Glib::RefPtr<Something> refSomething2 = refSomething;
- g_assert_cmpint(refSomething->ref_count(), ==, 2);
- g_assert_cmpint(refSomething2->ref_count(), ==, 2);
- g_assert_cmpint(refSomething->max_ref_count(), ==, 2);
+ g_assert_cmpint(refSomething->ref_count(), ==, 1);
+ g_assert_cmpint(refSomething2->ref_count(), ==, 1);
+ g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
}
// 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);
+ g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
}
static Glib::RefPtr<Something>
static Glib::RefPtr<Something> something_to_get;
// Reinitialize it each time:
- something_to_get = Glib::RefPtr<Something>(new Something());
+ something_to_get = Glib::make_refptr_for_instance<Something>(new Something());
return something_to_get;
}
test_refptr_with_parent_copy_constructor()
{
// We use get_something() because test_refptr_with_parent_move_constructor() does.
+ //The reference count should not change,
+ //because we only take and release a single reference:
Glib::RefPtr<Something> 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);
+ g_assert_cmpint(refSomething->ref_count(), ==, 1);
+ g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
{
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);
+ parent.something_ref_count(), ==, 1);
+ g_assert_cmpint(parent.something_max_ref_count(), ==, 1);
}
// 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);
+ g_assert_cmpint(refSomething->ref_count(), ==, 1);
+ g_assert_cmpint(refSomething->max_ref_count(), ==, 1);
}
static void
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(), ==, 2);
+ g_assert_cmpint(parent.something_ref_count(), ==, 1);
+ g_assert_cmpint(parent.something_max_ref_count(), ==, 1);
}
static void
#include <glibmm.h>
+#include <iomanip>
#include <iostream>
int
main(int, char**)
{
+ // Don't use the user's preferred locale. The decimal delimiter may be ','
+ // instead of the expected '.'.
+ Glib::set_init_to_users_preferred_locale(false);
+
Glib::init();
char carr[10] = "Užduotys";
// This threw an exception before we added a ustring::FormatStream::stream(char*) overload.
Glib::ustring::format(cptr);
+ // Test substitution of various types and I/O manipulators
+ Glib::ustring expected("The meaning of life is 42, or with 2 decimal places, 42.00.");
+ auto the = "The";
+ std::string meaning("meaning");
+ Glib::ustring life("life");
+ auto number = 42.0;
+ auto places = 2;
+ auto actual = Glib::ustring::format(the, ' ', meaning, " of ", life, " is ",
+ number,
+ ", or with ", places, " decimal places, ",
+ std::fixed, std::setprecision(places), number,
+ '.');
+
+ if (actual != expected)
+ {
+ std::cerr << "expected (" << expected.size() << "):\n" << expected << "\n\n"
+ << "actual (" << actual .size() << "):\n" << actual << "\n";
+
+ return EXIT_FAILURE;
+ }
+
return EXIT_SUCCESS;
}
--- /dev/null
+#include <iostream>
+#include <glibmm.h>
+
+int
+main()
+{
+ Glib::init();
+
+ // 0-1: bad character
+ const char not_utf8[] = { '\x80',
+ // 1-4: good three bytes (one character)
+ '\xef', '\x80', '\x80',
+ // 4-5: bad character
+ '\xef',
+ // 5-6: bad character
+ '\x80',
+ // 6-7: good character
+ 'a',
+ // 7-8: bad character
+ '\0',
+ // 8-9: good character
+ 'd',
+ // 9-10: bad character
+ '\x80',
+ // 10-13: good three bytes (one character)
+ '\xef', '\x80', '\x80',
+ // 13-15: two bad characters
+ '\xef', '\x80'
+ };
+
+ const char fixed_utf8[] = { '\xef', '\xbf', '\xbd',
+ '\xef', '\x80', '\x80',
+ '\xef', '\xbf', '\xbd',
+ '\xef', '\xbf', '\xbd',
+ 'a',
+ '\xef', '\xbf', '\xbd',
+ 'd',
+ '\xef', '\xbf', '\xbd',
+ '\xef', '\x80', '\x80',
+ '\xef', '\xbf', '\xbd',
+ '\xef', '\xbf', '\xbd'
+ };
+
+ // const char repl_character[] = {'\xef', '\xbf', '\xbd'};
+ const Glib::ustring s(not_utf8, not_utf8 + sizeof not_utf8);
+ g_assert(s.validate() == false);
+
+ const Glib::ustring good_one = s.make_valid();
+ g_assert(s.validate() == false); // we make a copy
+ g_assert(good_one.validate()); // this one is good!
+
+ const Glib::ustring correct_output(fixed_utf8,
+ fixed_utf8 + sizeof fixed_utf8);
+ g_assert(correct_output.validate());
+ g_assert(correct_output == good_one);
+
+ return EXIT_SUCCESS;
+}
+++ /dev/null
-
-#include <glibmm.h>
-
-struct Foo
-{
- int bar;
-};
-
-namespace Gtk
-{
-class Widget;
-}
-
-void
-some_method()
-{
- // custom copyable
- Glib::Value<Foo> value_foo;
-
- // custom pointer
- Glib::Value<Foo*> value_foo_pointer;
- Glib::Value<const Foo*> value_foo_const_pointer;
-
- // Glib::Object pointer
- Glib::Value<Gtk::Widget*> value_widget_pointer;
- Glib::Value<const Gtk::Widget*> value_widget_const_pointer;
-}
-
-// Glib::Object RefPtr<>
-
-// template Glib::Value< Glib::RefPtr<Gdk::Pixbuf> >;
-// template Glib::Value< Glib::RefPtr<const Gdk::Pixbuf> >;
-
+#include "../glibmm_object/test_derived_object.h"
#include <glibmm.h>
+#include <cassert>
+
+struct Foo
+{
+ int bar = 1;
+};
+
+namespace Gtk
+{
+
+class Widget {
+};
-int
-main(int, char**)
+}
+
+void
+test()
{
+ {
+ Foo foo;
+
+ // custom copyable
+ Glib::Value<Foo> value;
+ value.init(Glib::Value<Foo>::value_type()); // TODO: Avoid this step?
+ value.set(foo);
+
+ const auto v = value.get();
+ assert(v.bar == 1);
+ }
+
+ {
+ Foo foo;
+
+ // custom pointer
+ Glib::Value<Foo*> value;
+ value.init(Glib::Value<Foo*>::value_type()); // TODO: Avoid this step?
+ value.set(&foo);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ {
+ Foo foo;
+
+ Glib::Value<const Foo*> value;
+ value.init(Glib::Value<const Foo*>::value_type()); // TODO: Avoid this step?
+ value.set(&foo);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ {
+ Gtk::Widget widget;
+
+ // Glib::Object pointer
+ Glib::Value<Gtk::Widget*> value;
+ value.init(Glib::Value<Gtk::Widget*>::value_type()); // TODO: Avoid this step?
+ value.set(&widget);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ {
+ Gtk::Widget widget;
+
+ Glib::Value<const Gtk::Widget*> value;
+ value.init(Glib::Value<const Gtk::Widget*>::value_type()); // TODO: Avoid this step?
+ value.set(&widget);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ Glib::init();
+
+ // TODO: Put this test, of internal stuff, somewhere else.
+ static_assert(Glib::Traits::HasGetBaseType<DerivedObject, GType()>::value,
+ "DerivedObject has no get_base_type().");
+
+ // RefPtr to Glib::ObjectBase-derived type:
+ {
+ GObject* gobject = G_OBJECT(g_object_new(TEST_TYPE_DERIVED, nullptr));
+ auto derived = Glib::make_refptr_for_instance(new DerivedObject(gobject, 5));
+
+ using ValueType = Glib::Value<Glib::RefPtr<DerivedObject>>;
+ ValueType value;
+ value.init(ValueType::value_type()); // TODO: Avoid this step?
+
+ // Check that value_type() returns the type of the underlying GObjectBase,
+ // not a custom GType for the Glib::RefPtr:
+ assert(ValueType::value_type() == DerivedObject::get_base_type());
+
+ value.set(derived);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ {
+ GObject* gobject = G_OBJECT(g_object_new(TEST_TYPE_DERIVED, nullptr));
+ auto derived = Glib::make_refptr_for_instance(new DerivedObject(gobject, 5));
+
+ using ValueType = Glib::Value<Glib::RefPtr<const DerivedObject>>;
+ ValueType value;
+ value.init(ValueType::value_type()); // TODO: Avoid this step?
+
+ // Check that value_type() returns the type of the underlying GObjectBase,
+ // not a custom GType for the Glib::RefPtr:
+ assert(ValueType::value_type() == DerivedObject::get_base_type());
+
+ value.set(derived);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ {
+ auto foo = std::make_shared<Foo>();
+
+ // custom pointer
+ Glib::Value<std::shared_ptr<Foo>> value;
+ value.init(Glib::Value<std::shared_ptr<Foo>>::value_type()); // TODO: Avoid this step?
+ value.set(foo);
+
+ const auto v = value.get();
+ assert(v);
+ }
+
+ {
+ auto foo = std::make_shared<Foo>();
+
+ Glib::Value<std::shared_ptr<const Foo>> value;
+ value.init(Glib::Value<std::shared_ptr<const Foo>>::value_type()); // TODO: Avoid this step?
+ value.set(foo);
+
+ const auto v = value.get();
+ assert(v);
+ }
+}
+
+// Glib::Object RefPtr<>
+
+// template Glib::Value< Glib::RefPtr<Gdk::Pixbuf> >;
+// template Glib::Value< Glib::RefPtr<const Gdk::Pixbuf> >;
+//
+
+int main() {
+ test();
+
return EXIT_SUCCESS;
}
+++ /dev/null
-// Glib::ValueArray is deprecated, but let's keep the test.
-// The recommended replacement is std::vector<> which requires no test here.
-#undef GLIBMM_DISABLE_DEPRECATED
-
-#include <glibmm.h>
-#include <iostream>
-
-#ifdef GLIBMM_DISABLE_DEPRECATED
-int
-main(int, char**)
-{
- // If glibmm is configured with --disable-deprecated-api, GLIBMM_DISABLE_DEPRECATED
- // is defined in glibmm.h (actually in glibmmconfig.h). The undef at the start of
- // this file has no effect.
- return 77; // Tell automake's test harness to skip this test.
-}
-
-#else
-
-// Use this line if you want debug output:
-// std::ostream& ostr = std::cout;
-
-// This seems nicer and more useful than putting an ifdef around the use of ostr:
-std::stringstream debug;
-std::ostream& ostr = debug;
-
-int
-on_compare(const Glib::ValueBase& v1, const Glib::ValueBase& v2)
-{
- const Glib::Value<int>& intVal1 = static_cast<const Glib::Value<int>&>(v1);
- const Glib::Value<int>& intVal2 = static_cast<const Glib::Value<int>&>(v2);
-
- int int1 = intVal1.get();
- int int2 = intVal2.get();
-
- if (int1 < int2)
- return -1;
- else if (int1 == int2)
- return EXIT_SUCCESS;
- else
- return 1;
-}
-
-int
-main(int, char**)
-{
- const int VALUES_COUNT = 10;
-
- Glib::init();
-
- Glib::Value<int> values[VALUES_COUNT];
- Glib::ValueArray array;
-
- for (int i = 0; i < VALUES_COUNT; i++)
- {
- values[i].init(Glib::Value<int>::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_COUNT; i++)
- {
- Glib::ValueBase value;
-
- if (!array.get_nth(i, value))
- {
- std::cerr << "Error getting element " << i << " of value array." << std::endl;
- return EXIT_FAILURE;
- break;
- }
-
- auto int_val = static_cast<Glib::Value<int>&>(value);
- ostr << int_val.get() << " ";
- }
- 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_COUNT - 1);
-
- ostr << "Array members after sorting without last element:" << std::endl;
-
- for (int i = 0; i < VALUES_COUNT - 1; i++)
- {
- Glib::ValueBase value;
-
- if (!array.get_nth(i, value))
- {
- std::cerr << "Error getting element " << i << " of value array." << std::endl;
- return EXIT_FAILURE;
- break;
- }
-
- auto int_val = static_cast<Glib::Value<int>&>(value);
- ostr << int_val.get() << " ";
- }
- ostr << std::endl; // End of line for list of array elements.
-
- return EXIT_SUCCESS;
-}
-#endif // GLIBMM_DISABLE_DEPRECATED
ostr << "Index of first map entry: " << child0.first << std::endl;
result_ok &= child0.first == 4;
auto extracted_tuple = child0.second;
-#if __cplusplus > 201103L // C++14 or higher
auto q3 = std::get<guint16>(extracted_tuple);
auto s3 = std::get<Glib::ustring>(extracted_tuple);
auto b3 = std::get<bool>(extracted_tuple);
-#else // C++11
- auto q3 = std::get<0>(extracted_tuple);
- auto s3 = std::get<1>(extracted_tuple);
- auto b3 = std::get<2>(extracted_tuple);
-#endif
ostr << "Extracted tuple1 from map: (" << q3 << ", " << s3 << ", " << b3 << ")" << std::endl;
result_ok &= q3 == q1 && s3 == s1 && b3 == b1;
// Extract from a tuple.
auto q4 = tuple2_variant.get_child<guint16>(0);
auto s4 = tuple2_variant.get_child_variant<Glib::ustring>(1).get();
-#if __cplusplus > 201103L // C++14 or higher
auto b4 = std::get<bool>(tuple2_variant.get());
-#else // C++11
- auto b4 = std::get<2>(tuple2_variant.get());
-#endif
ostr << "Extracted tuple2: (" << q4 << ", " << s4 << ", " << b4 << ")" << std::endl;
result_ok &= q4 == q2 && s4 == s2 && b4 == b2;
return result_ok;
}
+bool test_comparison()
+{
+ bool result_ok = true;
+
+ std::vector<int> int_vector1 = { 1, 2, 3, 4, 5, 6, 7, 8 };
+ std::vector<int> int_vector2 = { 1, 2, 3, 4, 5, 6, 7 };
+
+ auto int_variant1 = Glib::Variant<std::vector<int>>::create(int_vector1);
+ auto int_variant2 = Glib::Variant<std::vector<int>>::create(int_vector2);
+ auto int_variant3 = Glib::Variant<std::vector<int>>::create(int_vector1);
+
+ // Equality and inequality operators
+ ostr << "int_variant1 == int_variant2 (0): " << (int_variant1 == int_variant2) << std::endl;
+ result_ok &= !(int_variant1 == int_variant2);
+ ostr << "int_variant1 != int_variant2 (1): " << (int_variant1 != int_variant2) << std::endl;
+ result_ok &= (int_variant1 != int_variant2);
+
+ ostr << "int_variant1 == int_variant3 (1): " << (int_variant1 == int_variant3) << std::endl;
+ result_ok &= (int_variant1 == int_variant3);
+ ostr << "int_variant1 != int_variant3 (0): " << (int_variant1 != int_variant3) << std::endl;
+ result_ok &= !(int_variant1 != int_variant3);
+
+#if 0
+ // Less than (activate if operator<() exists)
+ ostr << "int_variant2 < int_variant1 (1): " << (int_variant2 < int_variant1) << std::endl;
+ result_ok &= (int_variant2 < int_variant1);
+ ostr << "int_variant1 < int_variant3 (0): " << (int_variant1 < int_variant3) << std::endl;
+ result_ok &= !(int_variant1 < int_variant3);
+#endif
+ return result_ok;
+}
+
} // anonymous namespace
int
bool result_ok = test_tuple();
result_ok &= test_object_path();
+ result_ok &= test_comparison();
return result_ok ? EXIT_SUCCESS : EXIT_FAILURE;
}
struct WarnCatcher
{
- WarnCatcher(const std::string& domain)
+ explicit WarnCatcher(const std::string& domain)
: m_domain(domain), m_old_flags(g_log_set_fatal_mask(m_domain.c_str(), get_log_flags()))
{
}
+++ /dev/null
-/* Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
- */
-
-#include <cstring>
-#include <giomm.h> //There is no class derived from Glib::Object in glibmm
-#include <glibmm.h>
-#include <iostream>
-#include <utility> // std::move
-
-int
-main(int, char**)
-{
- Glib::init();
- bool success = true;
-
- // A Glib::WeakRef cannot be created from a Glib::RefPtr<Glib::Bytes>,
- // because Glib::Bytes is not derived from Glib::ObjectBase.
- // const int bdata = 1234;
- // Glib::RefPtr<Glib::Bytes> bytes = Glib::Bytes::create(&bdata, sizeof bdata);
- // Glib::WeakRef<Glib::Bytes> weakbytes = bytes; // does not compile
-
- // Gio::MemoryInputStream
- Glib::RefPtr<Gio::MemoryInputStream> memstream1 = Gio::MemoryInputStream::create();
- const char data[] = "Some arbitrary data";
- memstream1->add_data(data, sizeof data, Gio::MemoryInputStream::SlotDestroyData());
-
- // Downcast copy, followed by upcast.
- Glib::WeakRef<Gio::MemoryInputStream> weakmemstream1 = memstream1;
- Glib::WeakRef<Gio::InputStream> weakstream1 = weakmemstream1;
- Glib::WeakRef<Gio::MemoryInputStream> weakmemstream2 =
- Glib::WeakRef<Gio::MemoryInputStream>::cast_dynamic(weakstream1);
- Glib::RefPtr<Gio::MemoryInputStream> memstream2 = weakmemstream2.get();
- if (memstream2)
- {
- char buffer[200];
- gsize bytes_read = 0;
- try
- {
- memstream2->read_all(buffer, sizeof buffer, bytes_read);
- std::cout << buffer << std::endl;
- success &= std::strcmp(buffer, data) == 0;
- }
- catch (const Glib::Error& ex)
- {
- std::cout << "Error reading from memory stream: " << ex.what() << std::endl;
- success = false;
- }
- }
- else
- {
- std::cout << "!memstream2" << std::endl;
- success = false;
- }
-
- // Move construction.
- Glib::WeakRef<Gio::MemoryInputStream> weakmemstream3(std::move(weakmemstream1));
- if (weakmemstream1.get() || !weakmemstream3.get())
- {
- success = false;
- if (weakmemstream1.get())
- std::cout << "weakmemstream1 || !weakmemstream3: weakmemstream1" << std::endl;
- if (!weakmemstream3.get())
- std::cout << "weakmemstream1 || !weakmemstream3: !weakmemstream3" << std::endl;
- }
- else
- {
- // Move assignment.
- weakmemstream2 = std::move(weakmemstream3);
- if (!weakmemstream2 || weakmemstream3)
- {
- success = false;
- if (!weakmemstream2.get())
- std::cout << "!weakmemstream2 || weakmemstream3: !weakmemstream2" << std::endl;
- if (weakmemstream3.get())
- std::cout << "!weakmemstream2 || weakmemstream3: weakmemstream3" << std::endl;
- }
- else
- {
- // Downcast move, followed by upcast.
- weakstream1 = std::move(weakmemstream2);
- weakmemstream1 = Glib::WeakRef<Gio::MemoryInputStream>::cast_dynamic(weakstream1);
- if (weakmemstream2 || !weakmemstream1)
- {
- success = false;
- if (weakmemstream2)
- std::cout << "weakmemstream2 || !weakmemstream1: weakmemstream2" << std::endl;
- if (!weakmemstream1)
- std::cout << "weakmemstream2 || !weakmemstream1: !weakmemstream1" << std::endl;
- }
- }
- }
-
- // Gio::SimpleAction
- Glib::RefPtr<Gio::SimpleAction> action1 = Gio::SimpleAction::create("Action1");
-
- Glib::ustring name = action1->get_name();
- std::cout << "The name is '" << name << "'." << std::endl;
- success &= name == "Action1";
-
- Glib::WeakRef<Gio::SimpleAction> weakaction1 = action1;
- Glib::WeakRef<Gio::SimpleAction> weakaction2 = weakaction1;
-
- // A second RefPtr
- Glib::RefPtr<Gio::SimpleAction> action2 = weakaction1.get();
- if (action2)
- {
- name = action2->get_name();
- std::cout << "The name is '" << name << "'." << std::endl;
- success &= name == "Action1";
- }
- else
- {
- std::cout << "!action2" << std::endl;
- success = false;
- }
-
- weakaction1.reset();
- if (weakaction1.get())
- {
- std::cout << "weakaction1" << std::endl;
- success = false;
- }
-
- action2 = weakaction2.get();
- if (action2)
- {
- name = action2->get_name();
- std::cout << "The name is '" << name << "'." << std::endl;
- success &= name == "Action1";
- }
- else
- {
- std::cout << "!action2" << std::endl;
- success = false;
- }
-
- // Reset one of the RefPtrs. One remains.
- action1.reset();
- action2 = weakaction2.get();
- if (action2)
- {
- name = action2->get_name();
- std::cout << "The name is '" << name << "'." << std::endl;
- success &= name == "Action1";
- }
- else
- {
- std::cout << "!action2" << std::endl;
- success = false;
- }
-
- // Reset the other RefPtr as well.
- action2.reset();
- if (weakaction2.get())
- {
- std::cout << "weakaction2" << std::endl;
- success = false;
- }
-
- return success ? EXIT_SUCCESS : EXIT_FAILURE;
-}
dist_noinst_SCRIPTS = enum.pl
noinst_PROGRAMS = extra_defs_gen/generate_defs_glib extra_defs_gen/generate_defs_gio
-lib_LTLIBRARIES = extra_defs_gen/libglibmm_generate_extra_defs-2.4.la
+lib_LTLIBRARIES = extra_defs_gen/libglibmm_generate_extra_defs-2.60.la
extradefs_includedir = $(includedir)/$(GLIBMM_MODULE_NAME)/glibmm_generate_extra_defs
extradefs_include_HEADERS = extra_defs_gen/generate_extra_defs.h
extradefs_ldflags = -no-undefined -version-info $(LIBGLIBMM_SO_VERSION)
-extra_defs_gen_libglibmm_generate_extra_defs_2_4_la_SOURCES = extra_defs_gen/generate_extra_defs.cc
-extra_defs_gen_libglibmm_generate_extra_defs_2_4_la_LDFLAGS = $(extradefs_ldflags)
-extra_defs_gen_libglibmm_generate_extra_defs_2_4_la_LIBADD = $(GLIBMM_LIBS)
+extra_defs_gen_libglibmm_generate_extra_defs_2_60_la_SOURCES = extra_defs_gen/generate_extra_defs.cc
+extra_defs_gen_libglibmm_generate_extra_defs_2_60_la_LDFLAGS = $(extradefs_ldflags)
+extra_defs_gen_libglibmm_generate_extra_defs_2_60_la_LIBADD = $(GLIBMM_LIBS)
extra_defs_gen_generate_defs_glib_SOURCES = extra_defs_gen/generate_defs_glib.cc
extra_defs_gen_generate_defs_glib_LDADD = $(GLIBMM_LIBS) $(lib_LTLIBRARIES)
# Regenerate all glibmm's docs.xml and .defs files
-cd "$(dirname "$0")"
-
./glib_generate_docs.sh
./glib_generate_enums.sh
./glib_generate_extra_defs.sh
#!/bin/bash
-# The script assumes that it resides in the tools/gen_scripts directory and
-# the XML file will be placed in gio/src.
+# Note that JHBUILD_SOURCES should be defined to contain the path to the root
+# of the jhbuild sources. Also the script assumes that it resides in the
+# tools/gen_scripts directory and the XML file will be placed in glib/src.
-source "$(dirname "$0")/init_generate.sh"
+if [ -z "$JHBUILD_SOURCES" ]; then
+ echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+ exit 1;
+fi
-out_dir="$root_dir/gio/src"
+PREFIX="$JHBUILD_SOURCES"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/gio/src"
-params="--with-properties --no-recursion"
-for dir in "$source_prefix/gio" "$build_prefix/gio"; do
- params="$params -s $dir"
+PARAMS="--with-properties --no-recursion"
+for dir in "$PREFIX"/glib/gio; do
+ PARAMS="$PARAMS -s $dir"
done
-# Exclude $build_prefix/gio/xdp-dbus.c.
-params="$params -x $build_prefix/gio/xdp-dbus.c"
-"$gen_docs" $params > "$out_dir/gio_docs.xml"
+DOCEXTRACT_TO_XML_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/docextract_to_xml.py"
+$DOCEXTRACT_TO_XML_PY $PARAMS > "$OUT_DIR"/gio_docs.xml
#!/bin/bash
-# The script assumes that it resides in the tools/gen_scripts directory and
-# the defs file will be placed in gio/src.
+# 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 gio/src.
# To update the gio_enums.defs file:
# 1. ./gio_generate_enums.sh
# 3. ./gio_generate_enums.sh --make-patch
# 4. Like step 2 when updating only the gio_enums.defs file.
-source "$(dirname "$0")/init_generate.sh"
+if [ -z "$JHBUILD_SOURCES" ]; then
+ echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+ exit 1;
+fi
-out_dir="$root_dir/gio/src"
-out_file=gio_enums.defs
-out_dir_file="$out_dir"/$out_file
+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
shopt -s extglob # Enable extended pattern matching
-shopt -s nullglob # Skip a filename pattern that matches no file
if [ $# -eq 0 ]
then
+ ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl"
# Process files whose names end with .h, but not with private.h.
- # Exclude $build_prefix/gio/xdp-dbus.h.
- "$gen_enums" "$source_prefix"/gio/!(*private).h "$build_prefix"/gio/!(*private|xdp-dbus).h > "$out_dir_file"
+ $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"
- patch $patch_options $out_file $out_file.patch
+ 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
+ diff --unified=5 "$OUT_DIR_FILE".orig "$OUT_DIR_FILE" > "$OUT_DIR_FILE".patch
else
echo "Usage: $0 [--make-patch]"
exit 1
# 3. ./gio_generate_extra_defs.sh --make-patch
# 4. Like step 2 when updating only the gio_signals.defs file.
-source "$(dirname "$0")/init_generate.sh"
-
-out_dir="$root_dir/gio/src"
-out_file=gio_signals.defs
-out_dir_file="$out_dir"/$out_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
if [ $# -eq 0 ]
then
- "$extra_defs_gen_dir"/generate_defs_gio > "$out_dir_file"
+ "$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
+ 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
+ diff --unified=5 "$OUT_DIR_FILE".orig "$OUT_DIR_FILE" > "$OUT_DIR_FILE".patch
else
echo "Usage: $0 [--make-patch]"
exit 1
#!/bin/bash
-# The script assumes that it resides in the tools/gen_scripts directory and
-# the defs file will be placed in gio/src.
+# 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.
-source "$(dirname "$0")/init_generate.sh"
+if [ -z "$JHBUILD_SOURCES" ]; then
+ echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+ exit 1;
+fi
-out_dir="$root_dir/gio/src"
+PREFIX="$JHBUILD_SOURCES/glib"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/gio/src"
shopt -s extglob # Enable extended pattern matching
-shopt -s nullglob # Skip a filename pattern that matches no file
+H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py"
# Process files whose names end with .h, but not with private.h.
-# Exclude $build_prefix/gio/xdp-dbus.h.
-"$gen_methods" "$source_prefix"/gio/!(*private).h "$build_prefix"/gio/!(*private|xdp-dbus).h > "$out_dir"/gio_methods.defs
+$H2DEF_PY "$PREFIX"/gio/!(*private).h > "$OUT_DIR"/gio_methods.defs
+#patch "$OUT_DIR"/gio_methods.defs "$OUT_DIR"/gio_methods.defs.patch
#!/bin/bash
-# The script assumes that it resides in the tools/gen_scripts directory and
-# the XML file will be placed in glib/src.
+# 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 XML file will be placed in glib/src.
-source "$(dirname "$0")/init_generate.sh"
+if [ -z "$JHBUILD_SOURCES" ]; then
+ echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+ exit 1;
+fi
-out_dir="$root_dir/glib/src"
+PREFIX="$JHBUILD_SOURCES"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/glib/src"
-params="--with-properties --no-recursion"
-for dir in "$source_prefix"/{glib,glib/deprecated,gmodule,gobject,gthread} \
- "$build_prefix"/{glib,gmodule,gobject,gthread}; do
- params="$params -s $dir"
+PARAMS="--with-properties --no-recursion"
+for dir in "$PREFIX"/glib/{glib,glib/deprecated,gmodule,gobject,gthread}; do
+ PARAMS="$PARAMS -s $dir"
done
-"$gen_docs" $params > "$out_dir/glib_docs.xml"
+DOCEXTRACT_TO_XML_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/docextract_to_xml.py"
+$DOCEXTRACT_TO_XML_PY $PARAMS > "$OUT_DIR/glib_docs.xml"
#!/bin/bash
-# The script assumes that it resides in the tools/gen_scripts directory and
-# the defs files will be placed in glib/src.
+# 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 files will be placed in glib/src.
# To update the g[lib|module|object]_enums.defs files:
# 1. ./glib_generate_enums.sh
# 3. ./glib_generate_enums.sh --make-patch
# 4. Like step 2 when updating only the g[lib|module|object]_enums.defs files.
-source "$(dirname "$0")/init_generate.sh"
+if [ -z "$JHBUILD_SOURCES" ]; then
+ echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+ exit 1;
+fi
-out_dir="$root_dir/glib/src"
+PREFIX="$JHBUILD_SOURCES/glib"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/glib/src"
shopt -s extglob # Enable extended pattern matching
-shopt -s nullglob # Skip a filename pattern that matches no file
if [ $# -eq 0 ]
then
+ ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl"
# Process files whose names end with .h, but not with private.h.
- "$gen_enums" "$source_prefix"/glib/!(*private).h "$source_prefix"/glib/deprecated/!(*private).h \
- "$build_prefix"/glib/!(*private).h "$build_prefix"/glib/deprecated/!(*private).h > "$out_dir"/glib_enums.defs
- "$gen_enums" "$source_prefix"/gmodule/!(*private).h "$build_prefix"/gmodule/!(*private).h > "$out_dir"/gmodule_enums.defs
- "$gen_enums" "$source_prefix"/gobject/!(*private).h "$build_prefix"/gobject/!(*private).h > "$out_dir"/gobject_enums.defs
+ $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"
- patch $patch_options glib_enums.defs glib_enums.defs.patch
+ 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
+ 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
# This script assumes that it resides in the tools/gen_scripts directory and
# the defs file will be placed in glib/src.
-source "$(dirname "$0")/init_generate.sh"
+ROOT_DIR="$(dirname "$0")/../.."
+GEN_DIR="../extra_defs_gen"
+OUT_DIR="$ROOT_DIR/glib/src"
-out_dir="$root_dir/glib/src"
-
-"$extra_defs_gen_dir"/generate_defs_glib > "$out_dir"/glib_signals.defs
+"$GEN_DIR"/generate_defs_glib > "$OUT_DIR"/glib_signals.defs
#!/bin/bash
-# The script assumes it resides in the tools/gen_scripts directory and
-# the defs files will be placed in glib/src.
+# Note that JHBUILD_SOURCES should be defined to contain the path to the root
+# 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
# 3. ./glib_generate_methods.sh --make-patch
# 4. Like step 2 when updating only the g[lib|module|object]_functions.defs files.
-source "$(dirname "$0")/init_generate.sh"
+if [ -z "$JHBUILD_SOURCES" ]; then
+ echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+ exit 1;
+fi
-out_dir="$root_dir/glib/src"
+PREFIX="$JHBUILD_SOURCES/glib"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/glib/src"
shopt -s extglob # Enable extended pattern matching
-shopt -s nullglob # Skip a filename pattern that matches no file
if [ $# -eq 0 ]
then
+ H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py"
# Process files whose names end with .h, but not with private.h.
- "$gen_methods" "$source_prefix"/glib/!(*private).h "$source_prefix"/glib/deprecated/!(*private).h \
- "$build_prefix"/glib/!(*private).h "$build_prefix"/glib/deprecated/!(*private).h > "$out_dir"/glib_functions.defs
- "$gen_methods" "$source_prefix"/gmodule/!(*private).h "$build_prefix"/gmodule/!(*private).h > "$out_dir"/gmodule_functions.defs
- "$gen_methods" "$source_prefix"/gobject/!(*private).h "$build_prefix"/gobject/!(*private).h > "$out_dir"/gobject_functions.defs
+ $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"
- patch $patch_options glib_functions.defs glib_functions.defs.patch
+ 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
+ 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
+++ /dev/null
-#!/bin/bash
-
-# This file is part of glibmm-2.4.
-# Initializes some variables for the scripts that generate docs and defs files.
-# Not intented to be called directly from the command line.
-
-# Global environment variables:
-# GMMPROC_GEN_SOURCE_DIR Top directory where source files are searched for.
-# Default value: $(dirname "$0")/../../..
-# i.e. 3 levels above this file.
-# GMMPROC_GEN_BUILD_DIR Top directory where built files are searched for.
-# Default value: $GMMPROC_GEN_SOURCE_DIR
-#
-# If you use jhbuild, you can set these environment variables equal to jhbuild's
-# configuration variables checkoutroot and buildroot, respectively.
-# Usually you can leave GMMPROC_GEN_SOURCE_DIR undefined.
-# If you have set buildroot=None, GMMPROC_GEN_BUILD_DIR can also be undefined.
-
-# Root directory of glibmm-2.4 source files.
-root_dir="$(dirname "$0")/../.."
-
-# Where to search for source files.
-if [ -z "$GMMPROC_GEN_SOURCE_DIR" ]; then
- GMMPROC_GEN_SOURCE_DIR="$root_dir/.."
-fi
-
-# Where to search for built files.
-if [ -z "$GMMPROC_GEN_BUILD_DIR" ]; then
- GMMPROC_GEN_BUILD_DIR="$GMMPROC_GEN_SOURCE_DIR"
-fi
-
-# Scripts in glibmm-2.4. These are source files.
-gen_docs="$GMMPROC_GEN_SOURCE_DIR/glibmm-2.4/tools/defs_gen/docextract_to_xml.py"
-gen_methods="$GMMPROC_GEN_SOURCE_DIR/glibmm-2.4/tools/defs_gen/h2def.py"
-gen_enums="$GMMPROC_GEN_SOURCE_DIR/glibmm-2.4/tools/enum.pl"
-
-# Where to find executables that generate extra defs (signals and properties).
-# glibmm-2.4 is built with autotools.
-# autotools support, but don't require, non-source-dir builds.
-extra_defs_gen_dir="$GMMPROC_GEN_BUILD_DIR/glibmm-2.4/tools/extra_defs_gen"
-
-source_prefix="$GMMPROC_GEN_SOURCE_DIR/glib"
-build_prefix="$GMMPROC_GEN_BUILD_DIR/glib"
-if [ "$build_prefix" == "$source_prefix" ]; then
- # glib is built with meson, which requires non-source-dir builds.
- # This is what jhbuild does, if neccesary, to force non-source-dir builds.
- build_prefix="$build_prefix/build"
-fi
_PUSH(SECTION_CC)
Glib::RefPtr<`'__CPPNAME__`'> __CPPNAME__`'::create(`'$2`')
{
- return Glib::RefPtr<`'__CPPNAME__`'>( new __CPPNAME__`'(`'$3`') );
+ return Glib::make_refptr_for_instance<`'__CPPNAME__`'>( new __CPPNAME__`'(`'$3`') );
}
_POP()
Glib::RefPtr<__NAMESPACE__::__CPPNAME__> wrap(__REAL_CNAME__`'* object, bool take_copy)
{
- return Glib::RefPtr<__NAMESPACE__::__CPPNAME__>( dynamic_cast<__NAMESPACE__::__CPPNAME__*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
+ return Glib::make_refptr_for_instance<__NAMESPACE__::__CPPNAME__>( dynamic_cast<__NAMESPACE__::__CPPNAME__*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
//We use dynamic_cast<> in case of multiple inheritance.
}
Glib::RefPtr<__NAMESPACE__::__CPPNAME__> wrap(__CNAME__`'* object, bool take_copy)
{
- return Glib::RefPtr<__NAMESPACE__::__CPPNAME__>( dynamic_cast<__NAMESPACE__::__CPPNAME__*> (Glib::wrap_auto_interface<__NAMESPACE__::__CPPNAME__> ((GObject*)(object), take_copy)) );
+ return Glib::make_refptr_for_instance<__NAMESPACE__::__CPPNAME__>( dynamic_cast<__NAMESPACE__::__CPPNAME__*> (Glib::wrap_auto_interface<__NAMESPACE__::__CPPNAME__> ((GObject*)(object), take_copy)) );
//We use dynamic_cast<> in case of multiple inheritance.
}
__OPAQUE_FUNC_REF`'(object);
// See the comment at the top of this file, if you want to know why the cast works.
- return Glib::RefPtr<__NAMESPACE__::__CPPNAME__>(reinterpret_cast<__NAMESPACE__::__CPPNAME__*>(object));
+ return Glib::make_refptr_for_instance<__NAMESPACE__::__CPPNAME__>(reinterpret_cast<__NAMESPACE__::__CPPNAME__*>(object));
}
} // namespace Glib
Glib::RefPtr<__CPPNAME__> __CPPNAME__::create()
{
// See the comment at the top of this file, if you want to know why the cast works.
- return Glib::RefPtr<__CPPNAME__>(reinterpret_cast<__CPPNAME__*>(__OPAQUE_FUNC_NEW`'()));
+ return Glib::make_refptr_for_instance<__CPPNAME__>(reinterpret_cast<__CPPNAME__*>(__OPAQUE_FUNC_NEW`'()));
}
')dnl endif __OPAQUE_FUNC_NEW
-dnl $Id$
-
#
# Define a hashing for names
#
define(`__ARG3__',`$`'3')
+
+# _CONV_ENUM(namespace, enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of namespace+enum_name.
define(`_CONV_ENUM',`dnl
-_CONVERSION(`$1$2', `$2', (($2)(__ARG3__)))
-_CONVERSION(`$1$2', `$1::$2', (($1::$2)(__ARG3__)))
-_CONVERSION(`$2', `$1$2', (($1$2)(__ARG3__)))
-_CONVERSION(`$1::$2', `$1$2', (($1$2)(__ARG3__)))
+pushdef(`C_ENUM_NAME', `m4_ifelse(`$3',,`$1$2',`$3')')
+_CONVERSION(`C_ENUM_NAME', `$2', static_cast<$2>(__ARG3__))
+_CONVERSION(`C_ENUM_NAME', `$1::$2', static_cast<$1::$2>(__ARG3__))
+_CONVERSION(`$2', `C_ENUM_NAME', static_cast<C_ENUM_NAME>(__ARG3__))
+_CONVERSION(`$1::$2', `C_ENUM_NAME', static_cast<C_ENUM_NAME>(__ARG3__))
+popdef(`C_ENUM_NAME')
+')dnl
+
+# _CONV_INCLASS_ENUM(namespace, class_name, enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of namespace+class_name+enum_name.
+define(`_CONV_INCLASS_ENUM',`dnl
+pushdef(`C_ENUM_NAME', `m4_ifelse(`$4',,`$1$2$3',`$4')')
+_CONVERSION(`C_ENUM_NAME', `$3', static_cast<$3>(__ARG3__))
+_CONVERSION(`C_ENUM_NAME', `$2::$3', static_cast<$2::$3>(__ARG3__))
+_CONVERSION(`C_ENUM_NAME', `$1::$2::$3', static_cast<$1::$2::$3>(__ARG3__))
+_CONVERSION(`$3', `C_ENUM_NAME', static_cast<C_ENUM_NAME>(__ARG3__))
+_CONVERSION(`$2::$3', `C_ENUM_NAME', static_cast<C_ENUM_NAME>(__ARG3__))
+_CONVERSION(`$1::$2::$3', `C_ENUM_NAME', static_cast<C_ENUM_NAME>(__ARG3__))
+popdef(`C_ENUM_NAME')
')dnl
# e.g. Glib::RefPtr<Gdk::Something> to GdkSomething*
-_CONV_ENUM(G,AppInfoCreateFlags)
-_CONV_ENUM(G,ApplicationFlags)
-_CONV_ENUM(G,AskPasswordFlags)
-_CONV_ENUM(G,BusType)
-_CONV_ENUM(G,ConverterFlags)
-_CONV_ENUM(G,ConverterResult)
-_CONV_ENUM(G,CredentialsType)
-_CONV_ENUM(G,DataStreamByteOrder)
-_CONV_ENUM(G,DataStreamNewlineType)
-_CONV_ENUM(GDBus,CallFlags)
-_CONV_ENUM(GDBus,CapabilityFlags)
-_CONV_ENUM(GDBus, InterfaceSkeletonFlags)
-_CONV_ENUM(GDBus,MessageFlags)
-_CONV_ENUM(GDBus,MessageHeaderField)
-_CONV_ENUM(GDBus,MessageType)
-_CONV_ENUM(GDBus,ProxyFlags)
-_CONV_ENUM(GDBus,SendMessageFlags)
-_CONV_ENUM(GDBus,ServerFlags)
-_CONV_ENUM(G,DriveStartFlags)
-_CONV_ENUM(G,DriveStartFlags)
-_CONV_ENUM(G,DriveStartStopType)
-_CONV_ENUM(G,EmblemOrigin)
-_CONV_ENUM(G,FileAttributeInfoFlags)
-_CONV_ENUM(G,FileAttributeStatus)
-_CONV_ENUM(G,FileAttributeType)
-_CONV_ENUM(G,FileCopyFlags)
-_CONV_ENUM(G,FileCreateFlags)
-_CONV_ENUM(G,FileMonitorEvent)
-_CONV_ENUM(G,FileMonitorFlags)
-_CONV_ENUM(G,FileQueryInfoFlags)
-_CONV_ENUM(G,FileType)
-_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)
-_CONV_ENUM(G,ResourceFlags)
-_CONV_ENUM(G,ResourceLookupFlags)
-_CONV_ENUM(G,SettingsBindFlags)
-_CONV_ENUM(G,SocketClientEvent)
-_CONV_ENUM(G,SocketFamily)
-_CONV_ENUM(G,SocketMsgFlags)
-_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)
-_CONV_ENUM(G,TlsPasswordFlags)
-_CONV_ENUM(G,TlsRehandshakeMode)
-_CONV_ENUM(G,UnixSocketAddressType)
-_CONV_ENUM(G,ZlibCompressorFormat)
+dnl
+dnl Gio C names have prefix 'G' or 'GDBus' but C++ namespace Gio ot Gio::DBus
+dnl
+# _CONV_GIO_ENUM(enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of G+enum_name.
+define(`_CONV_GIO_ENUM',`dnl
+_CONV_ENUM(`Gio',`$1',`m4_ifelse(`$2',,`G$1',`$2')')
+')dnl
+
+# _CONV_GIO_DBUS_ENUM(enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of GDBus+enum_name.
+define(`_CONV_GIO_DBUS_ENUM',`dnl
+_CONV_ENUM(`Gio::DBus',`$1',`m4_ifelse(`$2',,`GDBus$1',`$2')')
+')dnl
+
+# _CONV_GIO_INCLASS_ENUM(class_name, enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of G+class_name+enum_name.
+define(`_CONV_GIO_INCLASS_ENUM',`dnl
+_CONV_INCLASS_ENUM(`Gio',`$1',`$2',`m4_ifelse(`$3',,`G$1$2',`$3')')
+')dnl
+
+# _CONV_GIO_DBUS_INCLASS_ENUM(class_name, enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of GDBus+class_name+enum_name.
+define(`_CONV_GIO_DBUS_INCLASS_ENUM',`dnl
+_CONV_INCLASS_ENUM(`Gio::DBus',`$1',`$2',`m4_ifelse(`$3',,`GDBus$1$2',`$3')')
+')dnl
+
+_CONV_GIO_INCLASS_ENUM(AppInfo,CreateFlags)
+_CONV_GIO_INCLASS_ENUM(Application,Flags)
+_CONV_GIO_ENUM(AskPasswordFlags)
+_CONV_GIO_ENUM(BusType)
+_CONV_GIO_INCLASS_ENUM(Converter,Flags)
+_CONV_GIO_INCLASS_ENUM(Converter,Result)
+_CONV_GIO_INCLASS_ENUM(Credentials,Type)
+_CONV_GIO_ENUM(DataStreamByteOrder)
+_CONV_GIO_ENUM(DataStreamNewlineType)
+_CONV_GIO_DBUS_ENUM(CallFlags)
+_CONV_GIO_DBUS_ENUM(CapabilityFlags)
+_CONV_GIO_DBUS_INCLASS_ENUM(InterfaceSkeleton,Flags)
+_CONV_GIO_DBUS_INCLASS_ENUM(Message,ByteOrder)
+_CONV_GIO_DBUS_ENUM(MessageFlags)
+_CONV_GIO_DBUS_ENUM(MessageHeaderField)
+_CONV_GIO_DBUS_ENUM(MessageType)
+_CONV_GIO_DBUS_ENUM(ProxyFlags)
+_CONV_GIO_DBUS_ENUM(SendMessageFlags)
+_CONV_GIO_DBUS_INCLASS_ENUM(Server,Flags)
+_CONV_GIO_INCLASS_ENUM(Drive,StartFlags)
+_CONV_GIO_INCLASS_ENUM(Drive,StartStopType)
+_CONV_GIO_INCLASS_ENUM(Emblem,Origin)
+_CONV_GIO_INCLASS_ENUM(FileAttributeInfo,Flags)
+_CONV_GIO_ENUM(FileAttributeStatus)
+_CONV_GIO_ENUM(FileAttributeType)
+_CONV_GIO_INCLASS_ENUM(FileCopy,Flags)
+_CONV_GIO_INCLASS_ENUM(FileCreate,Flags)
+_CONV_GIO_INCLASS_ENUM(FileMonitor,Event)
+_CONV_GIO_INCLASS_ENUM(FileMonitor,Flags)
+_CONV_GIO_ENUM(FileQueryInfoFlags)
+_CONV_GIO_ENUM(FileType)
+_CONV_GIO_INCLASS_ENUM(Mount,MountFlags)
+_CONV_GIO_ENUM(MountOperationResult)
+_CONV_GIO_INCLASS_ENUM(Mount,UnmountFlags)
+_CONV_GIO_ENUM(NetworkConnectivity)
+_CONV_GIO_INCLASS_ENUM(Notification,Priority)
+_CONV_GIO_INCLASS_ENUM(OutputStream,SpliceFlags)
+_CONV_GIO_ENUM(PasswordSave)
+_CONV_GIO_INCLASS_ENUM(Resolver,RecordType)
+_CONV_GIO_INCLASS_ENUM(Resource,Flags)
+_CONV_GIO_INCLASS_ENUM(Resource,LookupFlags)
+_CONV_GIO_INCLASS_ENUM(Settings,BindFlags)
+_CONV_GIO_ENUM(SocketClientEvent)
+_CONV_GIO_ENUM(SocketFamily)
+_CONV_GIO_INCLASS_ENUM(Socket,MsgFlags)
+_CONV_GIO_INCLASS_ENUM(Socket,Protocol)
+_CONV_GIO_INCLASS_ENUM(Socket,Type)
+_CONV_GIO_ENUM(TlsCertificateFlags)
+_CONV_GIO_ENUM(TlsCertificateRequestFlags)
+_CONV_GIO_INCLASS_ENUM(TlsDatabase,VerifyFlags)
+_CONV_GIO_INCLASS_ENUM(TlsDatabase,LookupFlags)
+_CONV_GIO_ENUM(TlsInteractionResult)
+_CONV_GIO_INCLASS_ENUM(TlsPassword,Flags)
+_CONV_GIO_ENUM(TlsRehandshakeMode)
+_CONV_GIO_INCLASS_ENUM(UnixSocketAddress,Type)
+_CONV_GIO_ENUM(ZlibCompressorFormat)
# Action
_CONVERSION(`GAction*',`Glib::RefPtr<Action>',`Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<AppInfo>&',`GAppInfo*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`Glib::RefPtr<AppInfo>',`GAppInfo*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`GAppInfo*',`const Glib::RefPtr<AppInfo>&',`Glib::wrap($3)')
-_CONVERSION(`const Glib::ListHandle< Glib::RefPtr<Gio::File> >&',`GList*',`$3.data()')
+_CONVERSION(`const std::vector<Glib::RefPtr<Gio::File>>&',`GList*',`Glib::ListHandler<Glib::RefPtr<Gio::File>>::vector_to_list($3).data()')
# Application
_CONVERSION(`GApplication*',`Glib::RefPtr<Application>',`Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<InputStream>&',`GInputStream*',__CONVERT_CONST_REFPTR_TO_P)
_CONVERSION(`const Glib::RefPtr<Gio::InputStream>&',`GInputStream*',__CONVERT_CONST_REFPTR_TO_P)
_CONVERSION(`GInputStream*',`Glib::RefPtr<InputStream>',`Glib::wrap($3)')
+_CONVERSION(`GInputStream*',`Glib::RefPtr<Gio::InputStream>',`Glib::wrap($3)')
# MenuAttributeIter
_CONVERSION(`GMenuAttributeIter*',`Glib::RefPtr<MenuAttributeIter>',`Glib::wrap($3)')
# MenuItem
_CONVERSION(`GMenuItem*',`Glib::RefPtr<MenuItem>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<MenuItem>&',`GMenuItem*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const MenuItem>&',`GMenuItem*',__CONVERT_CONST_REFPTR_TO_P)
# Mount
_CONVERSION(`GMount*',`Glib::RefPtr<Mount>',`Glib::wrap($3)')
#Settings
_CONVERSION(`GSettings*',`Glib::RefPtr<Settings>',`Glib::wrap($3)')
-_CONVERSION(`const Glib::StringArrayHandle&',`const gchar*-const*',`($3).data()')
+_CONVERSION(`const std::vector<Glib::ustring>&',`const gchar*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data()')
_CONVERSION(`const Glib::RefPtr<SettingsBackend>&',`GSettingsBackend*',__CONVERT_REFPTR_TO_P)
_CONVERSION(`GSettingsSchemaKey*',`Glib::RefPtr<SettingsSchemaKey>',`Glib::wrap($3)')
dnl
dnl Glib C names have prefix 'G' but C++ namespace Glib
dnl
+# _CONV_GLIB_ENUM(enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of G+enum_name.
define(`_CONV_GLIB_ENUM',`dnl
-_CONVERSION(`G$1', `$1', (($1)(__ARG3__)))
-_CONVERSION(`G$1', `Glib::$1', ((Glib::$1)(__ARG3__)))
-_CONVERSION(`$1', `G$1', ((G$1)(__ARG3__)))
-_CONVERSION(`Glib::$1', `G$1', ((G$1)(__ARG3__)))
+_CONV_ENUM(`Glib',`$1',`m4_ifelse(`$2',,`G$1',`$2')')
+')dnl
+
+# _CONV_GLIB_INCLASS_ENUM(class_name, enum_name[, C_enum_name])
+# Specify C_enum_name, if it's not the concatenation of G+class_name+enum_name.
+define(`_CONV_GLIB_INCLASS_ENUM',`dnl
+_CONV_INCLASS_ENUM(`Glib',`$1',`$2',`m4_ifelse(`$3',,`G$1$2',`$3')')
')dnl
_EQUAL(gchar,char)
dnl # These are for fixmegtkconst
_CONVERSION(`const guchar*',`guchar*',`const_cast<guchar*>($3)',`$3')
-_CONV_GLIB_ENUM(BindingFlags)
+_CONV_GLIB_INCLASS_ENUM(Binding,Flags)
_CONV_GLIB_ENUM(IOCondition)
_CONV_GLIB_ENUM(IOFlags)
_CONV_GLIB_ENUM(IOStatus)
-_CONV_GLIB_ENUM(KeyFileFlags)
+_CONV_GLIB_INCLASS_ENUM(KeyFile,Flags)
_CONV_GLIB_ENUM(OptionArg)
-_CONV_GLIB_ENUM(RegexCompileFlags)
-_CONV_GLIB_ENUM(RegexMatchFlags)
+_CONV_GLIB_INCLASS_ENUM(Regex,CompileFlags)
+_CONV_GLIB_INCLASS_ENUM(Regex,MatchFlags)
_CONV_GLIB_ENUM(SeekType)
_CONV_GLIB_ENUM(TimeType)
_CONVERSION(`const Glib::ustring&',`const char*',`$3.c_str()')
_CONVERSION(`const Glib::ustring&', `const guchar*', `(($2)$3.c_str())')
_CONVERSION(`const std::string&',`const char*',`$3.c_str()')
-_CONVERSION(`std::string',`const char*',`$3.c_str()')
_CONVERSION(`const Glib::ustring&',`gchar*',`const_cast<gchar*>($3.c_str())')
-_CONVERSION(`gchar*',`Glib::ustring',__GCHARP_TO_USTRING)
_CONVERSION(`const-gchar*',`Glib::ustring',__GCHARP_TO_USTRING)
_CONVERSION(`const-guchar*',`Glib::ustring',__GCHARP_TO_USTRING)
_CONVERSION(`const gchar*',`Glib::ustring',__GCHARP_TO_USTRING)
_CONVERSION(`const char*',`const-gchar*',`$3')
_CONVERSION(`const-gchar*',`const char*',`$3')
_CONVERSION(`const char*',`const std::string&',__GCHARP_TO_STDSTRING)
-_CONVERSION(`char*',`std::string',__GCHARP_TO_STDSTRING)
-_CONVERSION(`std::string', `char*', `g_strdup(($3).c_str())')
-_CONVERSION(`const std::string&', `char*', `g_strdup(($3).c_str())')
-_CONVERSION(`Glib::ustring', `char*', `g_strdup(($3).c_str())')
_CONVERSION(`return-gchar*',`Glib::ustring',`Glib::convert_return_gchar_ptr_to_ustring($3)')
_CONVERSION(`return-gchar*',`std::string',`Glib::convert_return_gchar_ptr_to_stdstring($3)')
dnl
-dnl _ENUM(cpp_type, c_type, value_suffix, `element_list', `gtype_func', `optional_refdoc_comment', 'deprecated')
-dnl $1 $2 $3 $4 $5 $6 $7
+dnl _ENUM(cpp_type, c_type, value_suffix, `element_list', `no_gtype', `conv_to_int',
+dnl $1 $2 $3 $4 $5 $6
+dnl in_class, `optional_refdoc_comment', 'deprecated')
+dnl $7 $8 $9
dnl
m4_define(`_ENUM',`dnl
_PUSH()
m4_define(`__ENUM_CPPNAME__',`$1')
m4_define(`__ENUM_CNAME__',`$2')
-m4_define(`__ENUM_VALUE_BASE__',`Glib::Value_$3<__NAMESPACE__::__ENUM_CPPNAME__>')
+m4_define(`__ENUM_CLASS_CPPNAME__',m4_ifelse($7,0,,`__CPPNAME__::')`__ENUM_CPPNAME__')
+m4_define(`__ENUM_INDENT1__',m4_ifelse($7,0,,` '))
+m4_define(`__ENUM_INDENT2__',__ENUM_INDENT1__`'m4_ifelse($6,,,` '))
+m4_define(`__ENUM_VALUE_BASE__',`Glib::Value_$3<__NAMESPACE__::__ENUM_CLASS_CPPNAME__>')
_POP()
dnl
m4_define(`__DOCGROUP_'__MODULE_CANONICAL__`_ENUMS__')dnl
/** @addtogroup '__MODULE_CANONICAL__`Enums __MODULE_CANONICAL__ Enums and Flags */
-')dnl endif
+__ENUM_INDENT1__')`'dnl endif
dnl
dnl
-ifelse(`$7',,,`_DEPRECATE_IFDEF_START')`'dnl The expansion of _DEPRECATE_IFDEF_START ends with a newline
-/** $6
- *
- * @ingroup __MODULE_CANONICAL__`'Enums
-m4_ifelse($3,Flags,`dnl
- * @par Bitwise operators:
- * <tt>%__ENUM_CPPNAME__ operator|(__ENUM_CPPNAME__, __ENUM_CPPNAME__)</tt><br>
- * <tt>%__ENUM_CPPNAME__ operator&(__ENUM_CPPNAME__, __ENUM_CPPNAME__)</tt><br>
- * <tt>%__ENUM_CPPNAME__ operator^(__ENUM_CPPNAME__, __ENUM_CPPNAME__)</tt><br>
- * <tt>%__ENUM_CPPNAME__ operator~(__ENUM_CPPNAME__)</tt><br>
- * <tt>%__ENUM_CPPNAME__& operator|=(__ENUM_CPPNAME__&, __ENUM_CPPNAME__)</tt><br>
- * <tt>%__ENUM_CPPNAME__& operator&=(__ENUM_CPPNAME__&, __ENUM_CPPNAME__)</tt><br>
- * <tt>%__ENUM_CPPNAME__& operator^=(__ENUM_CPPNAME__&, __ENUM_CPPNAME__)</tt><br>
+ifelse(`$9',,,`_DEPRECATE_IFDEF_START'`'__ENUM_INDENT1__)`'dnl The expansion of _DEPRECATE_IFDEF_START ends with a newline
+ifelse($6,,,`/** Wrapper for enum __ENUM_CPPNAME__.
+__ENUM_INDENT1__ * __ENUM_CPPNAME__ enumerators are scoped and can be implicitly converted to int.
+__ENUM_INDENT1__ * The scope is __NAMESPACE__::__ENUM_CLASS_CPPNAME__::
+__ENUM_INDENT1__ *
+__ENUM_INDENT1__ * @ingroup __MODULE_CANONICAL__`'Enums
+__ENUM_INDENT1__ */
+__ENUM_INDENT1__`'class __ENUM_CPPNAME__`'_Wrapper final
+__ENUM_INDENT1__{
+__ENUM_INDENT1__`'public:
+__ENUM_INDENT2__')`'dnl endif conv_to_int
+/** $8
+__ENUM_INDENT2__ *
+__ENUM_INDENT2__ * @ingroup __MODULE_CANONICAL__`'Enums
+m4_ifelse($3,`Flags',`dnl
+__ENUM_INDENT2__ * @par Bitwise operators:
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__ operator|(__ENUM_CLASS_CPPNAME__, __ENUM_CLASS_CPPNAME__)</tt><br>
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__ operator&(__ENUM_CLASS_CPPNAME__, __ENUM_CLASS_CPPNAME__)</tt><br>
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__ operator^(__ENUM_CLASS_CPPNAME__, __ENUM_CLASS_CPPNAME__)</tt><br>
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__ operator~(__ENUM_CLASS_CPPNAME__)</tt><br>
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__& operator|=(__ENUM_CLASS_CPPNAME__&, __ENUM_CLASS_CPPNAME__)</tt><br>
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__& operator&=(__ENUM_CLASS_CPPNAME__&, __ENUM_CLASS_CPPNAME__)</tt><br>
+__ENUM_INDENT2__ * <tt>__ENUM_CLASS_CPPNAME__& operator^=(__ENUM_CLASS_CPPNAME__&, __ENUM_CLASS_CPPNAME__)</tt><br>
')dnl endif
- */
-enum __ENUM_CPPNAME__
-{
+__ENUM_INDENT2__ */
+__ENUM_INDENT2__`'enum ifelse($6,,`class ',)`'__ENUM_CPPNAME__
+__ENUM_INDENT2__{
$4
-};
-m4_ifelse($3,Flags,`dnl
+__ENUM_INDENT2__};
+ifelse($6,,,`__ENUM_INDENT2__`'#ifndef DOXYGEN_SHOULD_SKIP_THIS
+__ENUM_INDENT2__`'__ENUM_CPPNAME__`'_Wrapper`'() = delete;
+__ENUM_INDENT2__`'#endif
+__ENUM_INDENT1__};
+__ENUM_INDENT1__/** __ENUM_CPPNAME__ enumerators are scoped by the wrapper class
+__ENUM_INDENT1__ * and can be implicitly converted to int.
+__ENUM_INDENT1__ *
+__ENUM_INDENT1__ * @ingroup __MODULE_CANONICAL__`'Enums
+__ENUM_INDENT1__ */
+__ENUM_INDENT1__`'using __ENUM_CPPNAME__ = __ENUM_CPPNAME__`'_Wrapper::__ENUM_CPPNAME__;
+')`'dnl endif conv_to_int
+m4_ifelse($3,`Flags',`dnl
+m4_ifelse($7,0,,`dnl in_class
+_PUSH(SECTION_HEADER3)
+__NAMESPACE_BEGIN__
+ifelse(`$9',,,`_DEPRECATE_IFDEF_START')`'dnl
+')dnl endif
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__ operator|(__ENUM_CPPNAME__ lhs, __ENUM_CPPNAME__ rhs)
- { return static_cast<__ENUM_CPPNAME__>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
+inline __ENUM_CLASS_CPPNAME__ operator|(__ENUM_CLASS_CPPNAME__ lhs, __ENUM_CLASS_CPPNAME__ rhs)
+ { return static_cast<__ENUM_CLASS_CPPNAME__>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__ operator&(__ENUM_CPPNAME__ lhs, __ENUM_CPPNAME__ rhs)
- { return static_cast<__ENUM_CPPNAME__>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
+inline __ENUM_CLASS_CPPNAME__ operator&(__ENUM_CLASS_CPPNAME__ lhs, __ENUM_CLASS_CPPNAME__ rhs)
+ { return static_cast<__ENUM_CLASS_CPPNAME__>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__ operator^(__ENUM_CPPNAME__ lhs, __ENUM_CPPNAME__ rhs)
- { return static_cast<__ENUM_CPPNAME__>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
+inline __ENUM_CLASS_CPPNAME__ operator^(__ENUM_CLASS_CPPNAME__ lhs, __ENUM_CLASS_CPPNAME__ rhs)
+ { return static_cast<__ENUM_CLASS_CPPNAME__>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__ operator~(__ENUM_CPPNAME__ flags)
- { return static_cast<__ENUM_CPPNAME__>(~static_cast<unsigned>(flags)); }
+inline __ENUM_CLASS_CPPNAME__ operator~(__ENUM_CLASS_CPPNAME__ flags)
+ { return static_cast<__ENUM_CLASS_CPPNAME__>(~static_cast<unsigned>(flags)); }
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__& operator|=(__ENUM_CPPNAME__& lhs, __ENUM_CPPNAME__ rhs)
- { return (lhs = static_cast<__ENUM_CPPNAME__>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
+inline __ENUM_CLASS_CPPNAME__& operator|=(__ENUM_CLASS_CPPNAME__& lhs, __ENUM_CLASS_CPPNAME__ rhs)
+ { return (lhs = static_cast<__ENUM_CLASS_CPPNAME__>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__& operator&=(__ENUM_CPPNAME__& lhs, __ENUM_CPPNAME__ rhs)
- { return (lhs = static_cast<__ENUM_CPPNAME__>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
+inline __ENUM_CLASS_CPPNAME__& operator&=(__ENUM_CLASS_CPPNAME__& lhs, __ENUM_CLASS_CPPNAME__ rhs)
+ { return (lhs = static_cast<__ENUM_CLASS_CPPNAME__>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup __MODULE_CANONICAL__`'Enums */
-inline __ENUM_CPPNAME__& operator^=(__ENUM_CPPNAME__& lhs, __ENUM_CPPNAME__ rhs)
- { return (lhs = static_cast<__ENUM_CPPNAME__>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
+inline __ENUM_CLASS_CPPNAME__& operator^=(__ENUM_CLASS_CPPNAME__& lhs, __ENUM_CLASS_CPPNAME__ rhs)
+ { return (lhs = static_cast<__ENUM_CLASS_CPPNAME__>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
+m4_ifelse($7,0,,`dnl in_class
+ifelse(`$9',,,`_DEPRECATE_IFDEF_END')`'dnl
+__NAMESPACE_END__
+_POP()
+')dnl endif
')dnl endif Flags
-ifelse(`$7',,,`_DEPRECATE_IFDEF_END')`'dnl The expansion of _DEPRECATE_IFDEF_END ends with a newline
-m4_ifelse(`$5',`NO_GTYPE',,`dnl else
+ifelse(`$9',,,`_DEPRECATE_IFDEF_END')`'dnl The expansion of _DEPRECATE_IFDEF_END ends with a newline
+
+m4_ifelse($5,`NO_GTYPE',,`dnl else
+m4_ifelse($7,0,`dnl not in_class
__NAMESPACE_END__
+',`dnl else
+_PUSH(SECTION_HEADER3)
+')dnl endif
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
-ifelse(`$7',,,`_DEPRECATE_IFDEF_START')`'dnl
+ifelse(`$9',,,`_DEPRECATE_IFDEF_START')`'dnl
template <>
-class Value<__NAMESPACE__::__ENUM_CPPNAME__> : public __ENUM_VALUE_BASE__
+class Value<__NAMESPACE__::__ENUM_CLASS_CPPNAME__> : public __ENUM_VALUE_BASE__
{
public:
static GType value_type() G_GNUC_CONST;
};
-ifelse(`$7',,,`_DEPRECATE_IFDEF_END')`'dnl
+ifelse(`$9',,,`_DEPRECATE_IFDEF_END')`'dnl
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+m4_ifelse($7,0,`dnl not in_class
__NAMESPACE_BEGIN__
+',`dnl else
+_POP()
+')dnl endif
_PUSH(SECTION_SRC_GENERATED)
-ifelse(`$7',,,`_DEPRECATE_IFDEF_START')`'dnl
+ifelse(`$9',,,`_DEPRECATE_IFDEF_START')`'dnl
// static
-GType Glib::Value<__NAMESPACE__::__ENUM_CPPNAME__>::value_type()
+GType Glib::Value<__NAMESPACE__::__ENUM_CLASS_CPPNAME__>::value_type()
{
-m4_ifelse(`$5',,`dnl
return _GET_TYPE_FUNC(__ENUM_CNAME__);
-',`dnl
- return `$5()';
-')dnl
}
-ifelse(`$7',,,`_DEPRECATE_IFDEF_END')`'dnl
+ifelse(`$9',,,`_DEPRECATE_IFDEF_END')`'dnl
_POP()
')dnl endif !NO_GTYPE
dnl
-dnl _GERROR(cpp_type, c_type, domain, `element_list', `gtype_func', `class_docs', `enum_docs', 'deprecated')
-dnl $1 $2 $3 $4 $5 $6 $7 $8
+dnl _GERROR(cpp_type, c_type, domain, `element_list', `no_gtype', `class_docs', `enum_docs', 'deprecated')
+dnl $1 $2 $3 $4 $5 $6 $7 $8
dnl
m4_define(`_GERROR',`dnl
};
ifelse(`$8',,,`_DEPRECATE_IFDEF_END')`'dnl The expansion of _DEPRECATE_IFDEF_END ends with a newline
-m4_ifelse(`$5',`NO_GTYPE',,`dnl else
+m4_ifelse($5,`NO_GTYPE',,`dnl else
__NAMESPACE_END__
#ifndef DOXYGEN_SHOULD_SKIP_THIS
throw __NAMESPACE__::__CPPNAME__`'(gobject);
}
-m4_ifelse(`$5',`NO_GTYPE',,`dnl else
+m4_ifelse($5,`NO_GTYPE',,`dnl else
// static
GType Glib::Value<__NAMESPACE__::__CPPNAME__::Code>::value_type()
{
-m4_ifelse(`$5',,`dnl
return _GET_TYPE_FUNC(__CNAME__);
-',`dnl
- return `$5()';
-')dnl
}
')dnl endif !NO_GTYPE
')dnl
',dnl If the C function returns non-void:
dnl Store the return if there are C output parameters.
-`ifelse(`$6',,` return ',` `$3' retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');
+`ifelse(`$6',,` return ',` auto retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');
dnl Insert the initializations for the C output parameters
ifelse(`$8',,,`$8
')dnl
ifelse(`$6',,,`$6
')`'dnl
ifelse(`$16',,dnl If no C++ output parameter is specified:
-` ifelse(`$3',void,,``$3' retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');
+` ifelse(`$3',void,,`auto retvalue = ')_CONVERT($4,`$3',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)');
'dnl
,dnl A C++ output parameter is specified:
` _INITIALIZE($17,$4,`$16',`$2`'(ifelse(`$9',1,const_cast<__CNAME__*>(gobj()),gobj())`'ifelse(`$7',,,`, ')$7)',$21);
` ifelse(`$3',void,,dnl
dnl Returns non-void:
dnl Store the return if there are C output parameters
-ifelse(`$6',,`return ',``$3' retval = '))_CONVERT($4,`$3',`$2`'($7)');'dnl
+ifelse(`$6',,`return ',`auto retval = '))_CONVERT($4,`$3',`$2`'($7)');'dnl
dnl A C++ output parameter is specified so initialize it from C return
,` _INITIALIZE($14,$4,`$13',`$2`'($7)',$18);'dnl
)
ifelse(`$6',,,`$6
')`'dnl
ifelse(`$13',,dnl If no C++ output parameter is specified:
- ifelse(`$3',void,,``$3' retvalue = ')_CONVERT($4,`$3',`$2`'($7)');dnl
+ ifelse(`$3',void,,`auto retvalue = ')_CONVERT($4,`$3',`$2`'($7)');dnl
dnl A C++ output parameter is specified:
,` _INITIALIZE($14,$4,`$13',`$2`'($7)',$18);'dnl
)dnl
')dnl
ifelse($13,,`dnl no detail_name
$10
- Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > signal_$4`'();
+ Glib::SignalProxy<$5`'($6)> signal_$4`'();
',dnl detail_name
$14,0,`dnl
$10
- Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > signal_$4`'(const Glib::ustring& $13 = Glib::ustring());
+ Glib::SignalProxyDetailed<$5`'($6)> signal_$4`'(const Glib::ustring& $13 = Glib::ustring());
',`dnl detail_name and two_signal_methods
$10
- Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > signal_$4`'();
+ Glib::SignalProxy<$5`'($6)> signal_$4`'();
$10
- Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > signal_$4`'(const Glib::ustring& $13);
+ Glib::SignalProxyDetailed<$5`'($6)> signal_$4`'(const Glib::ustring& $13);
')dnl end detail_name
ifelse(`$9',,,`_DEPRECATE_IFDEF_END
')dnl
static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`'void* data)
{
using namespace __NAMESPACE__;
- using SlotType = sigc::slot< $5`'_COMMA_PREFIX($6) >;
+ using SlotType = sigc::slot<$5`'($6)>;
auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
// Do not try to call a signal on a disassociated wrapper.
static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3)`' void* data)
{
using namespace __NAMESPACE__;
- using SlotType = sigc::slot< void`'_COMMA_PREFIX($6) >;
+ using SlotType = sigc::slot<void($6)>;
auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
// Do not try to call a signal on a disassociated wrapper.
ifelse(`$9',,,`_DEPRECATE_IFDEF_START
')dnl
ifelse($13,,`dnl no detail_name
-Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'()
+Glib::SignalProxy<$5`'($6)> __CPPNAME__::signal_$4`'()
{
- return Glib::SignalProxy< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info);
+ return Glib::SignalProxy<$5`'($6) >(this, &__CPPNAME__`'_signal_$4_info);
}
',dnl detail_name
$14,0,`dnl
-Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
+Glib::SignalProxyDetailed<$5`'($6)> __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
{
- return Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info, $13);
+ return Glib::SignalProxyDetailed<$5`'($6)>(this, &__CPPNAME__`'_signal_$4_info, $13);
}
',`dnl detail_name and two_signal_methods
-Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'()
+Glib::SignalProxy<$5`'($6)> __CPPNAME__::signal_$4`'()
{
- return Glib::SignalProxy< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info);
+ return Glib::SignalProxy<$5`'($6)>(this, &__CPPNAME__`'_signal_$4_info);
}
-Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
+Glib::SignalProxyDetailed<$5`'($6)> __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
{
- return Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info, $13);
+ return Glib::SignalProxyDetailed<$5`'($6)>(this, &__CPPNAME__`'_signal_$4_info, $13);
}
')dnl end detail_name
ifelse(`$9',,,`_DEPRECATE_IFDEF_END
# 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.
+ if (scalar @docs_param_names != scalar @c_param_names)
+ {
+ print STDERR "DocsParser.pm: Warning, $$obj_function{name}\n" .
+ " Incompatible parameter lists in the docs.xml file and the methods.defs file.\n";
+ }
+
# Skip first param if this is a signal.
if ($$obj_function{name} =~ /\w+::/)
{
# Skip the last param if it's an error output param.
if (scalar @docs_param_names && $docs_param_names[-1] eq "error")
{
- pop(@docs_param_names);
- pop(@c_param_names);
+ # If the number of parameters in @docs_param_names is not greater than
+ # the number of parameters in the _WRAP macro, the parameter called "error"
+ # is probably not an error output parameter.
+ if (!defined($objCppfunc) || scalar @docs_param_names > scalar @{$$objCppfunc{param_names}})
+ {
+ pop(@docs_param_names);
+ pop(@c_param_names);
+ }
}
my $cpp_param_names;
{
$out_param_index = $$param_mappings{OUT};
}
+ if (scalar @docs_param_names != scalar @$cpp_param_names)
+ {
+ print STDERR "DocsParser.pm: Warning, $$obj_function{name}\n" .
+ " Incompatible parameter lists in the docs.xml file and the _WRAP macro.\n";
+ }
}
my %param_name_mappings; # C name -> C++ name
my $cxx_name = (($module eq "G") ? "" : (ucfirst(lc($module)) . "::")) . $name;
- #print "DocsParser.pm: Assuming the enumerator $c_name shall become $cxx_name.\n";
+ print "DocsParser.pm: Assuming the enumerator $c_name shall become $cxx_name.\n";
+
return $cxx_name;
}
# string module;
# string c_type;
#
+# string array elem_short_names;
# string array elem_names;
# string array elem_values;
# string c_prefix;
$$self{flags} = 0;
$$self{c_prefix} = "";
+ $$self{elem_short_names} = [];
$$self{elem_names} = [];
$$self{elem_values} = [];
}
# this should never happen
+ warn if(scalar(@{$$self{elem_short_names}}) != scalar(@{$$self{elem_values}}));
warn if(scalar(@{$$self{elem_names}}) != scalar(@{$$self{elem_values}}));
return $self;
{
my ($self, $value) = @_;
+ my $elem_short_names = [];
my $elem_names = [];
my $elem_values = [];
my $common_prefix = undef;
# and handles triples like '("dq-token", "MY_SCANNER_DQ_TOKEN", "'"'").
foreach (split_enum_tokens($value))
{
- if (/^"\S+" "(\S+)" "(.+)"$/)
+ if (/^"(\S+)" "(\S+)" "(.+)"$/)
{
- my ($name, $value) = ($1, $2);
+ my ($nick_name, $name, $value) = ($1, $2, $3);
# detect whether there is module prefix common to all names, e.g. GTK_
my $prefix = $1 if ($name =~ /^([^_]+_)/);
$common_prefix = "";
}
+ # enum.pl generates nick names from the C names of the enum constants.
+ # A nick name consists of the trailing part of the enum name.
+ # The leading part which is common for each constant of an enum type
+ # has been removed. The remaining part is then tranform to lowercase
+ # and hyphens.
+ # Transform the nick name with lowercase letters and hyphens
+ # back to a short name with uppercase letters and underscores.
+ # The short names are suitable for 'enum class' definitions.
+ $nick_name =~ tr/a-z-/A-Z_/;
+ push(@$elem_short_names, $nick_name);
push(@$elem_names, $name);
push(@$elem_values, $value);
}
$$self{c_prefix} = $common_prefix;
}
+ $$self{elem_short_names} = $elem_short_names;
$$self{elem_names} = $elem_names;
$$self{elem_values} = $elem_values;
}
-sub beautify_values($)
+sub beautify_values($$)
{
- my ($self) = @_;
+ my ($self, $use_short_names) = @_;
return if($$self{flags});
- my $elem_names = $$self{elem_names};
+ my $elem_names = $use_short_names ? $$self{elem_short_names} : $$self{elem_names};
my $elem_values = $$self{elem_values};
my $num_elements = scalar(@$elem_values);
sub build_element_list($$$$)
{
- my ($self, $ref_subst_in, $ref_subst_out, $indent) = @_;
+ my ($self, $use_short_names, $ref_subst_in, $ref_subst_out, $indent) = @_;
- my $elem_names = $$self{elem_names};
+ my $elem_names = $use_short_names ? $$self{elem_short_names} : $$self{elem_names};
my $elem_values = $$self{elem_values};
my $num_elements = scalar(@$elem_names);
return $elements;
}
+# The name prefix is defined by: $name_prefix . $short_name eq $name
+# I.e. what shall be chopped off the name to get the short name.
+sub get_name_prefix($)
+{
+ my ($self) = @_;
+
+ my $name = ${$$self{elem_names}}[0];
+ my $short_name = ${$$self{elem_short_names}}[0];
+ my $prefix_length = length($name) - length($short_name);
+
+ return substr($name, 0, $prefix_length);
+}
+
sub dump($)
{
my ($self) = @_;
# but possibly spaces between the multiple ">>".
# Quoted strings are not detected. If a quoted string exists in a function
# prototype, it's probably as part of a default value, inside ("x") or {"y"}.
- #
+ #
my @str = ();
foreach (split(/(\bconst\b|[,=&*>]|<.*?>|{.*?}|\(.*?\)|\s+)/, $line))
{
}
# void output_wrap_enum($filename, $line_num, $cpp_type, $c_type,
-# $comment, $ref_subst_in, $ref_subst_out, $gtype_func,
-# $deprecated, $deprecation_docs, $newin)
-sub output_wrap_enum($$$$$$$$$$$$)
+# $comment, $ref_subst_in, $ref_subst_out, $no_gtype, $conv_to_int,
+# $in_class, $deprecated, $deprecation_docs, $newin)
+sub output_wrap_enum($$$$$$$$$$$$$$)
{
my ($self, $filename, $line_num, $cpp_type, $c_type,
- $comment, $ref_subst_in, $ref_subst_out, $gtype_func,
- $deprecated, $deprecation_docs, $newin) = @_;
+ $comment, $ref_subst_in, $ref_subst_out, $no_gtype, $conv_to_int,
+ $in_class, $deprecated, $deprecation_docs, $newin) = @_;
my $objEnum = GtkDefs::lookup_enum($c_type);
if(!$objEnum)
return;
}
- $objEnum->beautify_values();
+ $objEnum->beautify_values(1);
- my $elements = $objEnum->build_element_list($ref_subst_in, $ref_subst_out, " ");
+ my $indent = " ";
+ $indent .= " " if ($in_class);
+ $indent .= " " if ($conv_to_int);
+ my $elements = $objEnum->build_element_list(1, $ref_subst_in, $ref_subst_out, $indent);
add_m4_quotes(\$elements);
if(!$elements)
return;
}
- my $value_suffix = "Enum";
- $value_suffix = "Flags" if($$objEnum{flags});
+ # Chop off the name prefix in the documentation.
+ my $name_prefix = $objEnum->get_name_prefix();
+ unshift(@$ref_subst_in, "^$name_prefix");
+ unshift(@$ref_subst_out, "");
# Get the enum documentation from the parsed docs.
+ $indent = substr($indent, 1); # Remove one blank
my $enum_docs = DocsParser::lookup_enum_documentation("$c_type", "$cpp_type",
- " ", $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin);
+ $indent, $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin);
# Merge the passed in comment to the existing enum documentation.
- $comment .= "\n * " . $enum_docs if $enum_docs ne "";
+ $comment .= "\n$indent* $enum_docs" if $enum_docs ne "";
+
+ my $value_suffix = "Enum";
+ $value_suffix = "Flags" if ($$objEnum{flags});
- my $str = sprintf("_ENUM(%s,%s,%s,\`%s\',\`%s\',\`%s\',\`%s\')dnl\n",
+ my $str = sprintf("_ENUM(%s,%s,%s,\`%s\',\`%s\',\`%s\',%d,\`%s\',\`%s\')dnl\n",
$cpp_type,
$c_type,
$value_suffix,
$elements,
- $gtype_func,
+ $no_gtype,
+ $conv_to_int,
+ $in_class,
$comment,
$deprecated
);
-
$self->append($str);
}
-sub output_wrap_enum_docs_only($$$$$$$$$$$)
+sub output_wrap_enum_docs_only($$$$$$$$$$$$)
{
my ($self, $filename, $line_num, $module_canonical, $cpp_type, $c_type,
- $comment, $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin) = @_;
+ $comment, $ref_subst_in, $ref_subst_out, $in_class, $deprecation_docs, $newin) = @_;
- # Get the existing enum description from the parsed docs.
+ my $objEnum = GtkDefs::lookup_enum($c_type);
+ if(!$objEnum)
+ {
+ $self->output_wrap_failed($c_type, "enum defs lookup failed.");
+ return;
+ }
+ # Chop off the name prefix in the documentation.
+ my $name_prefix = $objEnum->get_name_prefix();
+ unshift(@$ref_subst_in, "^$name_prefix");
+ unshift(@$ref_subst_out, "");
+
+ # Get the enum documentation from the parsed docs.
+ my $indent = " ";
+ $indent .= " " if ($in_class);
my $enum_docs = DocsParser::lookup_enum_documentation("$c_type", "$cpp_type",
- " ", $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin);
+ $indent, $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin);
if($enum_docs eq "")
{
}
# Include the enum docs in the module's enum docs group.
- $enum_docs .= "\n *\n * \@ingroup ${module_canonical}Enums";
+ $enum_docs .= "\n$indent*\n$indent* \@ingroup ${module_canonical}Enums";
# Merge the passed in comment to the existing enum documentation.
- $comment = "/** " . $comment . "\n * " . $enum_docs . "\n */\n";
+ $comment = "/** " . $comment . "\n$indent* " . $enum_docs . "\n$indent*/\n";
$self->append($comment);
}
# void output_wrap_gerror($filename, $line_num, $cpp_type, $c_type, $domain,
-# $class_docs, $ref_subst_in, $ref_subst_out, $gtype_func,
+# $class_docs, $ref_subst_in, $ref_subst_out, $no_gtype,
# $deprecated, $deprecation_docs, $newin)
sub output_wrap_gerror($$$$$$$$$$$$$)
{
my ($self, $filename, $line_num, $cpp_type, $c_type, $domain,
- $class_docs, $ref_subst_in, $ref_subst_out, $gtype_func,
+ $class_docs, $ref_subst_in, $ref_subst_out, $no_gtype,
$deprecated, $deprecation_docs, $newin) = @_;
my $objDefsParser = $$self{objDefsParser};
# Shouldn't happen, and if it does, I'd like to know that.
warn if($$objEnum{flags});
- $objEnum->beautify_values();
+ $objEnum->beautify_values(0);
# cut off the module prefix, e.g. GDK_
my $prefix = $domain;
unshift(@$ref_subst_in, "^${prefix}_");
unshift(@$ref_subst_out, "");
- my $elements = $objEnum->build_element_list($ref_subst_in, $ref_subst_out, " ");
+ my $elements = $objEnum->build_element_list(0, $ref_subst_in, $ref_subst_out, " ");
add_m4_quotes(\$elements);
# Get the enum documentation from the parsed docs.
# Prevent Doxygen from auto-linking to a class called Exception.
$class_docs =~ s/([^%])(Exception class)/$1%$2/g;
- my $str = sprintf("_GERROR(%s,%s,%s,\`%s\',\`%s\',\`%s\',\`%s\',\`%s\')dnl\n",
+ my $str = sprintf("_GERROR(%s,%s,%s,\`%s\',%s,\`%s\',\`%s\',\`%s\')dnl\n",
$cpp_type,
$c_type,
$domain,
$elements,
- $gtype_func,
+ $no_gtype,
$class_docs,
$enum_docs,
$deprecated
my $str = "";
# Move to the first "(":
- while ( scalar(@tokens) )
- {
- my $t = $self->extract_token();
- last if ($t eq "(");
- }
+ while (scalar(@tokens))
+ {
+ my $t = $self->extract_token();
+ last if ($t eq "(");
+ }
- # TODO: Don't count "(" and ")" within double quotes.
- # There may be .hg files with unpaired quotes that generate correct
- # .h and .cc files. Don't want to break such code yet.
- # See also TODO in string_split_commas().
+ my $filename = $$self{filename};
+ my $line_num = $$self{line_num};
# Concatenate until the corresponding ")":
- while ( scalar(@tokens) )
+ while (scalar(@tokens) and $filename eq $$self{filename})
+ {
+ my $t = $self->extract_token();
+ $in_quotes = !$in_quotes if ($t eq '"');
+ # Don't count "(" and ")" within double quotes.
+ if (!$in_quotes)
{
- my $t = $self->extract_token();
- $in_quotes = !$in_quotes if ($t eq '"');
$level++ if ($t eq "(");
$level-- if ($t eq ")");
-
- if (!$level)
- {
- $self->error("End of gmmproc directive within a quoted string.\n") if $in_quotes;
- return $str;
- }
- $str .= $t;
+ return $str if (!$level); # Found matching ")"
}
+ $str .= $t;
+ }
- return "";
+ # No matching ")" found.
+ my $quote_text = $in_quotes ? " in a quoted string" : "";
+ die "$filename:$line_num: *** End of file$quote_text in a gmmproc macro. ***\n";
}
########################################
### breaks up a string by commas (smart)
-# @strings string_split_commas($string [, $ignore_quotes])
-sub string_split_commas($;$)
+# @strings string_split_commas($string)
+sub string_split_commas($)
{
- my ($in, $ignore_quotes) = @_;
+ my ($in) = @_;
- $ignore_quotes = 2 unless defined $ignore_quotes;
my @out;
my $level = 0;
my $in_quotes = 0;
next if ($t eq "");
- # 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) >= $ignore_quotes);
+ $in_quotes = !$in_quotes if ($t eq '"');
if (!$in_quotes)
{
$level++ if ($t eq "(" or $t eq "<" or $t eq "{");
}
# The "slot_callback" option tells gmmproc the name of the
# callback function that should be passed to the C function if the
- # method has a slot.
- elsif($argRef =~ /^slot_callback\s+(\w+)/)
+ # method has a slot. The name can contain a namespace prefix.
+ elsif($argRef =~ /^slot_callback\s+([:\w]+)/)
{
$$objCppfunc{slot_callback} = $1;
}
my $line_num = $$self{line_num};
my $str = $self->extract_bracketed_text();
- my @args = string_split_commas($str, 1);
+ my @args = string_split_commas($str);
my $entity_type = "method";
my @subst_in = [];
my @subst_out = [];
- my $gtype_func = "";
+ my $no_gtype = "";
+ my $conv_to_int = "";
my $argDeprecated = "";
my $deprecation_docs = "";
my $newin = "";
- # $gtype_func:
- # 1. If an empty string, the M4 macro _ENUM or _GERROR calls _GET_TYPE_FUNC()
- # that generates the function name from the name of the C type, e.g.
- # GFileAttributeType -> g_file_attribute_type_get_type
- # 2. If NO_GTYPE, no call to a *_get_type() function and no Glib::Value
- # specialization is generated for the enum type.
- # 3. If anything else, it's assumed to be the name of the *_get_type() function
- # to generate a call to.
-
# Build a list of custom substitutions, and recognize some flags too.
foreach (@args)
{
if ($arg eq "NO_GTYPE")
{
- $gtype_func = "NO_GTYPE";
+ $no_gtype = $arg;
}
- elsif ($arg =~ /^gtype_func\s+(\w+)/)
+ elsif (!$is_gerror and $arg eq "CONV_TO_INT")
{
- $gtype_func = $1;
+ $conv_to_int = $arg;
}
elsif ($arg =~ /^s#([^#]+)#([^#]*)#$/)
{
$newin = string_unquote(string_trim($1));
}
}
- return ($cpp_type, $c_type, $domain, \@subst_in, \@subst_out, $gtype_func,
- $argDeprecated, $deprecation_docs, $newin);
+ return ($cpp_type, $c_type, $domain, \@subst_in, \@subst_out, $no_gtype,
+ $conv_to_int, $argDeprecated, $deprecation_docs, $newin);
}
+# void on_wrap_enum()
+# _WRAP_ENUM(cpp_type, c_type [,NO_GTYPE] [,CONV_TO_INT] [,s#regexpr#subst#]*)
+# Optional arguments:
+# NO_GTYPE Don't generate code for a specialization of the template
+# Glib::Value_Enum or Glib::Value_Flags.
+# Necessary, if the C type enum is not registered as a GType.
+# CONV_TO_INT "Convertible to int" Generate a plain enum (not an enum class)
+# within a class. Such an enum is scoped like an enum class,
+# and it can be implicitly converted to int like a plain enum.
+# s#regexpr#subst# Zero or more substitutions in names of enum constants, e.g. s#^DATE_##.
+#
+# _WRAP_ENUM can be located either in a class or outside all classes.
+# When located in a class, and Value specialization shall be generated or it's
+# a Flags type (i.e. bitwise operators shall be generated), then the following
+# requirements must be fulfilled:
+# 1. _WRAP_ENUM must be located in the public part of the class.
+# 2. The class must contain a class macro (_CLASS_GENERIC, _CLASS_GOBJECT,
+# _CLASS_GTKOBJECT, etc.) before _WRAP_ENUM.
+#
sub on_wrap_enum($)
{
my ($self) = @_;
my $comment = $self->extract_preceding_documentation();
# get the arguments
- my ($cpp_type, $c_type, undef, $ref_subst_in, $ref_subst_out, $gtype_func,
+ my ($cpp_type, $c_type, undef, $ref_subst_in, $ref_subst_out, $no_gtype, $conv_to_int,
$argDeprecated, $deprecation_docs, $newin) = $self->on_wrap_any_enum(0);
$$self{objOutputter}->output_wrap_enum(
$$self{filename}, $$self{line_num}, $cpp_type, $c_type,
- $comment, $ref_subst_in, $ref_subst_out, $gtype_func,
- $argDeprecated, $deprecation_docs, $newin);
+ $comment, $ref_subst_in, $ref_subst_out, $no_gtype, $conv_to_int,
+ $$self{in_class}, $argDeprecated, $deprecation_docs, $newin);
}
sub on_wrap_enum_docs_only($)
my $comment = $self->extract_preceding_documentation();
# get the arguments
- my ($cpp_type, $c_type, undef, $ref_subst_in, $ref_subst_out, undef,
+ my ($cpp_type, $c_type, undef, $ref_subst_in, $ref_subst_out, undef, undef,
$argDeprecated, $deprecation_docs, $newin) = $self->on_wrap_any_enum(0);
# Get the module name so the enum docs can be included in the module's
$$self{objOutputter}->output_wrap_enum_docs_only(
$$self{filename}, $$self{line_num}, $module_canonical, $cpp_type, $c_type,
- $comment, $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin);
+ $comment, $ref_subst_in, $ref_subst_out, $$self{in_class}, $deprecation_docs, $newin);
}
sub on_wrap_gerror($)
my $class_docs = $self->extract_preceding_documentation();
# get the arguments
- my ($cpp_type, $c_type, $domain, $ref_subst_in, $ref_subst_out, $gtype_func,
+ my ($cpp_type, $c_type, $domain, $ref_subst_in, $ref_subst_out, $no_gtype, undef,
$argDeprecated, $deprecation_docs, $newin) = $self->on_wrap_any_enum(1);
$$self{objOutputter}->output_wrap_gerror(
$$self{filename}, $$self{line_num}, $cpp_type, $c_type, $domain,
- $class_docs, $ref_subst_in, $ref_subst_out, $gtype_func,
+ $class_docs, $ref_subst_in, $ref_subst_out, $no_gtype,
$argDeprecated, $deprecation_docs, $newin);
}
# files that it depends on.
# Example: In glibmm, go to directory glibmm, and run
-# tools/test_scripts/testheaders.sh -I glib glibmm-2.4 gio # compile glibmm/gio/giomm/*.h
-# tools/test_scripts/testheaders.sh glibmm-2.4 glib gio # compile glibmm/glib/glibmm/*.h and glibmm/gio/giomm/*.h
-# tools/test_scripts/testheaders.sh -I glib -I gio glibmm-2.4 glib/glibmm/ustring.h # compile glibmm/glib/glibmm/ustring.h
+# tools/test_scripts/testheaders.sh -I glib glibmm-2.60 gio # compile glibmm/gio/giomm/*.h
+# tools/test_scripts/testheaders.sh glibmm-2.60 glib gio # compile glibmm/glib/glibmm/*.h and glibmm/gio/giomm/*.h
+# tools/test_scripts/testheaders.sh -I glib -I gio glibmm-2.60 glib/glibmm/ustring.h # compile glibmm/glib/glibmm/ustring.h
# Usage: testheaders.sh [-I<dir>]... <pkg> [<dir> | <file>]...
# -I<dir> is added to the g++ command.
exit 1
}
+extra_gcc_args=-std=c++17
+
# Search for directories to include in CFLAGS.
idirs=""
while [ $# -gt 0 ]
for headerfile in $i/${i}mm/*.h
do
echo "=== $headerfile"
- g++ -c -x c++ -std=c++11 -o /dev/null $headerfile $CFLAGS
+ g++ -c -x c++ $extra_gcc_args -o /dev/null $headerfile $CFLAGS
done
else
echo "=== $i"
- g++ -c -x c++ -std=c++11 -o /dev/null $i $CFLAGS
+ g++ -c -x c++ $extra_gcc_args -o /dev/null $i $CFLAGS
fi
done