Add namespacing to un-namespaced methods in cspi.
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_action.c
index 9ce42a7..4a5fa29 100644 (file)
@@ -5,9 +5,6 @@
  * @obj: a pointer to the #AccessibleAction on which to operate.
  *
  * Increment the reference count for an #AccessibleAction.
- *
- * Returns: 0 (no return code implemented yet).
- *
  **/
 void
 AccessibleAction_ref (AccessibleAction *obj)
@@ -20,9 +17,6 @@ AccessibleAction_ref (AccessibleAction *obj)
  * @obj: a pointer to the #AccessibleAction on which to operate.
  *
  * Decrement the reference count for an #AccessibleAction.
- *
- * Returns: 0 (no return code implemented yet).
- *
  **/
 void
 AccessibleAction_unref (AccessibleAction *obj)
@@ -37,15 +31,21 @@ AccessibleAction_unref (AccessibleAction *obj)
  * Get the number of actions invokable on an #AccessibleAction implementor.
  *
  * Returns: a #long integer indicatin the number of invokable actions.
- *
  **/
 long
 AccessibleAction_getNActions (AccessibleAction *obj)
 {
-  return (long)
+  long retval;
+
+  cspi_return_val_if_fail (obj != NULL, -1);
+
+  retval =
     Accessibility_Action__get_nActions (CSPI_OBJREF (obj), cspi_ev ());
-}
 
+  cspi_return_val_if_ev ("getNActions", -1);
+
+  return retval;
+}
 
 /**
  * AccessibleAction_getDescription:
@@ -56,16 +56,22 @@ AccessibleAction_getNActions (AccessibleAction *obj)
  *      object implementing #AccessibleAction.
  *
  * Returns: a UTF-8 string describing the '@i-th' invokable action.
- *
  **/
 char *
 AccessibleAction_getDescription (AccessibleAction *obj,
-                                 long int i)
+                                 long int          i)
 {
-  return (char *)
+  char *retval;
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval =
     Accessibility_Action_getDescription (CSPI_OBJREF (obj),
                                         (CORBA_long) i,
                                         cspi_ev ());
+
+  cspi_return_val_if_ev ("getDescription", NULL);
+
+  return retval;
 }
 
 /**
@@ -78,19 +84,24 @@ AccessibleAction_getDescription (AccessibleAction *obj,
  *
  * Returns: a UTF-8 string which can be parsed to determine the @i-th
  *       invokable action's keybindings.
- *
  **/
 char *
 AccessibleAction_getKeyBinding (AccessibleAction *obj,
-                               long int i)
+                               long int          i)
 {
-  return (char *) 
+  char *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval =
     Accessibility_Action_getKeyBinding (CSPI_OBJREF (obj),
        (CORBA_long) i,
        cspi_ev ());
-}
 
+  cspi_return_val_if_ev ("getKeyBinding", NULL);
 
+  return retval;
+}
 
 /**
  * AccessibleAction_getName:
@@ -101,18 +112,24 @@ AccessibleAction_getKeyBinding (AccessibleAction *obj,
  *      object implementing #AccessibleAction.
  *
  * Returns: the 'event type' name of the action, as a UTF-8 string.
- *
  **/
 char *
 AccessibleAction_getName (AccessibleAction *obj,
-                         long int i)
+                         long int          i)
 {
-  return (char *)
+  char *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval =
    Accessibility_Action_getName (CSPI_OBJREF (obj),
                                 (CORBA_long) i,
                                 cspi_ev ());
-}
 
+  cspi_return_val_if_ev ("getName", NULL);
+
+  return retval;
+}
 
 /**
  * AccessibleAction_doAction:
@@ -122,16 +139,21 @@ AccessibleAction_getName (AccessibleAction *obj,
  * Invoke the action indicated by #index.
  *
  * Returns: #TRUE if the action is successfully invoked, otherwise #FALSE.
- *
  **/
 SPIBoolean
 AccessibleAction_doAction (AccessibleAction *obj,
                            long int i)
 {
-  return (SPIBoolean)
+  SPIBoolean retval;
+
+  cspi_return_val_if_fail (obj != NULL, FALSE);
+
+  retval = (SPIBoolean)
     Accessibility_Action_doAction (CSPI_OBJREF (obj),
                                   (CORBA_long) i,
                                   cspi_ev ());
-}
 
+  cspi_return_val_if_ev ("doAction", FALSE);
 
+  return retval;
+}