summaryrefslogtreecommitdiff
path: root/glib/glibmm/objectbase.cc
Commit message (Collapse)AuthorAgeFilesLines
* Object construction: Add custom class init and instance init functionsKjell Ahlstedt2017-02-151-0/+54
| | | | | | | Make it possible for named custom types to register additions to the class init function and to register an instance init function. An extra class init function is useful in Gtk::WidgetCustomDraw and Gtk::WidgetCustomSnapshot. Bug 775348
* Glib::ObjectBase: Remove connect_property_changed_with_return()Kjell Ahlstedt2016-11-301-15/+2
| | | | and let connect_property_changed() return a sigc::connection.
* Glib::ObjectBase: Use std::forward_list for interface class pointersKjell Ahlstedt2016-11-251-6/+3
| | | | | | | std::forward_list is ideally suited for storing pointers to the interfaces of custom types. The list is often empty, never long. No need to use a pointer to a container in order to save storage space (as I did in the previous commit). An empty std::forward_list consists of nothing but a pointer.
* Glib::ObjectBase: Replace extra_object_base_data map by instance dataKjell Ahlstedt2016-11-241-15/+8
| | | | | | | | | | | | | | | | | | * 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.
* sigc3: .h/.cc files: Use slot/signal<R(Args...)> syntax.Murray Cumming2016-11-141-4/+4
|
* Run clang-format on glib .cc files.Murray Cumming2016-02-261-87/+108
|
* Add some connect() overloads that move the sigc::slotKjell Ahlstedt2016-02-011-11/+20
| | | | | | | | | | | | | | | * glib/glibmm/dispatcher.[cc|h]: Add Dispatcher::connect(&&). * glib/glibmm/objectbase.[cc|h]: Add ObjectBase::connect_property_changed(&&) and ObjectBase::connect_property_changed_with_return(&&). * glib/glibmm/propertyproxy_base.[cc|h]: Add PropertyProxyConnectionNode(&&) ctor, PropertyProxyConnectionNode::connect_changed() and SignalProxyProperty::connect(&&). * glib/glibmm/signalproxy.[cc|h]: Add SignalProxyNormal::connect_impl_(&&), SignalProxy::connect(&&), SignalProxy::connect_notify(&&), SignalProxyDetailed::connect_impl_(&&), SignalProxyDetailedAnyType::connect(&&) and SignalProxyDetailedAnyType::connect_notify(&&). * glib/glibmm/signalproxy_connectionnode.[cc|h]: Add SignalProxyConnectionNode(&&) ctor
* Remove now-unnecessary includes of glibmm/threads.h.Murray Cumming2015-11-271-1/+0
|
* ObjectBase: Change extra_object_base_data_mutex to a std::mutex.Murray Cumming2015-11-261-4/+5
| | | | | | Instead of a (now deprecated) Glib::Threads::Mutex*. As discussed here: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c12
* Glib: More nullptr instead of 0.Murray Cumming2015-11-201-4/+4
|
* ObjectBase, Object, Interface: Fix move constructors and move assignmentsKjell Ahlstedt2015-10-311-9/+15
| | | | | | | | | | | | | | | | * glib/glibmm/interface.cc: Don't call ObjectBase's move assignment operator from Interface's move assignment operator. * glib/glibmm/object.cc: Perform of job of sigc::trackable's move constructor in Object's move constructor. * glib/glibmm/objectbase.cc: Move constructor: Set gobject_ = nullptr. Fix the assignment of cpp_destruction_in_progress_. Move assignment: Add self-assignment guard. Avoid the risk of accidentally deleting *this. Let a call to initialize_move() do most of the job. * tests/glibmm_interface_move/main.cc: * tests/glibmm_object_move/main.cc: * tests/glibmm_objectbase_move/main.cc: Really test move assignment. Test that the wrapped C object has been moved, and not copied. Bug #756962.
* Fix the build with --enable-warnings=fatalKjell Ahlstedt2015-09-231-1/+2
| | | | * glib/glibmm/objectbase.cc: Cast pointers to void* in call to g_warning().
* ObjectBase: move operations: Call the sigc::trackable base.Murray Cumming2015-09-011-1/+4
|
* Make destructors explicitly noexcept.Murray Cumming2015-08-311-1/+1
| | | | | Destructors are already noexcept, but this makes that even clearer. This might be foolish.
* ObjectBase: Add initialize_move().Murray Cumming2015-08-221-0/+44
| | | | | | | | | | | And _move_current_wrapper() for it to use. Object and Interface can use initialize_move() in their move constructors. They need to do this because their calls to the ObjectBase move constructors will not actually run, at least when in a derived class, because ObjectBase is a virtual base class (for use in virtual inheritance). We have initialize() for much the same reason, for the regular constructors.
* Glib::ObjectBase, Object, Interface: Add move operators.Murray Cumming2015-08-221-0/+18
| | | | | Add move constructors and move assignment operators so that derived classes can have these too.
* C++11: Use nullptr.Murray Cumming2015-07-161-3/+3
|
* Glib::ObjectBase: Don't use std::auto_ptrKjell Ahlstedt2015-05-031-4/+1
| | | | | | * glib/glibmm/objectbase.[h|cc]: Use a plain pointer instead of std::auto_ptr. auto_ptr is deprecated in C++11, and can cause compilation warnings. Bug #748630.
* Revert "Pass 0 (NULL) instead of for C properties."Murray Cumming2013-09-081-12/+0
| | | | This reverts commit db1668a39d9646882d5aa6b7386a3b7ea70f99af.
* Revert "Fix the build"Murray Cumming2013-09-081-2/+5
| | | | This reverts commit 5d4342dd14bb7ca79b63c1341fdfa420164b35e4.
* Fix the buildMurray Cumming2013-09-031-5/+2
|
* Pass 0 (NULL) instead of for C properties.Murray Cumming2013-09-031-0/+12
| | | | | | | | * glib/glibmm/objectbase.cc: set_property_value(): * glib/glibmm/propertyproxy_base.cc: set_property(): If the value is a G_TYPE_STRING (a gchar*), and is "", then pass 0 instead. Bug #686909
* Add interfaces to custom types before class_init.Kjell Ahlstedt2013-08-011-1/+15
| | | | | | | | | | | | | | | | | | | | | * glib/glibmm/class.[h|cc]: Add a clone_custom_type() overload that takes a vector of pointers to Interface_Class instances, so we can call their add_interface() functions on the GType just after registering it, but before instantiating the first GObject. custom_class_init_function(): Override properties of implemented interfaces that have not been overridden in a base class. * glib/glibmm/interface.cc: Interface::Interface(const Interface_Class& interface_class): If the GObject has not been instantiated yet, then add interface_class to the Class::custom_interface_classes vector. * glib/glibmm/objectbase.[h|cc]: Add extra_object_base_data and extra_object_base_data_mutex. * glib/glibmm/objectbase.cc: ~ObjectBase(): Erase 'this' from extra_object_base_data. * glib/glibmm/object.cc: Default constructor and Object::Object(const Glib::ConstructParams& construct_params): Pass the list of Interface_Class pointers to the new Class::clone_custom_type() method overload. Bug #697229.
* Strip trailing whitespace.Mark Vender2012-10-291-1/+1
| | | | | | | * gio/giomm/*.[h|cc]: * gio/src/*.[hg|ccg]: * glib/glibmm/*.[h|cc]: * glib/src/*.[hg|ccg]: Strip trailing whitespace. Bug #681072.
* Revert "Gio::Application: Initialize glibmm and giomm."Murray Cumming2011-01-191-19/+4
| | | | | This reverts commit 590000d08fa94a72d042ac1143fa042c90cf9705. Initializing glibmm in ObjectBase is not actually necessary.
* Gio::Application: Initialize glibmm and giomm.Murray Cumming2011-01-181-4/+19
| | | | | | | | | * glib/glibmm/objectbase.cc: Constructors: Call Glib::init(), making it unnecessary to call this explicitly before instantiating a Glib::Object. * gio/src/application.ccg: Make sure that giomm can be used as soon as a Gio::Application has been instantiated. This should let use just instantiate a Gtk::Application instead of using Gtk::Main.
* ObjectBase: Fixed refcount debugging message.Krzesimir Nowak2010-11-081-2/+2
| | | | | | * glib/glibmm/objectbase.cc: A parameter passed to g_warning() in destroy_notify_callback() describing a name of GObject should be indeed a name, not a pointer to GObject.
* Add Glib::ObjectBase::freeze_notify()/thaw_notify. Fixes Bug #575533Jonathon Jongsma2009-07-261-0/+10
|
* Remove mention of G_GNUC_PRETTY_FUNCTION in comment because a codeDaniel Elstner2009-02-171-2/+0
| | | | | | | | | * glib/glibmm/debug.h: Remove mention of G_GNUC_PRETTY_FUNCTION in comment because a code maintenance tool of André Klapper complained about it. * glib/glibmm/objectbase.cc: Likewise. svn path=/trunk/; revision=785
* 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
* Added connect_property_changed_with_return() becauseMurray Cumming2008-01-201-0/+8
| | | | | | | | | | | 2008-01-20 Murray Cumming <murrayc@murrayc.com> * glib/glibmm/objectbase.cc: * glib/glibmm/objectbase.h: Added connect_property_changed_with_return() because onnect_property_changed() doesn not return a sigc::connection. Bug #433984 (Philip Langdale, Kalle Vahlman). svn path=/trunk/; revision=530
* Added connect_property_changed(), as an alternative to use when theMurray Cumming2006-11-101-0/+18
| | | | | | | | | | | | 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. * glib/glibmm/propertyproxy_base.cc: * glib/glibmm/propertyproxy_base.h: Move PropertyProxyConnectionNode into the header, so we can reuse it for connect_property_changed().
* Mark private functions as static, to stop them being exported in the API,Murray Cumming2006-04-121-1/+1
| | | | | | | | | | | | | | | 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.
* Spring cleaning. ditto.Daniel Elstner2004-06-201-3/+3
| | | | | * glib/glibmm/objectbase.cc: Spring cleaning. * glib/glibmm/object.cc: ditto.
* documentation fixes and corrections in the comments reflecting the shiftMartin Schulze2004-02-131-4/+2
| | | | | | | | | 2004-02-13 Martin Schulze <teebaum@cvs.gnome.org> * documentation fixes and corrections in the comments reflecting the shift to libsigc++ 2. * make all source files in example thread use libsigc++ 2 instead of libsigc++ 1.2.
* Now uses ObjectBase instead of Object, because glib can now haveMurray Cumming2003-11-011-0/+10
| | | | | | | | | | | | | | | 2003-11-01 Murray Cumming <murrayc@usa.net> * glib/glibmm/propertyproxy.h, propertyproxy_base.[h|cc]: Now uses ObjectBase instead of Object, because glib can now have properties on interfaces. This is needed, for instance, by the GtkFileChooser interface wrapper in gtkmm. * glib/glibmm/object.h: Moved get/set_property() methods into ObjectBase, for the same reason. * tools/pm/WrapParser.pm, Output.pm: Added optional no_default_handler parameter to gmmproc _WRAP_SIGNAL() macro, for signals whose default signal handler is not in the klass struct and therefore can not be overridden.
* merged some bits from 2.2Murray Cumming2003-07-191-0/+6
|
* GTKMM_ m4 tests and #defines are now prefixed with GLIBMM_Murray Cumming2003-01-221-8/+8
| | | | | | 2003-01-22 Murray Cumming <murrayc@usa.net> * GTKMM_ m4 tests and #defines are now prefixed with GLIBMM_
* Initial revisionMurray Cumming2003-01-071-0/+257