Changes to introspection generation to remove DOCTYPE and XML
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_application.c
index 0e5a760..4be9422 100644 (file)
@@ -1,25 +1,45 @@
 /*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ */
+
+/*
  *
  * AccessibleApplication function prototypes
  *
  */
 
 #include <cspi/spi-private.h>
+#include <locale.h>
 
 /**
  * AccessibleApplication_ref:
  * @obj: a pointer to the #AccessibleApplication on which to operate.
  *
  * Increment the reference count for an #AccessibleApplication.
- *
- * Returns: (no return code implemented yet).
- *
  **/
-int
+void
 AccessibleApplication_ref (AccessibleApplication *obj)
 {
-  Accessibility_Application_ref (*obj, spi_ev ());
-  return 0;
+  cspi_object_ref (obj);
 }
 
 /**
@@ -27,15 +47,11 @@ AccessibleApplication_ref (AccessibleApplication *obj)
  * @obj: a pointer to the #AccessibleApplication object on which to operate.
  *
  * Decrement the reference count for an #AccessibleApplication.
- *
- * Returns: (no return code implemented yet).
- *
  **/
-int
+void
 AccessibleApplication_unref (AccessibleApplication *obj)
 {
-  Accessibility_Application_unref (*obj, spi_ev ());
-  return 0;
+  cspi_object_unref (obj);
 }
 
 /**
@@ -46,12 +62,21 @@ AccessibleApplication_unref (AccessibleApplication *obj)
  *
  * Returns: a UTF-8 string indicating which UI toolkit is
  *          used by an application.
- *
  **/
 char *
 AccessibleApplication_getToolkitName (AccessibleApplication *obj)
 {
-  return Accessibility_Application__get_toolkitName (*obj, spi_ev ());
+  char *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval =
+    Accessibility_Application__get_toolkitName (CSPI_OBJREF (obj),
+                                               cspi_ev ());
+
+  cspi_return_val_if_ev ("toolkitName", NULL);
+
+  return retval;
 }
 
 /**
@@ -63,12 +88,21 @@ AccessibleApplication_getToolkitName (AccessibleApplication *obj)
  *
  * Returns: a UTF-8 string indicating the application's
  *          at-spi version.
- *
  **/
 char *
 AccessibleApplication_getVersion (AccessibleApplication *obj)
 {
-  return Accessibility_Application__get_version (*obj, spi_ev ());
+  char *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval =
+    Accessibility_Application__get_version (CSPI_OBJREF (obj),
+                                           cspi_ev ());
+
+  cspi_return_val_if_ev ("version", NULL);
+
+  return retval;
 }
 
 /**
@@ -81,11 +115,70 @@ AccessibleApplication_getVersion (AccessibleApplication *obj)
  *
  * Returns: a unique #long integer associated with the application
  *          by the Registry, or 0 if the application is not registered.
-**/
+ **/
 long
 AccessibleApplication_getID (AccessibleApplication *obj)
 {
-  return Accessibility_Application__get_id (*obj, spi_ev ());
+  long retval;
+
+  cspi_return_val_if_fail (obj != NULL, 0);
+
+  retval = Accessibility_Application__get_id (CSPI_OBJREF (obj),
+                                             cspi_ev ());
+
+  cspi_return_val_if_ev ("id", 0);
+
+  return retval;
+}
+
+/**
+ * AccessibleApplication_getLocale:
+ * @obj: a pointer to the #AccessibleApplication being queried.
+ * @lc_category: one of the POSIX LC_TYPE enumeration, for instance
+ * LC_MESSAGES.
+ *
+ * Get a POSIX-compliant string describing the application's current
+ * locale setting for a particular @lctype category.
+ *
+ * @Since: AT-SPI 1.4
+ *
+ * Returns: a POSIX-compliant locale string, e.g. "C", "pt_BR", "sr@latn", etc.
+ **/
+char *
+AccessibleApplication_getLocale (AccessibleApplication *obj, int lc_category)
+{
+  gchar *retval;
+  Accessibility_LOCALE_TYPE lctype;
+
+  cspi_return_val_if_fail (obj != NULL, CORBA_string_dup (""));
+
+  switch (lc_category) 
+  {
+  case LC_COLLATE:
+    lctype = Accessibility_LOCALE_TYPE_COLLATE;
+    break;
+  case LC_CTYPE:
+    lctype = Accessibility_LOCALE_TYPE_CTYPE;
+    break;
+  case LC_NUMERIC:
+    lctype = Accessibility_LOCALE_TYPE_NUMERIC;
+    break;
+  case LC_MONETARY:
+    lctype = Accessibility_LOCALE_TYPE_MONETARY;
+    break;
+  case LC_MESSAGES:
+  default:
+    lctype = Accessibility_LOCALE_TYPE_MESSAGES;
+    break;
+  }
+
+  retval = Accessibility_Application_getLocale (CSPI_OBJREF (obj),
+                                               lctype,
+                                               cspi_ev ());
+
+  cspi_return_val_if_ev ("id", CORBA_string_dup (""));
+
+  return CORBA_string_dup (retval);
 }
 
 /**
@@ -99,7 +192,7 @@ AccessibleApplication_getID (AccessibleApplication *obj)
  * Returns: #TRUE if the application was paused successfully, #FALSE otherwise.
  *
  **/
-boolean
+SPIBoolean
 AccessibleApplication_pause (AccessibleApplication *obj)
 {
   return FALSE;
@@ -115,10 +208,8 @@ AccessibleApplication_pause (AccessibleApplication *obj)
  * Returns: #TRUE if application processing resumed successfully, #FALSE otherwise.
  *
  **/
-boolean
+SPIBoolean
 AccessibleApplication_resume (AccessibleApplication *obj)
 {
   return FALSE;
 }
-
-