[cally] Removing default name and description
authorAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 20 May 2011 12:07:47 +0000 (14:07 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 20 May 2011 12:07:47 +0000 (14:07 +0200)
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

clutter/cally/cally-clone.c
clutter/cally/cally-rectangle.c
clutter/cally/cally-stage.c
clutter/cally/cally-texture.c

index 4c59d08..a6eee36 100644 (file)
 #include "cally-clone.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_init       (CallyClone *clone);
 
 /* AtkObject */
 static void                  cally_clone_real_initialize (AtkObject *obj,
-                                                           gpointer   data);
-static G_CONST_RETURN gchar *cally_clone_get_description (AtkObject *obj);
-
+                                                          gpointer   data);
 
 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);
 
   class->initialize      = cally_clone_real_initialize;
-  class->get_description = cally_clone_get_description;
 }
 
 static void
@@ -137,17 +132,3 @@ cally_clone_real_initialize (AtkObject *obj,
 
   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;
-}
index b0c10a4..8e7c0b4 100644 (file)
 #include "cally-rectangle.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_init       (CallyRectangle *rectangle);
 
 /* AtkObject */
 static void                  cally_rectangle_real_initialize (AtkObject *obj,
-                                                             gpointer   data);
-static G_CONST_RETURN gchar *cally_rectangle_get_description (AtkObject *obj);
-
+                                                              gpointer   data);
 
 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);
 
   class->initialize      = cally_rectangle_real_initialize;
-  class->get_description = cally_rectangle_get_description;
 }
 
 static void
@@ -97,17 +92,3 @@ cally_rectangle_real_initialize (AtkObject *obj,
 
   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;
-}
index 75bc486..9a986c2 100644 (file)
@@ -52,8 +52,6 @@ static void cally_stage_class_init (CallyStageClass *klass);
 static void cally_stage_init       (CallyStage      *stage);
 
 /* 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,
                                                           gpointer   data);
 static AtkStateSet*          cally_stage_ref_state_set   (AtkObject *obj);
@@ -65,9 +63,6 @@ static void                  cally_stage_deactivate_cb   (ClutterStage *stage,
                                                           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);
 
 #define CALLY_STAGE_GET_PRIVATE(obj) \
@@ -86,8 +81,6 @@ cally_stage_class_init (CallyStageClass *klass)
 /*   CallyActorClass *cally_class  = CALLY_ACTOR_CLASS (klass); */
 
   /* AtkObject */
-  class->get_name = cally_stage_get_name;
-  class->get_description = cally_stage_get_description;
   class->initialize = cally_stage_real_initialize;
   class->ref_state_set = cally_stage_ref_state_set;
 
@@ -213,39 +206,6 @@ cally_stage_new (ClutterActor *actor)
   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
 cally_stage_real_initialize (AtkObject *obj,
                              gpointer  data)
index 8b2508f..7824e8c 100644 (file)
 #include "cally-texture.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_init       (CallyTexture *texture);
 
 /* AtkObject */
 static void                  cally_texture_real_initialize (AtkObject *obj,
                                                            gpointer   data);
-static G_CONST_RETURN gchar *cally_texture_get_description (AtkObject *obj);
-
 
 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);
 
   class->initialize      = cally_texture_real_initialize;
-  class->get_description = cally_texture_get_description;
 }
 
 static void
@@ -99,17 +94,3 @@ cally_texture_real_initialize (AtkObject *obj,
   /* default role */
   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;
-}