summaryrefslogtreecommitdiff
path: root/glib/glibmm/class.h
Commit message (Collapse)AuthorAgeFilesLines
* Object construction: Add custom class init and instance init functionsKjell Ahlstedt2017-02-151-7/+14
| | | | | | | 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: Use std::forward_list for interface class pointersKjell Ahlstedt2016-11-251-3/+7
| | | | | | | 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/+0
| | | | | | | | | | | | | | | | | | * 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.
* C++11: .h/.cc files: Replace typedefs with using.Murray Cumming2016-03-311-2/+2
|
* Run clang-format on glib .h files.Murray Cumming2016-02-261-14/+14
|
* Make destructors explicitly noexcept.Murray Cumming2015-08-311-1/+1
| | | | | Destructors are already noexcept, but this makes that even clearer. This might be foolish.
* Rename ambiguously named overridden property variable and typePovilas Kanapickas2014-07-071-5/+5
| | | | | | | | | | | * glib/glibmm/class.[cc|h]: * glib/glibmm/interface.cc: * glib/glibmm/property.cc: Rename properties_quark and properties_type to iface_properties_quark and iface_properties_type. As custom_[set|get]_property_callback() in property.cc also sets and gets user-defined properties, this naming choice may be confusing. These names are intended for use by glibmm only. Renaming is not an ABI/API break. Bug #731484.
* Add interfaces to custom types before class_init.Kjell Ahlstedt2013-08-011-0/+28
| | | | | | | | | | | | | | | | | | | | | * 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.
* Custom Interface Properties: Use base finalize function to free data.José Alburquerque2013-05-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | * glib/glibmm/class.cc (Class::clone_custom_type): Specify a custom base finalize function for the custom type which would free the properties data that might exist due to properties of implemented interfaces being overridden. This is better than having an interface finalize function because the custom type could implement several interfaces which would mean that the interface finalize function would execute more than once as opposed to just once for the base finalize function. * glib/glibmm/class.h (Class::interface_finalize_function): Replace with Class::custom_class_base_finalize_function(). * glib/glibmm/interface.cc (Interface_Class::add_interface): Do not specify a custom interface finalize function. (Interface::Interface(const Interface_Class&): Also initialize the property GValues using g_param_value_set_default() so that they are initialized with the default values of the properties and not just the default value of the GValue type. Bug #697229.
* Custom Interfaces: Implement derived interface properties in present.José Alburquerque2013-04-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/glibmm/class.cc (Class::properties_quark): Initialize this GQuark which is used to store/get the data used for setting and getting the properties of the interfaces that a custom type overrides. (Class::interface_finalize_function): Add this function which once invoked frees the property data stored as gqata in the GType and allocated/appended to in the Glib::Interface constructor below. * glib/glibmm/class.h: Declare the interface_finalize_function above. Also declare the quark used to store/get the property data and the typedef data type of the property data. * glib/glibmm/interface.cc (Interface_Class::add_interface): Specify a custom interface finalize function when adding the interface so that the resources allocated for handling the derived interface properties can be freed if the type is a custom interface type. (Interface::Interface(const Interface_Class&)): Modify the constructor so that when dealing with a custom interface type, it gets a list of the properties of the interface to be added and overrides these by appending approperiate GValues to the data used to handle getting/setting properties that is stored as qdata in the GType. The constructor uses g_param_spec_overrided() to override the properties of the implemented interface and g_object_install_property() to install the properties. * glib/glibmm/property.cc (PropertyBase::install_property): Rewrite this method so that the acquired generated id's of custom implemented properties does not collide with the id's of properties of implemented interfaces that have been overridden in a custom type. This is done by offsetting the acquired generated id (by addition) with the number of already existing properties (the ones that have been overridden). (custom_get_property_callback): Rewrite this function (which gets properties for custom types) so that if the property id is less than or equal to the number of overridden interface properties (which would mean that an overridden interface property should be gotten) the correct overridden interface property is gotten. Otherwise, a custom property should be retrieved, in which case the id is offset (by subtraction) when the PropertyBase is retrieved from the id which would ensure getting the correct PropertyBase. (custom_set_property_callback): Rewrite this function as the above custom_get_property_callback was rewritten.
* Increased versionglibmm-2.21.1-realMurray Cumming2009-06-291-0/+7
|
* 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
* Merged changes from glibmm-2-10 branch.Murray Cumming2006-05-121-0/+1
|
* Temporarily reverted some stuff. I will recommit some of it.Murray Cumming2005-01-211-17/+0
|
* #include glibmmconfig.h so thatMurray Cumming2005-01-211-0/+1
| | | | | | | | | | 2005-01-21 Murray Cumming <murrayc@localhost.localdomain> * glib/glibmm/class.h: #include glibmmconfig.h so that GLIBMM_CAN_ASSIGN_NON_EXTERN_C_FUNCTIONS_TO_EXTERN_C_CALLBACKS can be defined. * glib/glibmm/class.cc: Use ifdef instead of ifndef where that is what I meant. Fixes the build.
* Fix the buildMurray Cumming2005-01-201-4/+1
|
* More use of exern C, with an intermediate callback, to satisfy the IRIXMurray Cumming2005-01-201-0/+19
| | | | | | | | | | 2005-01-20 Murray Cumming <murrayc@murrayc.com> * glib/glibmm/class.h: More use of exern C, with an intermediate callback, to satisfy the IRIX MipsPro compiler. * glib/glibmm/container.h: #ifdef out a dynamic_cast that MipsPro does not allow, and which I can not think of a better place to put. See the comment in the code.
* Initial revisionMurray Cumming2003-01-071-0/+76