clutter: Rename CallyRoot to StageManagerAccessible

Moving it to the correct namespace and marking it as a private type
as it is not supposed to be replaced externally

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
This commit is contained in:
Bilal Elmoussaoui 2024-08-02 17:29:34 +02:00 committed by Marge Bot
parent 3d22e4fe40
commit 71f5d30d7f
5 changed files with 62 additions and 82 deletions

View File

@ -38,7 +38,7 @@
#include <string.h> #include <string.h>
#include "clutter/clutter-accessibility-private.h" #include "clutter/clutter-accessibility-private.h"
#include "clutter/cally-root.h" #include "clutter/clutter-stage-manager-accessible-private.h"
#include "clutter/clutter.h" #include "clutter/clutter.h"
#define DEFAULT_PASSWORD_CHAR '*' #define DEFAULT_PASSWORD_CHAR '*'
@ -77,7 +77,7 @@ static AtkObject*
clutter_accessibility_get_root (void) clutter_accessibility_get_root (void)
{ {
if (!root) if (!root)
root = cally_root_new (); root = clutter_stage_manager_accessible_new ();
return root; return root;
} }

View File

@ -1,4 +1,4 @@
/* CALLY - The Clutter Accessibility Implementation Library /* Clutter.
* *
* Copyright (C) 2009 Igalia, S.L. * Copyright (C) 2009 Igalia, S.L.
* *
@ -20,35 +20,20 @@
#pragma once #pragma once
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include <atk/atk.h> #include <atk/atk.h>
#include "clutter/clutter-macros.h" #include "clutter/clutter-macros.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define CALLY_TYPE_ROOT (cally_root_get_type ()) #define CLUTTER_TYPE_STAGE_MANAGER_ACCESSIBLE (clutter_stage_manager_accessible_get_type ())
CLUTTER_EXPORT G_DECLARE_FINAL_TYPE (ClutterStageManagerAccessible,
G_DECLARE_DERIVABLE_TYPE (CallyRoot, clutter_stage_manager_accessible,
cally_root, CLUTTER,
CALLY, STAGE_MANAGER_ACCESSIBLE,
ROOT, AtkGObjectAccessible)
AtkGObjectAccessible)
typedef struct _CallyRoot CallyRoot; AtkObject * clutter_stage_manager_accessible_new (void);
typedef struct _CallyRootClass CallyRootClass;
struct _CallyRootClass
{
/*< private >*/
AtkGObjectAccessibleClass parent_class;
};
CLUTTER_EXPORT
AtkObject *cally_root_new (void);
G_END_DECLS G_END_DECLS

View File

