All pastes #157139 Raw Edit

lavi

public text v1 · immutable
·published 2006-09-01 09:50 UTC
rendered paste body
static void
selection_changed_cb (const AccessibleEvent *event, void *user_data)
{
	char *role, *name;
  
	role = Accessible_getRoleName (event->source);
	name = Accessible_getName (event->source);
  
	g_print ("Selection changed: %s - %s\n", role, name);
  
	if (strcasecmp (role, "page tab list") == 0) {
		int page_tab_index = -1;
	
		page_tab_index = get_page_tab_index (event->source); 
   
		if (page_tab_index >= 0) {
			/*
			  For the default selected tab base_type will be
			  just application name, So we no need to generate them
			  in test scripts
			*/
			if (strcmp (base_type, application) !=0 ) {
				_R (fp, "selecttab ('%s', 'ptl%s', '%d')\n", base_type, base_type+3, page_tab_index);
				fflush (fp);
			}
		}
	} else if (strcasecmp (role, "table") == 0)
	{
		int page_tab_index = -1;
	
		page_tab_index = get_page_tab_index (event->source); 
   
		if (page_tab_index >= 0) {
			/*
			  For the default selected tab base_type will be
			  just application name, So we no need to generate them
			  in test scripts
			*/
			if (strcmp (base_type, application) !=0 ) {
				_R (fp, "selectrowindex ('%s', 'tbl%d', '%d')\n", base_type, name, page_tab_index - 1);
				fflush (fp);
			}
		}
	} else {
		g_print ("==== Not Handle in selection_changed_cb \n");
	}

	SPI_freeString (name);
	SPI_freeString (role);
}