static void xtttbl_login_success_bc( void *ctx) { XttTbl *xtttbl = (XttTbl *)ctx; char msg[80]; CoLogin::get_login_info( 0, 0, xtttbl->user, (unsigned long *)&xtttbl->priv, 0); sprintf( msg, "User %s logged in", xtttbl->user); xtttbl->cologin = 0; xtttbl->message('I', msg); }
static int xtttbl_logout_func( void *client_data, void *client_flag) { XttTbl *xtttbl = (XttTbl *)client_data; char msg[80]; if ( strcmp( xtttbl->base_user, "") == 0) { sprintf( msg, "User %s logged out", xtttbl->user); xtttbl->message('I', msg); } else { sprintf( msg, "Returned to user %s", xtttbl->base_user); xtttbl->message('I', msg); } strcpy( xtttbl->user, xtttbl->base_user); xtttbl->priv = xtttbl->base_priv; return 1; }
static int xtttbl_open_func( void *client_data, void *client_flag) { XttTbl *xtttbl = (XttTbl *)client_data; char arg1_str[80]; int arg1_sts; arg1_sts = dcli_get_qualifier( "dcli_arg1", arg1_str, sizeof(arg1_str)); if ( strncmp( arg1_str, "GRAPH", strlen( arg1_str)) == 0) { } else xtttbl->message('E',"Syntax error"); return XTTTBL__SUCCESS; }
void XttTblGtk::activate_command(GtkWidget* w, gpointer data) { XttTbl* xtt = (XttTbl*)data; if (!xtt->is_authorized()) return; if (xtt->command_open) { g_object_set(((XttTblGtk*)xtt)->cmd_input, "visible", FALSE, NULL); xtt->set_prompt(""); xtt->command_open = 0; return; } gtk_editable_delete_text(GTK_EDITABLE(((XttTblGtk*)xtt)->cmd_input), 0, -1); g_object_set(((XttTblGtk*)xtt)->cmd_input, "visible", TRUE, NULL); xtt->message(' ', ""); gtk_widget_grab_focus(((XttTblGtk*)xtt)->cmd_input); xtt->set_prompt("xtt >"); xtt->command_open = 1; }
static int xtttbl_help_func( void *client_data, void *client_flag) { XttTbl *xtttbl = (XttTbl *)client_data; int sts; char arg_str[80]; char file_str[80]; char bookmark_str[80]; char key[80]; char return_str[80]; int pop; int width, height; int nr; if ( ODD( dcli_get_qualifier( "/INDEX", file_str, sizeof(file_str)))) { if ( ODD( dcli_get_qualifier( "/HELPFILE", file_str, sizeof(file_str)))) { sts = CoXHelp::dhelp_index( navh_eHelpFile_Other, file_str); if ( EVEN(sts)) xtttbl->message('E', "Unable to find file"); } else { if ( ODD( dcli_get_qualifier( "/BASE", 0, 0))) sts = CoXHelp::dhelp_index( navh_eHelpFile_Base, NULL); else sts = CoXHelp::dhelp_index( navh_eHelpFile_Project, NULL); } return 1; } if ( ODD( dcli_get_qualifier( "/VERSION", 0, 0))) { sts = CoXHelp::dhelp( "version", "", navh_eHelpFile_Other, "$pwr_exe/xtt_version_help.dat", 0); if ( EVEN(sts)) xtttbl->message('E', "No help on this subject"); return sts; } int strict = 0; if ( EVEN( dcli_get_qualifier( "dcli_arg1", arg_str, sizeof(arg_str)))) { sts = CoXHelp::dhelp( "help command", "", navh_eHelpFile_Base, NULL, strict); return 1; } if ( EVEN( dcli_get_qualifier( "/BOOKMARK", bookmark_str, sizeof(bookmark_str)))) strcpy( bookmark_str, ""); strcpy( key, arg_str); if ( ODD( dcli_get_qualifier( "dcli_arg2", arg_str, sizeof(arg_str)))) { strcat( key, " "); strcat( key, arg_str); if ( ODD( dcli_get_qualifier( "dcli_arg3", arg_str, sizeof(arg_str)))) { strcat( key, " "); strcat( key, arg_str); if ( ODD( dcli_get_qualifier( "dcli_arg3", arg_str, sizeof(arg_str)))) { strcat( key, " "); strcat( key, arg_str); if ( ODD( dcli_get_qualifier( "dcli_arg4", arg_str, sizeof(arg_str)))) { strcat( key, " "); strcat( key, arg_str); } } } } if ( ! ODD( dcli_get_qualifier( "/RETURNCOMMAND", return_str, sizeof(return_str)))) strcpy( return_str, ""); if ( ODD( dcli_get_qualifier( "/WIDTH", arg_str, sizeof(arg_str)))) { // convert to integer nr = sscanf( arg_str, "%d", &width); if ( nr != 1) { xtttbl->message('E', "Width syntax error"); return XTTTBL__HOLDCOMMAND; } } else width = 0; if ( ODD( dcli_get_qualifier( "/HEIGHT", arg_str, sizeof(arg_str)))) { // convert to integer nr = sscanf( arg_str, "%d", &height); if ( nr != 1) { xtttbl->message('E', "Height syntax error"); return XTTTBL__HOLDCOMMAND; } } else height = 0; pop = ODD( dcli_get_qualifier( "/POPNAVIGATOR", 0, 0)); if ( ODD( dcli_get_qualifier( "/HELPFILE", file_str, sizeof(file_str)))) { sts = CoXHelp::dhelp( key, bookmark_str, navh_eHelpFile_Other, file_str, strict); if ( EVEN(sts)) xtttbl->message('E', "No help on this subject"); } else if ( ODD( dcli_get_qualifier( "/BASE", 0, 0))) { sts = CoXHelp::dhelp( key, bookmark_str, navh_eHelpFile_Base, 0, strict); if ( EVEN(sts)) xtttbl->message('E', "No help on this subject"); } else { sts = CoXHelp::dhelp( key, bookmark_str, navh_eHelpFile_Base, 0, strict); if ( EVEN(sts)) { sts = CoXHelp::dhelp( key, bookmark_str, navh_eHelpFile_Project, 0, strict); if ( EVEN(sts)) xtttbl->message('E', "No help on this subject"); } } return 1; }