1
0
Fork 0

clutter: Rename CallyClone to CloneAccessible

Moving it to the correct namespace and marking as final

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
This commit is contained in:
Bilal Elmoussaoui 2024-08-03 19:59:56 +02:00 committed by Marge Bot
parent 7c5223dfc7
commit 02c6473175
5 changed files with 38 additions and 54 deletions

View file

@ -20,31 +20,16 @@
#pragma once
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-actor-accessible.h"
G_BEGIN_DECLS
#define CALLY_TYPE_CLONE (cally_clone_get_type ())
#define CLUTTER_TYPE_CLONE_ACCESSIBLE (clutter_clone_accessible_get_type ())
CLUTTER_EXPORT
G_DECLARE_DERIVABLE_TYPE (CallyClone,
cally_clone,
CALLY,
CLONE,
ClutterActorAccessible)
typedef struct _CallyClone CallyClone;
typedef struct _CallyCloneClass CallyCloneClass;
struct _CallyCloneClass
{
/*< private >*/
ClutterActorAccessibleClass parent_class;
};
G_DECLARE_FINAL_TYPE (ClutterCloneAccessible,
clutter_clone_accessible,
CLUTTER,
CLONE_ACCESSIBLE,
ClutterActorAccessible)
G_END_DECLS

View file

@ -19,21 +19,21 @@
*/
/**
* CallyClone:
* ClutterCloneAccessible:
*
* Implementation of the ATK interfaces for a #ClutterClone
*
* #CallyClone implements the required ATK interfaces of [class@Clutter.Clone]
* #ClutterCloneAccessible implements the required ATK interfaces of [class@Clutter.Clone]
*
* In particular it sets a proper role for the clone, as just a image,
* as it is the sanest and simplest approach.
*/
/* Design rationale for CallyClone:
/* Design rationale for ClutterCloneAccessible:
*
* In the old times, it was just ClutterCloneTexture. So, from a a11y POV
* CallyCloneTexture was just another image, like ClutterTexture, and if
* it was a clone was irrelevant. So on cally-0.8, CallyCloneTexture
* ClutterCloneAccessibleTexture was just another image, like ClutterTexture, and if
* it was a clone was irrelevant. So on cally-0.8, ClutterCloneAccessibleTexture
* expose a object with role ATK_ROLE_IMAGE. But now, ClutterClone is more
* general. You can clone any object, including groups, and made things
* like have one text entry, and a clone with different properties in the
@ -68,34 +68,33 @@
*/
#include "config.h"
#include "clutter/cally-clone.h"
#include "clutter/clutter-clone-accessible-private.h"
/* AtkObject */
static void cally_clone_real_initialize (AtkObject *obj,
gpointer data);
struct _ClutterCloneAccessible
{
ClutterActorAccessible parent;
};
G_DEFINE_TYPE (CallyClone, cally_clone, CLUTTER_TYPE_ACTOR_ACCESSIBLE)
G_DEFINE_FINAL_TYPE (ClutterCloneAccessible, clutter_clone_accessible, CLUTTER_TYPE_ACTOR_ACCESSIBLE)
static void
cally_clone_class_init (CallyCloneClass *klass)
clutter_clone_accessible_real_initialize (AtkObject *obj,
gpointer data)
{
/* GObjectClass *gobject_class = G_OBJECT_CLASS (klass); */
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = cally_clone_real_initialize;
}
static void
cally_clone_init (CallyClone *clone)
{
/* nothing to do yet */
}
static void
cally_clone_real_initialize (AtkObject *obj,
gpointer data)
{
ATK_OBJECT_CLASS (cally_clone_parent_class)->initialize (obj, data);
ATK_OBJECT_CLASS (clutter_clone_accessible_parent_class)->initialize (obj, data);
obj->role = ATK_ROLE_IMAGE;
}
static void
clutter_clone_accessible_class_init (ClutterCloneAccessibleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
class->initialize = clutter_clone_accessible_real_initialize;
}
static void
clutter_clone_accessible_init (ClutterCloneAccessible *clone)
{
}

View file

@ -37,7 +37,7 @@
#include "config.h"
#include "clutter/cally-clone.h"
#include "clutter/clutter-clone-accessible-private.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-clone.h"
#include "clutter/clutter-debug.h"
@ -343,7 +343,7 @@ clutter_clone_class_init (ClutterCloneClass *klass)
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
actor_class->paint = clutter_clone_paint;
actor_class->get_accessible_type = cally_clone_get_type;
actor_class->get_accessible_type = clutter_clone_accessible_get_type;
actor_class->get_paint_volume = clutter_clone_get_paint_volume;
actor_class->get_preferred_width = clutter_clone_get_preferred_width;
actor_class->get_preferred_height = clutter_clone_get_preferred_height;

View file

@ -30,11 +30,11 @@
#include "clutter/clutter-types.h"
#include "clutter/clutter-actor-accessible.h"
#include "clutter/cally-clone.h"
#include "clutter/cally-root.h"
#include "clutter/cally-stage.h"
#include "clutter/cally-text.h"
#include "clutter/cally-root.h"
#include "clutter/clutter-action.h"
#include "clutter/clutter-actor.h"
#include "clutter/clutter-actor-meta.h"

View file

@ -104,6 +104,7 @@ clutter_sources = [
'clutter-box-layout.c',
'clutter-brightness-contrast-effect.c',
'clutter-click-action.c',
'clutter-clone-accessible.c',
'clutter-clone.c',
'clutter-color-manager.c',
'clutter-color-state.c',
@ -182,6 +183,7 @@ clutter_private_headers = [
'clutter-actor-private.h',
'clutter-backend-private.h',
'clutter-blur-private.h',
'clutter-clone-accessible-private.h',
'clutter-constraint-private.h',
'clutter-content-private.h',
'clutter-context-private.h',
@ -218,14 +220,12 @@ clutter_nonintrospected_sources = [
clutter_backend_private_headers = []
clutter_headers += [
'cally-clone.h',
'cally-root.h',
'cally-stage.h',
'cally-text.h',
]
clutter_sources += [
'cally-clone.c',
'cally-root.c',
'cally-stage.c',
'cally-text.c',