@ -1,4 +1,4 @@
/* CALLY - The Clutter Accessibility Implementation Library /* Clutter.
* *
* Copyright (C) 2008 Igalia, S.L. * Copyright (C) 2008 Igalia, S.L.
* *
@ -19,11 +19,9 @@
*/ */
/** /**
* CallyRoot: * ClutterStageManagerAccessible:
* *
* Root object for the Cally toolkit * The root object of the accessibility tree-like
*
* #CallyRoot is the root object of the accessibility tree-like
* hierarchy, exposing the application level. * hierarchy, exposing the application level.
* *
* Somewhat equivalent to #GailTopLevel. We consider that this class * Somewhat equivalent to #GailTopLevel. We consider that this class
@ -33,58 +31,41 @@
* [class@Clutter.StageManager]). * [class@Clutter.StageManager]).
*/ */
#include "atk/atk.h"
#include "config.h" #include "config.h"
#include "clutter/cally-root.h" #include "clutter/clutter-stage-manager-accessible-private.h"
#include "clutter/clutter-actor.h" #include "clutter/clutter-actor.h"
#include "clutter/clutter-stage-private.h" #include "clutter/clutter-stage-private.h"
#include "clutter/clutter-stage-manager.h" #include "clutter/clutter-stage-manager.h"
/* AtkObject.h */ struct _ClutterStageManagerAccessible {
static void cally_root_initialize (AtkObject *accessible, AtkGObjectAccessible parent;
gpointer data); };
static gint cally_root_get_n_children (AtkObject *obj);
static AtkObject * cally_root_ref_child (AtkObject *obj,
gint i);
static AtkObject * cally_root_get_parent (AtkObject *obj);
static const char * cally_root_get_name (AtkObject *obj);
G_DEFINE_TYPE (CallyRoot, cally_root, ATK_TYPE_GOBJECT_ACCESSIBLE) G_DEFINE_FINAL_TYPE (ClutterStageManagerAccessible, clutter_stage_manager_accessible, ATK_TYPE_GOBJECT_ACCESSIBLE)
static void static void
cally_root_class_init (CallyRootClass *klass) clutter_stage_manager_accessible_init (ClutterStageManagerAccessible *manager_accessible)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
/* AtkObject */
class->get_n_children = cally_root_get_n_children;
class->ref_child = cally_root_ref_child;
class->get_parent = cally_root_get_parent;
class->initialize = cally_root_initialize;
class->get_name = cally_root_get_name;
}
static void
cally_root_init (CallyRoot *root)
{ {
} }
/** /**
* cally_root_new: * clutter_stage_manager_accessible_new:
* *
* Creates a new #CallyRoot object. * Creates a new #ClutterStageManagerAccessible object.
* *
* Return value: the newly created #AtkObject * Return value: the newly created #AtkObject
*/ */
AtkObject* AtkObject*
cally_root_new (void) clutter_stage_manager_accessible_new (void)
{ {
GObject *object = NULL; GObject *object = NULL;
AtkObject *accessible = NULL; AtkObject *accessible = NULL;
ClutterStageManager *stage_manager = NULL; ClutterStageManager *stage_manager = NULL;
object = g_object_new (CALLY_TYPE_ROOT, NULL); object = g_object_new (CLUTTER_TYPE_STAGE_MANAGER_ACCESSIBLE, NULL);
accessible = ATK_OBJECT (object); accessible = ATK_OBJECT (object);
stage_manager = clutter_stage_manager_get_default (); stage_manager = clutter_stage_manager_get_default ();
@ -96,15 +77,16 @@ cally_root_new (void)
/* AtkObject.h */ /* AtkObject.h */
static void static void
cally_root_initialize (AtkObject *accessible, clutter_stage_manager_accessible_initialize (AtkObject *accessible,
gpointer data) gpointer data)
{ {
ClutterStageManager *stage_manager = NULL; ClutterStageManager *stage_manager = NULL;
const GSList *iter = NULL; const GSList *iter = NULL;
const GSList *stage_list = NULL; const GSList *stage_list = NULL;
ClutterStage *clutter_stage = NULL; ClutterStage *stage = NULL;
AtkObject *cally_stage = NULL; AtkObject *stage_accessible = NULL;
CallyRoot *root = CALLY_ROOT (accessible); ClutterStageManagerAccessible *manager_accessible =
CLUTTER_STAGE_MANAGER_ACCESSIBLE (accessible);
accessible->role = ATK_ROLE_APPLICATION; accessible->role = ATK_ROLE_APPLICATION;
accessible->accessible_parent = NULL; accessible->accessible_parent = NULL;
@ -115,22 +97,23 @@ cally_root_initialize (AtkObject *accessible,
for (iter = stage_list; iter != NULL; iter = g_slist_next (iter)) for (iter = stage_list; iter != NULL; iter = g_slist_next (iter))
{ {
clutter_stage = CLUTTER_STAGE (iter->data); stage = CLUTTER_STAGE (iter->data);
cally_stage = clutter_actor_get_accessible (CLUTTER_ACTOR (clutter_stage)); stage_accessible = clutter_actor_get_accessible (CLUTTER_ACTOR (stage));
atk_object_set_parent (cally_stage, ATK_OBJECT (root)); atk_object_set_parent (stage_accessible, ATK_OBJECT (manager_accessible));
} }
ATK_OBJECT_CLASS (cally_root_parent_class)->initialize (accessible, data); ATK_OBJECT_CLASS (clutter_stage_manager_accessible_parent_class)->initialize (accessible, data);
} }
static gint static gint
cally_root_get_n_children (AtkObject *obj) clutter_stage_manager_accessible_get_n_children (AtkObject *obj)
{ {
CallyRoot *root = CALLY_ROOT (obj); ClutterStageManagerAccessible *manager_accessible =
CLUTTER_STAGE_MANAGER_ACCESSIBLE (obj);
GObject *stage_manager = GObject *stage_manager =
atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (root)); atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (manager_accessible));
const GSList *stages = const GSList *stages =
clutter_stage_manager_peek_stages (CLUTTER_STAGE_MANAGER (stage_manager)); clutter_stage_manager_peek_stages (CLUTTER_STAGE_MANAGER (stage_manager));
@ -138,12 +121,13 @@ cally_root_get_n_children (AtkObject *obj)
} }
static AtkObject* static AtkObject*
cally_root_ref_child (AtkObject *obj, clutter_stage_manager_accessible_ref_child (AtkObject *obj,
gint i) gint i)
{ {
CallyRoot *cally_root = CALLY_ROOT (obj); ClutterStageManagerAccessible *manager_accessible =
CLUTTER_STAGE_MANAGER_ACCESSIBLE (obj);
GObject *stage_manager = GObject *stage_manager =
atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (cally_root)); atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (manager_accessible));
const GSList *stages = const GSList *stages =
clutter_stage_manager_peek_stages (CLUTTER_STAGE_MANAGER (stage_manager)); clutter_stage_manager_peek_stages (CLUTTER_STAGE_MANAGER (stage_manager));
gint n_stages = g_slist_length ((GSList *)stages); gint n_stages = g_slist_length ((GSList *)stages);
@ -164,13 +148,26 @@ cally_root_ref_child (AtkObject *obj,
} }
static AtkObject* static AtkObject*
cally_root_get_parent (AtkObject *obj) clutter_stage_manager_accessible_get_parent (AtkObject *obj)
{ {
return NULL; return NULL;
} }
static const char * static const char *
cally_root_get_name (AtkObject *obj) clutter_stage_manager_accessible_get_name (AtkObject *obj)
{ {
return g_get_prgname (); return g_get_prgname ();
} }
static void
clutter_stage_manager_accessible_class_init (ClutterStageManagerAccessibleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
/* AtkObject */
class->get_n_children = clutter_stage_manager_accessible_get_n_children;
class->ref_child = clutter_stage_manager_accessible_ref_child;
class->get_parent = clutter_stage_manager_accessible_get_parent;
class->initialize = clutter_stage_manager_accessible_initialize;
class->get_name = clutter_stage_manager_accessible_get_name;
}

