summaryrefslogtreecommitdiff
path: root/glib/glibmm/main.cc
Commit message (Collapse)AuthorAgeFilesLines
* Glib, Gio: Add some methods for glibmm 2.72Kjell Ahlstedt2022-04-071-0/+8
| | | | | | | | | | | | | * configure.ac: * meson.build: Require glib-2.0 >= 2.71.2. * gio/src/dbusproxy.hg: signal_signal() accepts a signal name. * gio/src/file.[ccg|hg]: Add move_async() and move_finish(). * gio/src/socketclient.hg: Deprecate set/get/property_tls_validation_flags(). * gio/src/tlscertificate.hg: Add properties private_key, private_key_pem, pkcs11_uri, private_key_pkcs11_uri. * gio/src/tlsclientconnection.hg: Deprecate set/get/property_validation_flags(). * glib/glibmm/main.[cc|h]: Add create(MainContextFlags flags). * glib/src/enums.hg: Add enum Glib::MainContextFlags.
* Glib::MainContext: Add push/pop/get_thread_default()Kjell Ahlstedt2019-10-071-0/+20
| | | | See issue #56
* Fix callback races in glibmm when source is destructedDainis Jonitis2019-04-181-7/+23
| | | | | | | | | | | It is normal situation when glib main loop iterates sources on one thread where it checks whether source is still active and its callback functions can be called and glibmm Source being destroyed on other thread. Glibmm should check once again that callback_data and callback_funcs fields are still valid and GSource was not marked as inactive while its callback handlers are called. Fixes #41
* Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-08-311-3/+3
| | | | | | | | | | | | | | gcc8 -Wextra prints a warning when a single reinterpret_cast is used for conversion between different types of function pointers. The previous fix with a union in Glib::bitwise_equivalent_cast<>() is not standard C++. Rename the function to Glib::function_pointer_cast<>(), and use two reinterpret_casts as recommended in gcc's documentation. * glib/src/optiongroup.ccg: Use a reinterpret_cast to convert from a function pointer to void*. That's possible now. It's "conditionally supported", starting with C++11. See https://github.com/libsigcplusplus/libsigcplusplus/issues/8
* Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-07-171-3/+4
| | | | | | | | | | | | gcc8 -Wextra prints a warning when reinterpret_cast is used for conversion between different types of function pointers. Avoid that by adding Glib::bitwise_equivalent_cast<>() with a union with members of the two types of function pointers. * glib/src/optiongroup.ccg: Use Glib::bitwise_equivalent_cast<>() to convert from a function pointer to void*. See https://github.com/libsigcplusplus/libsigcplusplus/issues/1
* Revert "Avoid compiler warnings from function pointer conversions"Kjell Ahlstedt2018-07-171-21/+5
| | | | | | This reverts commit fa85bd1161d5d914095d1a3f9b620da294c9af79. This can be done in a better way by keeping the union in a template function.
* Avoid compiler warnings from function pointer conversionsKjell Ahlstedt2018-07-131-5/+21
| | | | | | | | gcc8 -Wextra prints a warning when reinterpret_cast is used for conversion between different types of function pointers. Avoid that by instead using a union with members of the two types of function pointers. See https://github.com/libsigcplusplus/libsigcplusplus/issues/1
* Glib::TimeoutSource: Use monotonic time consistentlyKjell Ahlstedt2018-01-251-32/+16
| | | | | | * glib/glibmm/main.[cc|h]: Change type of TimeoutSource::expiration_ from Glib::TimeVal to gint64. Use Source::get_time() consistently. Bug 792524
* Glib::Source: Remove get_current_time() from main.hKjell Ahlstedt2017-11-171-2/+0
| | | | | get_current_time() is a deprecated function that was removed from main.cc by commit 45cc8f8f8cb093a9e8aa8747af93c57941e1b32a
* Update the Free Software Foundation address in copyright noticesKjell Ahlstedt2017-08-301-2/+1
| | | | Bug 786824
* Fix build when _WRAP_ENUM generates enum classKjell Ahlstedt2017-04-111-2/+2
| | | | Bug 86864
* Add and use make_refptr_for_instance().Murray Cumming2017-04-061-10/+10
| | | | This will make it easier to change the underlying RefPtr type.
* IOChannel: Avoid creating a RefPtr to this.Murray Cumming2017-04-051-0/+12
| | | | | | | By adding a private IOSource constructor (and create()), accessible via a friend declaration, that takes the raw GIOChannel. See https://bugzilla.gnome.org/show_bug.cgi?id=755037#c20
* PollFD: autodeduce type of fd fieldMarcin Kolny2016-12-061-5/+5
| | | | | | | | * glib/glibmm/main.[h|cc]: file descriptor to poll can be either of gint, or gint64 type, depending on the platform. glibmm should follow this rule as well. https://bugzilla.gnome.org/show_bug.cgi?id=772074
* Glib::Source: Replace extra_source_data by instance dataKjell Ahlstedt2016-12-031-54/+13
| | | | | | * glib/glibmm/main.[cc|h]: Replace the std::map containing ExtraSourceData with instance data in Source. The map was just a way of avoiding an ABI break, but now we can break ABI. Bug 561885
* Glib::ObjectBase: Replace extra_object_base_data map by instance dataKjell Ahlstedt2016-11-241-0/+1
| | | | | | | | | | | | | | | | | | * glib/glibmm/class.[cc|h]: Remove the clone_custom_type() overload without an interface_class_vector_type argument. * glib/glibmm/interface.cc: * glib/glibmm/object.cc: * glib/glibmm/objectbase.[cc|h]: Replace the std::map containing ExtraObjectBaseData with instance data in ObjectBase. The map was just a way of avoiding an ABI break, but now we can break ABI. The new data is a std::unique_ptr<Class::interface_class_vector_type> rather than a Class::interface_class_vector_type. It's a vector which is used only during a short period during object construction, and only for custom objects. With a pointer to the vector, it need not be created for the majority of objects, and if it is created, it can be deleted when it's no longer needed. * gio/src/application.ccg: * glib/glibmm/main.cc: Add #include <mutex> that should have been there before, but now became necessary, when it was removed from objectbase.h.
* Remove deprecated API.Murray Cumming2016-11-141-24/+0
|
* Remove deprecated Thread and Threads API.Murray Cumming2016-11-141-21/+0
|
* sigc3: .h/.cc files: Use slot/signal<R(Args...)> syntax.Murray Cumming2016-11-141-23/+23
|
* sigc3: SourceConnectionNode: Derive from sigc::notifiable.Murray Cumming2016-11-141-15/+25
| | | | | This shows how having a sigc::notifiable base class is much nicer than using these objects as void* as in libsigc++-2.0.
* Rearrange some multiline comments.Murray Cumming2016-02-271-1/+2
| | | | | | Putting the comment before the code, instead of to the right, because clang-format can not (and could not) know which comments are meant to be aligned. I prefer this anyway.
* Re-run clang-format on some files.Murray Cumming2016-02-261-2/+2
| | | | | I need to make a subsequent commit to fix the now-unaligned trailing comments.
* Run clang-format on glib .cc files.Murray Cumming2016-02-261-315/+377
|
* glibmm/main: More declarations within #ifndef GLIBMM_DISABLE_DEPRECATEDKjell Ahlstedt2015-11-291-4/+6
| | | | | | | | | * glib/glibmm/main.h: Include 'namespace Threads' declarations only if GLIBMM_DISABLE_DEPRECATED is not defined. * glib/glibmm/main.cc: Inlude glibmm/threads.h only if GLIBMM_DISABLE_DEPRECATED is not defined. Use G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS instead of undefining G_DISABLE_DEPRECATED.
* Use std::unique_lock::unlock() instead of release()Kjell Ahlstedt2015-11-281-3/+3
| | | | | | | * glib/blibmm/main.cc: * gio/src/application.ccg: Glib::Threads::Mutex::Lock::release() should have been replaced by std::unique_lock::unlock(). std::unique_lock::release() does not unlock the mutex. Bug #757674.
* Glib::Main: Use std::mutex instead of Glib::Threads::Mutex.Murray Cumming2015-11-261-4/+4
| | | | And std::unique_lock instead of Glib::Threads::Mutex::Lock.
* Glib::MainContext: Deprecate wait(cond, mutex).Murray Cumming2015-11-261-1/+1
| | | | | | | Because it uses the deprecated Threads API in its API, and doesn't seem generally useful. As suggested here: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c11
* Glib: More nullptr instead of 0Kjell Ahlstedt2015-11-231-4/+1
|
* Glib: More nullptr instead of 0.Murray Cumming2015-11-201-15/+15
|
* Make destructors explicitly noexcept.Murray Cumming2015-08-311-4/+4
| | | | | Destructors are already noexcept, but this makes that even clearer. This might be foolish.
* C++11: Use nullptr.Murray Cumming2015-07-161-10/+10
|
* C++11: examples/tests: More use of auto.Murray Cumming2015-07-151-2/+2
|
* Add Gio:SocketSource, SignalSocket and Socket::create_source()Kjell Ahlstedt2014-05-151-0/+39
| | | | | | | | | | | * .gitignore: Add !gio/giomm/socketsource.[cc|h]. * gio/giomm.h: * gio/giomm/filelist.am: Add socketsource.h. * gio/giomm/socketsource.[cc|h]: New files. SocketSource and SignalSocket. * gio/src/socket.[ccg|hg]: Add create_source(). Remove many trailing blanks in socket.hg. * glib/glibmm/main.[cc|h]: Add functions required when a class derived from Source is defined in another file. Bug #725281.
* Glib::MainContext: Add invoke().Kjell Ahlstedt2013-06-021-0/+31
| | | | * glib/glibmm/main.[h|cc]: Add Glib::MainContext::invoke(). Bug #668184.
* Glib::Source: Fix the destruction and deletion.Kjell Ahlstedt2013-04-181-9/+65
| | | | | | * glib/glibmm/main.cc: Keep the Glib::Source wrapper until the GSource instance has been destroyed and all RefPtr<Source> have been deleted. Keep a separate ref count in glibmm. Bug #561885.
* Signal*::connect(): Make them less thread-unsafe.Kjell Ahlstedt2013-02-211-5/+5
| | | | | | | | * glib/glibmm/main.cc: Make SignalTimeout::connect(), connect_seconds(), SignalIdle::connect() and SignalChildWatch::connect() less thread-unsafe by moving conn_node->install() to before g_source_attach(). * glib/glibmm/main.h: Describe that the Signal*::connect*() methods that return a sigc::connection are not thread-safe. Bug #396958.
* Signal[Timeout|Idle]::connect_once() docs: Warn about thread-unsafety.Kjell Ahlstedt2013-02-201-3/+3
| | | | | | | * glib/glibmm/main.cc: Fix an incomplete comment. * glib/glibmm/main.h: SignalTimeout::connect_once(), connect_seconds_once(), SignalIdle::connect_once(): Describe the caution necessary because sigc::trackable-derived objects are not thread-safe. Bug #396963.
* Make SignalTimeout,SignalIdle::connect_once() more thread safe.Kjell Ahlstedt2012-04-041-7/+1
| | | | | * glib/glibmm/main.cc: Call SourceConnectionNode::install() before g_source_attach(). Suggested by Chris Vine. Bug #396963 comments 15-18.
* Make SignalTimeout,SignalIdle::connect_once() more thread safe.Kjell Ahlstedt2012-04-031-6/+52
| | | | | * glib/glibmm/main.cc: Don't create a sigc::connection in the connect_once() methods. Bug #396963.
* Fix the build with --disable-deprecated-api.Kjell Ahlstedt2012-02-281-0/+22
| | | | | | | | | | | | | | * glib/glibmm/main.cc: Call get_time() instead of the deprecated get_current_time(), when GLIBMM_DISABLE_DEPRECATED is defined. * glib/src/thread.[hg|ccg]: Use _IS_DEPRECATED instead of _DEPRECATE_IFDEF_{START|END}. _DEPRECATE_IFDEF_{START|END} does not include code generated by gmmproc within #ifndef/#endif. * glib/src/threads.ccg: Change catch(Glib::Thread::Exit&) to catch(Glib::Threads::Thread::Exit&). * glib/src/threads.hg: Add _GMMPROC_EXTRA_NAMESPACE(Threads). * glib/src/valuearray.hg: * gio/src/application.hg: #undef G_DISABLE_DEPRECATED in the .cc file. * tools/m4/class_shared.m4: Define _IS_DEPRECATED. Bug #640029.
* Add Glib::Threads::* in threads.h, deprecating everything in thread.hMurray Cumming2011-11-231-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | * glib/src/filelist.am: * glib/src/thread.[hg|ccg]: Deprecate the whole file, adding deprecation doxygen comments to all API. * glib/src/threads.[hg|ccg]: A new Threads namespace containing equivalents for everything in thread.h, implemented using only non-deprecated glib API. This was necessary because we had to break the ABI to do this. * glib/glibmm.h: Include threads.h * glib/glibmm/main.[h|cc]: Added a wait() method overload that takes the new types, deprecating the existing wait() method. * examples/network/resolver.cc: * examples/network/socket-client.cc: * examples/network/socket-server.cc: * examples/thread/dispatcher.cc: * examples/thread/dispatcher2.cc: * examples/thread/thread.cc: * examples/thread/threadpool.cc: * glib/glibmm/dispatcher.cc: * glib/glibmm/exceptionhandler.cc: * glib/glibmm/threadpool.[h|cc]: Use the new Glib::Threads::* types instead of thread.h.
* Avoid a deprecation warning in implelementation of deprecated API.Murray Cumming2011-11-231-0/+1
| | | | | | * glib/glibmm/main.cc: Define GLIB_DISABLE_DEPRECATION_WARNINGS to avoid a warning about g_source_get_current_time(), which we must use in our own deprecated code.
* thread.h: Allow use of this without causing deprecation compiler warnings.Murray Cumming2011-10-261-1/+3
| | | | | | | | | | | | | | | | | | | | | * glib/src/thread.hg: undef and then redefine G_DISABLE_DEPRECATED, and define GLIB_DISABLE_DEPRECATION_WARNINGS, if G_DISABLE_DEPRECATED is defined, so we can use the deprecated API in this header (though only in our own deprecated API). * tools/generate_wrap_init.pl.in: Include glibmm.h instead of glib.h so we can include thread.h first (via glibmm.h) instead of only later. This seems more logical than explicitly including thread.h in all (even non-glibmm) generated wrap_init.cc files. * tools/m4/base.m4: * glib/glibmm.h: * glib/glibmm/dispatcher.cc: * glib/glibmm/exceptionhandler.cc: * glib/glibmm/main.cc: * examples/thread/thread.cc: * examples/thread/threadpool.cc: Adjust the includes to include thread.h first.
* Fix the build with glib from git master.Murray Cumming2010-11-031-9/+7
| | | | | * glib/glibmm/main.[h|cc]: get_time(): Now returns a gint64 instead of a GTimeSpec output parameter.
* Fix the build with --enable-warnings=fatalMurray Cumming2010-11-011-0/+9
| | | | | | * glib/glibmm/main.[h|cc]: get_current_time(): undef G_DISABLE_DEPRECATED so this can build. Deprecate it to match the C API. Add get_time() which replaces it. However, we should replace our use of it, which seems difficult.
* Remove the reduced API options and code, as discussed on mailing list.Murray Cumming2010-05-311-24/+0
| | | | | | | | | * configure.ac: Removed the --enable-api-exceptions, --enable-api-properties, --enable-api-vfuncs and --enable-api-default-signal-handlers options. * build/reduced.m4: Removed. * tools/m4/*.m4: * tools/pm/Output.pm: Remove any use of ifdefs and auto_ptr for reduced API. * *.[hg|ccg|h|cc]: Remove the idefed code.
* Get rid of all uses of GLIBMM_USING_STD()Daniel Elstner2009-08-161-4/+0
| | | | | | | | | | * glib/src/*.{ccg,hg}: Remove all uses of GLIBMM_USING_STD(). We definitely do not need this anymore, and probably never did. We never covered all symbols from namespace std anyway and never got any complaint about it. Also, be careful to always include the glibmmconfig.h header when it is needed. * glib/glibmm/*.{cc,h}: ditto. * glib/glibmmconfig.h.in: Clean up and re-indent.
* Change license header to mention Lesser General Public License version 2.1Deng Xiyue2009-01-191-4/+4
| | | | | | | | | | 2009-01-20 Deng Xiyue <manphiz@gmail.com> * Change license header to mention Lesser General Public License version 2.1 instead of Library General Public License, to be consistent with COPYING. svn path=/trunk/; revision=779
* Add convenience functions for one-shot timer/idle handlersJonathon Jongsma2008-12-121-0/+17
| | | | | | | | * glib/glibmm/main.h: * glib/glibmm/main.cc: Added SignalIdle::connect_once, SignalTimeout::connect_once, and SignalTimeout::connect_seconds_once. svn path=/trunk/; revision=750
* Clean up glib includes (Bug #563987)Jonathon Jongsma2008-12-101-1/+0
| | | | svn path=/trunk/; revision=749