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] ); } }
void exit_manager(void) { int answ[8]; App *pad = apps; #ifdef DEBUG printf(DEBUG_DEACTIVATED); #endif answ[0] = OLE_EXIT; answ[1] = ap_id; answ[2] = 0; answ[3] = 0; answ[4] = 0; answ[5] = 0; answ[6] = 0; answ[7] = 0; while (pad) { appl_write(pad->apID,16,answ); pad = pad->Next; } appl_exit(); }
GemTerm() { #ifndef SAI /* * Remove the menu bar */ menu_bar( gl_menu, FALSE ); #endif SAI /* * Free up the memory used by the resource */ rsrc_free(); /* * Close the workstation */ v_clsvwk( vdi_handle ); /* * And terminate the application */ appl_exit(); }
uninit_sys() { WORD dummy; WORD i; Vector ourmbvec; jimints_off(); wait_penup(); for (i=0; i<22000; i++) ; /* just stall - hey I'm experimenting */ free_cfont(); set_for_gem(); /*magic poke to set mouse wrap-around*/ *((WORD *)(aline-692)) = mouse_bx; *((WORD *)(aline-690)) = mouse_by; *((WORD *)(aline-666)) = gem_colr; Setscreen( -1L, -1L, irez); /*restore palette...*/ if (initted_color) Setpallete(color_env); remove_critical(); if (handle != 0) v_clsvwk(handle); if (gl_apid != -1) appl_exit(0); }
/* ---------------- */ 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(); }
/* ***Beim GEM abmelden*** */ void exitGEM(void) { setpal(oldpal); v_clsvwk(vhndl); rsrc_free(); 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(); 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(); }
void Gem_Exit( int code ) { v_clsvwk( vhandle ); rsrc_exit(); appl_exit(); exit( code ); }
/*---------------------------------------------------*/ void quit_all() { wind_update(END_MCTRL); wind_update(END_UPDATE); (void)rsrc_free(); (void)appl_exit(); exit(0); }
static int GEM_Available(void) { /* Test if AES available */ 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(); }
static int GEM_Available(void) { if (appl_init() == -1) return 0; appl_exit(); return 1; }
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(); }
/* * 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 */ }
void main( void ) { appl_init(); linea0(); if (ReadScreen()) { MakeMap(); SaveMap(); } appl_exit(); }
/*---------------------------------------------------*/ void quit_all() { (void)wind_get(wid,WF_CURRXYWH,&cx,&cy,&cw,&ch); wind_close(wid); wind_delete(wid); open_f=0; if (!_app) {/* ACCESSORY */ return; } (void)appl_exit(); exit(0); }
void main(void) { int Hdl; void *OldScreen; int dummy; long i; /* d‚termine la base line A pour la position souris */ linea_init(); /* charge l'image et la duplique en largeur */ Hdl=Fopen("MORETA.NEO",0); if (Hdl<0) { appl_exit(); Pterm0(); } Fseek(4L,Hdl,0); Fread(Hdl,32L,NewPalette); Fseek(128L,Hdl,0); for (i=0;i<200;i++) { LINE1 *p=(LINE1 *)&picbuf[0].line[i]; Fread(Hdl,sizeof(LINE1),p); p[1]=p[0]; } Fclose(Hdl); /* Duplique l'image en hauteur */ picbuf[1]=picbuf[0]; /* Installe la pallette et sauve l'ancienne */ InsPalette(); /* Sauve l'adresse de l'‚cran courant */ OldScreen=GetScreenPtr(); /* Installe la routine de scrolling en VBL */ InsVBL(Scrolling); /* Boucle en attendant un Ctrl-C */ while (1) if (Bconstat(2)<0 && (char)Bconin(2)==3) break; /* Remet tout en ordre et sort de l… */ RmvVBL(); SetScreenPtr(OldScreen); SetScroll(0); SetLineStride(0); RestPalette(); }
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(); }
/*----------------------------------------------------------------------- * Shut down GEM application. */ void gem_exit(int code) { WIND w; /* Close, delete & free all open windows */ while (w = w_lookup(W_HEAD)) w->free(w); /* Shut down screen workstation & quit */ if (wsid) v_clsvwk(wsid); appl_exit(); exit(code); }
void terminate() { int message[8]; char problem[] = "[1][ | Problem occured during | | initialisation !][ Hmm ]"; if (_app) { appl_exit(); return; } else { FOREVER { evnt_mesag (message); if (message[0] == AC_OPEN) form_alert (1, problem); } } }
/* ------------------------------------- */ void leave_prg(void) { register int i; if (off_flag) graf_mouse(M_ON, 0L); if (fnt_point[akt_id]) vst_unload_fonts(vdi_handle, 1); for (i = 0; i < 5; i++) kb_rec[i + 2] = old_kb[i]; 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() */
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 ); }
/* gem_exit() * ================================================================ * Clean exit. */ void gem_exit( int code ) { int ignore[8]; /* * Go into an endless loop if we're a desk accessory... */ if( !_app ) for(;;) evnt_mesag( ignore ); /* * Otherwise, clean up and call the exit hooks */ wind_update( END_UPDATE ); close_vwork(); wind_exit(); appl_exit(); exit( code ); }
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; }