text: Use macros for subclassing boilerplate

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
This commit is contained in:
Bilal Elmoussaoui 2023-11-11 20:04:56 +01:00
parent 9409604820
commit 3679c82482
4 changed files with 232 additions and 159 deletions

View File

@ -30,6 +30,5 @@
#ifndef __GI_SCANNER__ #ifndef __GI_SCANNER__
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterInputDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterText, g_object_unref)
#endif /* __GI_SCANNER__ */ #endif /* __GI_SCANNER__ */

File diff suppressed because it is too large Load Diff

View File

@ -35,23 +35,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CLUTTER_TYPE_TEXT (clutter_text_get_type ()) #define CLUTTER_TYPE_TEXT (clutter_text_get_type ())
#define CLUTTER_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXT, ClutterText))
#define CLUTTER_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TEXT, ClutterTextClass))
#define CLUTTER_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TEXT))
#define CLUTTER_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TEXT))
#define CLUTTER_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TEXT, ClutterTextClass))
typedef struct _ClutterText ClutterText;
typedef struct _ClutterTextPrivate ClutterTextPrivate;
typedef struct _ClutterTextClass ClutterTextClass;
struct _ClutterText
{
/*< private >*/
ClutterActor parent_instance;
ClutterTextPrivate *priv;
};
/** /**
* ClutterTextClass: * ClutterTextClass:
@ -74,7 +57,10 @@ struct _ClutterTextClass
}; };
CLUTTER_EXPORT CLUTTER_EXPORT
GType clutter_text_get_type (void) G_GNUC_CONST; G_DECLARE_DERIVABLE_TYPE (ClutterText,
clutter_text,
CLUTTER, TEXT,
ClutterActor)
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterActor * clutter_text_new (void); ClutterActor * clutter_text_new (void);

View File

@ -63,6 +63,7 @@ typedef struct _ClutterTransition ClutterTransition;
typedef struct _ClutterPropertyTransition ClutterPropertyTransition; typedef struct _ClutterPropertyTransition ClutterPropertyTransition;
typedef struct _ClutterKeyframeTransition ClutterKeyframeTransition; typedef struct _ClutterKeyframeTransition ClutterKeyframeTransition;
typedef struct _ClutterTransitionGroup ClutterTransitionGroup; typedef struct _ClutterTransitionGroup ClutterTransitionGroup;
typedef struct _ClutterText ClutterText;
typedef struct _ClutterAction ClutterAction; typedef struct _ClutterAction ClutterAction;
typedef struct _ClutterConstraint ClutterConstraint; typedef struct _ClutterConstraint ClutterConstraint;