1
0
Fork 0

clutter: Rename CallyStage to StageAccessible

Moving it to the correct namespace and marking it a final private
type

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
This commit is contained in:
Bilal Elmoussaoui 2024-08-02 17:16:40 +02:00 committed by Marge Bot
parent 02c6473175
commit 3d22e4fe40
7 changed files with 117 additions and 135 deletions

View file

@ -1,108 +0,0 @@
/* CALLY - The Clutter Accessibility Implementation Library
*
* Copyright (C) 2008 Igalia, S.L.
*
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/**
* CallyStage:
*
* Implementation of the ATK interfaces for a #ClutterStage
*
* #CallyStage implements the required ATK interfaces for [class@Clutter.Stage]
*
* Some implementation details: at this moment #CallyStage is used as
* the most similar Window object in this toolkit (ie: emitting window
* related signals), although the real purpose of [class@Clutter.Stage] is
* being a canvas. Anyway, this is required for applications using
* just clutter, or directly [class@Clutter.Stage]
*/
#include "config.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/cally-stage.h"
#include "clutter/clutter-stage.h"
/* AtkObject.h */
static void cally_stage_real_initialize (AtkObject *obj,
gpointer data);
static AtkStateSet* cally_stage_ref_state_set (AtkObject *obj);
/* AtkWindow */
static void cally_stage_window_interface_init (AtkWindowIface *iface);
G_DEFINE_TYPE_WITH_CODE (CallyStage,
cally_stage,
CLUTTER_TYPE_ACTOR_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_WINDOW,
cally_stage_window_interface_init));
static void
cally_stage_class_init (CallyStageClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
/* AtkObject */
class->initialize = cally_stage_real_initialize;
class->ref_state_set = cally_stage_ref_state_set;
}
static void
cally_stage_init (CallyStage *cally_stage)
{
}
static void
cally_stage_real_initialize (AtkObject *obj,
gpointer data)
{
g_return_if_fail (CALLY_IS_STAGE (obj));
ATK_OBJECT_CLASS (cally_stage_parent_class)->initialize (obj, data);
atk_object_set_role (obj, ATK_ROLE_WINDOW);
}
static AtkStateSet*
cally_stage_ref_state_set (AtkObject *obj)
{
CallyStage *cally_stage = NULL;
AtkStateSet *state_set = NULL;
ClutterStage *stage = NULL;
g_return_val_if_fail (CALLY_IS_STAGE (obj), NULL);
cally_stage = CALLY_STAGE (obj);
state_set = ATK_OBJECT_CLASS (cally_stage_parent_class)->ref_state_set (obj);
stage = CLUTTER_STAGE (CLUTTER_ACTOR_FROM_ACCESSIBLE (cally_stage));
if (stage == NULL)
return state_set;
if (clutter_stage_is_active (stage))
atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
return state_set;
}
/* AtkWindow */
static void
cally_stage_window_interface_init (AtkWindowIface *iface)
{
/* At this moment AtkWindow is just about signals */
}

View file

@ -39,7 +39,6 @@
#include "clutter/clutter-accessibility-private.h"
#include "clutter/cally-root.h"
#include "clutter/cally-stage.h"
#include "clutter/clutter.h"
#define DEFAULT_PASSWORD_CHAR '*'

View file

@ -1,4 +1,4 @@
/* CALLY - The Clutter Accessibility Implementation Library
/* Clutter.
*
* Copyright (C) 2008 Igalia, S.L.
*
@ -20,31 +20,17 @@
#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"
#include "clutter/clutter-macros.h"
G_BEGIN_DECLS
#define CALLY_TYPE_STAGE (cally_stage_get_type ())
#define CLUTTER_TYPE_STAGE_ACCESSIBLE (clutter_stage_accessible_get_type ())
CLUTTER_EXPORT
G_DECLARE_DERIVABLE_TYPE (CallyStage,
cally_stage,
CALLY,
STAGE,
ClutterActorAccessible)
typedef struct _CallyStage CallyStage;
typedef struct _CallyStageClass CallyStageClass;
struct _CallyStageClass
{
/*< private >*/
ClutterActorAccessibleClass parent_class;
};
G_DECLARE_FINAL_TYPE (ClutterStageAccessible,
clutter_stage_accessible,
CLUTTER,
STAGE_ACCESSIBLE,
ClutterActorAccessible)
G_END_DECLS

View file

