model_server/api_ui/src/cliUI.cxx
/* Function called from minibrowser when it is trying to display instances of "selection" */
Function called from minibrowser when it is trying to display instances of "selection"
Function called from minibrowser when it is trying to display instances of " selection "
int cli_instance_hook(symbolPtr& selection, symbolArr& domain_selection, symbolArr& cli_results, 
		      genString& cli_title, genString& cli_click_cb)
{
    Tcl_CmdInfo instance_hook_info;
    if(!interpreter_instance)
	return 0;
    if(Tcl_GetCommandInfo(interpreter_instance->interp, (char *)"instance_hook", &instance_hook_info) == 0)
	return 0;
    DI_object di_selection;
    DI_object_create(&di_selection);
    symbolArr *selection_arr = get_DI_symarr(di_selection);
    DI_object di_domain;
    DI_object_create(&di_domain);
    symbolArr *domain_arr = get_DI_symarr(di_domain);
    genString cmd;
    cmd.printf("instance_hook _DI_%d _DI_%d", di_selection, di_domain);
    interpreter_instance->ReferenceObject(di_selection);
    interpreter_instance->ReferenceObject(di_domain);
    selection_arr->insert_last(selection);
    domain_arr->insert_last(domain_selection);
    instance_click_script = "";
    instance_title        = "";
    int result   = interpreter_instance->EvalCmd((char *)cmd) == TCL_OK;
    if(result) {
	DI_object di_result = interpreter_instance->DecodeDIResult();
	if(di_result == NULL)
	    result = 0;
	else {
	    symbolArr *res_arr = get_DI_symarr(di_result);
	    cli_results.insert_last(*res_arr);
	}
	cli_title    = instance_title;
	cli_click_cb = instance_click_script;
    } else {
	msg("Following error(s) returned from instance_hook:\n$1") << Tcl_GetStringResult(interpreter_instance->interp) << eom;
    }
    interpreter_instance->DeleteDIObject(di_domain);
    interpreter_instance->DeleteDIObject(di_selection);
    return result;
}
int cli_instance_hook ( symbolPtr & selection , symbolArr & domain_selection , symbolArr & cli_results , genString & cli_title , genString & cli_click_cb ) { Tcl_CmdInfo instance_hook_info ; if ( ! interpreter_instance ) return 0 ; if ( Tcl_GetCommandInfo ( interpreter_instance -> interp , ( char * ) " " , & instance_hook_info ) == 0 ) return 0 ; DI_object di_selection ; DI_object_create ( & di_selection ) ; symbolArr * selection_arr = get_DI_symarr ( di_selection ) ; DI_object di_domain ; DI_object_create ( & di_domain ) ; symbolArr * domain_arr = get_DI_symarr ( di_domain ) ; genString cmd ; cmd . printf ( " " , di_selection , di_domain ) ; interpreter_instance -> ReferenceObject ( di_selection ) ; interpreter_instance -> ReferenceObject ( di_domain ) ; selection_arr -> insert_last ( selection ) ; domain_arr -> insert_last ( domain_selection ) ; instance_click_script = " " ; instance_title = " " ; int result = interpreter_instance -> EvalCmd ( ( char * ) cmd ) == TCL_OK ; if ( result ) { DI_object di_result = interpreter_instance -> DecodeDIResult ( ) ; if ( di_result == NULL ) result = 0 ; else { symbolArr * res_arr = get_DI_symarr ( di_result ) ; cli_results . insert_last ( * res_arr ) ; } cli_title = instance_title ; cli_click_cb = instance_click_script ; } else { msg ( " \n " ) << Tcl_GetStringResult ( interpreter_instance -> interp ) << eom ; } interpreter_instance -> DeleteDIObject ( di_domain ) ; interpreter_instance -> DeleteDIObject ( di_selection ) ; return result ; }
Function called from minibrowser when it is trying to display instances of "selection"
Function called from minibrowser when it is trying to display instances of " selection "