Cally initialization code
authorAlejandro Piñeiro <apinheiro@igalia.com>
Mon, 14 Jun 2010 16:05:57 +0000 (18:05 +0200)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 5 Jul 2010 15:45:43 +0000 (16:45 +0100)
This commit includes a method to init the a11y support. Two main purposes:

 * Register the different Atk factories.
 * Ensure that there are a AtkUtil implementation class available.

Part of CB#2097

clutter/cally/cally.c [new file with mode: 0644]
clutter/cally/cally.h [new file with mode: 0644]

diff --git a/clutter/cally/cally.c b/clutter/cally/cally.c
new file mode 100644 (file)
index 0000000..85be3eb
--- /dev/null
@@ -0,0 +1,93 @@
+/* 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "cally.h"
+
+#include "cally-factory.h"
+#include "cally-util.h"
+
+extern void gnome_accessibility_module_init     (void);
+extern void gnome_accessibility_module_shutdown (void);
+
+static int cally_initialized = FALSE;
+
+/* factories initialization*/
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_ACTOR, cally_actor, cally_actor_new)
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_GROUP, cally_group, cally_group_new)
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_STAGE, cally_stage, cally_stage_new)
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXT, cally_text, cally_text_new)
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_TEXTURE, cally_texture, cally_texture_new)
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_RECTANGLE, cally_rectangle, cally_rectangle_new)
+CALLY_ACCESSIBLE_FACTORY (CALLY_TYPE_CLONE, cally_clone, cally_clone_new)
+
+void
+cally_accessibility_module_init(void)
+{
+  if (cally_initialized)
+    return;
+
+  cally_initialized = TRUE;
+
+  /* setting the factories */
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_ACTOR, cally_actor);
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_GROUP, cally_group);
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_STAGE, cally_stage);
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXT, cally_text);
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_TEXTURE, cally_texture);
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_RECTANGLE, cally_rectangle);
+  CALLY_ACTOR_SET_FACTORY (CLUTTER_TYPE_CLONE, cally_clone);
+
+  /* Initialize the CallyUtility class */
+  g_type_class_unref (g_type_class_ref (CALLY_TYPE_UTIL));
+
+  g_message ("Clutter Accessibility Module initialized");
+}
+
+
+/**
+ * gnome_accessibility_module_shutdown:
+ * @void:
+ *
+ * Common gnome hook to be used in order to activate the module
+ **/
+void
+gnome_accessibility_module_init                 (void)
+{
+  cally_accessibility_module_init ();
+}
+
+/**
+ * gnome_accessibility_module_shutdown:
+ * @void:
+ *
+ * Common gnome hook to be used in order to de-activate the module
+ **/
+void
+gnome_accessibility_module_shutdown             (void)
+{
+  if (!cally_initialized)
+    return;
+
+  cally_initialized = FALSE;
+
+  g_message ("Clutter Accessibility Module shutdown");
+}
diff --git a/clutter/cally/cally.h b/clutter/cally/cally.h
new file mode 100644 (file)
index 0000000..7120809
--- /dev/null
@@ -0,0 +1,40 @@
+/* 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __CALLY_H
+#define __CALLY_H
+
+#include "cally-actor.h"
+#include "cally-group.h"
+#include "cally-stage.h"
+#include "cally-text.h"
+#include "cally-texture.h"
+#include "cally-rectangle.h"
+#include "cally-clone.h"
+
+G_BEGIN_DECLS
+
+void cally_accessibility_module_init(void);
+
+G_END_DECLS
+
+#endif /* __CALLY_H */