X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=cspi%2Fspi_application.c;h=4be9422584e999be0bb783d3a456e7ea9db01934;hb=8d3aa905941cb4f17a07ab6efb2e8eddfc866688;hp=f008ea34fb80db0585294a4b11c1a1302867e40e;hpb=408978dd34f3338e49b6ace5f60b7606579ce7a9;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/cspi/spi_application.c b/cspi/spi_application.c index f008ea3..4be9422 100644 --- a/cspi/spi_application.c +++ b/cspi/spi_application.c @@ -1,93 +1,189 @@ +/* + * 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. + */ /* * - * SpiAccessibleApplication function prototypes + * AccessibleApplication function prototypes * */ +#include +#include + /** - * SpiAccessibleApplication_ref: - * @obj: a pointer to the #SpiAccessibleApplication on which to operate. - * - * Increment the reference count for an #SpiAccessibleApplication. - * - * Returns: (no return code implemented yet). + * AccessibleApplication_ref: + * @obj: a pointer to the #AccessibleApplication on which to operate. * + * Increment the reference count for an #AccessibleApplication. **/ -int -SpiAccessibleApplication_ref (SpiAccessibleApplication *obj) +void +AccessibleApplication_ref (AccessibleApplication *obj) { - Accessibility_SpiApplication_ref (*obj, &ev); - return 0; + cspi_object_ref (obj); } /** - * SpiAccessibleApplication_unref: - * @obj: a pointer to the #SpiAccessibleApplication object on which to operate. - * - * Decrement the reference count for an #SpiAccessibleApplication. - * - * Returns: (no return code implemented yet). + * AccessibleApplication_unref: + * @obj: a pointer to the #AccessibleApplication object on which to operate. * + * Decrement the reference count for an #AccessibleApplication. **/ -int -SpiAccessibleApplication_unref (SpiAccessibleApplication *obj) +void +AccessibleApplication_unref (AccessibleApplication *obj) { - Accessibility_SpiApplication_unref (*obj, &ev); - return 0; + cspi_object_unref (obj); } /** - * SpiAccessibleApplication_getToolkitName: - * @obj: a pointer to the #SpiAccessibleApplication to query. + * AccessibleApplication_getToolkitName: + * @obj: a pointer to the #AccessibleApplication to query. * - * Get the name of the UI toolkit used by an #SpiAccessibleApplication. + * Get the name of the UI toolkit used by an #AccessibleApplication. * * Returns: a UTF-8 string indicating which UI toolkit is * used by an application. - * **/ char * -SpiAccessibleApplication_getToolkitName (SpiAccessibleApplication *obj) +AccessibleApplication_getToolkitName (AccessibleApplication *obj) { - return Accessibility_SpiApplication__get_toolkitName (*obj, &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; } /** - * SpiAccessibleApplication_getVersion: - * @obj: a pointer to the #SpiAccessibleApplication being queried. + * AccessibleApplication_getVersion: + * @obj: a pointer to the #AccessibleApplication being queried. * * Get the version of the at-spi bridge exported by an - * #SpiAccessibleApplication instance. + * #AccessibleApplication instance. * * Returns: a UTF-8 string indicating the application's * at-spi version. - * **/ char * -SpiAccessibleApplication_getVersion (SpiAccessibleApplication *obj) +AccessibleApplication_getVersion (AccessibleApplication *obj) { - return Accessibility_SpiApplication__get_version (*obj, &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; } /** - * SpiAccessibleApplication_getID: - * @obj: a pointer to the #SpiAccessibleApplication being queried. + * AccessibleApplication_getID: + * @obj: a pointer to the #AccessibleApplication being queried. * - * Get the unique ID assigned by the SpiRegistry to an - * #SpiAccessibleApplication instance. + * Get the unique ID assigned by the Registry to an + * #AccessibleApplication instance. * (Not Yet Implemented by the registry). * * Returns: a unique #long integer associated with the application - * by the SpiRegistry, or 0 if the application is not registered. + * by the Registry, or 0 if the application is not registered. + **/ long -SpiAccessibleApplication_getID (SpiAccessibleApplication *obj) +AccessibleApplication_getID (AccessibleApplication *obj) +{ + 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) { - return Accessibility_SpiApplication__get_id (*obj, &ev); + 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); } /** - * SpiAccessibleApplication_pause: + * AccessibleApplication_pause: + * @obj: a pointer to the #Accessible object on which to operate. * * Attempt to pause the application (used when client event queue is * over-full). @@ -96,25 +192,24 @@ SpiAccessibleApplication_getID (SpiAccessibleApplication *obj) * Returns: #TRUE if the application was paused successfully, #FALSE otherwise. * **/ -boolean -SpiAccessibleApplication_pause (SpiAccessibleApplication *obj) +SPIBoolean +AccessibleApplication_pause (AccessibleApplication *obj) { return FALSE; } /** - * SpiAccessibleApplication_resume: + * AccessibleApplication_resume: + * @obj: a pointer to the #Accessible object on which to operate. * - * Attempt to resume the application (used after #SpiAccessibleApplication_pause). + * Attempt to resume the application (used after #AccessibleApplication_pause). * Not Yet Implemented. * * Returns: #TRUE if application processing resumed successfully, #FALSE otherwise. * **/ -boolean -SpiAccessibleApplication_resume (SpiAccessibleApplication *obj) +SPIBoolean +AccessibleApplication_resume (AccessibleApplication *obj) { return FALSE; } - -