+++ /dev/null
-Makefile
-Makefile.in
-aclocal.m4
-autom4te.cache
-config.log
-config.status
-configure
-glibmm-2.4.pc
-glibmmconfig.h
-libtool
-stamp-h1
-*.os
-*.dylib
+2.12.5:
+
+Thu, 25 Jan 2007 23:13:05 +0100 Dodji Seketeli
+
+ * tools/m4/base.m4:
+ prefix the builting mkstemp with 'm4' because otherwise,
+ m4 1.4.8 recognizes it as a builtin macro and expands it, leading
+ to compilation errors on some distros.
+ This should fix #397167. Thanks to Daniel Elstner for spotting this.
+
+2.12.4:
+
+2006-11-28 Daniel Elstner <danielk@openismus.com>
+
+ * tools/pm/GtkDefs.pm (read_defs): Allow an empty pair of
+ parentheses in the innermost match. This fixes the problem of
+ gmmproc choking on "()" in the documentation strings. This would
+ still break on unmatched parentheses, though. Of course the
+ parser should just skip over quoted strings, but I wasn't able
+ to get that to work.
+ * glib/src/glib_enums.defs (GNormalizeMode): Manually fix the
+ improperly parsed value of G_NORMALIZE_NFD. Fortunately this
+ doesn't change anything since the "#error" token was interpreted
+ as zero, which happens to be the right value.
+ * glib/src/glib_functions.defs (g_iconv): Manually convert to
+ a function definition, as it was improperly parsed as a method
+ with a zero-length name (!) of object GIConv. This fixes the
+ annoying gmmproc warning about an allegedly unwrapped method.
+
+2006-11-27 Daniel Elstner <danielk@openismus.com>
+
+ * tools/enum.pl (parse): Ignore whitespace in front of an enum
+ typedef. This fixes parsing of HildonTelephoneEditorFormat in
+ hildon-libs.
+ * tools/pm/Enum.pm (parse_values): Check whether the enumeration
+ constants actually have a common module prefix before attempting
+ to remove it. This fixes the incorrect parsing of inconsistently
+ named enums in hildon-libs.
+
+2006-11-27 Daniel Elstner <danielk@openismus.com>
+
+ * tools/enum.pl (form_names): Break the loop if the length of the
+ common prefix reaches zero. This fixes the infinite loop when
+ processing the inconsistently named enumeration constants of the
+ Hildon libraries.
+
+2006-11-22 Oliver Nittka <oly@nittka.com>
+
+ * glib/src/value_basictypes.cc.m4: When registering float parameters,
+ use -G_MAXFLOAT instead of G_MINFLOAT. Since we first implemented this,
+ the glib documentation has been updated to make it clearer that this is
+ the real minimum and G_MINFLOAT is the minimum positive value.
+ Do the same for doubles too.
+
+2.12.3:
+
+2006-11-10 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/Makefile.am: Add enum.pl to the dist, so that it is in
+ tarballs. Someone saw it mentioned in the appendix, but could not
+ find it in the tarball.
+
+2006-11-10 Murray Cumming <murrayc@murrayc.com>
+
+ * docs/reference/Doxyfile.in: Add PREDEFINES for the optional API,
+ so that the documentation shows the regular API.
+
+2006-11-10 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/objectbase.cc:
+ * glib/glibmm/objectbase.h: Added connect_property_changed(),
+ as an alternative to use when the property proxies are not
+ available because GLIBMM_PROPERTIES_ENABLED is not defined.
+ SignalProxyProperty::connect(): Use notify::propertyname instead of
+ just notify, so do not have to check the property name later. This
+ should be more efficient (when this is used, rarely).
+ * glib/glibmm/propertyproxy_base.cc:
+ * glib/glibmm/propertyproxy_base.h: Move PropertyProxyConnectionNode
+ into the header, so we can reuse it for connect_property_changed().
+
+2006-10-01 Murray Cumming <murrayc@murrayc.com>
+
+ * Makefile.am:
+ * docs/Makefile.am:
+ * docs/Makefile_web.am_fragment:
+ * docs/images/Makefile.am:
+ * docs/reference/Makefile.am:
+ * docs/reference/README:
+ * examples/Makefile.am: Upload to the new hoster instead of to sourceforge.
+ Abstracted the host and path names into docs/Makefile_web.am_fragment to
+ avoid duplication.
+
+2006-10-04 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/class.cc:
+ * glib/src/iochannel.ccg:
+ * glib/src/markup.ccg: Add a silly line to avoid unused parameters
+ when GLIBMM_EXCEPTION_ENABLED is not set.
+ * glib/glibmm/error.h: Do not use G_GNU_NO_RETURN on the version
+ of throw_exception() that returns, to avoid a warning.
+
+2006-09-19 Ralf Stephan <ralf@ark.in-berlin.de>
+
+ * glib/glibmm/ustring.h:
+ ustring(const ustring& src, size_type i, size_type n=npos)
+ and
+ ustring(const char* src, size_type n) constructors:
+ In the reference documentation, mention explicitly that
+ n is the number of _UTF-8_ characters, rather than
+ ASCII characters (bytes).
+
+2.12.2:
+
+2006-09-28 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * MSVC_Net2003/glibmm/glibmm.vcproj: Remove sarray from list of
+ source and header files.
+
+2006-09-26 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmmconfig.h.in: For win32, define
+ GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS to 1,
+ instead of just defining it to nothing.
+ * scripts/reduced.m4: In the AC_ARG_ENABLE() to
+ define (or not) GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS,
+ use api-default-signal-handlers as the first parameter
+ instead of api-exceptions (a copy/paste error), though it does
+ not seem to make any difference.
+ Bug #357830.
+
+2.12.1:
+
+2006-09-14 Johannes Schmid <jhs@gnome.org>
+
+ * tools/m4/class_shared.m4: Change _IMPLEMENTS_INTERFACE to
+ _IMPLEMENTS_INTERFACE_CC so we can have more control over it,
+ by generating the _IMPLEMENTS_INTERFACE_CC from the WrapParser.pm.
+ * tools/m4/method.m4:
+ * tools/m4/signal.m4:
+ * tools/m4/vfunc.m4: Added optional parameters that result in
+ #ifdefs around methods, signals, vfuncs, etc.
+ * tools/pm/Output.pm: Addef ifdef() and endif().
+ output_wrap_vfunc_h(), output_wrap_vfunc_cc(),
+ output_wrap_default_signal_handler_h(),
+ output_wrap_default_signal_handler_cc(),
+ output_wrap_meth(),
+ output_wrap_create(),
+ output_wrap_sig_decl(): Support optional ifdefs around
+ declarations and implementations, by calling ifdef() and endif(),
+ or by passing the extra argument to the m4 macros.
+ * tools/pm/WrapParser.pm: parse_and_build_output():
+ Parse _IMPLEMENTS_INTERFACE, and call the new on_implements_interface()
+ method, which uses the new output_implements_interface() method,
+ so it can have an optional ifdef parameter.
+ on_wrap_method(), on_wrap_create(), on_wrap_vfunc(), output_wrap_signal(),
+ output_wrap_vfunc(): Handle the optional ifdef (with a parameter) option
+ for the _WRAP*() macros.
+
+ This adds support for disabling certain features by using the new
+ "ifdef" argument for methods, vfuncs, signals and interfaces.
+
+2006-08-18 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * MSVC_Net2003/*.vcproj: Updated for glibmm-2.12.
+
+2.12.0:
+
+2.11.3:
+
+2006-04-25 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in:
+ * glib/glibmmconfig.h.in:
+ * scripts/reduced.m4: Added a --enable-api-default-signal-handlers option. This defines
+ GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED, which is used to #ifdef default signal handlers.
+ This saves on library code size (less code and API symbols) and application code size and
+ loading time (less virtual methods, which must be imported and resolved at load time) and
+ per-object memory size (smaller object sizes because of less virtual methods.)
+ * tools/m4/class_interface.m4:
+ * tools/m4/class_shared.m4: Put default signal handler code in #ifdefs.
+
+2.11.2:
+
+2006-07-17 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in: Reverted the previous patch slightly to unbreak glibmmconfig.h.
+
+2.11.1:
+
+2006-07-16 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in: Quote GLIBMM_*_VERSION to avoid m4 warnings. Patch from
+ Bug #347076 from Kevin McBride.
+ * scripts/sun.m4: Quote GLIBMM_PROG_CXX_SUN to avoid an m4 warning.
+ Patch from Bug #347077 from Kevin McBride.
+
+2006-07-16 Jonathon Jongsma <jonathon.jongsma@gmail.com>
+
+ * glib/src/date.ccg: fix implementation of Glib::Date::set_time_current() so
+ that it doesn't set the date to Dec 31, 1969.
+
+2006-06-19 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/object.h: Check whether DestroyNotify is defined, so we can warn about
+ including X11/Xlib.h before this header, which will break things.
+ Bug #316726 from Mert Tugcu and Javeed Shaikh.
+
+2006-06-09 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * glib/glibmm/objectbase.h : Inline the set_property and
+ get_property methods. This is required by mingw32-gcc as
+ ObjectBase is explicitly dllexported.
+
+2006-06-05 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/src/convert.ccg: When using --enable-api-exception=no, only try to get the Glib::Error
+ when the GError is not null.
+
+2006-05-18 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/m4/method.m4: _METHOD(): When using errthrow, actually print the function call even if
+ the return type is 0.
+
+2006-05-16 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/m4/method.m4: _METHOD(), _STATIC_METHOD(): Remove spaces before dnl statements,
+ to avoid unwanted indentation in .cc files.
+
+2006-05-16 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/m4/convert_base.m4: _CONVERT(): If the return type is void, use the unconverted
+ statement, not no statement. This prevents some void methods from being totally empty.
+ This was a (very bad) regression introduced by the optional API changed.
+ Bug #341895 from Philip Langdale.
+ * tools/m4/method.m4: _METHOD(), _STATIC_METHOD(): Attempt to remove unnecessary newlines,
+ though some indenting spaces slipped in instead. Must fix that.
+
+2006-05-14 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/value.cc:
+ * glib/glibmm/value.h: Restored the init(GValue*) method that was lost when
+ merging changes from the glibmm-2-10 branch.
+
+2006-05-09 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/ustring.cc:
+ * glib/src/date.ccg:
+ * glib/src/convert.ccg:
+ * glib/src/convert.hg: Added #ifdefed versions for the case that
+ exceptions are disabled.
+
+2006-05-10 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in:
+ * scripts/reduced.m4: Moved --enable-deprecated-api macro into scripts/reduced.m4.
+ Added the --enable-api-exceptions macro that was missing from my last commit.
+
+2006-04-05 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in:
+ * scripts/reduced.m4: Added --enable-api-exceptions option. When this
+ is used, methods that would normally throw an exception will now take
+ an extra std::auto_ptr<Glib::Error> argument that should be checked with
+ auto_ptr::get().
+ * glib/glibmmconfig.h.in: Undef the GLIBMM_EXCEPTIONS_ENABLED,
+ so it will be defined.
+ * tools/m4/gerror.m4: throw_func() returns an auto_ptr of a
+ Glib::Error when exceptions are disabled.
+ * tools/m4/method.m4:
+ * tools/pm/Output.pm: on_wrap_method(): Added alternative API with
+ #ifdefs
+ * tools/m4/signal.m4:
+ * tools/m4/signalproxy_custom.m4:
+ * tools/m4/vfunc.m4: Put #ifdefs around the exception re-throwing
+ try/catch blocks.
+ * glib/glibmm/dispatcher.cc:
+ * glib/glibmm/dispatcher.h:
+ * glib/glibmm/error.cc:
+ * glib/glibmm/error.h:
+ * glib/glibmm/exceptionhandler.cc:
+ * glib/glibmm/exceptionhandler.h:
+ * glib/glibmm/main.cc:
+ * glib/glibmm/signalproxy.cc:
+ * glib/glibmm/streamiochannel.cc:
+ * glib/glibmm/stringutils.cc:
+ * glib/glibmm/threadpool.cc:
+ * glib/src/iochannel.ccg:
+ * glib/src/iochannel.hg:
+ * glib/src/markup.ccg:
+ * glib/src/spawn.ccg:
+ * glib/src/thread.ccg: Put #ifdefs around try/catch blocks, and
+ use alternative API when appropriate.
+ * examples/iochannel_stream/fdstream.cc:
+ * examples/markup/parser.cc:
+ * examples/options/main.cc: Adapted examples to
+ the alternative API, with #ifdefs
+ * tools/m4/convert_base.m4: Avoid any conversion if the result is
+ void, to allow _WRAP_METHOD() to ignore bool results, so we can
+ generate some methods that are currently hand-coded.
+
+2006-05-09 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/value.cc:
+ * glib/glibmm/value.h: Added init(const GValue*), so that we can copy GValue instances
+ of any type at runtime. Needed by libgdamm, which returns const GValue* instances.
+
+This is the HEAD branch, for API additions. See also the glibmm-2-10 branch.
+
+2.10.1:
+
+2006-04-12 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/m4/signalproxy_custom.m4: Remove this file because it is not installed and
+ does not seem to be used.
+
+2006-04-12 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/m4/signal.m4: Mark the (private) signal info callback functions as
+ static, to save on code size.
+
+2006-04-12 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/pm/WrapParser.pm: Parse a new optional constversion parameter for
+ _WRAP_METHOD(), to save on code size by just calling the non-const overload
+ instead of generating almost identical code.
+ * tools/m4/method.m4: _METHOD(): Take extra parameters for use when constversion is used.
+ * tools/pm/Output.pm: Send the extra parameters to _METHOD().
+ * docs/internal/using_gmmproc.txt: Documented the new constversion option.
+
+2006-04-12 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/main.cc:
+ * glib/glibmm/objectbase.cc:
+ * glib/glibmm/property.cc:
+ * glib/glibmm/ustring.cc:
+ * glib/glibmm/value_custom.cc:
+ * glib/src/spawn.ccg: Mark private functions as
+ static, to stop them being exported in the API, to reduce the
+ library code size slightly.
+ * tools/m4/signal.m4: Make generated callback functions static, for
+ the same reasons.
+
+2006-04-07 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * README.win32: Updated for Mingw-4.1.
+
+2006-04-06 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * MSVC_Net2003/*.vcproj: Embed the manifest file into executables
+ in the case of the Debug target.
+ * README.win32: Fixed a few typos.
+ * build_shared/Makefile_build.am_fragment: Add -DGLIBMM_BUILD to
+ the extra_defines compiler flags (switch between
+ dllexport/dllimport on win32).
+ * glib/glibmmconfig.h.in: Define GLIBMM_DLL when building with
+ mingw32/cygwin. This makes the GLIBMM_API tag (and GTKMM_API for
+ gtkmm) active with these two platforms, as required by bug
+ #309030.
+ * glib/glibmm/object.h, glib/glibmm/objectbase.h : Tag the Object
+ and ObjectBase classes with GLIBMM_API to make Visual Studio happy.
+
+2.10.0:
+
+2006-02-25 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/pm/DocsParser.pm: looklookup_documentation(): Put the
+ @deprecated text immediately after the main description, before
+ the parameters, so that Doxygen actually uses it.
+
+2006-02-25 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/pm/DocsParser.pm: looklookup_documentation(): Accept an
+ extra deprecated_documentation parameter, to be appended to the
+ Doxygen documentation.
+ * tools/pm/Output.pm: output_wrap_meth(): Put the documentation
+ inside the deprecation #ifdef, for neatness.
+ * tools/pm/WrapParser.pm: on_wrap_method(): Read an optional string
+ after the optional deprecated parameter, used to say why the
+ method is deprecated, in case it was not deprecated by the C API,
+ in which case it would already have documentation for this.
+
+2006-02-27 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * README.win32: Updated for glibmm-2.8 (MS Visual Studio 2005).
+ * glib/glibmm/ustring.h: Tag npos with GLIBMM_API, in order to
+ dllexport it on win32. Bug #332438.
+ * MSVC_Net2003/*.vcproj: Updated for Visual Studio 2005. Added the
+ /vd2 compiler flag (Bug #158040).
+ * MSVC_Net2003/glibmm.sln: Updated for Visual Studio 2005.
+ * MSVC_Net2003/gendef/gendef.cc: Redirect output of dumpbin to a
+ file.
+ * glib/glibmmconfig.h.in: Undefined
+ GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS for MSVC.
+
+2006-02-03 Murray Cumming <murrayc@murrayc.com>
+
+ * docs/internal/using_gmmproc.txt: Section about regenerating .defs:
+ Repeat the hint about extra_defs_gen here.
+
+2006-02-27 Cedric Gustin <cedric.gustin@gmail.com>
+
+ * glib/glibmm/ustring.h: Tag npos with GLIBMM_API, in order to
+ dllexport it on win32. Bug #332438.
+
+2006-02-07 Rob Page <page.rob@gmail.com>
+
+ * glib/glibmm/ustring.h: fix a typo in the documentation for uppercase()
+
+2.9.1:
+
+2006-01-28 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/src/optiongroup.ccg: add_entry_with_wrapper(): Copy the
+ CppOptionEntry into the map _after_ setting entry_ so that we
+ really delete it in release_c_arg(), to avoid a memory leak.
+
+2006-01-28 Rob Page <rob@gmail.com>
+
+ * docs/reference/glibmm_header.html_fragment: Fix the link
+ to the Main page. Bug #328299.
+
+2006-01-27 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/src/optionentry.ccg: Constructor: Avoid memory
+ leak caused by double instantiation of gobject_.
+
+2005-12-16 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/object.h:
+ * glib/glibmm/objectbase.h: Hide some internal stuff
+ from Doxygen. Add/Improve the Doxygen documentation.
+ * glib/src/convert.hg: Correct the declaration of
+ filename_display_name() to match the implementation.
+ Previously this would have been unusable due to a linker
+ error.
+
+2005-11-30 Murray Cumming <murrayc@murrayc.com>
+
+ * docs/reference/Doxyfile.in: Define the @newin aliases,
+ as in gtkmm.
+ * tools/pm/DocsParser.pm: Convert Since: in gtk-doc
+ text to @newin for our doxygen docs.
+
+2005-11-29 Murray Cumming <murrayc.com>
+
+ * build_shared/Makefile_build.am_fragment:
+ * configure.in: Added --enable-use-deprecations,
+ defaulting to no (do not check for them), so that
+ the tarball will still build when newer versions
+ of glib deprecate some API.
+ * examples/Makefile.am_fragment: Use the
+ deprecation, if wanted.
+
+2005-11-29 Murray Cumming <murrayc@murrayc.com>
+
+ * build_shared/Makefile_build.am_fragment:
+ * configure.in: Added --enable-deprecated-api
+ option. When set to disabled, it does not build
+ deprecated API. This reduces the size of the library,
+ and might be useful for embedded devices.
+ * glib/src/date.ccg:
+ * glib/src/date.hg: Use _DEPRECATE_IFDEF_START/END
+ around the deprecated set_time() method.
+
+2005-11-29 Murray Cumming <murrayc@murrayc.com>
+
+ * tools/m4/base.m4: Add
+ _DEPRECATE_IFDEF_START and _DEPRECATE_IFDEF_END
+ macros, to #ifdef-out generated methods.
+ Added _DEPRECATE_IFDEF_CLASS_START and
+ _DEPRECATE_IFDEF_CLASS_END for whole classes.
+ Put _DEPRECATE_IFDEF_CLASS* around all generated
+ code. It does nothing if the class is not deprecated.
+ * tools/m4/class_gtkobject.m4: Add _DEPRECATED macro,
+ used to mark a class as deprecated.
+ * tools/m4/method.m4: Take an extra parameter, to
+ optionally mark the method as deprecated, to add
+ #ifdefs around the code, with
+ _DEPRECATE_IFDEF_START/END
+ * tools/pm/Output.pm: _DEPRECATE_IFDEF_START/END
+ around the declarations of deprecated methods.
+ * tools/pm/WrapParser.pm: Check for an optional
+ deprecated parameter to _WRAP_METHOD().
+ * tools/m4/member.m4: Allow optional deprecated
+ method for _MEMBER_GET/SET*() to ifdef the code
+ out.
+ * tools/generate_wrap_init.pl.in: Put an #ifdef
+ around use of deprecated classes.
+
+2005-11-23 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in: Depend on glib 2.9, which
+ has new API.
+ * glib/src/date.ccg:
+ * glib/src/date.hg: Wrap glib_date_set_time_t()
+ and glib_date_set_time_val(). Deprecate
+ set_time(GTime) in favour of the new method
+ overloads. Added set_time_current(), wrapping the
+ case that the time_t is 0.
+
+This is the HEAD branch, for new API, targetting glib 2.9. See also the
+glibmm-2-8 branch.
+
+2.8.2:
+
+2005-11-23 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/glibmm/containers.h: Do not use g_assert() in
+ a header, because g++ sometimes warns that it has
+ no effect.
+
+2005-10-29 Murray Cumming <murrayc@murrayc.com>
+
+ * scripts/macros.m4: AL_PROG_GNU_MAKE():
+ Use $MAKE-make instead of $ac_make, which
+ apparently fixes a build problem on some
+ Solaris systems. Thanks to Mark Rouchal in
+ bug #307480.
+
+2.8.1:
+
+2005-10-19 Murray Cumming <murrayc@murrayc.com>
+
+ * configure.in: Check for glib 2.8. Bug #317913.
+
+2.8.0:
+
+Updated NEWS and increased version to 2.8.0.
+
+2.7.3:
+
+2005-08-17 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/src/glib_docs.xml: Regenerated with docextract_to_xml.py
+ * glib/src/glib_enums.defs: Regenerated with enums.pl
+ * glib/src/glib_functions.defs: Regenerated with h2defs.py
+
+2.7.2:
+
+2005-07-16 Murray Cumming <murrayc@murrayc.com
+
+ * glib/glibmm/miscutils.cc: Reimplemented build_filename() and
+ build_path() with the new non-vararg functions in glib 2.7,
+ instead of implementing them in gtkmm.
+ * glib/src/glib_enums.defs: Regenerated with enums.pl
+ * glib/src/optionentry.hg: Added FLAG_NO_ARG, FLAG_FILENAME,
+ FLAG_OPTIONAL_ARG, and FLAG_NOALIAS enum values.
+
+
+2.7.1:
+
+2005-06-08 Murray Cumming <murrayc@murrayc.com
+
+ * glib/glibmm/propertyproxy.h:
+ PropertyProxy_ReadOnly<>::get_value(),
+ PropertyProxy_WriteOnly<>::set_value(): Add implementations
+ instead of casting to unrelated PropertyProxy() and calling it
+ there. The AIX compiler did not like this hack. Bug #301610
+
+2005-06-07 Cedric Gustin <cedric.gustin@swing.be>
+
+ * glib/glibmm/miscutils.cc: In get_home_dir, return an empty
+ string when HOME is not defined (Win9x). Bug #306310 from Michael
+ Hofmann.
+ * glib/glibmm/miscutils.h: Updated docstring for the get_home_dir
+ method.
+
+2005-04-27 Murray Cumming <murrayc@murrayc.com>
+
+ * examples/child_watch/main.cc:
+ * examples/thread/dispatcher.cc:
+ * examples/thread/thread.cc:
+ * glib/glibmm/dispatcher.cc: Inherit signal handler objects from
+ sigc::trackable. This is necessary with some libsigc++ patches,
+ though not currently necessary with regular libsigc++.
+
+2005-04-22 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/src/gmodule_enums.defs: Regenerate with enums.pl
+ * glib/src/gmodule_functions.defs: Regenerate with h2defs.py
+ This adds the BIND_LOCAL enum value. Bug #172748 from
+ Phillip Neiswanger.
+
+2005-04-05 Murray Cumming <murrayc@murrayc.com>
+
+ * tool/pm/Output.pm: output_wrap_property(): Do not add the
+ const read-only method override if the property can not be read. Be
+ careful because this removes a little API from generated code. You
+ should hand-code the wrongly-generated methods and mark them as
+ deprecated.
+ * glib/glibmm/refptr.h: Added cast_const<>, like the existing
+ cast_dynamic<> and cast_static.
+
+2005-03-31 Murray Cumming <murrayc@murrayc.com>
+
+ * glib/src/glib_functions.defs: Updated with
+ h2defs.py.
+
+2005-03-13 Yair Hershkovitz <yairhr@gmail.com>
+
+ * glib/glibmm/main.h,
+ glib/glibmm/main.cc: Added MainContext::signal_child_watch()
+ * examples/: Added child_watch/ example
+
+2005-03-11 Yair Hershkovitz <yairhr@gmail.com>
+
+ * glib/glibmm/main.h, glib/glibmm/main.cc:
+ Add Glib::SignalChildWatch class, Glib::signal_child_watch()
+
+This is the HEAD branch, for new API. Bug fixes that do not change or add
+API should also be applied to the glibmm-2-6 branch.
+
+2005-03-09 Cedric Gustin <cedric.gustin@swing.be>
+
+ * MSVC_Net2003/Makefile.am: Add blank.cpp to EXTRA_DIST.
+ * MSVC_Net2003/glibmm/glibmm.vcproj: Remove sarray.cc from the
+ list of source files.
+ * MSVC_Net2003/examples/*/*.vcproj,
+ MSVC_Net2003/tests/glibmm_value/glibmmvalue.vcproj: Change name of
+ PDB file to $(OutDir)/$(TargetName).pdb.
+
2.6.1:
2005-03-07 Murray Cumming <murrayc@murrayc.com>
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
Installation Names
==================
-By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
+use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
./configure CC=/usr/local2/bin/gcc
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script). Here is a another example:
+
+ /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
`configure' Invocation
======================
ACLOCAL_AMFLAGS = -I scripts
-SUBDIRS = glibmm
+SUBDIRS = glibmm
DIST_SUBDIRS = $(SUBDIRS)
-EXTRA_DIST = build_shared/Makefile_build.am_fragment \
- build_shared/Makefile_build_gensrc.am_fragment \
- build_shared/Makefile_gensrc.am_fragment \
- build_shared/Makefile_gensrc_platform.am_fragment \
- build_shared/Makefile_build_extra.am_fragment \
- CHANGES glibmmconfig.h.in glibmm-2.4.pc.in
-
glibmm_includedir = $(includedir)/glibmm-2.4
glibmm_include_HEADERS = glibmm.h
all-local:
@echo "*** Everything completed ***"
+
+dist-hook:
+ @echo; echo; \
+ echo "**********************************************************"; \
+ echo "* IMPORTANT NOTICE: *"; \
+ echo "* *"; \
+ echo "* Be sure you have done a complete build before running *"; \
+ echo "* 'make dist' or 'make distcheck', because otherwise *"; \
+ echo "* the tarball will _not_ contain the dependency rules *"; \
+ echo "* generated by the compiler. *"; \
+ echo "**********************************************************"; \
+ echo; echo
+
+2.12.5:
+
+* Fix code generation when using the latest m4, and functions named
+ mkstemp, as experienced on Ubuntu Feisty.
+ Bug #397167 (Dodji Seketeli, Daniel Elstner)
+
+2.12.4:
+
+* gmmproc improvements:
+ - gmmproc: Allow () in property and signal documentation.
+ - gmmproc: Do not try to remove a common prefix from the
+ C enam values, if there is no common prefix.
+ - enum.pl: Allow whitespace in front of an enum typedef.
+ (Daniel Elstner)
+ - enum.pl: Fix an infinite loop.
+
+* Glib::Value: When registering float parameters, use
+ G_MAXFLOAT as the minimum, instead of G_MINFLOAT.
+ Likewise for doubles.
+ (Oliver Nittka)
+
+2.12.3:
+
+* ObjectBase: Added connect_property_changed(),
+ as an alternative to use when the property proxies are not
+ available because GLIBMM_PROPERTIES_ENABLED is not defined.
+ (Murray Cumming)
+* Documentation:
+ - Small ustring reference documentation improvement.
+ (Ralf Stephan)
+
+2.12.2
+
+*Build:
+ - Fix for api-default-signal-handlers option.
+ Bug #357830 (Matt Hoosier)
+ - win32: Remove unused source file from Visual Studio project.
+ (Cedric Gustin)
+
+2.12.1:
+
+* Support optional ifdef parameters in the .hg macros,
+ to allow, for instance the --enable-atk=no option,
+ to disable the build and use of the atkmm API,
+ for use in embedded environments.
+ (Johannes Schimd, Murray Cuming, Openismus)
+
+2.12.0:
+
+Changes sinze 2.10:
+* Added the --enable-api-default-signal-handlers option, for use in
+ embedded environments that have reduced resources. See configure --help
+ for the other subsets.
+* Value: Added init(const GValue*), so we can copy GValue instances
+ of any type at runtime. Needed by the new branch of libgdamm.
+
+2.11.3:
+
+* Build: Added the --enable-api-default-signal-handlers option, for use in
+ embedded environments that have reduced resources. See configure --help
+ for the other subsets.
+
+2.11.2:
+
+* Date: Fix implementation of Glib::Date::set_time_current() so
+ that it doesn't set the date to Dec 31, 1969.
+ (Jonathon Jongsma)
+* Value: Added init(const GValue*), so we can copy GValue instances
+ of any type at runtime. Needed by the new branch of libgdamm.
+ (Murray Cumming)
+* Added a #warning to warn about including X11/Xlib.h before a glibmm header,
+ which would break things. Bug #316726 from Mert Tugcu and Javeed Shaikh.
+ (Murray Cumming)
+* Build:
+ - Quote some m4 macros to avoid warnings. Bugs (with patches) #347076
+ and #347077
+ (Kevin McBride).
+ - Fix exporting of get/set_property() on mingw32-gcc.
+ (Cedric Gustin)
+
+
+
+
+2.10.1
+
+* Windows Build:
+ - Define GLIBMM_DLL when building with mingw32 or cygwin,
+ because it is needed by gtkmm. Bug #309030
+ (Cedric Gustin)
+* OptionGroup: Allow default values, by not initializing them all.
+ (Armin Burgmeier)
+* Slight code size reduction by marking private functions as static.
+ (Murray Cumming)
+
+2.10.0:
+
+* Windows Build:
+ - ustring.h: Tag npos with GLIBMM_API, in order to
+ dllexport it on win32. Bug #332438.
+ - Updated MSVC++ build files and README, for MS Visual Studio 2005.
+ (Cedric Gustin)
+* gmmproc code generator:
+ - WRAP_METHOD() Take an extra optional argument: deprecated deprecationtext -
+ so that we can insert the appropriate doxygen tag in the documentation, where
+ the C documentation does not do it for us.
+
+2.9.1:
+
+* Date:
+ - Added set_time(time_t), set_time(GTimeVal), and deprecated
+ set_time(GTime)
+ - Added set_time_current().
+ (Murray Cumming)
+* Build: Added --enable-deprecated-api option. When set to disabled,
+ it does not build deprecated API. This reduces the size of the
+ library, and might be useful for embedded devices.
+ (Murray Cumming)
+
+2.8.2:
+
+* Solaris build fix: Correct the detection
+ of make. (Mark Rouchal)
+
+2.8.1:
+
+* Build: Check for glib 2.8.
+
+2.8.0:
+
+API additions since glibmm 2.6:
+
+* GModule: Add BIND_LOCAL enum value.
+ (Bug #172748 from Phillip Neiswanger).
+* MainContext Added signal_child_watch()
+ and examples/child_watch.
+ (Yair Hershkovitz)
+* OptionEntry: Added FLAG_NO_ARG, FLAG_FILENAME,
+ FLAG_OPTIONAL_ARG, and FLAG_NOALIAS enum values.
+ (Murray Cumming)
+
+2.7.3:
+
+* Updated reference documentation from glib documentation.
+
+2.7.2:
+
+* OptionEntry: Added FLAG_NO_ARG, FLAG_FILENAME,
+ FLAG_OPTIONAL_ARG, and FLAG_NOALIAS enum values.
+* build_filename() and build_path(): Now use the implementation
+ from glib.
+
+2.7.1:
+
+* GModule: Add BIND_LOCAL enum value.
+ (Bug #172748 from Phillip Neiswanger).
+* MainContext Added signal_child_watch()
+ and examples/child_watch.
+ (Yair Hershkovitz)
+* Fixes from 2.6.2.
+
2.6.1:
* Interface::add_interface(): Disabled the check for a second call,
-This is the unstable version of gtkmm, aimed at Gtk+ 2.0.x.
-See CHANGES for a comparison with gtkmm 1.2.
+This is glibmm, a C++ API for parts of glib that are useful for C++.
+See http://www.gtkmm.org
-Contents:
-* Your unstable development environment
-* Required libraries:
-Your unstable development environment
--------------------------------------
-
-Until the GTK+ 2.0 / GNOME 2.0 platform is stable, you should try to separate these unstable libraries from your stable GTK+ 1.2 / GNOME 1.2/1.4 libraries. You can do this by installing the unstable libraries into a different prefix.
-e.g. ./configure --prefix=/usr/devgnome2
-
-When using the development libraries, you will need to modify some environment variables. This will be easier if you create a file (e.g. devgnome2) in your home directory that contains these commands:
-
-export PATH="/usr/devgnome2/bin:$PATH"; export LD_LIBRARY_PATH="/usr/devgnome2/lib" ; export PKG_CONFIG_PATH="/usr/devgnome2/lib/pkgconfig:$PKG_CONFIG_PATH" ;
-
-You can then type
-# source devgnome2
-to prepare your environment before building or working with the development libraries.
-
-You may also need to edit /etc/ld.so.conf to add /usr/devgnome2/lib, and then type /sbin/ldconfig to re-process the ld.so.conf.
-
-
-The vicious-build-scripts module in cvs.gnome.org might help you with this, if you can get it to work.
-
-Required Libraries
-------------------
-
-* Of course, you will need gtk+ 2 and its dependencies.
-* libsigc++ 1.2 (A release, or libsigc++-1.2 from cvs)
glibmm2.Merge([libraries['sigc2'], libraries['glib2']])
glibmm2.Append(CXXFLAGS='-DHAVE_CONFIG_H')
-#glibmm2.Append(CXXFLAGS='-DG_DISABLE_DEPRECATED')
+glibmm2.Append(CXXFLAGS='-DG_DISABLE_DEPRECATED')
glibmm2.Append(CXXFLAGS='-DG_LOG_DOMAIN=\\\"glibmm\\\"')
libglibmm2 = glibmm2.SharedLibrary('glibmm2', glibmm2_files)
# Version and initialization
#########################################################################
GLIBMM_MAJOR_VERSION=2
-GLIBMM_MINOR_VERSION=6
-GLIBMM_MICRO_VERSION=1
+GLIBMM_MINOR_VERSION=12
+GLIBMM_MICRO_VERSION=5
GLIBMM_VERSION=$GLIBMM_MAJOR_VERSION.$GLIBMM_MINOR_VERSION.$GLIBMM_MICRO_VERSION
GLIBMM_RELEASE=$GLIBMM_MAJOR_VERSION.$GLIBMM_MINOR_VERSION
-AC_DEFINE_UNQUOTED(GLIBMM_MAJOR_VERSION, $GLIBMM_MAJOR_VERSION)
-AC_DEFINE_UNQUOTED(GLIBMM_MINOR_VERSION, $GLIBMM_MINOR_VERSION)
-AC_DEFINE_UNQUOTED(GLIBMM_MICRO_VERSION, $GLIBMM_MICRO_VERSION)
+AC_DEFINE_UNQUOTED([GLIBMM_MAJOR_VERSION], $GLIBMM_MAJOR_VERSION, [Major Version])
+AC_DEFINE_UNQUOTED([GLIBMM_MINOR_VERSION], $GLIBMM_MINOR_VERSION, [Minor Version])
+AC_DEFINE_UNQUOTED([GLIBMM_MICRO_VERSION], $GLIBMM_MICRO_VERSION, [Micro Version])
AC_SUBST(GLIBMM_MAJOR_VERSION)
AC_SUBST(GLIBMM_MINOR_VERSION)
AC_SUBST(GLIBMM_MICRO_VERSION)
# ? :+1 : ? == just some internal changes, nothing breaks but might work
# better
# CURRENT : REVISION : AGE
-LIBGLIBMM_SO_VERSION=1:13:0
+LIBGLIBMM_SO_VERSION=1:24:0
AC_SUBST(LIBGLIBMM_SO_VERSION)
AC_CONFIG_AUX_DIR(scripts)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
+dnl Used for enabling the "-no-undefined" flag while generating DLLs
+dnl Copied from the official gtk+-2 configure.in
+AC_MSG_CHECKING([for some Win32 platform])
+case "$host" in
+ *-*-mingw*|*-*-cygwin*)
+ platform_win32=yes
+ ;;
+ *)
+ platform_win32=no
+ ;;
+esac
+AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
+
+AC_MSG_CHECKING([for native Win32])
+case "$host" in
+ *-*-mingw*)
+ os_win32=yes
+ ;;
+ *)
+ os_win32=no
+ ;;
+esac
+AC_MSG_RESULT([$os_win32])
+AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
+
AC_DISABLE_STATIC
+AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AL_PROG_GNU_M4(AC_MSG_ERROR([dnl
SUN make does not work for building gtkmm.
Please install GNU make.]))
-#########################################################################
-# Dependancy checks
-#########################################################################
-gtkmm_min_glib_version=2.6.0
-
-PKG_CHECK_MODULES(GLIBMM, glib-2.0 >= ${gtkmm_min_glib_version} gobject-2.0 >= ${gtkmm_min_glib_version} gmodule-2.0 >= ${gtkmm_min_glib_version})
-AC_SUBST(GLIBMM_CFLAGS)
-AC_SUBST(GLIBMM_LIBS)
-
-# gthread isn't a requirement, but we should use its CFLAGS if available.
-PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= ${gtkmm_min_glib_version},[],[GTHREAD_CFLAGS=''; GTHREAD_LIBS=''])
-AC_SUBST(GTHREAD_CFLAGS)
-AC_SUBST(GTHREAD_LIBS)
-
-
#########################################################################
# C++ checks
#########################################################################
AC_PROG_CXX
+# Check for the SUN Forte compiler, and define GLIBMM_COMPILER_SUN_FORTE in the header.
+GLIBMM_PROG_CXX_SUN
+
+# Ensure MSVC-compatible struct packing convention is used when
+# compiling for Win32 with gcc.
+# What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
+# gcc2 uses "-fnative-struct".
+if test x"$os_win32" = xyes; then
+ if test x"$GCC" = xyes -a x"$GXX" = xyes; then
+ msnative_struct=''
+ AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
+ if test -z "$ac_cv_prog_CC"; then
+ our_gcc="$CC"
+ else
+ our_gcc="$ac_cv_prog_CC"
+ fi
+ case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
+ 2.)
+ if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
+ msnative_struct='-fnative-struct'
+ fi
+ ;;
+ *)
+ if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
+ msnative_struct='-mms-bitfields'
+ fi
+ ;;
+ esac
+ if test x"$msnative_struct" = x ; then
+ AC_MSG_RESULT([no way])
+ AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
+ else
+ CXXFLAGS="$CXXFLAGS $msnative_struct"
+ AC_MSG_RESULT([${msnative_struct}])
+ fi
+ fi
+fi
+
AC_LANG_CPLUSPLUS
AC_CXX_BOOL(,config_error=yes)
GLIBMM_CXX_CAN_USE_NAMESPACES_INSIDE_EXTERNC()
GLIBMM_CXX_ALLOWS_STATIC_INLINE_NPOS()
+
# Check whether --enable-debug-refcounting was given.
GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING()
# Evaluate the --enable-warnings=level option.
GTKMM_ARG_ENABLE_WARNINGS()
+# Add an --enable-use-deprecations configure option:
+AC_ARG_ENABLE(deprecations,
+ [AC_HELP_STRING([--enable-use-deprecations],
+ [warn about deprecated usages [default=no]])],,
+ [enable_deprecations=no])
+
+if test "x$enable_use_deprecations" = "xyes"; then
+ DISABLE_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED"
+ AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
+fi
+
+#Offer the ability to omit some API from the library,
+#to reduce the code size:
+GLIBMM_ARG_ENABLE_API_DEPRECATED()
+GLIBMM_ARG_ENABLE_API_EXCEPTIONS()
+GLIBMM_ARG_ENABLE_API_PROPERTIES()
+GLIBMM_ARG_ENABLE_API_VFUNCS()
+
+# Offer the ability to omit some API from the library,
+# to reduce the code size:
+GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS()
+
# Dummy conditional just to make automake-1.4 happy.
# We need an always-false condition in docs/Makefile.am.
AM_CONDITIONAL(GTKMM_FALSE,[false])
# maintainer-mode rules. That would fail since we aren't using autoheader.
AUTOHEADER=':'
+
AC_CONFIG_FILES([
Makefile
+++ /dev/null
-Makefile
-Makefile.in
-*.os
## Copyright (c) 2001
## The gtkmm development team.
-SUBDIRS =
+SUBDIRS = private
sublib_name = glibmm
sublib_libname = glibmm-2.4
sublib_cflags = $(GLIBMM_CFLAGS)
sublib_files_extra_posix_cc =
+sublib_files_extra_win32_cc =
-sublib_files_general_cc = \
+sublib_files_extra_general_cc = \
class.cc \
containers.cc \
debug.cc \
value_custom.cc \
wrap.cc
-sublib_files_posix_h =
+sublib_files_extra_posix_h =
+sublib_files_extra_win32_h =
-sublib_files_general_h = \
+sublib_files_extra_general_h = \
arrayhandle.h \
class.h \
containerhandle_shared.h \
value_custom.h \
wrap.h
-files_built_general_cc = value_basictypes.cc
-files_built_general_h = signalproxy.h value_basictypes.h
+files_built_general_cc += value_basictypes.cc
+files_built_general_h += signalproxy.h value_basictypes.h
lib_LTLIBRARIES = libglibmm-2.4.la
+if OS_WIN32
+libglibmm_2_4_la_SOURCES = $(files_all_general_cc) $(files_all_win32_cc)
+else
libglibmm_2_4_la_SOURCES = $(files_all_general_cc) $(files_all_posix_cc)
+endif
libglibmm_2_4_la_LDFLAGS = $(common_ldflags)
libglibmm_2_4_la_LIBADD = $(GLIBMM_LIBS)
// the vfunc and default signal handler callbacks.
(*self->class_init_func_)(g_class, 0);
+#ifdef GLIBMM_PROPERTIES_ENABLED
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;
+#endif //GLIBMM_PROPERTIES_ENABLED
}
} // namespace Glib
*/
#include <glib-object.h>
+#include <glibmmconfig.h> //Include this here so that the /private/*.h classes have access to GLIBMM_VFUNCS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
reference operator*() const
{
- g_assert(node_);
+ //g++ complains that this statement has no effect: g_assert(node_);
return reinterpret_cast<T&>( node_ ? node_->data : glibmm_null_pointer );
}
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/convert.h>
#include <glibmm/private/convert_p.h>
{
if(gobject_ == reinterpret_cast<GIConv>(-1))
{
- GError* error = 0;
+ GError* gerror = 0;
// Abuse g_convert() to create a GError object. This may seem a weird
// thing to do, but it gives us consistently translated error messages
// at no further cost.
- g_convert("", 0, to_codeset.c_str(), from_codeset.c_str(), 0, 0, &error);
+ g_convert("", 0, to_codeset.c_str(), from_codeset.c_str(), 0, 0, &gerror);
// If this should ever fail we're fucked.
- g_assert(error != 0);
+ g_assert(gerror != 0);
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
g_iconv(gobject_, 0, &inbytes_left, &outbuf, &outbytes_left);
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string IConv::convert(const std::string& str)
+#else
+std::string IConv::convert(const std::string& str, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_convert_with_iconv(
- str.data(), str.size(), gobject_, 0, &bytes_written, &error);
+ str.data(), str.size(), gobject_, 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}
return is_utf8;
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert(const std::string& str,
const std::string& to_codeset,
const std::string& from_codeset)
+#else
+std::string convert(const std::string& str,
+ const std::string& to_codeset,
+ const std::string& from_codeset, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_convert(
str.data(), str.size(), to_codeset.c_str(), from_codeset.c_str(),
- 0, &bytes_written, &error);
+ 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert_with_fallback(const std::string& str,
const std::string& to_codeset,
const std::string& from_codeset)
+#else
+std::string convert_with_fallback(const std::string& str,
+ const std::string& to_codeset,
+ const std::string& from_codeset, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_convert_with_fallback(
str.data(), str.size(), to_codeset.c_str(), from_codeset.c_str(), 0,
- 0, &bytes_written, &error);
+ 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert_with_fallback(const std::string& str,
const std::string& to_codeset,
const std::string& from_codeset,
const Glib::ustring& fallback)
+#else
+std::string convert_with_fallback(const std::string& str,
+ const std::string& to_codeset,
+ const std::string& from_codeset,
+ const Glib::ustring& fallback, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_convert_with_fallback(
str.data(), str.size(), to_codeset.c_str(), from_codeset.c_str(),
- const_cast<char*>(fallback.c_str()), 0, &bytes_written, &error);
+ const_cast<char*>(fallback.c_str()), 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring locale_to_utf8(const std::string& opsys_string)
+#else
+Glib::ustring locale_to_utf8(const std::string& opsys_string, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_locale_to_utf8(
- opsys_string.data(), opsys_string.size(), 0, &bytes_written, &error);
+ opsys_string.data(), opsys_string.size(), 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
const ScopedPtr<char> scoped_buf (buf);
return Glib::ustring(scoped_buf.get(), scoped_buf.get() + bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string locale_from_utf8(const Glib::ustring& utf8_string)
+#else
+std::string locale_from_utf8(const Glib::ustring& utf8_string, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_locale_from_utf8(
- utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &error);
+ utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring filename_to_utf8(const std::string& opsys_string)
+#else
+Glib::ustring filename_to_utf8(const std::string& opsys_string, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_filename_to_utf8(
- opsys_string.data(), opsys_string.size(), 0, &bytes_written, &error);
+ opsys_string.data(), opsys_string.size(), 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
const ScopedPtr<char> scoped_buf (buf);
return Glib::ustring(scoped_buf.get(), scoped_buf.get() + bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string filename_from_utf8(const Glib::ustring& utf8_string)
+#else
+std::string filename_from_utf8(const Glib::ustring& utf8_string, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
- GError* error = 0;
+ GError* gerror = 0;
char *const buf = g_filename_from_utf8(
- utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &error);
+ utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname)
+#else
+std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
char* hostname_buf = 0;
- GError* error = 0;
+ GError* gerror = 0;
- char *const buf = g_filename_from_uri(uri.c_str(), &hostname_buf, &error);
+ char *const buf = g_filename_from_uri(uri.c_str(), &hostname_buf, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
// Let's take ownership at this point.
const ScopedPtr<char> scoped_buf (buf);
return std::string(scoped_buf.get());
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string filename_from_uri(const Glib::ustring& uri)
+#else
+std::string filename_from_uri(const Glib::ustring& uri, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
- GError* error = 0;
- char *const buf = g_filename_from_uri(uri.c_str(), 0, &error);
+ GError* gerror = 0;
+ char *const buf = g_filename_from_uri(uri.c_str(), 0, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return std::string(ScopedPtr<char>(buf).get());
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& hostname)
+#else
+Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& hostname, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
- GError* error = 0;
- char *const buf = g_filename_to_uri(filename.c_str(), hostname.c_str(), &error);
+ GError* gerror = 0;
+ char *const buf = g_filename_to_uri(filename.c_str(), hostname.c_str(), &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return Glib::ustring(ScopedPtr<char>(buf).get());
}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring filename_to_uri(const std::string& filename)
+#else
+Glib::ustring filename_to_uri(const std::string& filename, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
- GError* error = 0;
- char *const buf = g_filename_to_uri(filename.c_str(), 0, &error);
+ GError* gerror = 0;
+ char *const buf = g_filename_to_uri(filename.c_str(), 0, &gerror);
- if(error)
- Error::throw_exception(error);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror) ::Glib::Error::throw_exception(gerror);
+ #else
+ if(gerror) error = ::Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return Glib::ustring(ScopedPtr<char>(buf).get());
}
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::ConvertError::throw_func(GError* gobject)
{
throw Glib::ConvertError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::ConvertError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::ConvertError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
* @return The converted string.
* @throw Glib::ConvertError
*/
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert(const std::string& str);
+ #else
+ std::string convert(const std::string& str, std::auto_ptr<Glib::Error>& error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
GIConv gobj() { return gobject_; }
* @return The converted string.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert(const std::string& str,
const std::string& to_codeset,
const std::string& from_codeset);
+#else
+std::string convert(const std::string& str,
+ const std::string& to_codeset,
+ const std::string& from_codeset, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts a string from one character set to another, possibly including
* fallback sequences for characters not representable in the output.
* @return The converted string.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert_with_fallback(const std::string& str,
const std::string& to_codeset,
const std::string& from_codeset);
+#else
+std::string convert_with_fallback(const std::string& str,
+ const std::string& to_codeset,
+ const std::string& from_codeset, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts a string from one character set to another, possibly including
* fallback sequences for characters not representable in the output.
* @return The converted string.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string convert_with_fallback(const std::string& str,
const std::string& to_codeset,
const std::string& from_codeset,
const Glib::ustring& fallback);
+#else
+std::string convert_with_fallback(const std::string& str,
+ const std::string& to_codeset,
+ const std::string& from_codeset,
+ const Glib::ustring& fallback, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Convert from the current locale's encoding to UTF-8.
* Convenience wrapper around Glib::convert().
* @return The input string converted to UTF-8 encoding.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring locale_to_utf8(const std::string& opsys_string);
+#else
+Glib::ustring locale_to_utf8(const std::string& opsys_string, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Convert from UTF-8 to the current locale's encoding.
* Convenience wrapper around Glib::convert().
* system's current locale.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string locale_from_utf8(const Glib::ustring& utf8_string);
+#else
+std::string locale_from_utf8(const Glib::ustring& utf8_string, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts a string which is in the encoding used for filenames into
* a UTF-8 string.
* @return The converted string.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring filename_to_utf8(const std::string& opsys_string);
+#else
+Glib::ustring filename_to_utf8(const std::string& opsys_string, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts a string from UTF-8 to the encoding used for filenames.
* @param utf8_string A UTF-8 encoded string.
* @return The converted string.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string filename_from_utf8(const Glib::ustring& utf8_string);
+#else
+std::string filename_from_utf8(const Glib::ustring& utf8_string, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts an escaped UTF-8 encoded URI to a local filename
* in the encoding used for filenames.
* @return The resulting filename.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname);
+#else
+std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts an escaped UTF-8 encoded URI to a local filename in the encoding
* used for filenames.
* @return The resulting filename.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
std::string filename_from_uri(const Glib::ustring& uri);
+#else
+std::string filename_from_uri(const Glib::ustring& uri, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts an absolute filename to an escaped UTF-8 encoded URI.
* @param filename An absolute filename specified in the encoding used
* @return The resulting URI.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& hostname);
+#else
+Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& hostname, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Converts an absolute filename to an escaped UTF-8 encoded URI.
* @param filename An absolute filename specified in the encoding used
* @return The resulting URI.
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring filename_to_uri(const std::string& filename);
+#else
+Glib::ustring filename_to_uri(const std::string& filename, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Returns the display basename for the particular filename, guaranteed
* to be valid UTF-8. The display name might not be identical to the filename,
* @param filename: a pathname hopefully in the GLib file name encoding
* @result A string containing a rendition of the filename in valid UTF-8.
*/
-Glib::ustring filename_display_name(const Glib::ustring& filename);
+Glib::ustring filename_display_name(const std::string& filename);
/** @} group CharsetConv */
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/date.h>
#include <glibmm/private/date_p.h>
#include <ctime>
#include <algorithm>
+
#include <glibmm/convert.h>
#include <glibmm/utility.h>
#include <glibmmconfig.h>
GLIBMM_USING_STD(max)
-
namespace Glib
{
g_date_set_parse(&gobject_, str.c_str());
}
+#ifndef GLIBMM_DISABLE_DEPRECATED
+
void Date::set_time(GTime time)
{
+ //This method, and the C function that it wraps, are deprecated.
g_date_set_time(&gobject_, time);
}
+#endif // GLIBMM_DISABLE_DEPRECATED
+
+
+void Date::set_time(time_t timet)
+{
+ g_date_set_time_t(&gobject_, timet);
+}
+
+void Date::set_time_current()
+{
+ //As suggested in the C documentation:
+ g_date_set_time_t(&gobject_, time(NULL));
+}
+
+void Date::set_time(const GTimeVal& timeval)
+{
+ g_date_set_time_val(&gobject_, const_cast<GTimeVal*>(&timeval));
+}
void Date::set_month(Date::Month month)
{
struct tm tm_data;
g_date_to_struct_tm(&gobject_, &tm_data);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
const std::string locale_format = locale_from_utf8(format);
+ #else
+ std::auto_ptr<Glib::Error> error; //TODO: Check it?
+ const std::string locale_format = locale_from_utf8(format, error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
gsize bufsize = std::max<gsize>(2 * locale_format.size(), 128);
do
if(len != 0 || buf.get()[0] == '\0')
{
g_assert(len < bufsize);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
return locale_to_utf8(std::string(buf.get(), len));
+ #else
+ std::auto_ptr<Glib::Error> error; //TODO: Check it?
+ return locale_to_utf8(std::string(buf.get(), len), error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
while((bufsize *= 2) <= 65536);
*/
+ #undef G_DISABLE_DEPRECATED //So we can use deprecated functions in our deprecated methods.
+
#include <glibmm/ustring.h>
#include <glib/gdate.h>
extern "C" { struct tm; }
#endif
-
namespace Glib
{
*/
void set_parse (const Glib::ustring& str);
- //TODO: Add set_time_current() - see the docs comment below.?
+ #ifndef GLIBMM_DISABLE_DEPRECATED
+
/** Sets the value of a date from a GTime (time_t) value.
- * To set the value of a date to the current day, you could write:
- *
- *set_time(time(NULL));
*
* @param time GTime value to set.
+ *
+ * @deprecated Please use set_time(time_t) or set_time(const GTimeVal&).
*/
void set_time(GTime time);
+ #endif // GLIBMM_DISABLE_DEPRECATED
+
+
+ /** Sets the value of a date from a <type>time_t</type> value.
+ *
+ * @param timet time_t value to set
+ *
+ * @see set_time_current()
+ *
+ * Since: 2.10
+ */
+ void set_time(time_t timet);
+
+ /** Sets the value of a date from a GTimeVal value. Note that the
+ * tv_usec member is ignored, because Glib::Date can't make use of the
+ * additional precision.
+ *
+ * @see set_time_current()
+ *
+ * @param timeval GTimeVal value to set
+ *
+ * Since: 2.10
+ */
+ void set_time(const GTimeVal& timeval);
+
+ void set_time_current();
/** Sets the month of the year. If the resulting day-month-year triplet is invalid, the date will be invalid.
* @param month Month to set.
namespace Glib
{
-class DispatchNotifier
+class DispatchNotifier : public sigc::trackable
{
public:
~DispatchNotifier();
{
create_pipe();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
#ifdef G_OS_WIN32
conn_io_handler_ = context_->signal_io().connect(
sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler),
sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler),
fd_receiver_, Glib::IO_IN);
#endif /* !G_OS_WIN32 */
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
throw;
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
DispatchNotifier::~DispatchNotifier()
if(!fd_receiver_)
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
GError* const error = g_error_new(G_FILE_ERROR, G_FILE_ERROR_FAILED,
"Failed to create event for inter-thread communication: %s",
g_win32_error_message(GetLastError()));
throw Glib::FileError(error);
+#else
+ return; //TODO: Provide an alternative to the exception.
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+
#else /* !G_OS_WIN32 */
int filedes[2] = { -1, -1 };
if(pipe(filedes) < 0)
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
GError* const error = g_error_new(G_FILE_ERROR, g_file_error_from_errno(errno),
"Failed to create pipe for inter-thread communication: %s",
g_strerror(errno));
throw Glib::FileError(error);
+#else
+ return; //TODO: Provide an alternative to the exception.
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
fd_set_close_on_exec(filedes[0]);
// 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.
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
data.dispatcher->signal_();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
#else /* !G_OS_WIN32 */
DispatchNotifyData data;
// 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.
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
data.dispatcher->signal_(); // emit
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
#endif /* !G_OS_WIN32 */
return true;
* @throw Glib::FileError
*/
Dispatcher();
+
/** Create new Dispatcher instance using an arbitrary main context.
* @throw Glib::FileError
*/
GLIBMM_USING_STD(map)
-
namespace
{
gobject_ = 0;
}
-
// static
void Error::register_init()
{
(*throw_func_table)[domain] = throw_func;
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
// static, noreturn
void Error::throw_exception(GError* gobject)
+#else
+std::auto_ptr<Glib::Error> Error::throw_exception(GError* gobject)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
g_assert(gobject != 0);
if(const ThrowFunc throw_func = (*throw_func_table)[gobject->domain])
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
(*throw_func)(gobject);
+ #else
+ return (*throw_func)(gobject);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
g_assert_not_reached();
}
"unknown error domain '%s': throwing generic Glib::Error exception\n",
(gobject->domain) ? g_quark_to_string(gobject->domain) : "(null)");
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
// Doesn't copy, because error-returning functions return a newly allocated GError for us.
throw Glib::Error(gobject);
+#else
+ return std::auto_ptr<Glib::Error>(new Glib::Error(gobject));
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+
} // namespace Glib
#include <glib/gquark.h>
#include <glibmm/exception.h>
+#include <glibmmconfig.h> //For GLIBMM_EXCEPTIONS_ENABLED
+
+#ifndef GLIBMM_EXCEPTIONS_ENABLED
+//When not usinge exceptions, we pass auto_ptrs of the exceptions objects around instead.
+#include <memory> //For std::auto_ptr
+#endif
namespace Glib
void propagate(GError** dest);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
typedef void (* ThrowFunc) (GError*);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ typedef std::auto_ptr<Glib::Error> (* ThrowFunc) (GError*);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
static void register_init();
static void register_cleanup();
static void register_domain(GQuark domain, ThrowFunc throw_func);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_exception(GError* gobject) G_GNUC_NORETURN;
+#else
+ static std::auto_ptr<Glib::Error> throw_exception(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
GLIBMM_USING_STD(exception)
GLIBMM_USING_STD(list)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
namespace
{
} // namespace Glib
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+
*/
#include <sigc++/sigc++.h>
+#include <glibmmconfig.h>
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
namespace Glib
{
} // namespace Glib
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#endif /* _GLIBMM_EXCEPTIONHANDLER_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/fileutils.h>
#include <glibmm/private/fileutils_p.h>
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::FileError::throw_func(GError* gobject)
{
throw Glib::FileError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::FileError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::FileError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/iochannel.h>
#include <glibmm/private/iochannel_p.h>
}
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::RefPtr<IOChannel> IOChannel::create_from_file(const std::string& filename, const std::string& mode)
+#else
+Glib::RefPtr<IOChannel> IOChannel::create_from_file(const std::string& filename, const std::string& mode, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
- GError* error = 0;
- GIOChannel *const channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &error);
+ GError* gerror = 0;
+ GIOChannel *const channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror);
- if(error)
- Glib::Error::throw_exception(error);
+ if(gerror)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::Error::throw_exception(gerror);
+ #else
+ error = Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
return Glib::wrap(channel, false);
}
#endif /* G_OS_WIN32 */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::write(const Glib::ustring& str)
+#else
+IOStatus IOChannel::write(const Glib::ustring& str, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
gsize bytes_written = 0;
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
return write(str.data(), str.bytes(), bytes_written);
+#else
+ return write(str.data(), str.bytes(), bytes_written, error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::read_line(Glib::ustring& line)
+#else
+IOStatus IOChannel::read_line(Glib::ustring& line, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::ScopedPtr<char> buf;
- GError* error = 0;
+ GError* gerror = 0;
gsize bytes = 0;
- const GIOStatus status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &error);
+ const GIOStatus status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror);
- if(error)
- Glib::Error::throw_exception(error);
+ if(gerror)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::Error::throw_exception(gerror);
+ #else
+ error = Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
if(buf.get())
line.assign(buf.get(), buf.get() + bytes);
return (IOStatus) status;
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::read_to_end(Glib::ustring& str)
+#else
+IOStatus IOChannel::read_to_end(Glib::ustring& str, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::ScopedPtr<char> buf;
- GError* error = 0;
+ GError* gerror = 0;
gsize bytes = 0;
- const GIOStatus status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &error);
+ const GIOStatus status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror);
- if(error)
- Glib::Error::throw_exception(error);
+ if(gerror)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::Error::throw_exception(gerror);
+ #else
+ error = Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
if(buf.get())
str.assign(buf.get(), buf.get() + bytes);
return (IOStatus) status;
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::read(Glib::ustring& str, gsize count)
+#else
+IOStatus IOChannel::read(Glib::ustring& str, gsize count, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
Glib::ScopedPtr<char> buf (g_new(char, count));
- GError* error = 0;
+ GError* gerror = 0;
gsize bytes = 0;
- const GIOStatus status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &error);
+ const GIOStatus status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror);
- if(error)
- Glib::Error::throw_exception(error);
+ if(gerror)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::Error::throw_exception(gerror);
+ #else
+ error = Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
if(buf.get())
str.assign(buf.get(), buf.get() + bytes);
return (IOStatus) status;
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::set_encoding(const std::string& encoding)
+#else
+IOStatus IOChannel::set_encoding(const std::string& encoding, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
- GError* error = 0;
+ GError* gerror = 0;
const GIOStatus status = g_io_channel_set_encoding(
- gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &error);
+ gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &gerror);
- if(error)
- Glib::Error::throw_exception(error);
+ if(gerror)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::Error::throw_exception(gerror);
+ #else
+ error = Glib::Error::throw_exception(gerror);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
return (IOStatus) status;
}
GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
gsize* bytes_read, GError** err)
{
+ if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return (GIOStatus) wrapper->read_vfunc(buf, count, *bytes_read);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Error& error)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return G_IO_STATUS_ERROR;
}
GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count,
gsize* bytes_written, GError** err)
{
+ if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return (GIOStatus) wrapper->write_vfunc(buf, count, *bytes_written);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Error& error)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return G_IO_STATUS_ERROR;
}
// static
GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err)
{
+ if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return (GIOStatus) wrapper->seek_vfunc(offset, (SeekType) type);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Error& error)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return G_IO_STATUS_ERROR;
}
// static
GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err)
{
+ if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return (GIOStatus) wrapper->close_vfunc();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Error& error)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
return G_IO_STATUS_ERROR;
}
{
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
const Glib::RefPtr<Source> source = wrapper->create_watch_vfunc((IOCondition) condition);
return (source) ? source->gobj_copy() : 0;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
}
// static
GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err)
{
+ if(!&err) err = err; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return (GIOStatus) wrapper->set_flags_vfunc((IOFlags) flags);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Error& error)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return G_IO_STATUS_ERROR;
}
{
IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return (GIOFlags) wrapper->get_flags_vfunc();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return GIOFlags(0);
}
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::IOChannelError::throw_func(GError* gobject)
{
throw Glib::IOChannelError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::IOChannelError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::IOChannelError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
namespace Glib
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::read(gunichar& unichar)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_read_unichar(gobj(), &(unichar), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::read(gunichar& unichar, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_read_unichar(gobj(), &(unichar), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::read(char* buf, gsize count, gsize& bytes_read)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_read_chars(gobj(), buf, count, &(bytes_read), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::read(char* buf, gsize count, gsize& bytes_read, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_read_chars(gobj(), buf, count, &(bytes_read), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::write(const char* buf, gssize count, gsize& bytes_written)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_write_chars(gobj(), buf, count, &(bytes_written), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::write(const char* buf, gssize count, gsize& bytes_written, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_write_chars(gobj(), buf, count, &(bytes_written), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::write(gunichar unichar)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_write_unichar(gobj(), unichar, &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::write(gunichar unichar, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_write_unichar(gobj(), unichar, &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::seek(gint64 offset, SeekType type)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_seek_position(gobj(), offset, ((GSeekType)(type)), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::seek(gint64 offset, SeekType type, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_seek_position(gobj(), offset, ((GSeekType)(type)), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::flush()
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_flush(gobj(), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::flush(std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_flush(gobj(), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::close(bool flush)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_shutdown(gobj(), static_cast<int>(flush), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::close(bool flush, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_shutdown(gobj(), static_cast<int>(flush), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
gsize IOChannel::get_buffer_size() const
void IOChannel::set_buffer_size(gsize size)
{
- g_io_channel_set_buffer_size(gobj(), size);
+g_io_channel_set_buffer_size(gobj(), size);
}
IOFlags IOChannel::get_flags() const
return ((IOFlags)(g_io_channel_get_flags(const_cast<GIOChannel*>(gobj()))));
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus IOChannel::set_flags(IOFlags flags)
-{
- GError *error = 0;
- IOStatus retvalue = ((IOStatus)(g_io_channel_set_flags(gobj(), ((GIOFlags)(flags)), &(error))));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+IOStatus IOChannel::set_flags(IOFlags flags, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ IOStatus retvalue = ((IOStatus)(g_io_channel_set_flags(gobj(), ((GIOFlags)(flags)), &(gerror))));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
void IOChannel::set_buffered(bool buffered)
{
- g_io_channel_set_buffered(gobj(), static_cast<int>(buffered));
+g_io_channel_set_buffered(gobj(), static_cast<int>(buffered));
}
bool IOChannel::get_buffered() const
void IOChannel::set_close_on_unref(bool do_close)
{
- g_io_channel_set_close_on_unref(gobj(), static_cast<int>(do_close));
+g_io_channel_set_close_on_unref(gobj(), static_cast<int>(do_close));
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
* @return An IOChannel for the opened file.
* @throw Glib::FileError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<IOChannel> create_from_file(const std::string& filename, const std::string& mode);
+#else
+ static Glib::RefPtr<IOChannel> create_from_file(const std::string& filename, const std::string& mode, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Creates an I/O channel from a file descriptor.
* or G::IOChannelError.
* @return A G::IOStatus.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus read(gunichar& unichar);
+#else
+ IOStatus read(gunichar& unichar, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Read a character sequence into memory.
* @param buf A buffer to read data into.
* or G::IOChannelError.
* @return The status of the operation.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus read(char* buf, gsize count, gsize& bytes_read);
+#else
+ IOStatus read(char* buf, gsize count, gsize& bytes_read, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Read a maximum of @a count bytes into @a str.
* @param count The maximum number of bytes to read.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus read(Glib::ustring& str, gsize count);
+#else
+ IOStatus read(Glib::ustring& str, gsize count, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Read a whole line.
* Reads until the line separator is found, which is included
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus read_line(Glib::ustring& line);
+#else
+ IOStatus read_line(Glib::ustring& line, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Reads all the remaining data from the file.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus read_to_end(Glib::ustring& str);
+#else
+ IOStatus read_to_end(Glib::ustring& str, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Write a string to the I/O channel.
* @throw Glib::IOChannelError
* @throw Glib::ConvertError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus write(const Glib::ustring& str);
+#else
+ IOStatus write(const Glib::ustring& str, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Write a memory area of @a count bytes to the I/O channel.
* @param buf The start of the memory area.
* or G::IOChannelError.
* @return The status of the operation.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus write(const char* buf, gssize count, gsize& bytes_written);
+#else
+ IOStatus write(const char* buf, gssize count, gsize& bytes_written, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Write a single UCS-4 character to the I/O channel.
* @param unichar The character to write.
* or G::IOChannelError.
* @return A G::IOStatus.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus write(gunichar unichar);
+#else
+ IOStatus write(gunichar unichar, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Seek the I/O channel to a specific position.
* @param offset The offset in bytes from the position specified by @a type.
* @param error A location to return an error of type G::IOChannelError.
* @return The status of the operation.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus seek(gint64 offset, SeekType type = SEEK_TYPE_SET);
+#else
+ IOStatus seek(gint64 offset, SeekType type, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Flush the buffers of the I/O channel.
* @return The status of the operation.
* G::IO_CHANNEL_NORMAL, G::IO_CHANNEL_AGAIN, or
* G::IO_CHANNEL_ERROR.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus flush();
+#else
+ IOStatus flush(std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Close the I/O channel.
* Any pending data to be written will be flushed if @a flush is <tt>true</tt>.
* @param err Location to store a G::IOChannelError.
* @return The status of the operation.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus close(bool flush = true);
+#else
+ IOStatus close(bool flush, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Get the IOChannel internal buffer size.
* @return The buffer size.
* @param error A location to return an error of type G::IOChannelError.
* @return The status of the operation.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus set_flags(IOFlags flags);
+#else
+ IOStatus set_flags(IOFlags flags, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
/** Set the buffering status of the I/O channel.
* The buffering state can only be set if the channel's encoding is
* @return Glib::IO_STATUS_NORMAL if the encoding was successfully set.
* @throw Glib::IOChannelError
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
IOStatus set_encoding(const std::string& encoding = std::string());
+#else
+ IOStatus set_encoding(const std::string& encoding, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
/** Get the encoding of the I/O channel.
{
SourceConnectionNode *const conn_data = static_cast<SourceConnectionNode*>(data);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
// Recreate the specific slot from the generic slot node.
return (*static_cast<sigc::slot<bool>*>(conn_data->get_slot()))();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
}
SourceCallbackData *const callback_data = static_cast<SourceCallbackData*>(data);
g_return_val_if_fail(callback_data->node != 0, 0);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
// 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);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ return 0;
+}
+
+/* Only used by SignalChildWatch::connect().
+ * These don't use Glib::Source, to avoid the unnecessary overhead
+ * of a completely unused wrapper object.
+ */
+static gboolean glibmm_child_watch_callback(GPid pid, gint child_status, void* data)
+{
+ SourceConnectionNode *const conn_data = static_cast<SourceConnectionNode*>(data);
+
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try {
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ //Recreate the specific slot from the generic slot node.
+ (*static_cast<sigc::slot<void, GPid, int>*>(conn_data->get_slot()))(pid, child_status);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
}
return SignalIO(0); // 0 means default context
}
+/**** Glib::SignalChildWatch **************************************************/
+
+inline
+SignalChildWatch::SignalChildWatch(GMainContext* context)
+:
+ context_ (context)
+{}
+
+sigc::connection 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());
+
+ GSource *const source = g_child_watch_source_new(pid);
+
+ if(priority != G_PRIORITY_DEFAULT)
+ g_source_set_priority(source, priority);
+
+ g_source_set_callback(
+ source, (GSourceFunc)&glibmm_child_watch_callback, conn_node,
+ &SourceConnectionNode::destroy_notify_callback);
+
+ g_source_attach(source, context_);
+ g_source_unref(source); // GMainContext holds a reference
+
+ conn_node->install(source);
+ return connection;
+}
+
+SignalChildWatch signal_child_watch()
+{
+ return SignalChildWatch(0); // 0 means default context
+}
/**** Glib::MainContext ****************************************************/
return SignalIO(gobj());
}
+SignalChildWatch MainContext::signal_child_watch()
+{
+ return SignalChildWatch(gobj());
+}
+
void MainContext::reference() const
{
g_main_context_ref(reinterpret_cast<GMainContext*>(const_cast<MainContext*>(this)));
// static
gboolean Source::prepare_vfunc(GSource* source, int* timeout)
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
Source *const self = get_wrapper(source);
return self->prepare(*timeout);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
return 0;
}
// static
gboolean Source::check_vfunc(GSource* source)
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
Source *const self = get_wrapper(source);
return self->check();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
return 0;
}
g_return_val_if_fail(callback == &glibmm_dummy_source_callback, 0);
g_return_val_if_fail(callback_data != 0 && callback_data->node != 0, 0);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
Source *const self = callback_data->wrapper;
return self->dispatch(callback_data->node->get_slot());
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return 0;
}
SignalIO& operator=(const SignalIO&);
};
+class SignalChildWatch
+{
+public:
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ explicit inline SignalChildWatch(GMainContext* context);
+#endif
+ /** Connects a child watch handler.
+ * @code
+ * Glib::signal_child_watch().connect(sigc::ptr_fun(&child_watch_handler), pid);
+ * @endcode
+ * @param slot A slot to call when child @a pid exited.
+ * @param pid The child to watch for.
+ * @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<void,GPid, int>& slot, GPid pid,
+int priority = PRIORITY_DEFAULT);
+private:
+ GMainContext* context_;
+
+ // no copy assignment
+ SignalChildWatch& operator=(const SignalChildWatch&);
+};
/** Convenience timeout signal.
* @return A signal proxy; you want to use SignalTimeout::connect().
*/
SignalIO signal_io();
+/** Convenience child watch signal.
+ * @return A signal proxy; you want to use SignalChildWatch::connect().
+ */
+SignalChildWatch signal_child_watch();
+
/** Main context.
*/
static Glib::RefPtr<MainContext> get_default();
/** Runs a single iteration for the given main loop.
- * This involves checking to see if any event sources are ready to be processed, then if no events sources are ready and may_block is true, waiting for a source to become ready, then dispatching the highest priority events sources that are ready. Note that even when may_block is true, it is still possible for iteration() to return FALSE, since the the wait may be interrupted for other reasons than an event source becoming ready.
+ * This involves checking to see if any event sources are ready to be processed, then if no events sources are
+ * ready and may_block is true, waiting for a source to become ready, then dispatching the highest priority events
+ * sources that are ready. Note that even when may_block is true, it is still possible for iteration() to return
+ * false, since the the wait may be interrupted for other reasons than an event source becoming ready.
* @param may_block Whether the call may block.
* @return true if events were dispatched.
*/
void wakeup();
/** Tries to become the owner of the specified context.
- * If some other context is the owner of the context, returns FALSE immediately. Ownership is properly recursive: the owner can require ownership again and will release ownership when release() is called as many times as acquire().
+ * If some other context is the owner of the context, returns FALSE immediately. Ownership is properly recursive:
+ * the owner can require ownership again and will release ownership when release() is called as many times as
+ * acquire().
* You must be the owner of a context before you can call prepare(), query(), check(), dispatch().
* @return true if the operation succeeded, and this thread is now the owner of context.
*/
bool acquire();
- /** 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.
+ /** 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.
*/
bool wait(Glib::Cond& cond, Glib::Mutex& mutex);
- /** 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 acquired.
+ /** 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 acquired.
*/
void release();
*/
SignalIO signal_io();
+ /** child watch signal, attached to this MainContext.
+ * @return A signal proxy; you want to use SignalChildWatch::connect().
+ */
+ SignalChildWatch signal_child_watch();
+
void reference() const;
void unreference() const;
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/markup.h>
#include <glibmm/private/markup_p.h>
void* user_data,
GError** error)
{
+ if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
Parser::AttributeMap attributes;
if(attribute_names && attribute_values)
}
cpp_context.get_parser()->on_start_element(cpp_context, element_name, attributes);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(MarkupError& err)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
void ParserCallbacks::end_element(GMarkupParseContext* context,
void* user_data,
GError** error)
{
+ if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
cpp_context.get_parser()->on_end_element(cpp_context, element_name);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(MarkupError& err)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
void ParserCallbacks::text(GMarkupParseContext* context,
void* user_data,
GError** error)
{
+ if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
cpp_context.get_parser()->on_text(cpp_context, Glib::ustring(text, text + text_len));
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(MarkupError& err)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
void ParserCallbacks::passthrough(GMarkupParseContext* context,
void* user_data,
GError** error)
{
+ if(!&error) error = error; //Avoid an unused parameter warning when GLIBMM_EXCEPTIONS_ENABLED is used.
+
ParseContext& cpp_context = *static_cast<ParseContext*>(user_data);
g_return_if_fail(context == cpp_context.gobj());
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
cpp_context.get_parser()->on_passthrough(
cpp_context, Glib::ustring(passthrough_text, passthrough_text + text_len));
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(MarkupError& err)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
void ParserCallbacks::error(GMarkupParseContext* context,
g_return_if_fail(context == cpp_context.gobj());
g_return_if_fail(error->domain == G_MARKUP_ERROR);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
cpp_context.get_parser()->on_error(cpp_context, MarkupError(g_error_copy(error)));
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::MarkupError::throw_func(GError* gobject)
{
throw Glib::MarkupError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::MarkupError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::MarkupError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
std::string get_home_dir()
{
- return std::string(g_get_home_dir());
+ const char *const value = g_get_home_dir();
+ return (value) ? std::string(value) : std::string();
}
std::string get_tmp_dir()
std::string build_filename(const Glib::ArrayHandle<std::string>& elements)
{
- return build_path(G_DIR_SEPARATOR_S, elements);
+ return Glib::convert_return_gchar_ptr_to_stdstring( g_build_filenamev(const_cast<char**>(elements.data())) );
+
}
std::string build_filename(const std::string& elem1, const std::string& elem2)
{
const char *const elements[] = { elem1.c_str(), elem2.c_str(), 0 };
- return build_path(G_DIR_SEPARATOR_S, elements);
+ return build_filename(elements);
}
+std::string build_path(const std::string& separator, const Glib::ArrayHandle<std::string>& elements)
+{
+ return Glib::convert_return_gchar_ptr_to_stdstring( g_build_pathv(separator.c_str(), const_cast<char**>(elements.data())) );
+
/* Yes, this reimplements the functionality of g_build_path() -- because
* it takes a varargs list, and calling it several times would result
* in different behaviour.
*/
-std::string build_path(const std::string& separator, const Glib::ArrayHandle<std::string>& elements)
-{
+ /*
std::string result;
result.reserve(256); //TODO: Explain why this magic number is useful. murrayc
result += last_trailing;
return result;
+ */
}
std::string find_program_in_path(const std::string& program)
std::string get_real_name();
/** Gets the current user's home directory.
- * @return The current user's home directory.
+ * @return The current user's home directory or an empty string if not defined.
*/
std::string get_home_dir();
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/module.h>
#include <glibmm/private/module_p.h>
return g_module_supported();
}
+
void Module::make_resident()
{
- g_module_make_resident(gobj());
+g_module_make_resident(gobj());
}
std::string Module::get_last_error()
return Glib::convert_const_gchar_ptr_to_stdstring(g_module_error());
}
+
bool Module::get_symbol(const std::string& symbol_name, void*& symbol) const
{
return g_module_symbol(const_cast<GModule*>(gobj()), symbol_name.c_str(), &(symbol));
enum ModuleFlags
{
MODULE_BIND_LAZY = 1 << 0,
- MODULE_BIND_MASK = 0x01
+ MODULE_BIND_LOCAL = 1 << 1,
+ MODULE_BIND_MASK = 0x03
};
/** @ingroup glibmmEnums */
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+//X11 defines DestroyNotify and some other non-prefixed stuff, and it's too late to change that now,
+//so let's give people a clue about the compilation errors that they will see:
+#ifdef DestroyNotify
+ #error "X11/Xlib.h seems to have been included before this header. Due to some commonly-named macros in X11/Xlib.h, it may only be included after any glibmm, gdkmm, or gtkmm headers."
+#endif //DestroyNotify
+
#include <glibmm/objectbase.h>
#include <glibmm/wrap.h>
#include <glibmm/quark.h>
#include <glibmm/containerhandle_shared.h> //Because its specializations may be here.
#include <glibmm/value.h>
+#include <glibmmconfig.h>
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
-class Object : virtual public ObjectBase
+class GLIBMM_API Object : virtual public ObjectBase
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
}
};
-//This confuse the SUN Forte compiler, so we ifdef it out:
+//This confuses the SUN Forte compiler, so we ifdef it out:
#ifdef GLIBMM_HAVE_DISAMBIGUOUS_CONST_TEMPLATE_SPECIALIZATIONS
/** Partial specialization for pointers to const GObject instances.
#include <glibmm/quark.h>
#include <glibmm/objectbase.h>
+#include <glibmm/propertyproxy_base.h> //For PropertyProxyConnectionNode
namespace
// char array rather than a string literal allows for fast pointer comparison,
// which is otherwise not guaranteed to work.
-const char anonymous_custom_type_name[] = "gtkmm__anonymous_custom_type";
+static const char anonymous_custom_type_name[] = "gtkmm__anonymous_custom_type";
} // anonymous namespace
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)
+{
+ // Create a proxy to hold our connection info
+ // This will be deleted by destroy_notify_handler.
+ PropertyProxyConnectionNode* pConnectionNode = new PropertyProxyConnectionNode(slot, gobj());
+
+ // connect it to gtk+
+ // pConnectionNode will be passed as the data argument to the callback.
+ // The callback will then call the virtual Object::property_change_notify() method,
+ // which will contain a switch/case statement which will examine the property name.
+ const Glib::ustring notify_signal_name = "notify::" + property_name;
+ pConnectionNode->connection_id_ = g_signal_connect_data(gobj(),
+ notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), pConnectionNode,
+ &PropertyProxyConnectionNode::destroy_notify_handler,
+ G_CONNECT_AFTER);
+}
+
bool _gobject_cppinstance_already_deleted(GObject* gobject)
{
#include <glibmm/signalproxy.h>
#include <glibmm/propertyproxy.h>
+#include <glibmm/ustring.h>
+#include <glibmm/value.h>
#include <sigc++/trackable.h>
#include <typeinfo>
#include <glibmmconfig.h>
#include <glibmm/debug.h>
+#include <glibmmconfig.h>
+
GLIBMM_USING_STD(type_info)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//This inherits virtually from sigc::trackable so that people can multiply inherit glibmm classes from other sigc::trackable-derived classes.
//See bugzilla.gnome.org bug # 116280
-class ObjectBase : virtual public sigc::trackable
+/** Glib::ObjectBase is a common base class for Objects and Interfaces.
+ *
+ * This is used as virtual base class. This means the ObjectBase
+ * constructor runs before all others, either implicitly or explicitly. Each of
+ * the available constructors initializes custom_type_name_ in a different way.
+ */
+class GLIBMM_API ObjectBase : virtual public sigc::trackable
{
protected:
- // Glib::ObjectBase is used as virtual base class. This means the ObjectBase
- // ctor runs before all others -- either implicitly or explicitly. Each of
- // the available ctors initializes custom_type_name_ in a different way:
- //
- // 1) default: custom_type_name_ = "gtkmm__anonymous_custom_type"
- // 2) const char*: custom_type_name_ = custom_type_name
- // 3) type_info: custom_type_name_ = custom_type_info.name()
- //
- // All classes generated by gtkmmproc use ctor 2) with custom_type_name = 0,
- // which essentially means it's not a custom type. This is used to optimize
- // vfunc and signal handler callbacks -- since the C++ virtual methods are
- // not overridden, invocation can be skipped.
- //
- // The default ctor 1) is called implicitly from the ctor of user-derived
- // classes -- yes, even if e.g. Gtk::Button calls ctor 2), a derived ctor
- // always overrides this choice. The language itself ensures that the ctor
- // is only invoked once.
- //
- // Ctor 3) is a special feature to allow creation of derived types on the
- // fly, without having to use g_object_new() manually. This feature is
- // sometimes necessary, e.g. to implement a custom Gtk::CellRenderer. The
- // neat trick with the virtual base class ctor makes it possible to reuse
- // the same direct base class' ctor as with non-custom types.
-
+ /** This default constructor is called implicitly from the constructor of user-derived
+ * classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.
+ * This is normal behaviour for C++ virtual inheritance.
+ *
+ * The GType name will be gtkmm__anonymous_custom_type.
+ */
ObjectBase();
+
+ /** A derived constructor always overrides this choice.
+ * The C++ language itself ensures that the constructor
+ * is only invoked once.
+ *
+ * All classes generated by gtkmmproc use this constructor, with custom_type_name = 0,
+ * which essentially means it's not a custom type. This is used to optimize
+ * vfunc and signal handler callbacks -- since the C++ virtual methods are
+ * not overridden, invocation can be skipped.
+ *
+ * The GType name will be @a custom_type_name.
+ */
explicit ObjectBase(const char* custom_type_name);
+
+ /** This constructor is a special feature to allow creation of derived types on the
+ * fly, without having to use g_object_new() manually. This feature is
+ * sometimes necessary, e.g. to implement a custom Gtk::CellRenderer. The
+ * neat trick with the virtual base class ctor makes it possible to reuse
+ * the same direct base class' constructor as with non-custom types.
+ *
+ * The GType name will be @a custom_type_info.name().
+ */
explicit ObjectBase(const std::type_info& custom_type_info);
virtual ~ObjectBase() = 0;
template <class PropertyType>
void get_property(const Glib::ustring& property_name, PropertyType& value) const;
-
- virtual void reference() const;
+ /** You can use the signal_changed() signal of the property proxy instead,
+ * but this is necessary when using the reduced API.
+ */
+ void connect_property_changed(const Glib::ustring& property_name, const sigc::slot<void>& slot);
+
+ /** Increment the reference count for this object.
+ * You should never need to do this manually - use the object via a RefPtr instead.
+ */
+ virtual void reference() const;
+
+ /** Decrement the reference count for this object.
+ * You should never need to do this manually - use the object via a RefPtr instead.
+ */
virtual void unreference() const;
+ ///Provides access to the underlying C GtkObject.
inline GObject* gobj() { return gobject_; }
+
+ ///Provides access to the underlying C GtkObject.
inline const GObject* gobj() const { return gobject_; }
- // Give a ref-ed copy to someone. Use for direct struct access.
+ /// Give a ref-ed copy to someone. Use for direct struct access.
GObject* gobj_copy() const;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static ObjectBase* _get_current_wrapper(GObject* object);
bool _cpp_destruction_is_in_progress() const;
-#endif
+#endif //DOXYGEN_SHOULD_SKIP_THIS
protected:
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
GObject* gobject_; // the GLib/GDK/GTK+ object instance
const char* custom_type_name_;
bool cpp_destruction_in_progress_;
virtual void destroy_notify_();
void _set_current_wrapper(GObject* object);
+#endif //DOXYGEN_SHOULD_SKIP_THIS
private:
// noncopyable
ObjectBase(const ObjectBase&);
ObjectBase& operator=(const ObjectBase&);
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
virtual void set_manage(); // calls g_error()
+#endif //DOXYGEN_SHOULD_SKIP_THIS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
friend class Glib::GSigConnectionNode; // for GSigConnectionNode::notify()
#ifndef DOXYGEN_SHOULD_SKIP_THIS
-template <class PropertyType>
+template <class PropertyType> inline
void ObjectBase::set_property(const Glib::ustring& property_name, const PropertyType& value)
{
Glib::Value<PropertyType> property_value;
this->set_property_value(property_name, property_value);
}
-template <class PropertyType>
+template <class PropertyType> inline
void ObjectBase::get_property(const Glib::ustring& property_name, PropertyType& value) const
{
Glib::Value<PropertyType> property_value;
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/optioncontext.h>
#include <glibmm/private/optioncontext_p.h>
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::OptionError::throw_func(GError* gobject)
{
throw Glib::OptionError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::OptionError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::OptionError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
namespace Glib
void OptionContext::set_help_enabled(bool help_enabled)
{
- g_option_context_set_help_enabled(gobj(), static_cast<int>(help_enabled));
+g_option_context_set_help_enabled(gobj(), static_cast<int>(help_enabled));
}
bool OptionContext::get_help_enabled() const
void OptionContext::set_ignore_unknown_options(bool ignore_unknown)
{
- g_option_context_set_ignore_unknown_options(gobj(), static_cast<int>(ignore_unknown));
+g_option_context_set_ignore_unknown_options(gobj(), static_cast<int>(ignore_unknown));
}
bool OptionContext::get_ignore_unknown_options() const
return g_option_context_get_ignore_unknown_options(const_cast<GOptionContext*>(gobj()));
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool OptionContext::parse(int& argc, char**& argv)
-{
- GError *error = 0;
- bool retvalue = g_option_context_parse(gobj(), &argc, &(argv), &(error));
- if(error) ::Glib::Error::throw_exception(error);
+#else
+bool OptionContext::parse(int& argc, char**& argv, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ bool retvalue = g_option_context_parse(gobj(), &argc, &(argv), &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
return retvalue;
+
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
* and <option>--help-</option><replaceable>groupname</replaceable> and creates
* suitable output to stdout.
*
- * Since: 2.6
+ * @newin2p6
* @param help_enabled <tt>true</tt> to enable <option>--help</option>, <tt>false</tt> to disable it.
*/
void set_help_enabled(bool help_enabled = true);
* is turned on for @a context . See g_option_context_set_help_enabled().
* @return <tt>true</tt> if automatic help generation is turned on.
*
- * Since: 2.6.
+ * @newin2p6.
*/
bool get_help_enabled() const;
* which don't start with a dash). But note that GOption cannot reliably
* determine whether a non-option belongs to a preceding unknown option.
*
- * Since: 2.6
+ * @newin2p6
* @param ignore_unknown <tt>true</tt> to ignore unknown options, <tt>false</tt> to produce
* an error when unknown options are met.
*/
* g_option_context_set_ignore_unknown_options().
* @return <tt>true</tt> if unknown options are ignored.
*
- * Since: 2.6.
+ * @newin2p6.
*/
bool get_ignore_unknown_options() const;
*
* If the parsing is successful, any parsed arguments are
* removed from the array and @a argc and @a argv are updated
- * accordingly. In case of an error, @a argc and @a argv are
- * left unmodified.
+ * accordingly. A '--' option is stripped from @a argv
+ * unless there are unparsed options before and after it,
+ * or some of the options after it start with '-'. In case
+ * of an error, @a argc and @a argv are left unmodified.
*
* If automatic <option>--help</option> support is enabled
* (see g_option_context_set_help_enabled()), and the
* @return <tt>true</tt> if the parsing was successful,
* <tt>false</tt> if an error occurred
*
- * Since: 2.6.
+ * @newin2p6.
*/
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool parse(int& argc, char**& argv);
+#else
+ bool parse(int& argc, char**& argv, std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
//g_option_context_add_main_entries(), just creates a group internally, adds them to it, and does a set_main_group()
//- a group without callbacks seems to do some simple default parsing.
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/optionentry.h>
#include <glibmm/private/optionentry_p.h>
{
OptionEntry::OptionEntry()
-: gobject_( new GOptionEntry() )
{
gobject_ = g_new0(GOptionEntry, 1);
}
OptionEntry::OptionEntry(const OptionEntry& src)
{
gobject_ = g_new0(GOptionEntry, 1);
-
+
operator=(src);
}
{
if(gobject_->long_name)
g_free(const_cast<char*>(gobject_->long_name));
-
+
gobject_->long_name = g_strdup(src.gobject_->long_name);
gobject_->short_name = src.gobject_->short_name; //It's just one char.
-
+
gobject_->flags = src.gobject_->flags;
gobject_->arg = src.gobject_->arg;
gobject_->arg_data = src.gobject_->arg_data; //Shared, because it's not owned by any instance of this class anyway.
-
+
if(gobject_->description)
g_free(const_cast<char*>(gobject_->description));
-
+
gobject_->description = g_strdup(src.gobject_->description);
-
+
if(gobject_->arg_description)
g_free(const_cast<char*>(gobject_->arg_description));
-
+
gobject_->arg_description = g_strdup(src.gobject_->arg_description);
}
-
+
return *this;
}
-
+
} // namespace Glib
{
-Glib::ustring OptionEntry::get_long_name() const
+ Glib::ustring OptionEntry::get_long_name() const
{
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->long_name);
}
-
-void OptionEntry::set_long_name(const Glib::ustring& value)
+
+ void OptionEntry::set_long_name(const Glib::ustring& value)
{
gobj()->long_name = g_strdup((value).c_str());
}
-
-gchar OptionEntry::get_short_name() const
+
+ gchar OptionEntry::get_short_name() const
{
return gobj()->short_name;
}
-
-void OptionEntry::set_short_name(const gchar& value)
+
+ void OptionEntry::set_short_name(const gchar& value)
{
gobj()->short_name = value;
}
-
-int OptionEntry::get_flags() const
+
+ int OptionEntry::get_flags() const
{
return gobj()->flags;
}
-
-void OptionEntry::set_flags(const int& value)
+
+ void OptionEntry::set_flags(const int& value)
{
gobj()->flags = value;
}
-
-Glib::ustring OptionEntry::get_description() const
+
+ Glib::ustring OptionEntry::get_description() const
{
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->description);
}
-
-void OptionEntry::set_description(const Glib::ustring& value)
+
+ void OptionEntry::set_description(const Glib::ustring& value)
{
gobj()->description = g_strdup((value).c_str());
}
-
-Glib::ustring OptionEntry::get_arg_description() const
+
+ Glib::ustring OptionEntry::get_arg_description() const
{
return Glib::convert_const_gchar_ptr_to_ustring(gobj()->arg_description);
}
-
-void OptionEntry::set_arg_description(const Glib::ustring& value)
+
+ void OptionEntry::set_arg_description(const Glib::ustring& value)
{
gobj()->arg_description = g_strdup((value).c_str());
}
-
+
} // namespace Glib
{
FLAG_HIDDEN = 1 << 0,
FLAG_IN_MAIN = 1 << 1,
- FLAG_REVERSE = 1 << 2
+ FLAG_REVERSE = 1 << 2,
+ FLAG_NO_ARG = 1 << 3,
+ FLAG_FILENAME = 1 << 4,
+ FLAG_OPTIONAL_ARG = 1 << 5,
+ FLAG_NOALIAS = 1 << 6
} GOptionFlags;
OptionEntry();
OptionEntry& operator=(const OptionEntry& src);
- Glib::ustring get_long_name() const;
- void set_long_name(const Glib::ustring& value);
-
- gchar get_short_name() const;
- void set_short_name(const gchar& value);
-
- int get_flags() const;
- void set_flags(const int& value);
-
+ Glib::ustring get_long_name() const;
+ void set_long_name(const Glib::ustring& value);
+
+ gchar get_short_name() const;
+ void set_short_name(const gchar& value);
+
+ int get_flags() const;
+ void set_flags(const int& value);
+
//TODO: G_OPTION_ARG_CALLBACK,
- Glib::ustring get_description() const;
- void set_description(const Glib::ustring& value);
-
- Glib::ustring get_arg_description() const;
- void set_arg_description(const Glib::ustring& value);
-
+ Glib::ustring get_description() const;
+ void set_description(const Glib::ustring& value);
+
+ Glib::ustring get_arg_description() const;
+ void set_arg_description(const Glib::ustring& value);
+
GOptionEntry* gobj() { return gobject_; }
const GOptionEntry* gobj() const { return gobject_; }
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/optiongroup.h>
#include <glibmm/private/optiongroup_p.h>
CppOptionEntry cppEntry;
cppEntry.carg_type_ = arg_type;
cppEntry.allocate_c_arg();
-
+
cppEntry.cpparg_ = cpp_arg;
-
- //Remember the C++/C mapping so that we can use it later:
- map_entries_[name] = cppEntry;
-
+
//Give the information to the C API:
- cppEntry.entry_ = new OptionEntry(entry); //g_option_group_add_entry() does not take its own copy, so we must keep the instance alive.*/
+
+ cppEntry.entry_ = new OptionEntry(entry); //g_option_group_add_entry() does not take its own copy, so we must keep the instance alive. */
+ //cppEntry.entry_ is deleted in release_c_arg(), via the destructor.
+
cppEntry.entry_->gobj()->arg = arg_type;
cppEntry.entry_->gobj()->arg_data = cppEntry.carg_;
-
+
+ //Remember the C++/C mapping so that we can use it later:
+ map_entries_[name] = cppEntry;
+
add_entry(*(cppEntry.entry_));
}
}
void OptionGroup::set_translation_domain(const Glib::ustring& domain)
{
- g_option_group_set_translation_domain(gobj(), domain.c_str());
+g_option_group_set_translation_domain(gobj(), domain.c_str());
}
/** A convenience function to use gettext() for translating
* user-visible strings.
*
- * Since: 2.6
+ * @newin2p6
* @param domain The domain to use.
*/
void set_translation_domain(const Glib::ustring& domain);
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_CONVERT_P_H
#define _GLIBMM_CONVERT_P_H
+
+
#endif /* _GLIBMM_CONVERT_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_DATE_P_H
#define _GLIBMM_DATE_P_H
+
+
#endif /* _GLIBMM_DATE_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_FILEUTILS_P_H
#define _GLIBMM_FILEUTILS_P_H
+
+
#endif /* _GLIBMM_FILEUTILS_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_IOCHANNEL_P_H
#define _GLIBMM_IOCHANNEL_P_H
+
+
#endif /* _GLIBMM_IOCHANNEL_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_MARKUP_P_H
#define _GLIBMM_MARKUP_P_H
+
+
#endif /* _GLIBMM_MARKUP_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_MODULE_P_H
#define _GLIBMM_MODULE_P_H
+
+
#endif /* _GLIBMM_MODULE_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_OPTIONCONTEXT_P_H
#define _GLIBMM_OPTIONCONTEXT_P_H
+
+
#endif /* _GLIBMM_OPTIONCONTEXT_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_OPTIONENTRY_P_H
#define _GLIBMM_OPTIONENTRY_P_H
+
+
#endif /* _GLIBMM_OPTIONENTRY_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_OPTIONGROUP_P_H
#define _GLIBMM_OPTIONGROUP_P_H
+
+
#endif /* _GLIBMM_OPTIONGROUP_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_SHELL_P_H
#define _GLIBMM_SHELL_P_H
+
+
#endif /* _GLIBMM_SHELL_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_SPAWN_P_H
#define _GLIBMM_SPAWN_P_H
+
+
#endif /* _GLIBMM_SPAWN_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_THREAD_P_H
#define _GLIBMM_THREAD_P_H
+
+
#endif /* _GLIBMM_THREAD_P_H */
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GLIBMM_UNICODE_P_H
#define _GLIBMM_UNICODE_P_H
+
+
#endif /* _GLIBMM_UNICODE_P_H */
*/
#include <glibmm/property.h>
+
+#ifdef GLIBMM_PROPERTIES_ENABLED
+
#include <glibmm/object.h>
#include <cstddef>
//
// We can reimplement this later if necessary.
-unsigned int property_to_id(Glib::ObjectBase& object, Glib::PropertyBase& property)
+static unsigned int property_to_id(Glib::ObjectBase& object, Glib::PropertyBase& property)
{
void *const base_ptr = dynamic_cast<void*>(&object);
void *const prop_ptr = &property;
} // namespace Glib
+#endif //GLIBMM_PROPERTIES_ENABLED
+
*/
#include <glibmm/propertyproxy.h>
-#include <glibmm/value.h>
+#ifdef GLIBMM_PROPERTIES_ENABLED
+
+#include <glibmm/value.h>
namespace Glib
{
} // namespace Glib
+#endif //GLIBMM_PROPERTIES_ENABLED
#endif /* _GLIBMM_PROPERTY_H */
#include <glibmm/propertyproxy_base.h>
+#ifdef GLIBMM_PROPERTIES_ENABLED
namespace Glib
{
/** Set the value of this property.
* @param data The new value for the property.
*/
- void set_value(const PropertyType& data)
- {
- PropertyProxy_Base& base = *this;
- // The downcast to PropertyProxy<T> is safe, and avoids code duplication.
- static_cast<PropertyProxy<T>&>(base).set_value(data);
- }
+ void set_value(const PropertyType& data);
/** Set the value of this property back to its default value
*/
/** Get the value of this property.
* @result The current value of the property.
*/
- PropertyType get_value() const
- {
- const PropertyProxy_Base& base = *this;
- // The downcast to PropertyProxy<T> is safe, and avoids code duplication.
- return static_cast<const PropertyProxy<T>&>(base).get_value();
- }
+ PropertyType get_value() const;
operator PropertyType() const
{ return this->get_value(); }
return value.get();
}
+//We previously just static_cast<> PropertyProxy_WriteOnly<> to PropertyProxy<> to call its set_value(),
+//to avoid code duplication.
+//But the AIX compiler does not like that hack.
+template <class T>
+void PropertyProxy_WriteOnly<T>::set_value(const T& data)
+{
+ Glib::Value<T> value;
+ value.init(Glib::Value<T>::value_type());
+
+ value.set(data);
+ set_property_(value);
+}
+
+//We previously just static_cast<> PropertyProxy_WriteOnly<> to PropertyProxy<> to call its set_value(),
+//to avoid code duplication.
+//But the AIX compiler does not like that hack.
+template <class T>
+T PropertyProxy_ReadOnly<T>::get_value() const
+{
+ Glib::Value<T> value;
+ value.init(Glib::Value<T>::value_type());
+
+ get_property_(value);
+ return value.get();
+}
+
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
} // namespace Glib
+#endif //GLIBMM_PROPERTIES_ENABLED
#endif /* _GLIBMM_PROPERTYPROXY_H */
*/
#include <glibmm/propertyproxy_base.h>
+
+#ifdef GLIBMM_PROPERTIES_ENABLED
+
#include <glibmm/signalproxy_connectionnode.h>
#include <glibmm/object.h>
#include <glibmm/private/object_p.h>
namespace Glib
{
-/** PropertyProxyConnectionNode is a connection node for use with SignalProxyProperty.
- * It's like ProxyConnectionNode, but it contains the property name too.
- */
-class PropertyProxyConnectionNode : public SignalProxyConnectionNode
+PropertyProxyConnectionNode::PropertyProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject)
+: SignalProxyConnectionNode(slot, gobject)
{
-public:
- friend class SignalProxyProperty;
-
- PropertyProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject, const gchar* property_name);
-
-protected:
- //This will be examined in the callback.
- //Should be a static string literal.
- const gchar* property_name_;
-};
+}
-PropertyProxyConnectionNode::PropertyProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject, const gchar* property_name)
-: SignalProxyConnectionNode(slot, gobject),
- property_name_(property_name)
+void PropertyProxyConnectionNode::callback(GObject*, GParamSpec* pspec, gpointer data) //static
{
+ if(pspec && data)
+ {
+ if(sigc::slot_base *const slot = SignalProxyBase::data_to_slot(data))
+ (*static_cast<sigc::slot<void>*>(slot))();
+ }
}
//SignalProxyProperty implementation:
sigc::connection SignalProxyProperty::connect(const SlotType& sl)
{
- // create a proxy to hold our connection info
- PropertyProxyConnectionNode* pConnectionNode = new PropertyProxyConnectionNode(sl, obj_->gobj(), property_name_ );
+ // Create a proxy to hold our connection info
+ // This will be deleted by destroy_notify_handler.
+ PropertyProxyConnectionNode* pConnectionNode = new PropertyProxyConnectionNode(sl, obj_->gobj());
// connect it to gtk+
// pConnectionNode will be passed as the data argument to the callback.
// The callback will then call the virtual Object::property_change_notify() method,
// which will contain a switch/case statement which will examine the property name.
+ const Glib::ustring notify_signal_name = "notify::" + Glib::ustring(property_name_);
pConnectionNode->connection_id_ = g_signal_connect_data(obj_->gobj(),
- "notify", (GCallback)(&callback), pConnectionNode,
+ notify_signal_name.c_str(), (GCallback)(&PropertyProxyConnectionNode::callback), pConnectionNode,
&PropertyProxyConnectionNode::destroy_notify_handler,
G_CONNECT_AFTER);
return sigc::connection(pConnectionNode->slot_);
}
-void SignalProxyProperty::callback(GObject*, GParamSpec* pspec, gpointer data) //static
-{
- if(pspec && data)
- {
- //Get the name of the property that has changed:
- const char* property_name_changed = pspec->name;
-
- //Get the name of the property that we are waiting for:
- PropertyProxyConnectionNode* conn = static_cast<PropertyProxyConnectionNode*>(data);
- const char* property_name_monitored = conn->property_name_;
-
- //If it's the correct property, then call the signal handler:
- if(strcmp(property_name_changed, property_name_monitored) == 0)
- {
- if(sigc::slot_base *const slot = data_to_slot(data))
- (*static_cast<sigc::slot<void>*>(slot))();
- }
- }
-}
-
//PropertyProxy_Base implementation:
} // namespace Glib
+#endif //GLIBMM_PROPERTIES_ENABLED
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <glibmmconfig.h>
+
#include <glibmm/value.h>
#include <glibmm/signalproxy.h>
-
namespace Glib
{
+#ifdef GLIBMM_PROPERTIES_ENABLED
+
class ObjectBase;
/// Use the connect() method, with sigc::ptr_fun() or sig::mem_fun() to connect signals to signal handlers.
sigc::connection connect(const SlotType& sl);
protected:
- static void callback(GObject* object, GParamSpec* pspec, gpointer data);
const char* property_name_; //Should be a static string literal.
void reset_property_();
ObjectBase* obj_; //The C++ wrapper instance of which this PropertyProxy is a member.
+
const char* property_name_; //Should be a static string literal.
private:
PropertyProxy_Base& operator=(const PropertyProxy_Base&);
};
+#endif //GLIBMM_PROPERTIES_ENABLED
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+class SignalProxyProperty;
+
+/** PropertyProxyConnectionNode is a connection node for use with SignalProxyProperty.
+ * It's like ProxyConnectionNode, but it contains the property name too.
+ * This is not public API.
+ */
+class PropertyProxyConnectionNode : public SignalProxyConnectionNode
+{
+public:
+ friend class SignalProxyProperty;
+
+ PropertyProxyConnectionNode(const sigc::slot_base& slot, GObject* gobject);
+
+ static void callback(GObject* object, GParamSpec* pspec, gpointer data);
+};
+
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
} // namespace Glib
+
+
#endif /* _GLIBMM_PROPERTYPROXY_BASE_H */
template <class T_CastFrom>
static inline RefPtr<T_CppObject> cast_static(const RefPtr<T_CastFrom>& src);
+ /** 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<T_CppObject> cast_const(const RefPtr<T_CastFrom>& src);
+
private:
T_CppObject* pCppObject_;
};
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)
+{
+ T_CppObject *const pCppObject = const_cast<T_CppObject*>(src.operator->());
+
+ if(pCppObject)
+ pCppObject->reference();
+
+ return RefPtr<T_CppObject>(pCppObject);
+}
+
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
/** @relates Glib::RefPtr */
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/shell.h>
#include <glibmm/private/shell_p.h>
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::ShellError::throw_func(GError* gobject)
{
throw Glib::ShellError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::ShellError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::ShellError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
// Do not try to call a signal on a disassociated wrapper.
if(Glib::ObjectBase::_get_current_wrapper(self))
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
if(sigc::slot_base *const slot = data_to_slot(data))
(*static_cast<sigc::slot<void>*>(slot))();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
}
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/spawn.h>
#include <glibmm/private/spawn_p.h>
* We don't need to worry about (un)referencing, since the
* child process gets its own copy of the parent's memory anyway.
*/
-void child_setup_callback(void* user_data)
+static void child_setup_callback(void* user_data)
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
(*reinterpret_cast<sigc::slot<void>*>(user_data))();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(...)
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
-void copy_output_buf(std::string* dest, const char* buf)
+static void copy_output_buf(std::string* dest, const char* buf)
{
if(dest)
{
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::SpawnError::throw_func(GError* gobject)
{
throw Glib::SpawnError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::SpawnError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::SpawnError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
return IO_STATUS_EOF;
if(stream_in_->fail())
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Reading from stream failed");
+ #else
+ return IO_STATUS_ERROR;
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
return IO_STATUS_NORMAL;
}
stream_out_->write(buf, count);
if(stream_out_->fail())
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Writing to stream failed");
+ #else
+ return IO_STATUS_ERROR;
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
bytes_written = count; // all or nothing ;)
}
if(failed)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Seeking into stream failed");
+ #else
+ return IO_STATUS_ERROR;
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
return Glib::IO_STATUS_NORMAL;
}
}
else
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED,
"Attempt to close non-file stream");
+ #else
+ return IO_STATUS_ERROR;
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
if(failed)
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw Glib::Error(G_IO_CHANNEL_ERROR, G_IO_CHANNEL_ERROR_FAILED, "Failed to close stream");
+ #else
+ return IO_STATUS_ERROR;
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
return IO_STATUS_NORMAL;
}
std::string::size_type start_index)
{
if(start_index > str.size())
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
throw std::out_of_range("out of range (strtod): start_index > str.size()");
+ #else
+ return 0;
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
const char *const bufptr = str.c_str();
char* endptr = 0;
{
g_return_val_if_fail(err_no == ERANGE, result);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ //Interpret the result in the event of an error:
if(result > 0.0)
throw std::overflow_error("overflow (strtod): positive number too large");
throw std::overflow_error("overflow (strtod): negative number too large");
throw std::underflow_error("underflow (strtod): number too small");
+ #else
+ return result;
+ #endif // GLIBMM_EXCEPTIONS_ENABLED
}
if(endptr)
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/thread.h>
#include <glibmm/private/thread_p.h>
{
sigc::slot_base *const slot = reinterpret_cast<sigc::slot_base*>(data);
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
// Recreate the specific slot, and drop the reference obtained by create().
(*static_cast<sigc::slot<void>*>(slot))();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Thread::Exit&)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
delete slot;
return 0;
return static_cast<Code>(Glib::Error::code());
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
void Glib::ThreadError::throw_func(GError* gobject)
{
throw Glib::ThreadError(gobject);
}
+#else
+//When not using exceptions, we just pass the Exception object around without throwing it:
+std::auto_ptr<Glib::Error> Glib::ThreadError::throw_func(GError* gobject)
+{
+ return std::auto_ptr<Glib::Error>(new Glib::ThreadError(gobject));
+}
+#endif //GLIBMM_EXCEPTIONS_ENABLED
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static void throw_func(GError* gobject);
+#else
+ //When not using exceptions, we just pass the Exception object around without throwing it:
+ static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
friend void wrap_init(); // uses throw_func()
#endif
};
static void call_thread_entry_slot(void* data, void* user_data)
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
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();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
}
catch(Glib::Thread::Exit&)
{
{
Glib::exception_handlers_invoke();
}
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
}
} // anonymous namespace
// Generated by gtkmmproc -- DO NOT MODIFY!
+
#include <glibmm/unicode.h>
#include <glibmm/private/unicode_p.h>
enum NormalizeMode
{
NORMALIZE_DEFAULT,
- NORMALIZE_NFD,
+ NORMALIZE_NFD = NORMALIZE_DEFAULT,
NORMALIZE_DEFAULT_COMPOSE,
NORMALIZE_NFC = NORMALIZE_DEFAULT_COMPOSE,
NORMALIZE_ALL,
// Helper to implement ustring::find_first_of() and find_first_not_of().
// Returns the UTF-8 character offset, or ustring::npos if not found.
//
-ustring::size_type utf8_find_first_of(const std::string& str, ustring::size_type offset,
+static ustring::size_type utf8_find_first_of(const std::string& str, ustring::size_type offset,
const char* utf8_match, long utf8_match_size,
bool find_not_of)
{
// Helper to implement ustring::find_last_of() and find_last_not_of().
// Returns the UTF-8 character offset, or ustring::npos if not found.
//
-ustring::size_type utf8_find_last_of(const std::string& str, ustring::size_type offset,
+static ustring::size_type utf8_find_last_of(const std::string& str, ustring::size_type offset,
const char* utf8_match, long utf8_match_size,
bool find_not_of)
{
{
std::string locale_string;
is >> locale_string;
+
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
utf8_string = Glib::locale_to_utf8(locale_string);
+ #else
+ std::auto_ptr<Glib::Error> error; //TODO: Check this?
+ utf8_string = Glib::locale_to_utf8(locale_string, error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
return is;
}
std::ostream& operator<<(std::ostream& os, const Glib::ustring& utf8_string)
{
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
os << Glib::locale_from_utf8(utf8_string);
+ #else
+ std::auto_ptr<Glib::Error> error; //TODO: Check this?
+ os << Glib::locale_from_utf8(utf8_string, error);
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+
return os;
}
#endif /* GLIBMM_HAVE_SUN_REVERSE_ITERATOR */
#ifdef GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS
- static const size_type npos = std::string::npos;
+ static GLIBMM_API const size_type npos = std::string::npos;
#else
//The IRIX MipsPro compiler says "The indicated constant value is not known",
//so we need to initalize the static member data elsewhere.
- static const size_type npos;
+ static GLIBMM_API const size_type npos;
#endif
/*! Default constructor, which creates an empty string.
/*! Construct a ustring as a copy of a substring.
* @param src %Source ustring.
* @param i Index of first character to copy from.
- * @param n Number of characters to copy (defaults to copying the remainder).
+ * @param n Number of UTF-8 characters to copy (defaults to copying the remainder).
*/
ustring(const ustring& src, size_type i, size_type n=npos);
/*! Construct a ustring as a partial copy of a C string.
* @param src %Source C string encoded as UTF-8.
- * @param n Number of characters to copy.
+ * @param n Number of UTF-8 characters to copy.
*/
ustring(const char* src, size_type n);
//! @{
/*! Returns a new UTF-8 string with all characters characters converted to
- * their lowercase equivalent, while honoring the current locale. The
+ * their uppercase equivalent, while honoring the current locale. The
* resulting string may change in the number of bytes as well as in the
* number of characters. For instance, the German sharp s
* <tt>"ß"</tt> will be replaced by two characters
g_value_init(&gobject_, type);
}
+void ValueBase::init(const GValue* value)
+{
+ g_value_init(&gobject_, G_VALUE_TYPE(value));
+
+ if(value)
+ g_value_copy(value, &gobject_);
+}
+
ValueBase::ValueBase(const ValueBase& other)
{
GLIBMM_INITIALIZE_STRUCT(gobject_, GValue);
*
* init() is not implemented as constructor, to avoid the necessity
* to implement a forward constructor in each derived class.
+ *
+ * @param type The type that the Value should hold.
*/
void init(GType type);
+ /** Setup the GValue storing the type and value of the specified @a value.
+ * Note that init() should never be called twice.
+ *
+ * init() is not implemented as constructor, to avoid the necessity
+ * to implement a forward constructor in each derived class.
+ *
+ * @param value The existing GValue.
+ */
+ void init(const GValue* value);
+
/** Reset contents to the default value of its type.
*/
void reset();
{
return g_param_spec_float(
name.c_str(), 0, 0,
- G_MINFLOAT, G_MAXFLOAT, g_value_get_float(&gobject_),
+ -G_MAXFLOAT, G_MAXFLOAT, g_value_get_float(&gobject_),
GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
}
{
return g_param_spec_double(
name.c_str(), 0, 0,
- G_MINDOUBLE, G_MAXDOUBLE, g_value_get_double(&gobject_),
+ -G_MAXDOUBLE, G_MAXDOUBLE, g_value_get_double(&gobject_),
GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
}
namespace
{
-void warn_already_registered(const char* location, const std::string& full_name)
+static void warn_already_registered(const char* location, const std::string& full_name)
{
g_warning("file %s: (%s): The type name `%s' has been registered already.\n"
"This is not supposed to happen -- please send a mail with detailed "
#define GLIBMM_CONFIGURE
#elif defined(__MINGW32__)
#define GLIBMM_WIN32
+#define GLIBMM_DLL
#define GLIBMM_CONFIGURE
#else
//AIX clR compiler complains about this even though it doesn't get this far:
#endif /* _WIN32 */
#ifdef GLIBMM_CONFIGURE
-/* compiler feature tests that are used during compile time and run-time
- by gtk-- only. tests used by gdk-- and gtk-- should go into
- gdk--config.h.in */
#undef GLIBMM_CXX_HAVE_MUTABLE
#undef GLIBMM_CXX_HAVE_NAMESPACES
//#undef GLIBMM_CXX_GAUB
#undef GLIBMM_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS
#undef GLIBMM_CAN_USE_NAMESPACES_INSIDE_EXTERNC
#undef GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS
+#undef GLIBMM_PROPERTIES_ENABLED
+#undef GLIBMM_VFUNCS_ENABLED
+#undef GLIBMM_EXCEPTIONS_ENABLED
+#undef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
#endif
#ifdef GLIBMM_MSC
#define GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION 1
#define GLIBMM_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS 1
#define GLIBMM_CAN_USE_NAMESPACES_INSIDE_EXTERNC 1
- #define GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS 1
+ #define GLIBMM_PROPERTIES_ENABLED 1
+ #define GLIBMM_VFUNCS_ENABLED 1
+ #define GLIBMM_EXCEPTIONS_ENABLED 1
+ #define GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 1
#pragma warning (disable: 4786 4355 4800 4181)
#endif
+++ /dev/null
-config.guess
-config.sub
-install-sh
-ltmain.sh
-missing
dnl
dnl Check for GNU make (stolen from gtk+/configure.in)
AC_MSG_CHECKING(whether make is GNU Make)
-if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
+if ${MAKE-make} --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
--- /dev/null
+## GLIBMM_ARG_ENABLE_API_PROPERTIES()
+##
+## Provide the --enable-api-properties configure argument, enabled
+## by default.
+##
+AC_DEFUN([GLIBMM_ARG_ENABLE_API_PROPERTIES],
+[
+ AC_ARG_ENABLE([api-properties],
+ [ --enable-api-properties Build properties API.
+ [[default=yes]]],
+ [glibmm_enable_api_properties="$enableval"],
+ [glibmm_enable_api_properties='yes'])
+
+ if test "x$glibmm_enable_api_properties" = "xyes"; then
+ {
+ AC_DEFINE([GLIBMM_PROPERTIES_ENABLED],[1], [Defined when the --enable-api-properties configure argument was given])
+ }
+ fi
+])
+
+## GLIBMM_ARG_ENABLE_API_VFUNCS()
+##
+## Provide the --enable-api-vfuncs configure argument, enabled
+## by default.
+##
+AC_DEFUN([GLIBMM_ARG_ENABLE_API_VFUNCS],
+[
+ AC_ARG_ENABLE([api-vfuncs],
+ [ --enable-api-vfuncs Build vfuncs API.
+ [[default=yes]]],
+ [glibmm_enable_api_vfuncs="$enableval"],
+ [glibmm_enable_api_vfuncs='yes'])
+
+ if test "x$glibmm_enable_api_vfuncs" = "xyes"; then
+ {
+ AC_DEFINE([GLIBMM_VFUNCS_ENABLED],[1], [Defined when the --enable-api-vfuncs configure argument was given])
+ }
+ fi
+])
+
+## GLIBMM_ARG_ENABLE_API_EXCEPTIONS()
+##
+## Provide the --enable-api-exceptions configure argument, enabled
+## by default.
+##
+AC_DEFUN([GLIBMM_ARG_ENABLE_API_EXCEPTIONS],
+[
+ AC_ARG_ENABLE([api-exceptions],
+ [ --enable-api-exceptions Build exceptions API.
+ [[default=yes]]],
+ [glibmm_enable_api_exceptions="$enableval"],
+ [glibmm_enable_api_exceptions='yes'])
+
+ if test "x$glibmm_enable_api_exceptions" = "xyes"; then
+ {
+ AC_DEFINE([GLIBMM_EXCEPTIONS_ENABLED],[1], [Defined when the --enable-api-exceptions configure argument was given])
+ }
+ fi
+])
+
+## GLIBMM_ARG_ENABLE_API_DEPRECATED()
+##
+## Provide the --enable-deprecated-api configure argument, enabled
+## by default.
+##
+AC_DEFUN([GLIBMM_ARG_ENABLE_API_DEPRECATED],
+[
+ AC_ARG_ENABLE(deprecated-api,
+ [ --enable-deprecated-api Include (build) deprecated API in the libraries.
+ [[default=yes]]],
+ [glibmm_enable_api_deprecated="$enableval"],
+ [glibmm_enable_api_deprecated='yes'])
+
+ if test "x$glibmm_enable_api_deprecated" = "xyes"; then
+ {
+ AC_MSG_WARN([Deprecated API will be built, for backwards-compatibility.])
+ }
+ else
+ {
+ AC_MSG_WARN([Deprecated API will not be built, breaking backwards-compatibility. Do not use this build for distribution packages.])
+ DISABLE_DEPRECATED_API_CFLAGS="-DGLIBMM_DISABLE_DEPRECATED"
+ AC_SUBST(DISABLE_DEPRECATED_API_CFLAGS)
+ }
+ fi
+])
+
+
+## GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS()
+##
+## Provide the --enable-api-default-signal-handlers configure argument, enabled
+## by default.
+##
+AC_DEFUN([GLIBMM_ARG_ENABLE_API_DEFAULT_SIGNAL_HANDLERS],
+[
+ AC_ARG_ENABLE([api-default-signal-handlers],
+ [ --enable-api-default-signal-handlers Build default signal handlers API.
+ [[default=yes]]],
+ [glibmm_enable_api_default_signal_handlers="$enableval"],
+ [glibmm_enable_api_default_signal_handlers='yes'])
+
+ if test "x$glibmm_enable_api_default_signal_handlers" = "xyes"; then
+ {
+ AC_DEFINE([GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED],[1], [Defined when the --enable-api-default-signal-handlers configure argument was given])
+ }
+ fi
+])
--- /dev/null
+AC_DEFUN([GLIBMM_PROG_CXX_SUN],
+ [AC_CACHE_CHECK(whether we are using SUN CC compiler, ac_cv_prog_sun_cxx,
+ [if AC_TRY_COMMAND(${CXX-g++} -V 2>&1) | egrep "Sun WorkShop" >/dev/null 2>&1; then
+ ac_cv_prog_sun_cxx=yes
+ else
+ ac_cv_prog_sun_cxx=no
+ fi]
+ )]
+
+ if test "x${ac_cv_prog_sun_cxx}" = "xyes"; then
+ {
+ AC_DEFINE([GLIBMM_COMPILER_SUN_FORTE],[1], [Defined when the SUN Forte C++ compiler is being used.])
+ }
+ fi
+)