summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* meson.build: Specify 'check' option in run_command()Kjell Ahlstedt2022-02-141-1/+0
| | | | | | The default value will be changed in future Meson releases. Don't use deprecated python3.path() and execute(..., gui_app: ...).
* Meson build: No implicit_include_directoriesKjell Ahlstedt2021-04-081-0/+1
|
* Meson build: Make it possible to use glibmm as a subprojectKjell Ahlstedt2021-03-121-2/+2
| | | | glib and sigc++ can be subprojects of glibmm.
* Meson build: examples and tests: Add dependency('threads')Kjell Ahlstedt2021-03-121-1/+5
| | | | | | Multithreaded examples and tests depend on 'threads'. I noticed this when I started experimenting with subprojects. Strange that it was not reported as a missing dependency long ago.
* examples, tests: Disable deprecated API when building with MesonKjell Ahlstedt2020-03-091-0/+1
| | | | | Deprecated GLIBMM and GIOMM API are disabled when example programs and test programs are built with Autotools. Do the same when building with Meson.
* examples/thread/dispatcher.cc: Make C++17 compliantChun-wei Fan2020-03-021-3/+5
| | | | | std::mem_fun() and std::unary() have been removed from C++17, so port away from using these.
* examples: Don't build child_watch and iochannel_stream on WindowsChun-wei Fan2020-03-021-2/+8
| | | | | These use *nix items in the code, so they won't build nor run for Windows unless they are ported.
* Add support for building glibmm with MesonKjell Ahlstedt2020-03-011-0/+64
| | | | | | glibmm can be built with either Autotools or Meson. See MR !27
* Prepare existing files for building with MesonKjell Ahlstedt2020-03-011-3/+0
| | | | | | | | * examples/network/resolver.cc: Don't include config.h. It's not used. * glib/glibmm/ustring.cc: Check if GLIBMM_SIZEOF_WCHAR_T is defined. * tools/generate_wrap_init.pl.in: * tools/gmmproc.in: Change '\@' to '\ @'. Meson's configure_file() removes a backslash immediately before an at-sign.
* Avoid unnecessary conversions between std::string and Glib::ustringKjell Ahlstedt2019-11-183-13/+11
| | | | | A few implicit conversions in tests/ have been kept. They are probably deliberate, to test implicit conversion. Inspired by issue #65
* Remove Glib::TimeValKjell Ahlstedt2019-08-132-10/+10
| | | | | | | | | | | | | | | | | | GTimeVal has been deprecated in glib. Remove its wrapping in glibmm. * examples/dbus/server_without_bus.cc: * examples/dbus/session_bus_service.cc: Replace TimeVal by DateTime. * gio/src/fileinfo.[ccg|hg]: Remove [set_]modification_time(). Add set/get_modification_date_time(). * glib/glibmm.h: * glib/glibmm/filelist.am: Remove timeval. * glib/glibmm/timeval.[cc|h]: Removed files. * glib/src/date.[ccg|hg]: Remove set_time(const GTimeVal& timeval). * glib/src/datetime.[ccg|hg]: Remove create_now_local/utc(const TimeVal& tv) and to_timeval(). Add create_from_iso8601(), format_iso8601() and operator bool(). * tools/m4/convert_glib.m4: * tools/m4/convert_gio.m4: Remove conversions for GTimeVal.
* Glib::Property: Update for compatibility with Gtk::BuilderKjell Ahlstedt2019-06-271-0/+4
| | | | | | | | | When an object is created by GtkBuilder, the GObject-derived C object is created and its properties set before there is a C++ wrapper to store the property values in. Glib::custom_set_property_callback() stores property values in a data structure reached via a GQuark in the object. PropertyBase::lookup_property() copies those property values to the PropertyBase objects when the C++ wrapper is created.
* Glib::KeyFile: Make it a _CLASS_OPAQUE_REFCOUNTEDKjell Ahlstedt2019-02-021-5/+5
| | | | | | | | | | * examples/keyfile/main.cc: * gio/src/desktopappinfo.hg: Store KeyFile in a RefPtr. * glib/src/keyfile.[ccg|hg]: Replace _CLASS_GENERIC by _CLASS_OPAQUE_REFCOUNTED. Remove handcoded methods that are now generated by gmmproc. * tools/m4/convert_glib.m4: Update conversion for KeyFile. GKeyFile is refcounted since 2009.
* Glib::IOCondition: Add an IO_ prefix to the enumerator namesKjell Ahlstedt2017-09-054-8/+8
| | | | | | | IN and OUT can be preprocessor macros. IO_ is added to the enumerator names. E.g. Glib::IOCondition::IN is replaced by Glib::IOCondition::IO_IN. These enumerator names will be the same as before we used enum class. Bug 786717
* Update the Free Software Foundation address in copyright noticesKjell Ahlstedt2017-08-3014-30/+15
| | | | Bug 786824
* Glib::OptionEntry: Use _WRAP_ENUM for Glib::OptionEntry::FlagsKjell Ahlstedt2017-06-121-2/+2
| | | | It's changed from a plain enum to a scoped enum.
* Glib::SignalProxy: Make a specialization for void signal handlersKjell Ahlstedt2017-04-231-1/+1
| | | | | | | Make specializations of SignalProxy<> and SignalProxyDetailed<> for signal handlers that return void. The specializations have no connect_notify() method, and the 'after' parameter in the connect() method has a default value only in the specializations. Bug 126213
* Gio::Socket: Move enums into class.Murray Cumming2017-04-182-5/+5
|
* Fix make check when _WRAP_ENUM generates enum classKjell Ahlstedt2017-04-117-17/+18
| | | | Bug 86864
* Use std::dynamic_pointer_cast<>().Murray Cumming2017-04-073-3/+3
| | | | Instead of Glib::RefPtr<>::cast_dynamic().
* Glib::OptionGroup: Modify on_[pre|post]_parse(), on_error()Kjell Ahlstedt2017-03-211-6/+6
| | | | | | | Remove the OptionGroup& parameter in on_pre_parse(), on_post_parse() and on_error(). It's unnecessary. It's always identical to *this. Add a const Error& parameter to on_error(). It's an input parameter with information about an error that has occurred in OptionContext::parse().
* Gio::Resolver: Use std::vector instead of Glib::ListHandle<>.Murray Cumming2017-03-201-5/+3
| | | | | | Using Glib::ListHandler<>::list_to_array() and Glib::ListHandler<>::list_to_vector() instead, and only in the implementation instead of in the API.
* Examples: Make a single-parameter constructor explicit.Murray Cumming2016-12-121-1/+1
| | | | Noticed by cppcheck.
* Examples: Network: Small const improvement.Murray Cumming2016-12-122-2/+2
| | | | Noticed by cppcheck.
* examples/Makefile.am: Re-insert the dispatcher examplesKjell Ahlstedt2016-11-251-8/+3
| | | | | | When the Thread classes were removed, the dispatcher examples were removed from the list of check_PROGRAMS. I suppose that was a mistake. The dispatcher examples were not removed. They still work. They use std::thread.
* Remove deprecated Thread and Threads API.Murray Cumming2016-11-143-199/+1
|
* Examples: Avoid a warning about unused code.Murray Cumming2016-11-051-4/+0
| | | | | | | This useful warning seems to be new in g++ 6: thread/dispatcher2.cc:88:1: error: ‘{anonymous}::ThreadTimer::~ThreadTimer()’ defined but not used [-Werror=unused-function] ThreadTimer::~ThreadTimer()
* Examples: Use libsigc++ 2.9/10 and its slot/signal<R(Args...)> syntax.Murray Cumming2016-03-314-9/+9
| | | | The older libsigc++ syntax is deprecated.
* C++11: .h/.cc files: Replace typedefs with using.Murray Cumming2016-03-311-1/+1
|
* Correct bad uses of sigc::bind<1>.Murray Cumming2016-03-082-2/+2
| | | | | | | | | sigc::bind<1>() is meant to bind a value for the second argument, which makes no sense for a method with 1 parameter. sigc::bind() seems fine. I found this while working in the sigc3 branch, using libsigc++-3.0, which is less forgiving of this error.
* 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-1/+1
| | | | | I need to make a subsequent commit to fix the now-unaligned trailing comments.
* Run clang-format on the examples.Murray Cumming2016-02-2621-1305/+1276
|
* C++11: Use emplace_back() instead of push_back().Murray Cumming2016-02-051-4/+4
|
* Threads example: Fix build on Visual StudioChun-wei Fan2016-01-201-0/+5
| | | | | | | | We need to include <memory> for unique_* on Visual Studio, and for Visual Studio 2013 builds, we need to ensure that glibmmconfig.h is included so that noexcept is supported. https://bugzilla.gnome.org/show_bug.cgi?id=760612
* example: Remove unnecessary virtual keywords on destructors.Murray Cumming2015-12-242-3/+3
|
* examples/network: Improve the time-out functionalityKjell Ahlstedt2015-12-062-25/+58
| | | | | | | * examples/network/socket-client.cc: * examples/network/socket-server.cc: Store the thread pointer in a std::unique_ptr. Then the thread is always joined and deleted. Stop the thread immediately in case of error, or if the user requests end of transmission.
* Fix the build with --disable-deprecated-apiKjell Ahlstedt2015-12-051-3/+14
| | | | | | | | | | | | | | | | * examples/thread/threadpool.cc: If --disable-deprecated-api, just print a message and exit. * gio/src/<several>.hg: Add _CONFIGINCLUDE(giommconfig.h). * gio/src/menuitem.ccg: Add a missing _DEPRECATE_IFDEF_START/_END pair. * glib/glibmm/sarray.h: * glib/glibmm/threadpool.[cc|h]: #include <glibmmconfig.h> before ifndef GLIBMM_DISABLE_DEPRECATED. * glib/src/filelist.am: Remove glibmm_files_deprecated_hg. List deprecated files in glibmm_files_any_hg. The config file must be included before #ifndef xxx_DISABLE_DEPRECATED both in the .h file and in the .cc file, or else deprecated API is not properly disabled by --disable-deprecated-api.
* Deprecated Glib::ThreadPool.Murray Cumming2015-11-261-0/+6
| | | | | | Because we should encourage the use of 2 different thread APIs at the same time. Maybe std::async() does what a thread pool would do? If so, we should improve the deprecation documentation.
* examples/tests: Use simpler std::thread constructor.Murray Cumming2015-11-264-25/+7
| | | | | Instead of using a lambda. As suggested by Kjell Ahlstedt: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
* thread example: Use std::unique_ptr<> with std::thread.Murray Cumming2015-11-261-7/+5
| | | | | As suggested by Andrew Potter: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c9
* resolver example: Use std::mutex instead of G_LOCK_DEFINE_STATIC.Murray Cumming2015-11-261-7/+5
| | | | | As noticed by Kjell Ahlstedt: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c10
* Network examples: Use std::thread instead of Glib::Threads::Thread.Murray Cumming2015-11-263-7/+52
| | | | Bug #757674
* examples: dispatcher: Use std::thread and friends.Murray Cumming2015-11-262-15/+37
| | | | Instead of deprecated Glib::Threads::*.
* thread example: Use std::thread, etc, instead of deprecated Glib::Threads::*.Murray Cumming2015-11-261-16/+39
|
* threadpool example: Use std::mutex instead of Glib::Threads::Mutex.Murray Cumming2015-11-261-3/+4
| | | | And std::lock_guard<> instead of Glib::Threads::Mutex::Lock.
* Examples: Use nullptr instead of 0.Murray Cumming2015-11-201-1/+1
|
* Revert "Deprecate Regex now that we have std::regex."Murray Cumming2015-09-012-0/+46
| | | | | | I didn't mean to push this yet. Maybe we will never deprecate this if it offers better UTF-8 support than std::regex. This reverts commit a1f0b1a06095d81b6a5b8255b818b1c35c92df29.
* resolver example: Use std:stoul instead of stdstrtoulMurray Cumming2015-09-011-1/+1
|
* resolver example: Use std::strtoul instead of strtoul.Murray Cumming2015-09-011-1/+1
|