summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagappan <nagapan@gmail.com>2010-06-22 20:13:02 -0700
committerNagappan <nagapan@gmail.com>2010-06-22 20:13:02 -0700
commitadaf78c39fdcc6d7aad64d2745a3b479bb3ca2bc (patch)
tree19995caee8e70a1ddc6e8e2daf8bf91f853ed6b8
parent66bfb57cd1c5984d68ad3304a6040525d9f332ea (diff)
Added click for menu
-rw-r--r--src/menu.c66
1 files changed, 42 insertions, 24 deletions
diff --git a/src/menu.c b/src/menu.c
index 83456b8..ea20868 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -32,6 +32,20 @@
#include "ldtp-gui-comp.h"
static LDTPErrorCode
+click_menu_item (Accessible *object)
+{
+ AccessibleAction *action;
+
+ action = Accessible_getAction (object);
+ if (action) {
+ AccessibleAction_doAction (action, 0);
+ Accessible_unref (action);
+ }
+
+ return LDTP_ERROR_SUCCESS;
+}
+
+static LDTPErrorCode
select_menu_item (Accessible *object, char *param)
{
/*
@@ -40,31 +54,31 @@ select_menu_item (Accessible *object, char *param)
Instead we are clicking menu item. This bug is fixed in cvs of at-spi package
Thursday, February 03 2005 - 05:43 PM IST
*/
- // int i;
- // Accessible *child_object;
- // AccessibleSelection *selection;
- // AccessibleAction *action;
+ //int i;
+ //Accessible *child_object;
+ //AccessibleSelection *selection;
+ //AccessibleAction *action;
//
- // i = menu_item_exist (object, param);
- // if (i > -1)
- // {
- // child_object = Accessible_getChildAtIndex (object, i);
- // selection = Accessible_getSelection (object);
- // /*
- // Select child
- // */
- // AccessibleSelection_selectChild (selection, i);
- // action = Accessible_getAction (child_object);
- // AccessibleAction_doAction (action, 0);
- // }
+ //i = menu_item_exist (object, param);
+ //if (i > -1)
+ // {
+ // child_object = Accessible_getChildAtIndex (object, i);
+ // selection = Accessible_getSelection (object);
+ ///*
+ // Select child
+ //*/
+ // AccessibleSelection_selectChild (selection, i);
+ // action = Accessible_getAction (child_object);
+ // AccessibleAction_doAction (action, 0);
+ // }
//
- // action = Accessible_getAction (object);
- // /*
- // FIXME: If we do this action, then the menu selected doesn't
- // get deselected. Need to be resolved
- // */
- // AccessibleAction_doAction (action, 0);
- // Accessible_unref (action);
+ //action = Accessible_getAction (object);
+ ///*
+ // FIXME: If we do this action, then the menu selected doesn't
+ // get deselected. Need to be resolved
+ //*/
+ //AccessibleAction_doAction (action, 0);
+ //Accessible_unref (action);
return LDTP_ERROR_SUCCESS;
}
@@ -191,6 +205,7 @@ menu_main (LDTPClientContext* cctxt, int command, char *window_name)
gchar *role_name;
switch (command) {
+ case LDTP_CMD_CLICK:
case LDTP_CMD_SELECTMENUITEM:
case LDTP_CMD_MENUITEMENABLED:
case LDTP_CMD_MENUCHECK:
@@ -203,10 +218,13 @@ menu_main (LDTPClientContext* cctxt, int command, char *window_name)
LDTPGuiHandle *accessible = NULL;
Accessible *object = cctxt->gui_handle->handle;
+ if (command == LDTP_CMD_CLICK) {
+ click_menu_item (object);
+ return LDTP_ERROR_SUCCESS;
+ }
// AC: BUG FIX, if incorrect value of selectmenuitem ('dlg0', 'mnu0')
if (!cctxt->req->arg_list)
return LDTP_ERROR_ARGUMENT_NULL;
-
// Invoke menu
select_menu_item (cctxt->gui_handle->handle,
cctxt->req->arg_list->data);