View File

@ -30,9 +30,7 @@
#include "clutter/clutter-types.h" #include "clutter/clutter-types.h"
#include "clutter/clutter-actor-accessible.h" #include "clutter/clutter-actor-accessible.h"
#include "clutter/cally-root.h"
#include "clutter/cally-text.h" #include "clutter/cally-text.h"
#include "clutter/cally-root.h"
#include "clutter/clutter-action.h" #include "clutter/clutter-action.h"
#include "clutter/clutter-actor.h" #include "clutter/clutter-actor.h"

View File

@ -163,6 +163,7 @@ clutter_sources = [
'clutter-snap-constraint.c', 'clutter-snap-constraint.c',
'clutter-stage-accessible.c', 'clutter-stage-accessible.c',
'clutter-stage.c', 'clutter-stage.c',
'clutter-stage-manager-accessible.c',
'clutter-stage-manager.c', 'clutter-stage-manager.c',
'clutter-stage-view.c', 'clutter-stage-view.c',
'clutter-stage-window.c', 'clutter-stage-window.c',
@ -208,6 +209,7 @@ clutter_private_headers = [
'clutter-private.h', 'clutter-private.h',
'clutter-settings-private.h', 'clutter-settings-private.h',
'clutter-stage-accessible-private.h', 'clutter-stage-accessible-private.h',
'clutter-stage-manager-accessible-private.h',
'clutter-stage-manager-private.h', 'clutter-stage-manager-private.h',
'clutter-stage-private.h', 'clutter-stage-private.h',
'clutter-stage-view-private.h', 'clutter-stage-view-private.h',
@ -222,12 +224,10 @@ clutter_nonintrospected_sources = [
clutter_backend_private_headers = [] clutter_backend_private_headers = []
clutter_headers += [ clutter_headers += [
'cally-root.h',
'cally-text.h', 'cally-text.h',
] ]
clutter_sources += [ clutter_sources += [
'cally-root.c',
'cally-text.c', 'cally-text.c',
] ]