mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
Add G_DEFINE_* macros for final types
These should match the G_DECLARE_FINAL_* macros used in a header file.
This commit is contained in:
parent
c07dd416cf
commit
d1861c8fda
@ -1700,6 +1700,57 @@ guint g_type_get_type_registration_serial (void);
|
||||
* Since: 2.38
|
||||
*/
|
||||
#define G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_ABSTRACT, G_ADD_PRIVATE (TN))
|
||||
/**
|
||||
* G_DEFINE_FINAL_TYPE:
|
||||
* @TN: the name of the new type, in Camel case
|
||||
* @t_n: the name of the new type, in lower case, with words
|
||||
* separated by `_` (snake case)
|
||||
* @T_P: the #GType of the parent type
|
||||
*
|
||||
* A convenience macro for type implementations.
|
||||
*
|
||||
* Similar to G_DEFINE_TYPE(), but defines a final type.
|
||||
*
|
||||
* See G_DEFINE_TYPE_EXTENDED() for an example.
|
||||
*
|
||||
* Since: 2.70
|
||||
*/
|
||||
#define G_DEFINE_FINAL_TYPE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_FINAL, {}) GLIB_AVAILABLE_MACRO_IN_2_70
|
||||
/**
|
||||
* G_DEFINE_FINAL_TYPE_WITH_CODE:
|
||||
* @TN: the name of the new type, in Camel case
|
||||
* @t_n: the name of the new type, in lower case, with words
|
||||
* separated by `_` (snake case)
|
||||
* @T_P: the #GType of the parent type
|
||||
* @_C_: Custom code that gets inserted in the `type_name_get_type()` function.
|
||||
*
|
||||
* A convenience macro for type implementations.
|
||||
*
|
||||
* Similar to G_DEFINE_TYPE_WITH_CODE(), but defines a final type and
|
||||
* allows you to insert custom code into the `*_get_type()` function, e.g.
|
||||
* interface implementations via G_IMPLEMENT_INTERFACE().
|
||||
*
|
||||
* See G_DEFINE_TYPE_EXTENDED() for an example.
|
||||
*
|
||||
* Since: 2.70
|
||||
*/
|
||||
#define G_DEFINE_FINAL_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, G_TYPE_FLAG_FINAL) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() GLIB_AVAILABLE_MACRO_IN_2_70
|
||||
/**
|
||||
* G_DEFINE_FINAL_TYPE_WITH_PRIVATE:
|
||||
* @TN: the name of the new type, in Camel case
|
||||
* @t_n: the name of the new type, in lower case, with words
|
||||
* separated by `_` (snake case)
|
||||
* @T_P: the #GType of the parent type
|
||||
*
|
||||
* A convenience macro for type implementations.
|
||||
*
|
||||
* Similar to G_DEFINE_TYPE_WITH_PRIVATE(), but defines a final type.
|
||||
*
|
||||
* See G_DEFINE_TYPE_EXTENDED() for an example.
|
||||
*
|
||||
* Since: 2.70
|
||||
*/
|
||||
#define G_DEFINE_FINAL_TYPE_WITH_PRIVATE(TN, t_n, T_P) G_DEFINE_TYPE_EXTENDED (TN, t_n, T_P, G_TYPE_FLAG_FINAL, G_ADD_PRIVATE (TN)) GLIB_AVAILABLE_MACRO_IN_2_70
|
||||
/**
|
||||
* G_DEFINE_TYPE_EXTENDED:
|
||||
* @TN: The name of the new type, in Camel case.
|
||||
|
Loading…
Reference in New Issue
Block a user