cally/clone: Use macros for subclassing boilerplate

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
This commit is contained in:
Bilal Elmoussaoui 2024-01-02 09:28:07 +01:00
parent 4483d3ee96
commit befb21cbb2

View File

@ -30,23 +30,16 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CALLY_TYPE_CLONE (cally_clone_get_type ()) #define CALLY_TYPE_CLONE (cally_clone_get_type ())
#define CALLY_CLONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CALLY_TYPE_CLONE, CallyClone))
#define CALLY_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CALLY_TYPE_CLONE, CallyCloneClass)) CLUTTER_EXPORT
#define CALLY_IS_CLONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CALLY_TYPE_CLONE)) G_DECLARE_DERIVABLE_TYPE (CallyClone,
#define CALLY_IS_CLONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CALLY_TYPE_CLONE)) cally_clone,
#define CALLY_CLONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CALLY_TYPE_CLONE, CallyCloneClass)) CALLY,
CLONE,
CallyActor)
typedef struct _CallyClone CallyClone; typedef struct _CallyClone CallyClone;
typedef struct _CallyCloneClass CallyCloneClass; typedef struct _CallyCloneClass CallyCloneClass;
typedef struct _CallyClonePrivate CallyClonePrivate;
struct _CallyClone
{
/*< private >*/
CallyActor parent;
CallyClonePrivate *priv;
};
struct _CallyCloneClass struct _CallyCloneClass
{ {
@ -54,8 +47,6 @@ struct _CallyCloneClass
CallyActorClass parent_class; CallyActorClass parent_class;
}; };
CLUTTER_EXPORT
GType cally_clone_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT CLUTTER_EXPORT
AtkObject *cally_clone_new (ClutterActor *actor); AtkObject *cally_clone_new (ClutterActor *actor);