mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
[cally] Removing default name and description
Those were added on the old "just for automatic testing" times. That was somewhat silly on that moment. Now is just silly (ie: having the stage returning as default name "Stage"). The real description should be set by the app, or provided by the context of a specific actor feature (like the tooltip on StWidget). The current information provided by the default description can be mostly obtained from the ATK_ROLE, and the indirect debugging advantage of having always a meaningful description is just not enough to justify them, and you can solve that by proper debug logging. Fixes: http://bugzilla.clutter-project.org/show_bug.cgi?id=2482
This commit is contained in:
parent
247c8d49ae
commit
153532297c
@ -73,16 +73,12 @@
|
|||||||
#include "cally-clone.h"
|
#include "cally-clone.h"
|
||||||
#include "cally-actor-private.h"
|
#include "cally-actor-private.h"
|
||||||
|
|
||||||
#define CALLY_CLONE_DEFAULT_DESCRIPTION "ClutterClone accessibility object"
|
|
||||||
|
|
||||||
static void cally_clone_class_init (CallyCloneClass *klass);
|
static void cally_clone_class_init (CallyCloneClass *klass);
|
||||||
static void cally_clone_init (CallyClone *clone);
|
static void cally_clone_init (CallyClone *clone);
|
||||||
|
|
||||||
/* AtkObject */
|
/* AtkObject */
|
||||||
static void cally_clone_real_initialize (AtkObject *obj,
|
static void cally_clone_real_initialize (AtkObject *obj,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static G_CONST_RETURN gchar *cally_clone_get_description (AtkObject *obj);
|
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (CallyClone, cally_clone, CALLY_TYPE_ACTOR)
|
G_DEFINE_TYPE (CallyClone, cally_clone, CALLY_TYPE_ACTOR)
|
||||||
|
|
||||||
@ -93,7 +89,6 @@ cally_clone_class_init (CallyCloneClass *klass)
|
|||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
class->initialize = cally_clone_real_initialize;
|
class->initialize = cally_clone_real_initialize;
|
||||||
class->get_description = cally_clone_get_description;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -137,17 +132,3 @@ cally_clone_real_initialize (AtkObject *obj,
|
|||||||
|
|
||||||
obj->role = ATK_ROLE_IMAGE;
|
obj->role = ATK_ROLE_IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static G_CONST_RETURN gchar *
|
|
||||||
cally_clone_get_description (AtkObject *obj)
|
|
||||||
{
|
|
||||||
G_CONST_RETURN gchar *description = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_CLONE (obj), NULL);
|
|
||||||
|
|
||||||
description = ATK_OBJECT_CLASS (cally_clone_parent_class)->get_description (obj);
|
|
||||||
if (description == NULL)
|
|
||||||
description = CALLY_CLONE_DEFAULT_DESCRIPTION;
|
|
||||||
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
@ -33,16 +33,12 @@
|
|||||||
#include "cally-rectangle.h"
|
#include "cally-rectangle.h"
|
||||||
#include "cally-actor-private.h"
|
#include "cally-actor-private.h"
|
||||||
|
|
||||||
#define CALLY_RECTANGLE_DEFAULT_DESCRIPTION "A rectangle"
|
|
||||||
|
|
||||||
static void cally_rectangle_class_init (CallyRectangleClass *klass);
|
static void cally_rectangle_class_init (CallyRectangleClass *klass);
|
||||||
static void cally_rectangle_init (CallyRectangle *rectangle);
|
static void cally_rectangle_init (CallyRectangle *rectangle);
|
||||||
|
|
||||||
/* AtkObject */
|
/* AtkObject */
|
||||||
static void cally_rectangle_real_initialize (AtkObject *obj,
|
static void cally_rectangle_real_initialize (AtkObject *obj,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static G_CONST_RETURN gchar *cally_rectangle_get_description (AtkObject *obj);
|
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (CallyRectangle, cally_rectangle, CALLY_TYPE_ACTOR)
|
G_DEFINE_TYPE (CallyRectangle, cally_rectangle, CALLY_TYPE_ACTOR)
|
||||||
|
|
||||||
@ -53,7 +49,6 @@ cally_rectangle_class_init (CallyRectangleClass *klass)
|
|||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
class->initialize = cally_rectangle_real_initialize;
|
class->initialize = cally_rectangle_real_initialize;
|
||||||
class->get_description = cally_rectangle_get_description;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -97,17 +92,3 @@ cally_rectangle_real_initialize (AtkObject *obj,
|
|||||||
|
|
||||||
obj->role = ATK_ROLE_IMAGE;
|
obj->role = ATK_ROLE_IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static G_CONST_RETURN gchar *
|
|
||||||
cally_rectangle_get_description (AtkObject *obj)
|
|
||||||
{
|
|
||||||
G_CONST_RETURN gchar *description = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_RECTANGLE (obj), NULL);
|
|
||||||
|
|
||||||
description = ATK_OBJECT_CLASS (cally_rectangle_parent_class)->get_description (obj);
|
|
||||||
if (description == NULL)
|
|
||||||
description = CALLY_RECTANGLE_DEFAULT_DESCRIPTION;
|
|
||||||
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
@ -52,8 +52,6 @@ static void cally_stage_class_init (CallyStageClass *klass);
|
|||||||
static void cally_stage_init (CallyStage *stage);
|
static void cally_stage_init (CallyStage *stage);
|
||||||
|
|
||||||
/* AtkObject.h */
|
/* AtkObject.h */
|
||||||
static G_CONST_RETURN gchar *cally_stage_get_name (AtkObject *obj);
|
|
||||||
static G_CONST_RETURN gchar *cally_stage_get_description (AtkObject *obj);
|
|
||||||
static void cally_stage_real_initialize (AtkObject *obj,
|
static void cally_stage_real_initialize (AtkObject *obj,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static AtkStateSet* cally_stage_ref_state_set (AtkObject *obj);
|
static AtkStateSet* cally_stage_ref_state_set (AtkObject *obj);
|
||||||
@ -65,9 +63,6 @@ static void cally_stage_deactivate_cb (ClutterStage *stage,
|
|||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
#define CALLY_STAGE_DEFAULT_NAME "Stage"
|
|
||||||
#define CALLY_STAGE_DEFAULT_DESCRIPTION "Top level 'window' on which child actors are placed and manipulated"
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (CallyStage, cally_stage, CALLY_TYPE_GROUP);
|
G_DEFINE_TYPE (CallyStage, cally_stage, CALLY_TYPE_GROUP);
|
||||||
|
|
||||||
#define CALLY_STAGE_GET_PRIVATE(obj) \
|
#define CALLY_STAGE_GET_PRIVATE(obj) \
|
||||||
@ -86,8 +81,6 @@ cally_stage_class_init (CallyStageClass *klass)
|
|||||||
/* CallyActorClass *cally_class = CALLY_ACTOR_CLASS (klass); */
|
/* CallyActorClass *cally_class = CALLY_ACTOR_CLASS (klass); */
|
||||||
|
|
||||||
/* AtkObject */
|
/* AtkObject */
|
||||||
class->get_name = cally_stage_get_name;
|
|
||||||
class->get_description = cally_stage_get_description;
|
|
||||||
class->initialize = cally_stage_real_initialize;
|
class->initialize = cally_stage_real_initialize;
|
||||||
class->ref_state_set = cally_stage_ref_state_set;
|
class->ref_state_set = cally_stage_ref_state_set;
|
||||||
|
|
||||||
@ -213,39 +206,6 @@ cally_stage_new (ClutterActor *actor)
|
|||||||
return accessible;
|
return accessible;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* AtkObject.h */
|
|
||||||
static G_CONST_RETURN gchar *
|
|
||||||
cally_stage_get_name (AtkObject *obj)
|
|
||||||
{
|
|
||||||
G_CONST_RETURN gchar *name = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_STAGE (obj), NULL);
|
|
||||||
|
|
||||||
/* parent name */
|
|
||||||
name = ATK_OBJECT_CLASS (cally_stage_parent_class)->get_name (obj);
|
|
||||||
|
|
||||||
if (name == NULL)
|
|
||||||
name = CALLY_STAGE_DEFAULT_NAME;
|
|
||||||
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
static G_CONST_RETURN gchar *
|
|
||||||
cally_stage_get_description (AtkObject *obj)
|
|
||||||
{
|
|
||||||
G_CONST_RETURN gchar *description = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_STAGE (obj), NULL);
|
|
||||||
|
|
||||||
/* parent description */
|
|
||||||
description = ATK_OBJECT_CLASS (cally_stage_parent_class)->get_description (obj);
|
|
||||||
|
|
||||||
if (description == NULL)
|
|
||||||
description = CALLY_STAGE_DEFAULT_DESCRIPTION;
|
|
||||||
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cally_stage_real_initialize (AtkObject *obj,
|
cally_stage_real_initialize (AtkObject *obj,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
|
@ -34,16 +34,12 @@
|
|||||||
#include "cally-texture.h"
|
#include "cally-texture.h"
|
||||||
#include "cally-actor-private.h"
|
#include "cally-actor-private.h"
|
||||||
|
|
||||||
#define CALLY_TEXTURE_DEFAULT_DESCRIPTION "A texture"
|
|
||||||
|
|
||||||
static void cally_texture_class_init (CallyTextureClass *klass);
|
static void cally_texture_class_init (CallyTextureClass *klass);
|
||||||
static void cally_texture_init (CallyTexture *texture);
|
static void cally_texture_init (CallyTexture *texture);
|
||||||
|
|
||||||
/* AtkObject */
|
/* AtkObject */
|
||||||
static void cally_texture_real_initialize (AtkObject *obj,
|
static void cally_texture_real_initialize (AtkObject *obj,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
static G_CONST_RETURN gchar *cally_texture_get_description (AtkObject *obj);
|
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (CallyTexture, cally_texture, CALLY_TYPE_ACTOR)
|
G_DEFINE_TYPE (CallyTexture, cally_texture, CALLY_TYPE_ACTOR)
|
||||||
|
|
||||||
@ -54,7 +50,6 @@ cally_texture_class_init (CallyTextureClass *klass)
|
|||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
class->initialize = cally_texture_real_initialize;
|
class->initialize = cally_texture_real_initialize;
|
||||||
class->get_description = cally_texture_get_description;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -99,17 +94,3 @@ cally_texture_real_initialize (AtkObject *obj,
|
|||||||
/* default role */
|
/* default role */
|
||||||
obj->role = ATK_ROLE_IMAGE;
|
obj->role = ATK_ROLE_IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static G_CONST_RETURN gchar *
|
|
||||||
cally_texture_get_description (AtkObject *obj)
|
|
||||||
{
|
|
||||||
G_CONST_RETURN gchar *description = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CALLY_IS_TEXTURE (obj), NULL);
|
|
||||||
|
|
||||||
description = ATK_OBJECT_CLASS (cally_texture_parent_class)->get_description (obj);
|
|
||||||
if (description == NULL)
|
|
||||||
description = CALLY_TEXTURE_DEFAULT_DESCRIPTION;
|
|
||||||
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user