*cdecl cpx_init( XCPB *Xcpb ) { OBJECT *tree; xcpb = Xcpb; if( xcpb->booting ) { old_value = cur_value = save_vars; Set_Printer( &cur_value ); return( ( CPXINFO *)TRUE ); } else { appl_init(); AES_Version = _GemParBlk.global[0]; if( !xcpb->SkipRshFix ) (*xcpb->rsh_fix)( NUM_OBS, NUM_FRSTR, NUM_FRIMG, NUM_TREE, rs_object, rs_tedinfo, rs_strings, rs_iconblk, rs_bitblk, rs_frstr, rs_frimg, rs_trindex, rs_imdope ); /* Get the current printer configuration port settings * Currently, we use these values, * Should we instead slam the hardware with OUR settings instead? */ Get_Printer( &cur_value ); old_value = cur_value; push_data(); open_vwork(); close_vwork(); gl_ncolors = work_out[13]; if( !xcpb->SkipRshFix ) { if(( AES_Version >= 0x0330 ) && ( gl_ncolors > LWHITE )) { tree = (OBJECT *)rs_trindex[PRINTER]; MakeActivator( PRINTER, PSAVE ); MakeActivator( PRINTER, POK ); MakeActivator( PRINTER, PCANCEL ); } } cpxinfo.cpx_call = cpx_call; cpxinfo.cpx_draw = NULL; cpxinfo.cpx_wmove = NULL; cpxinfo.cpx_timer = NULL; cpxinfo.cpx_key = NULL; cpxinfo.cpx_button = NULL; cpxinfo.cpx_m1 = NULL; cpxinfo.cpx_m2 = NULL; cpxinfo.cpx_hook = NULL; cpxinfo.cpx_close = NULL; return( &cpxinfo ); } }
/* -------------------------------- */ void install_prg(void) { register int i; ap_id = appl_init(); open_vwork(); kb_rec = (int *)Iorec(1); for (i = 0; i < 5; i++) old_kb[i] = kb_rec[i + 2]; kb_rec[2] = 10; kb_rec[3] = 0; kb_rec[4] = 0; kb_rec[5] = 2; kb_rec[6] = 8; rsrc_load("M_TEXT.RSC"); rsrc_gaddr(ROOT, TXT_MENU, &menu_adr); graf_mouse(ARROW, 0L); init_mtext(); init_rsc(); menu_bar(menu_adr, TRUE); }
void main( void ) { int abort; #define AES_active ( _GemParBlk.global[0] ) appl_init(); fix_rsh(); /* needed for addresses of "hello" strings */ /* get_cookie is now called from the startup Supexec((long(*)())get_cookie); */ if( !ma_info ) { ma_info = &start; /* Not installed, set vectors */ Supexec( (long(*)())sethooks ); } if( AES_active ) { abort = configure(); appl_exit(); if( abort && (ma_info == &start) ) { Supexec( (long(*)())unhook ); Pterm0(); } } if( ma_info == &start ) Supexec( (long(*)())set_cookie ); if( !AES_active ) { Cconws( (char *)rs_frstr[HELLO1] ); Cconws( (char *)rs_frstr[HELLO2] ); } }
/* * Top level; * we get control from the desktop. */ main() { pnf = 0; /* set the flag to it isn't partition yet */ appl_init(); phys_handle=graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox); wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk); open_vwork(); wi_handle=wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk); hidden = FALSE; butdown = TRUE; /* doing a checking see if the cache in the system */ cachexst = (char) chkcache(); rsrc_load(RESOURCEFILE); /* Get all addresses of dialogues from resource file */ getalladdr(); needscan = TRUE; if (domulti() != 11) reboot(); wind_delete(wi_handle); v_clsvwk(handle); appl_exit(); }
/* ---------------- */ main() { char path2[80]; long code_len; appl_init(); path1[0] = Dgetdrv(); path1[1] = ':'; Dgetpath(path1 + 2, path1[0] + 1); path1[0] += 'A'; strcat(path1, "\\*.PRT"); code_len = (long)Malloc(-1L) - 75000; code_mem = (unsigned char *)Malloc(code_len); graf_mouse(ARROW, 0L); do { if (!fsel(path1, "PRT", "Druckersource w�hlen!")) break; strcpy(path2, path1); if (rindex(path2, '.') > rindex(path2, '\\')) strcpy(rindex(path2, '.'), ".PRC"); if (fsel(path2, "PRC", "Treiberdatei w�hlen!")) comp_source(path1, path2); } while(TRUE); appl_exit(); }
static int GEM_Available(void) { /* Test if AES available */ if (appl_init() == -1) return 0; appl_exit(); return 1; }
static int GEM_Available(void) { if (appl_init() == -1) return 0; appl_exit(); return 1; }
void main() { gl_apid = appl_init(); gem_program(); appl_exit(); }
/* * Top level; * we get control from the desktop. */ main() { pnf = 0; /* set the flag to it isn't partition yet */ appl_init(); phys_handle=graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox); wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk); open_vwork(); wi_handle=wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk); hidden = FALSE; butdown = TRUE; /* doing a checking see if the cache in the system */ cachexst = (char) chkcache(); /* check the existence of the BLiTTER */ blitxst = chkblit(); if (!rsrc_load(RESOURCEFILE)) { errs("[2][|", RESOURCEFILE, "][ EXIT ]"); goto punt; } /* Get all addresses of dialogues from resource file */ if (getalladdr() != OK) { errs("[2][|", RESOURCEFILE, "][ EXIT ]"); goto punt; } needscan = TRUE; redomul: ARROW_MOUSE; /* display menu bar */ menu_bar(menuobj, 1); running = TRUE; while (running) { domulti(); } /* * If nothing has been done to the hard disks * then just get out, back to the desktop. * Otherwise reboot the system. */ menu_bar(menuobj, 0); /* erase menu bar */ punt: wind_delete(wi_handle); v_clsvwk(handle); appl_exit(); }
/* * Top level; * we get control from the desktop. * */ main() { long *cookptr; /* pointer to AHDI cookie */ running = TRUE; appl_init(); phys_handle = graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox); wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk); open_vwork(); wi_handle = wind_create(WI_KIND, xdesk, ydesk, wdesk, hdesk); hidden = FALSE; butdown = TRUE; if (!rsrc_load(RESOURCEFILE)) { errs("[2][", RESOURCEFILE, "][ OK ]"); goto punt; } graf_mouse(ARROW, 0L); /* display menu bar */ if (getalladdr() == ERROR) { errs("[2][", RESOURCEFILE, "][ OK ]"); goto punt; } ostack = Super(NULL); /* Superuser mode for low memory access */ pun = (int *)(*(long *)PUNPTR); Super(ostack); /* back to User mode */ if (!pun || !(*pun)) { /* if no unit exists */ err(noavdrv); /* return error */ goto punt; } cookptr = (long *)((char *)pun + 2 + 16 + 16*4); if (*cookptr != AHDI || cookptr != *(long *)(cookptr + 1)) vernum = 0L; else vernum = (int *)(cookptr + 2); menu_bar(menubar, 1); /* put up menu bar */ while (running) domulti(); menu_bar(menubar, 0); /* erase menu bar */ punt: wind_delete(wi_handle); /* close window on screen */ v_clsvwk(handle); /* close virtual workstation */ appl_exit(); /* exit application HDX */ Pterm(0); /* terminate process */ }
*cdecl cpx_init( XCPB *Xcpb ) { xcpb = Xcpb; if( xcpb->booting ) { return( ( CPXINFO *)TRUE ); } else { appl_init(); AES_Version = _GemParBlk.global[0]; if( !xcpb->SkipRshFix ) (*xcpb->rsh_fix)( NUM_OBS, NUM_FRSTR, NUM_FRIMG, NUM_TREE, rs_object, rs_tedinfo, rs_strings, rs_iconblk, rs_bitblk, rs_frstr, rs_frimg, rs_trindex, rs_imdope ); open_vwork(); close_vwork(); gl_ncolors = work_out[13]; if( !xcpb->SkipRshFix ) { if(( AES_Version >= 0x0330 ) && ( gl_ncolors > LWHITE )) { tree = (OBJECT *)rs_trindex[MAINTREE]; MakeActivator( MAINTREE, MOK ); MakeActivator( MAINTREE, MCANCEL ); MakeIndicator( MAINTREE, SETON ); MakeIndicator( MAINTREE, SETOFF ); MakeIndicator( MAINTREE, NPON ); MakeIndicator( MAINTREE, NPOFF ); } } tree = (OBJECT *)rs_trindex[MAINTREE]; if( !initialize() ) return( ( CPXINFO *)FALSE ); cpxinfo.cpx_call = cpx_call; cpxinfo.cpx_draw = NULL; cpxinfo.cpx_wmove = NULL; cpxinfo.cpx_timer = NULL; cpxinfo.cpx_key = NULL; cpxinfo.cpx_button = NULL; cpxinfo.cpx_m1 = NULL; cpxinfo.cpx_m2 = NULL; cpxinfo.cpx_hook = NULL; cpxinfo.cpx_close = NULL; return( &cpxinfo ); } }
void main( void ) { appl_init(); linea0(); if (ReadScreen()) { MakeMap(); SaveMap(); } appl_exit(); }
void initialize(void) { int c; if (appl_init()<0) exit(EXIT_FAILURE); getcd( 0, program_path ); for (c=0;c<10000;c++) { email[c]='\0'; } wind_get(DESK,WF_WORKXYWH,&screenx,&screeny,&screenw,&screenh); graf_mouse(ARROW,NULL); }
int init_appl(void) { ap_id=appl_init(); if(ap_id==FAIL) { return(FALSE); } graf_mouse(ARROW,NULL); return(TRUE); }
int gem_init(int *px, int *py, int *pw, int *ph, int *aes_screenhandle, int *screenhandle, int work_in[], int work_out[]) { int ap_id; int wc, hc, wb, hb; ap_id = appl_init(); if (ap_id == -1) { fprintf(stderr, "Error initialising AES process\n"); getchar(); exit(1); } #ifdef WND_DEBUG wdebug_report = fopen("wndhndlr.dbg", "w"); sprintf(wdbg_tmpbuf, "wind_set(%1d, WF_NEWDESK, p%p, %d)", 0, (void *) NULL, 0); wnd_report(wdbg_tmpbuf); #endif /* wind_set(0, WF_NEWDESK, NULL, 0); */ #ifdef WND_DEBUG wnd_report("wind_get"); #endif wind_get(0, WF_WORKXYWH, px, py, pw, ph); _wndh_gl.dw_x = *px; _wndh_gl.dw_y = *py; _wndh_gl.dw_w = *pw; _wndh_gl.dw_h = *ph; *aes_screenhandle = graf_handle(&wc, &hc, &wb, &hb); _wndh_gl.aes_screen = *aes_screenhandle; work_in[0] = 1; /* current screen driver */ work_in[1] = LT_SOLID; /* line type */ work_in[2] = BLACK; /* line color */ work_in[3] = MT_DOT; /* marker type */ work_in[4] = BLACK; /* marker color */ work_in[5] = 1; /* font number (?) */ work_in[6] = BLACK; /* text color */ work_in[7] = FIS_SOLID; /* fill pattern */ work_in[8] = 1; /* fill pattern index */ work_in[9] = BLACK; /* fill color */ work_in[10] = 2; /* RC coordinate system */ *screenhandle = *aes_screenhandle; v_opnvwk(work_in, screenhandle, work_out); if (*screenhandle == 0) { fprintf(stderr, "Error initialising VDI screen workstation\n"); getchar(); exit(1); } _wndh_gl.vwk_screen = *screenhandle; graf_mouse(ARROW, NULL); return (ap_id); }
main() { int gr_mkmx, gr_mkmy; int gr_mkmstate, gr_mkkstate; int tmpx, tmpy; int tmpx1, tmpy1; int tmpx2, tmpy2; int index, rgb_in[3]; int draw; appl_init(); phys_handle = graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox); wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk); open_vwork(); wi_handle = wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk); graf_mouse(3, 0x0L); vswr_mode(handle, 3); graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); while(!(0x0002&gr_mkmstate)) { graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); if (0x0001&gr_mkmstate) { tmpy = gr_mkmy; tmpx = gr_mkmx; graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); graf_mouse(M_OFF, 0x0L); tmpy1 = gr_mkmy; tmpx1 = gr_mkmx; drawframe(tmpx, tmpy, tmpx1, tmpy1); graf_mouse(M_ON, 0x0L); while (0x0001&gr_mkmstate) { graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); if (((tmpx1 != gr_mkmx) || (tmpy1 != gr_mkmy)) && (0x0001&gr_mkmstate)) { graf_mouse(M_OFF, 0x0L); drawframe(tmpx, tmpy, tmpx1, tmpy1); drawframe(tmpx, tmpy, gr_mkmx, gr_mkmy); graf_mouse(M_ON, 0x0L); tmpy1 = gr_mkmy; tmpx1 = gr_mkmx; } } graf_mouse(M_OFF, 0x0L); drawframe(tmpx, tmpy, tmpx1, tmpy1); graf_mouse(M_ON, 0x0L); } } wind_delete(wi_handle); v_clsvwk(handle); appl_exit(); }
/* ---------------- */ main() { char formula[128]; appl_init(); open_vwork(); graf_mouse(ARROW, 0L); scanf("%s", formula); create_formula(formula); cls_vwork(); appl_exit(); }
/* ------------------------------------------------------------------- */ int main(void) { appl_init(); graf_mouse(ARROW, 0); if(is_ttf_gdos()) { /* is GDOS loaded? */ if(rsrc_load("ttf-dump.rsc")) { rsrc_gaddr( R_TREE, CHOOSER, &chooser ); choose_font(); rsrc_free(); } else form_alert(1, "[3][Cannot open resource file][OK]"); } else form_alert(1, "[3][this program needs TTF-GDOS][OK]"); appl_exit(); exit(0); } /* main() */
void gem_init() /* Appel‚ une fois au d‚but */ { int work_in[11], /* Ces tableaux sont n‚cessaires … v_opnvwk */ work_out[57], i; /* Variable de stockage temporaire */ ap_id = appl_init(); /* Initialise l'AES */ for (i=0; i<10; work_in[i++] = 1); /* [0-9] mis … 1 */ work_in[10] = 2; /* Drapeau de coordonn‚es, doit toujours ˆtre 2 */ v_opnvwk (work_in, &handle, work_out); /* Initialise la VDI */ x_max = work_out[0]; /* Stocker la r‚solution */ y_max = work_out[1]; }
void app_set_up(short *workstation) { short work_in[11]; short work_out[57]; short dummy; appl_init(); *workstation = graf_handle(&dummy, &dummy, &dummy, &dummy); for (short loop = 0; loop < 10; loop++) { work_in[loop] = 1; } work_in[10] = 2; v_opnvwk(work_in, workstation, work_out); }
/*---------------------------------------------------*/ void init() { int n,xs,ys; int bootdev; long old_stack; ap_id=appl_init(); if (!_app) (void)menu_register(ap_id," BlowUP030"); if (ap_id==-1) { puts("ERROR: ap_id=-1 !"); exit(1); } for (n=0;n<rs_numobs;n++) /*rsrc_obfix(rs_object,n);*/ { rs_object[n].ob_x=(rs_object[n].ob_x&255)*8+ (rs_object[n].ob_x>>8); rs_object[n].ob_y=(rs_object[n].ob_y&255)*16+ (rs_object[n].ob_y>>8); rs_object[n].ob_width=(rs_object[n].ob_width&255)*8+ (rs_object[n].ob_width>>8); rs_object[n].ob_height=(rs_object[n].ob_height&255)*16+ (rs_object[n].ob_height>>8); } wind_calc(WC_BORDER,NAME|MOVER|CLOSER,0,0,rs_object[TREE1].ob_width,rs_object[TREE1].ob_height, &xs,&ys,&cw,&ch); open_f=0; if (_app) { open_w(); if (!open_f) quit_all(); } get_conf(); if (mon_type()==0) rs_object[SAVER].ob_state|=DISABLED; (void)graf_mouse(ARROW,0); old_stack=Super(0L); bootdev=*(int*)(0x446); boot_prg_name[0]=(char)(bootdev+65); (void)Super((void*)old_stack); }
int main( void ) { appl_init(); graf_mouse(ARROW, 0); rsrc_obfix(rs_object,0); /* chg coord from char to pixel */ rsrc_obfix(rs_object,1); /* chg coord from char to pixel */ if( is_ttf_gdos() ) { /* is ttf-gdos loaded? */ save_inf(); dump_gem_fonts( Getrez()+2 ); /* screen workstation */ dump_gem_fonts( 21 ); /* printer */ call_fontwid(); tidy_up(); } else form_alert(1, "[3][this program needs TTF-GDOS][OK]"); appl_exit(); exit(0); } /* main() */
void main(void) { int i,ne; EVNTREC er[NUM_EVENTS]; appl_init(); graf_mouse(ARROW,0L); ne = appl_trecord(er,NUM_EVENTS); for(i = 0; i < ne; i++) { printf("%3d ap_event=%ld ap_value=%04lx\n",i,er[i].ap_event,er[i].ap_value); }; appl_exit(); }
launcher_main(void) #endif { OBJECT * desktop_bg; OBJECT * menu; int ap_id; /* Pdomain (1); FIXME decide where to put this */ /* Get application id */ ap_id = appl_init(); /* Fix resource data */ rsrc_rcfix(launch); /* Get address of desktop background */ rsrc_gaddr(R_TREE, DESKBG, &desktop_bg); /* Set desktop background */ wind_set(0, WF_NEWDESK, HI_WORD(desktop_bg), LO_WORD(desktop_bg), 0, 0); /* Get address of the menu */ rsrc_gaddr(R_TREE, MENU, &menu); /* Install menu */ menu_bar(menu, MENU_INSTALL); /* Register launcher as "oAESis" */ menu_register(ap_id, " oAESis"); graf_mouse(ARROW, 0L); start_programs(); updatewait(); appl_exit(); return 0; }
/* main() * ================================================================ */ void main( void ) { int i; appl_init(); AES_Version = _AESglobal[0]; /* Get the AES version number */ vhandle = graf_handle( &gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox ); work_in[0] = Getrez()+2; /* let's not gag GDOS */ for( i = 1; i < 10; work_in[i++] = 1 ); work_in[10] = 2; v_opnvwk( work_in, &vhandle, work_out ); xres = work_out[0]; yres = work_out[1]; num_pens = work_out[13]; gl_screen.g_x = gl_screen.g_y = 0; gl_screen.g_w = xres + 1; gl_screen.g_h = yres + 1; /* We're too wide for ST LOW Rez */ if(( work_in[0] == STLOW ) || ( work_in[0] == TTLOW )) { form_alert( 1, alow ); v_clsvwk( vhandle ); appl_exit(); exit( 0 ); } wind_get( 0, WF_WORKXYWH, &gl_full.g_x, &gl_full.g_y, &gl_full.g_w, &gl_full.g_h ); initialize(); if( !rsrc_init()) { form_alert( 1, arsc ); Gem_Exit( -1 ); } do_main(); Gem_Exit( 0 ); }
void main() { OBJECT *tree; int tree_cnt, count; appl_init(); graf_mouse (ARROW, NULL); if (rsrc_load ("CTRL.RSC") == 0) { form_alert (1, "[1][ | Couldn't locate CTRL.RSC ! ][ Ooops ]"); appl_exit(); return; } for (tree_cnt = 0; tree_cnt < 3; tree_cnt++) { rsrc_gaddr (R_TREE, tree_cnt, & tree); do { if (tree->ob_type & 0x7f00) if ((tree->ob_state & CROS_CHK) == CROS_CHK) { tree->ob_type = G_USERDEF; tree->ob_spec.userblk = &my_user_block; tree->ob_state &= ~ CROS_CHK; } } while ((tree++->ob_flags & LASTOB) == 0); } if (init_data() == 0) { rsrc_free(); appl_exit(); return; } wind_update (BEG_UPDATE); gem_prgm(); wind_update (END_UPDATE); rsrc_free(); appl_exit(); }
/*----------------------------------------------------------------------- * Initialize GEM application: * open virtual workstation and get desktop extent. */ void gem_init(void) { WORD i, wsin[11], hch; appl_init(); if (!isAES4()) { form_alert(1, "[3][ |Viewer can't run on |this TOS version.][ Quit ]"); gem_exit(-1); } AES_Version = _AESglobal[0]; MultiFlag = _AESglobal[1]; /* -1 == MULTITOS, else single tasking */ if( AES_Version >= 0x0410 ) /* CJG 06/24/93 */ IconFlag = SMALLER; else IconFlag = 0; shel_grok(G_AP_TERM); wsid = aesid = graf_handle(&wchar, &hchar, &wbox, &hbox); wsin[0] = Getrez()+2; for (i = 1; i < 10; i++) wsin[i] = 1; wsin[i] = 2; v_opnvwk(wsin, &wsid, wsout); if (!wsid) { form_error(8); /* not enough memory */ gem_exit(-1); } /* Get default AES point size */ vqt_attributes(aesid, &aes_t_attr.font); vst_font(wsid, 1); hch = def_pts = 0; while (hch < aes_t_attr.hchar) vst_point(wsid, ++def_pts, &i, &hch, &i, &i); wind_grect(0, WF_WORKXYWH, &desk); }
int main(void) { int x,y,w,h; int vid; int work_in[] = {1,7,1,1,1,1,1,1,1,1,2}; int work_out[57]; OBJECT * dial; appl_init(); vid = graf_handle(&vid,&vid,&vid,&vid); v_opnvwk(work_in,&vid,work_out); if(rsrc_load("test2rsc.rsc")) { rsrc_gaddr(R_TREE,TESTDIAL,&dial); form_center(dial,&x,&y,&w,&h); form_dial(FMD_START,0,0,0,0,x,y,w,h); objc_draw(dial,0,9,x,y,w,h); own_form_do(dial,0); form_dial(FMD_FINISH,0,0,0,0,x,y,w,h); rsrc_free(); } else { form_alert(1,"[1][Couldn't load resource file!][Bummer!]"); } v_clsvwk(vid); appl_exit(); return 0; }
WORD cpx_call( GRECT *work, void *copsdialog ) { appl_init(); MultiTOS = ( global[0] >= 0x400 && (global[1] == -1 || global[1] > 8) ); dog[OBACK].ob_x = work->g_x; dog[OBACK].ob_y = work->g_y; if ( Cops ) { wdlg_set_tree(copsdialog,dog); /* zeichnet auch Objektbaum, laut Doku */ dialog = copsdialog; } else { dog[OBACK].ob_width = work->g_w; dog[OBACK].ob_height = work->g_h; cpx_draw((GRECT*)&dog[OBACK].ob_x); } cpxSet_Evnt_Mask(xcpb,MU_TIMER|MU_BUTTON|MU_KEYBD, &dummymoblk,&dummymoblk,time); return 1; /* weitermachen */ }
int main () { apid = appl_init(); /* return application ID */ if (apid == -1) return(FALSE); /* unable to use AES */ if (!rsrc_load("./example3.rsc")) { form_alert(1, "[3][Unable to load resource][ Abort ]"); return(FALSE); /* unable to load resource */ } rsrc_gaddr(R_STRING, SYSALERT, &sys_alert); rsrc_gaddr(R_STRING, RESALERT, &reset_alert); rsrc_gaddr(R_STRING, IGNALERT, &ignore_alert); rsrc_gaddr(R_STRING, RETALERT, &retry_alert); do_alert(); /* Test what we want to test */ appl_exit(); return(TRUE); /* ID returned successfully */ }