/* Do_Redraw(); * ================================================================ */ void Do_Redraw( OBJECT *tree, GRECT *area ) { GRECT rect; graf_mouse( M_OFF, 0L ); wind_update( BEG_UPDATE ); wind_get( wid, WF_FIRSTXYWH, &rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h ); while( rect.g_w && rect.g_h ) { if( rc_intersect( area, &rect ) ) ObjcDraw( tree, ROOT, MAX_DEPTH, &rect ); wind_get( wid, WF_NEXTXYWH,&rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h ); } wind_update( END_UPDATE ); graf_mouse( M_ON, 0L ); }
/* * 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 iconize(WIND w) { char *s, name[9]; ICONWIND iw; WORD e, i, msg[8]; s = strrchr(w->name, '\\'); if (!s) s = w->name; strncpy(name, s+1, 8); name[8] = '\0'; if ((s = strchr(name, '.')) || (s = strchr(name, ' '))) *s = 0; i = iw_new(wsid, w->rwind.g_x, w->rwind.g_y, name, viewfile, BLACK, WHITE, w); if (i > 0) { iw = (ICONWIND)w_lookup(i); iw->w.do_button = iw_button; w_closed(w, msg); w->info[0] = 0; wind_sstr(w->id, WF_INFO, w->info); for(;;) { e = evnt_multi(MU_MESAG|MU_TIMER, 0,0,0, 0,0,0,0,0, 0,0,0,0,0, msg, 100,0, &i, &i, &i, &i, &i, &i); if (e & MU_MESAG) do_msg(msg); else if ((e & MU_TIMER) && wind_update(TRY_UPDATE)) break; } wind_update(END_UPDATE); graf_mouse(M_OFF, NULL); iw_drag(iw, 0, 0); graf_mouse(M_ON, NULL); wind_open(iw->w.id, iw->w.rwind.g_x, iw->w.rwind.g_y, iw->w.rwind.g_w, iw->w.rwind.g_h); } }
static int unlock( GEM_PLOTTER self ) { LOG(("%s: %s\n", (char*)__FILE__, __FUNCTION__)); if( (self->flags & PLOT_FLAG_LOCKED) == 0 ) return(1); self->flags &= ~PLOT_FLAG_LOCKED; wind_update(END_MCTRL); wind_update(END_UPDATE); graf_mouse(M_ON, NULL); return( 1 ); }
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); }
WORD get_file(WORD label) { WORD butn, ii; BYTE tmp_path[64], tmp_name[13]; if ( !sav_rcspath[0] ) get_defpath(tmp_path, "*.RSC"); else strcpy(tmp_path, sav_rcspath); tmp_name[0] = '\0'; #if GEMDOS if (Sversion() >= 0x0140) { LONG fs_label; fs_label = string_addr(label); fsel_exinput(ADDR(&tmp_path[0]), ADDR(&tmp_name[0]), &butn, (BYTE FAR *)fs_label); } else #endif fsel_input(ADDR(&tmp_path[0]), ADDR(&tmp_name[0]), &butn); graf_mouse(rcs_mform, 0x0L); if (butn) { if (!tmp_name[0]) if (hndl_alert(1, string_addr(NOFNAME)) == 1) return(FALSE); if (strcmp(sav_rcspath, tmp_path)) { #if GEMDOS Dsetpath((const char *)ADDR(tmp_path)); #else dos_chdir(ADDR(tmp_path)); #endif strcpy(sav_rcspath, tmp_path); } strcpy(rcs_rfile, &tmp_path[0]); for (ii = 0; rcs_rfile[ii] && rcs_rfile[ii] != '*'; ii++) ; rcs_rfile[ii - 1] = NULL; /* knock off slash */ strcat(rcs_rfile, "\\"); strcpy(&rsc_path[1], rcs_rfile); rsc_path[0] = strlen(rcs_rfile); strcat(rcs_rfile, &tmp_name[0]); /* Force 'rsc' extension on resource file.*/ r_to_xfile(rcs_rfile, "RSC"); r_to_xfile(rcs_dfile, "DFN"); return (TRUE); } /* if butn */ else return (FALSE); } /* get_file */
/* ------------ */ void mouse_off(void) { int dummy; if (!off_flag) { vq_mouse(vdi_handle, &dummy, &old_mx, &old_my); graf_mouse(M_OFF, 0L); off_flag = TRUE; } }
void progress_exit( void ) { if( preferences.pref_flags.multitask ) FormWindEnd(); else { graf_mouse( ARROW, NULL ); FormEnd( progress_tree, NULL ); } progress_win = NULL; progress_tree = NULL; }
int init_appl(void) { ap_id=appl_init(); if(ap_id==FAIL) { return(FALSE); } graf_mouse(ARROW,NULL); return(TRUE); }
void Do_Slider( int base, int slider, int index ) { PushValues(); (*xcpb->MFsave)(MFSAVE, &orig_mf); if( AES_Version >= 0x0320 ) graf_mouse( FLAT_HAND, 0L ); curslid = slider; (*xcpb->Sl_dragx)(tree, base, slider, CurData[index].xmin, CurData[index].xmax, &CurData[index].value, Update ); (*xcpb->MFsave)(MFRESTORE, &orig_mf); }
void update_objects(WINDFORM *wind,int obj_id,int depth, int pipe[8]) { CORDS2 r,u,o; CORDS t; if(pipe) { o.x1=pipe[4]; o.y1=pipe[5]; o.x2=pipe[4]+pipe[6]-1; o.y2=pipe[5]+pipe[7]-1; } graf_mouse(M_OFF,0); wind_update(BEG_UPDATE); wind_get(wind->whandle,WF_FIRSTXYWH,&t.x,&t.y,&t.w,&t.h); while(t.w || t.h) { if(pipe) { r.x1=t.x; r.y1=t.y; r.x2=t.x+t.w-1; r.y2=t.y+t.h-1; u.x1=max(r.x1,o.x1); u.y1=max(r.y1,o.y1); u.x2=min(r.x2,o.x2); u.y2=min(r.y2,o.y2); } else { u.x1=t.x; u.y1=t.y; u.x2=t.x+t.w-1; u.y2=t.y+t.h-1; } if((u.x2>=u.x1) && (u.y2>=u.y1)) objc_draw(wind->formtree,obj_id,depth, u.x1, u.y1, u.x2-u.x1+1, u.y2-u.y1+1); wind_get(wind->whandle,WF_NEXTXYWH,&t.x,&t.y,&t.w,&t.h); } wind_update(END_UPDATE); graf_mouse(M_ON,0); }
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); }
void redraw( const WINFO *w, GRECT *clip ) { OBJECT *tree; int savex, savey; GRECT rect; int pxy[4]; rect = w->work; wind_adjust( w, &rect ); rc_2xy( clip, (WORD *)pxy ); vs_clip( vhandle, 1, pxy ); graf_mouse( M_OFF, NULL ); #if SILLY_PATTERN vsf_interior( vhandle, FIS_PATTERN ); vsf_style( vhandle, 19 ); /* balls */ vsf_color( vhandle, BLACK ); #else vsf_interior( vhandle, FIS_SOLID ); vsf_color( vhandle, WHITE ); #endif vsf_perimeter( vhandle, FALSE ); vswr_mode( vhandle, MD_REPLACE ); v_bar( vhandle, pxy ); graf_mouse( M_ON, NULL ); tree = (OBJECT *)(w->x); savex = ObX(ROOT); savey = ObY(ROOT); ObX(ROOT) = rect.g_x - w->vir.g_x * gl_wchar; ObY(ROOT) = rect.g_y - w->vir.g_y * gl_hchar; Objc_draw( tree, ROOT, MAX_DEPTH, clip ); ObX(ROOT) = savex; ObY(ROOT) = savey; }
void GEM_CheckMouseMode(_THIS) { const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS); int set_system_cursor = 1, show_system_cursor = 1; #ifdef DEBUG_VIDEO_GEM printf("sdl:video:gem: check mouse mode\n"); #endif /* If the mouse is hidden and input is grabbed, we use relative mode */ GEM_mouse_relative = (!(SDL_cursorstate & CURSOR_VISIBLE)) && (this->input_grab != SDL_GRAB_OFF) && (SDL_GetAppState() & SDL_APPACTIVE); SDL_AtariXbios_LockMousePosition(GEM_mouse_relative); if (SDL_cursorstate & CURSOR_VISIBLE) { /* Application defined cursor only over the application window */ if ((SDL_GetAppState() & full_focus) == full_focus) { if (GEM_cursor) { graf_mouse(USER_DEF, GEM_cursor->mform_p); set_system_cursor = 0; } else { show_system_cursor = 0; } } } else { /* Mouse cursor hidden only over the application window */ if ((SDL_GetAppState() & full_focus) == full_focus) { set_system_cursor = 0; show_system_cursor = 0; } } graf_mouse(show_system_cursor ? M_ON : M_OFF, NULL); if (set_system_cursor) { graf_mouse(ARROW, NULL); } }
static void save_options(void) { XFILE *file; long n; int error = 0, h; graf_mouse(HOURGLASS, NULL); if ((file = x_fopen(optname, O_DENYRW | O_WRONLY, &error)) != NULL) { if ((n = x_fwrite(file, &options, sizeof(Options))) == sizeof(Options)) { if (options.cprefs & SAVE_COLORS) error = save_colors(file); if (error == 0) if ((error = dsk_save(file)) == 0) if ((error = ft_save(file)) == 0) if ((error = icnt_save(file)) == 0) if ((error = app_save(file)) == 0) if ((error = prg_save(file)) == 0) error = wd_save(file); } else error = (int) n; if (((h = x_fclose(file)) < 0) && (error == 0)) error = h; } graf_mouse(ARROW, NULL); if (error != 0) hndl_error(MSAVECFG, error); wd_set_update(WD_UPD_COPIED, optname, NULL); wd_do_update(); }
void gem_set_cursor( MFORM_EX * cursor ) { static unsigned char flags = 255; static int number = 255; if( flags == cursor->flags && number == cursor->number ) return; if( cursor->flags & MFORM_EX_FLAG_USERFORM ) { MouseSprite( cursor->tree, cursor->number); } else { graf_mouse(cursor->number, NULL ); } number = cursor->number; flags = cursor->flags; }
/* driver_redraw() * ================================================================ */ void driver_redraw( int *msg ) { GRECT area; GRECT rect; int clip[4]; area.g_x = msg[4]; area.g_y = msg[5]; area.g_w = msg[6]; area.g_h = msg[7]; graf_mouse( M_OFF, 0L ); wind_get( msg[3], WF_FIRSTXYWH, &rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h ); while( rect.g_w && rect.g_h ) { if( rc_intersect( &area, &rect ) ) { rc_2xy( &rect, clip ); vs_clip( vhandle, 1, clip ); /* Redraw Meta Driver */ #if 0 if( gl_meta ) do_cross_draw( ad_driver, PMETA2 ); /* Redraw Memory Driver */ if( gl_mem ) do_cross_draw( ad_driver, PMEM2 ); #endif } wind_get( msg[3], WF_NEXTXYWH,&rect.g_x, &rect.g_y, &rect.g_w, &rect.g_h ); } vs_clip( vhandle, 0, clip ); graf_mouse( M_ON, 0L ); }
short main(short int argc, char *argv[]) { short button; short nul; short workstation; app_set_up(&workstation); OUTPUT_WINDOW *output_window = setup_output_window(workstation); graf_mouse(ARROW, 0); handle_events(output_window); clean_up(output_window, workstation); return 0; }
/* ---------------- */ main() { char formula[128]; appl_init(); open_vwork(); graf_mouse(ARROW, 0L); scanf("%s", formula); create_formula(formula); cls_vwork(); appl_exit(); }
static int lock( GEM_PLOTTER self ) { LOG(("%s: %s\n", (char*)__FILE__, __FUNCTION__)); if( (self->flags & PLOT_FLAG_LOCKED) != 0 ) return(1); self->flags |= PLOT_FLAG_LOCKED; if( !wind_update(BEG_UPDATE|0x100) ) return(0); if( !wind_update(BEG_MCTRL|0x100) ){ wind_update(END_UPDATE); return(0); } graf_mouse(M_OFF, NULL); return( 1 ); }
/* Read each mailbox line, and mark the email filename number as being assigned */ void load_mailbox(char *filename) { FILE *fid; int mailnum; char buff[200],mailname[FMSIZE]; graf_mouse( BUSY_BEE, NULL ); fid = fopen( filename, "ra" ); if (fid!=NULL) { /* fprintf( log, "Loading Mailbox: %s\n", filename ); */ /* for (c=0;c<MAILBOX_SIZE;c++) { */ while (fgets( buff, sizeof(buff), fid )!=NULL) { mailnum = parse_mailbox_header( buff, mailname ); if (!check_mailbox_directories(mailname, mailnum)) { /* check directory */ if (email[mailnum]=='T') { /* if marked, reset it */ email[mailnum]='\0'; } } } fclose( fid ); } graf_mouse( ARROW, NULL ); }
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(); }
/* ------------------------------------- */ 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(); }
void GEM_FreeWMCursor(_THIS, WMcursor *cursor) { #ifdef DEBUG_VIDEO_GEM printf("sdl:video:gem: free cursor\n"); #endif if (cursor == NULL) return; graf_mouse(ARROW, NULL); if (cursor->mform_p != NULL) SDL_free(cursor->mform_p); SDL_free(cursor); }
/* ------------------------------------------------------------------- */ 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 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; }
BOOLEAN rsrc_init( void ) { if( rsrc_load( "xftest.rsc" ) ) { rsrc_gaddr( R_TREE, DIAL, &tree ); TedText(EDIT1) = edit1; TedText(EDIT2) = edit2; TedText(EDIT3) = edit3; rsrc_gaddr( R_TREE, MENU, &menu ); menu_bar( menu, TRUE ); graf_mouse( ARROW, NULL ); return TRUE; /* Resource is okay */ } return FALSE; }