@ -0,0 +1,106 @@
/* Clutter.
*
* Copyright (C) 2008 Igalia, S.L.
*
* Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/**
* ClutterStageAccessible:
*
* Implementation of the ATK interfaces for a #ClutterStage
*
* #ClutterStageAccessible implements the required ATK interfaces for [class@Clutter.Stage]
*
* Some implementation details: at this moment #ClutterStageAccessible is used as
* the most similar Window object in this toolkit (ie: emitting window
* related signals), although the real purpose of [class@Clutter.Stage] is
* being a canvas. Anyway, this is required for applications using
* just clutter, or directly [class@Clutter.Stage]
*/
#include "config.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-stage-accessible-private.h"
#include "clutter/clutter-stage.h"
/* AtkWindow */
static void clutter_stage_accessible_window_interface_init (AtkWindowIface *iface);
struct _ClutterStageAccessible
{
ClutterActorAccessible parent;
};
G_DEFINE_FINAL_TYPE_WITH_CODE (ClutterStageAccessible,
clutter_stage_accessible,
CLUTTER_TYPE_ACTOR_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_WINDOW,
clutter_stage_accessible_window_interface_init));
static void
clutter_stage_accessible_init (ClutterStageAccessible *stage_accessible)
{
}
static void
clutter_stage_accessible_real_initialize (AtkObject *obj,
gpointer data)
{
g_return_if_fail (CLUTTER_IS_STAGE_ACCESSIBLE (obj));
ATK_OBJECT_CLASS (clutter_stage_accessible_parent_class)->initialize (obj, data);
atk_object_set_role (obj, ATK_ROLE_WINDOW);
}
static AtkStateSet*
clutter_stage_accessible_ref_state_set (AtkObject *obj)
{
ClutterStageAccessible *stage_accessible;
AtkStateSet *state_set;
ClutterStage *stage;
g_return_val_if_fail (CLUTTER_IS_STAGE_ACCESSIBLE (obj), NULL);
stage_accessible = CLUTTER_STAGE_ACCESSIBLE (obj);
state_set = ATK_OBJECT_CLASS (clutter_stage_accessible_parent_class)->ref_state_set (obj);
stage = CLUTTER_STAGE (CLUTTER_ACTOR_FROM_ACCESSIBLE (stage_accessible));
if (stage == NULL)
return state_set;
if (clutter_stage_is_active (stage))
atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
return state_set;
}
/* AtkWindow */
static void
clutter_stage_accessible_window_interface_init (AtkWindowIface *iface)
{
/* At this moment AtkWindow is just about signals */
}
static void
clutter_stage_accessible_class_init (ClutterStageAccessibleClass *klass)
{
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
/* AtkObject */
class->initialize = clutter_stage_accessible_real_initialize;
class->ref_state_set = clutter_stage_accessible_ref_state_set;
}

View file

@ -41,7 +41,7 @@
#include "clutter/clutter-stage.h"
#include "clutter/cally-stage.h"
#include "clutter/clutter-stage-accessible-private.h"
#include "clutter/clutter-action-private.h"
#include "clutter/clutter-actor-private.h"
#include "clutter/clutter-backend-private.h"
@ -1343,7 +1343,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
gobject_class->finalize = clutter_stage_finalize;
actor_class->allocate = clutter_stage_allocate;
actor_class->get_accessible_type = cally_stage_get_type;
actor_class->get_accessible_type = clutter_stage_accessible_get_type;
actor_class->get_preferred_width = clutter_stage_get_preferred_width;
actor_class->get_preferred_height = clutter_stage_get_preferred_height;
actor_class->get_paint_volume = clutter_stage_get_paint_volume;

View file

@ -31,7 +31,6 @@
#include "clutter/clutter-actor-accessible.h"
#include "clutter/cally-root.h"
#include "clutter/cally-stage.h"
#include "clutter/cally-text.h"
#include "clutter/cally-root.h"

View file

@ -161,6 +161,7 @@ clutter_sources = [
'clutter-shader-types.c',
'clutter-swipe-action.c',
'clutter-snap-constraint.c',
'clutter-stage-accessible.c',
'clutter-stage.c',
'clutter-stage-manager.c',
'clutter-stage-view.c',
@ -206,6 +207,7 @@ clutter_private_headers = [
'clutter-paint-volume-private.h',
'clutter-private.h',
'clutter-settings-private.h',
'clutter-stage-accessible-private.h',
'clutter-stage-manager-private.h',
'clutter-stage-private.h',
'clutter-stage-view-private.h',
@ -221,13 +223,11 @@ clutter_backend_private_headers = []
clutter_headers += [
'cally-root.h',
'cally-stage.h',
'cally-text.h',
]
clutter_sources += [
'cally-root.c',
'cally-stage.c',
'cally-text.c',
]