inline static MaiInterfaceAction *getAction(AtkAction *aAction);
static MaiInterfaceAction *getAction(AtkAction *aAction);
inline static MaiInterfaceAction *getAction(AtkAction *aAction);G_BEGIN_DECLSstatic void interfaceInitCB(AtkActionIface *aIface);/* action interface callbacks */static gboolean doActionCB(AtkAction *aAction, gint aActionIndex);static gint getActionCountCB(AtkAction *aAction);static const gchar *getDescriptionCB(AtkAction *aAction, gint aActionIndex);static const gchar *getNameCB(AtkAction *aAction, gint aActionIndex);static const gchar *getKeybindingCB(AtkAction *aAction, gint aActionIndex);static gboolean     setDescriptionCB(AtkAction *aAction, gint aActionIndex,                                     const gchar *aDesc);G_END_DECLSMaiInterfaceAction::MaiInterfaceAction(MaiWidget *aMaiWidget):    MaiInterface(aMaiWidget){}MaiInterfaceAction::~MaiInterfaceAction(){}MaiInterfaceTypeMaiInterfaceAction::GetType(){    return MAI_INTERFACE_ACTION;}const GInterfaceInfo *MaiInterfaceAction::GetInterfaceInfo(){    static const GInterfaceInfo atk_if_action_info = {        (GInterfaceInitFunc)interfaceInitCB,        (GInterfaceFinalizeFunc) NULL,        NULL    };    return &atk_if_action_info;}gbooleanMaiInterfaceAction::DoAction(gint aActionIndex){    nsIAccessible *accessible = GetNSAccessible();    g_return_val_if_fail(accessible != NULL, FALSE);    nsresult rv = accessible->AccDoAction(aActionIndex);    return (NS_FAILED(rv)) ? FALSE : TRUE;}gintMaiInterfaceAction::GetActionCount(){    nsIAccessible *accessible = GetNSAccessible();    g_return_val_if_fail(accessible != NULL, 0);    PRUint8 num = 0;    nsresult rv = accessible->GetAccNumActions(&num);    return (NS_FAILED(rv)) ? 0 : gint(num);}const gchar *MaiInterfaceAction::GetDescription(gint aActionIndex){    // the interface in nsIAccessibleAction is empty    // use getName as default description    return GetName(aActionIndex);}const gchar *MaiInterfaceAction::GetName(gint aActionIndex){    nsIAccessible *accessible = GetNSAccessible();    g_return_val_if_fail(accessible != NULL, NULL);    if (!mName.IsEmpty())        return mName.get();    nsAutoString autoStr;    nsresult rv = accessible->GetAccActionName(aActionIndex, autoStr);    if (NS_FAILED(rv))        return NULL;    mName = NS_ConvertUCS2toUTF8(autoStr);    return mName.get();}const gchar *MaiInterfaceAction::GetKeybinding(gint aActionIndex){    nsIAccessible *accessible = GetNSAccessible();    g_return_val_if_fail(accessible != NULL, NULL);    /* this is not supported in nsIAccessible yet */    return NULL;}gbooleanMaiInterfaceAction::SetDescription(gint aActionIndex, const gchar *aDesc){    nsIAccessible *accessible = GetNSAccessible();    g_return_val_if_fail(accessible != NULL, FALSE);    /* this is not supported in nsIAccessible yet */    return FALSE;}/* static functions *//* do general checking for callbacks functions * return the MaiInterfaceAction extracted from atk action */MaiInterfaceAction *getAction(AtkAction *aAction){    g_return_val_if_fail(MAI_IS_ATK_WIDGET(aAction), NULL);    MaiWidget *maiWidget = (MaiWidget*)(MAI_ATK_OBJECT(aAction)->maiObject);    g_return_val_if_fail(maiWidget != NULL, NULL);    g_return_val_if_fail(maiWidget->GetAtkObject() == (AtkObject*)aAction,                         NULL);    MaiInterfaceAction *maiInterfaceAction = (MaiInterfaceAction*)        maiWidget->GetMaiInterface(MAI_INTERFACE_ACTION);    return maiInterfaceAction;}