void end_aktion (void) { if (akt_handle > 0) { int msg[8], d, event = 0; wind_close(akt_handle); wind_delete(akt_handle); akt_handle = -1; /* * Alle auflaufenden Redraw-Messages abarbeiten, damit * alle Fenster sauber sind, wenn der Dialog beendet ist. */ while (event != MU_TIMER) { event = evnt_multi(MU_MESAG|MU_TIMER, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, msg, 1, &d, &d, &d, &d, &d, &d); if ((event & MU_MESAG) && (msg[0] == WM_REDRAW)) handle_msg(msg); } /* Men� wieder an */ enable_menu(); } }
/* * 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(); }
/* open window and enter event loop */ void start_program (void) { struct win_data wd; int fullx, fully, fullw, fullh; graf_mouse (ARROW, 0L); /* ensure mouse is an arrow */ /* 1. set up and open our window */ wind_get (0, WF_WORKXYWH, &fullx, &fully, &fullw, &fullh); wd.handle = wind_create (NAME|CLOSER, fullx, fully, fullw, fullh); wind_set (wd.handle, WF_NAME, "Example: Version 1", 0, 0); wind_open (wd.handle, fullx, fully, 300, 200); /* create any application-specific data: the string to show, in this case */ wd.text = "Hello"; /* display content in window */ draw_example (app_handle, &wd); /* 2. process events for our window */ event_loop (&wd); /* 3. close and remove our window */ wind_close (wd.handle); wind_delete (wd.handle); }
void xw_delete(WINDOW *w) { if (xw_exist(w)) { wind_delete(w->xw_handle); xw_rem(w); } }
/* * 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(); }
/* wind_exit() * ===================================================================== */ void wind_exit( void ) { if( w.id != NO_WINDOW ) { wind_delete( w.id ); w.id = NO_WINDOW; } }
void destroy_output_window(OUTPUT_WINDOW *window) { objc_delete(window->obj_tree, 1); free(window->obj_tree[1].ob_spec.userblk); free(window->obj_tree); window->obj_tree_length = 0; wind_close(window->handle); wind_delete(window->handle); free(window); window = NULL; }
void close_settings(void) { LOG(("")); gemtk_wm_remove(settings_guiwin); settings_guiwin = NULL; wind_close(h_aes_win); wind_delete(h_aes_win); h_aes_win = 0; LOG(("Done")); }
/* * Free a window node */ void win_free(WNODE *thewin) { if (thewin->w_id != -1) wind_delete(thewin->w_id); G.g_wcnt--; thewin->w_id = 0; objc_order(G.g_screen, thewin->w_root, 1); obj_wfree( thewin->w_root, 0, 0, 0, 0 ); }
/* * 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 wind_exit( void ) { WINFO *w = window1, *pw; while( w ) { wind_close( w->id ); wind_delete( w->id ); w = (pw=w)->next; free( pw ); } }
/*---------------------------------------------------*/ 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); }
/* Wm_Closed() *========================================================================== * Handle main event_multi window close messages * * IN: int *msg: Event messages * OUT: void * * GLOBAL: WINFO w: window structure messages * _app: TRUE- we ran as a PRG file */ void Wm_Closed( int *msg ) { if( msg[3] == w.id ) { wind_close( w.id ); wind_delete( w.id ); GrowShrinkBox( SHRINKBOX ); w.id = NO_WINDOW; if( _app ) gem_exit( 0 ); } }
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(); }
static void GEM_FreeBuffers(_THIS) { /* Release buffer */ if ( GEM_buffer ) { free( GEM_buffer ); GEM_buffer=NULL; } /* Destroy window */ if (GEM_handle>=0) { wind_close(GEM_handle); wind_delete(GEM_handle); GEM_handle=-1; } }
static void atari_sslcert_viewer_destroy(struct atari_sslcert_viewer_s * cvwin) { assert(cvwin); assert(cvwin->init); assert(cvwin->window); NSLOG(netsurf, INFO, "cvwin %p", cvwin); if (atari_treeview_is_open(cvwin->tv)) atari_treeview_close(cvwin->tv); wind_delete(gemtk_wm_get_handle(cvwin->window)); gemtk_wm_remove(cvwin->window); cvwin->window = NULL; atari_treeview_delete(cvwin->tv); free(cvwin); NSLOG(netsurf, INFO, "done"); }
void atari_global_history_destroy(void) { if ( atari_global_history.init == false) { return; } if ( atari_global_history.window != NULL ) { if (atari_treeview_is_open(atari_global_history.tv)) atari_global_history_close(); wind_delete(gemtk_wm_get_handle(atari_global_history.window)); gemtk_wm_remove(atari_global_history.window); atari_global_history.window = NULL; atari_treeview_delete(atari_global_history.tv); atari_global_history.init = false; } NSLOG(netsurf, INFO, "done"); }
/*------------------------------*/ static void close_window(WORD handle) { int cx, cy, cw, ch; /* Holds current XYWH position */ graf_mouse(HOUR, 0L); /* Show hourglass */ wind_get(handle, WF_CXYWH, &cx, &cy, &cw, &ch); wind_close(handle); /* Close window off screen */ graf_shrinkbox(xstart, ystart, HBOX, WBOX, cx, cy, cw, ch); wind_delete(handle); /* Clear window from system */ graf_mouse(ARROW, 0L); /* Change cursor to ARROW */ }
/* Wm_Closed() *========================================================================== * Handle main event_multi window close messages * * IN: int *msg: Event messages * OUT: void * * GLOBAL: WINFO w: window structure messages * _app: TRUE- we ran as a PRG file */ void Wm_Closed( int *msg ) { if( msg[3] == w.id ) { close_xconfig( FALSE ); clear_active_slot( FALSE ); Close_Call_CPX( FALSE ); Shut_CPX_Down( FALSE ); wind_close( w.id ); wind_delete( w.id ); GrowShrinkBox( SHRINKBOX ); w.id = NO_WINDOW; evnt_set( Event2_Mask, -1, -1, -1, NULL, NULL, -1L ); if( _app ) gem_exit( 0 ); } }
/* rsrc_exit(); * ================================================================ */ void rsrc_exit( void ) { /* Free up the DATA Buffer */ if( data_buffer ) Mfree( data_buffer ); data_buffer = NULL; /* Close up and Free all the windows */ if( wid > 0 ) { wind_close( wid ); wind_delete( wid ); } /* Free up the Resource */ rsrc_free(); /* Free up the SubMenus and Popups */ FreeMenus(); }
main() { gem_init(); whandle = wind_create (4095, 20, 20, 280, 150); /* 4095 = tous les organes de commande */ if (whandle < 0) form_alert (1, "[3][D‚sol‚!|Il ne reste plus de handle fenˆtre libre!][OK]" ); else { wind_open (whandle, 20, 20, 280, 150); /* Calcul de la zone de travail */ wind_calc (1, 4095, 20, 20, 280, 150, &x, &y, &w, &h); /* Conversion de hauteur/largeur du deuxiŠme angle (x2/y2) */ pxyarray[0] = x; pxyarray[1] = y; pxyarray[2] = x+w-1; pxyarray[3] = y+h-1; /* Effacer la zone de travail */ vsf_interior (handle, 0); /* Remplir avec couleur du fond */ vsf_perimeter (handle, 0); /* Pas de cadre */ v_bar (handle, pxyarray); vsf_perimeter (handle, 1); /* R‚activer le cadre */ Crawcin(); /* Attendre appui touche */ wind_close (whandle); wind_delete (whandle); } gem_exit(); }
/* ------------------------- | Dialog window handler | ------------------------- */ int dialog_window(int wind_id, OBJECT *dialog, int action, int ext) { int x, y, w, h, s; int w_x, w_y, w_w, w_h; int hndl, sel; switch(action) { case CLS_DIA: wind_close(wind_id); wind_delete(wind_id); break; case OPN_DIA: form_center(dialog, &x, &y, &w, &h); wind_calc(WC_BORDER, MOVER|NAME, x, y, w, h, &w_x, &w_y, &w_w, &w_h); hndl = open_window(MOVER|NAME, w_x, w_y, w_w, w_h, ""); return hndl; case RDW_DIA: s = first_rect(wind_id, 0); while(s) { objc_draw(dialog, ext, MAX_DEPTH, r_xy[0], r_xy[1], r_xy[2], r_xy[3]); s = next_rect(wind_id, 0); } break; case ACT_DIA: sel = win_formdo(dialog, ext, wind_id); if (dialog[sel].ob_flags & EXIT) dialog[sel].ob_state &= ~SELECTED; return sel; } return 0; }
/* ***Fenster schlie�en*** */ void close_window(void) { wind_close(wihndl); wind_delete(wihndl); }
/* ***PopUp darstellen*** */ short wdial_popup(OBJECT *ptree, short *pitem, short popupx, short popupy, void (*msghndlr)(int msgbf[]), unsigned long msec, void (*tmrhndlr)()) { int mpopupret, pwhndl; int dx, dy, dw, dh; int newitem=-1, olditem=-1; int msgbuf[8]; int which; int mx, my, mb, br; wind_get(0, WF_WORKXYWH, &dx, &dy, &dw, &dh); /* Desktopgr��e */ if(popupx+ptree->ob_width > dx+dw) popupx=dx+dw-ptree->ob_width; if(popupx<dx) popupx=dx; ptree->ob_x=popupx; if(*pitem > 0) popupy-=ptree[*pitem].ob_y; if(popupy+ptree->ob_height > dy+dh) popupy=dy+dh-ptree->ob_height; if(popupy<dy) popupy=dy; ptree->ob_y=popupy; wind_calc(WC_BORDER, 0, ptree->ob_x, ptree->ob_y, ptree->ob_width, ptree->ob_height, &dx, &dy, &dw, &dh); pwhndl=wind_create(0, dx, dy, dw, dh); /* Fenster anmelden */ if(pwhndl<0) return(FALSE); wind_open(pwhndl, dx, dy, dw, dh); /* Fenster �ffnen */ /*objc_draw(ptree, 0, 1, dx, dy, dw, dh); ->Durch WM_REDRAW zeichnen lassen*/ do graf_mkstate(&mx, &my, &mb, &dx); while(mb); /* Maustasten vorher loslassen */ do { which=evnt_multi(MU_MESAG|MU_BUTTON|MU_TIMER, 1,1,1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, msgbuf, (short)msec,(short)(msec>>16), &mx, &my, &mb, &dx, &dx, &br); if(which&MU_MESAG) { if(msgbuf[3]==pwhndl && msgbuf[0]>=WM_REDRAW && msgbuf[0]<=WM_NEWTOP) { switch(msgbuf[0]) { case WM_REDRAW: wdial_redraw(pwhndl, ptree, (GRECT *)(&msgbuf[4])); break; case WM_TOPPED: wind_set(pwhndl, WF_TOP, 0L, 0L); break; } } else if( msghndlr ) msghndlr(msgbuf); } if(which&MU_TIMER) { newitem=objc_find(ptree, 0, 1, mx, my); if(newitem>0 && newitem!=olditem) { if( (ptree[newitem].ob_flags&TOUCHEXIT) && !(ptree[newitem].ob_state&DISABLED) ) { GRECT prct; ptree[olditem].ob_state&=~SELECTED; ptree[newitem].ob_state|=SELECTED; prct.g_x=ptree->ob_x+ptree[olditem].ob_x; prct.g_y=ptree->ob_y+ptree[olditem].ob_y; prct.g_w=ptree[olditem].ob_width; prct.g_h=ptree[olditem].ob_height; wdial_redraw(pwhndl, ptree, &prct); prct.g_x=ptree->ob_x+ptree[newitem].ob_x; prct.g_y=ptree->ob_y+ptree[newitem].ob_y; prct.g_w=ptree[newitem].ob_width; prct.g_h=ptree[newitem].ob_height; wdial_redraw(pwhndl, ptree, &prct); olditem=newitem; } else newitem=olditem; } else newitem=olditem; if( tmrhndlr ) tmrhndlr(); } } while(mb!=1); /* Bis Maustaste gedr�ckt */ newitem=objc_find(ptree, 0, 1, mx, my); if(newitem>0 && (ptree[newitem].ob_flags&TOUCHEXIT) && !(ptree[newitem].ob_state&DISABLED) ) { *pitem=newitem; mpopupret=TRUE; } else { mpopupret=FALSE; } if(olditem>0) ptree[olditem].ob_state&=~SELECTED; wind_close(pwhndl); wind_delete(pwhndl); /* Fenster schliessen */ return(mpopupret); }
/* * 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(); 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; } /* * Get maximum partition size from * wincap "@@" entry. */ /* if (wgetent("Parameters", "@@") == OK) { if (wgetnum("ms", &mxpsiz) != OK) mxpsiz = MAXPSIZ; } else { 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: /* * If we have to reboot, * tell the user and then do it. * */ if (rebootp) { if (form_alert(2, autoboot) == 1) { reboot(); } else { goto redomul; } } wind_delete(wi_handle); v_clsvwk(handle); appl_exit(); }
/* ***Fenster schlie�en + l�schen*** */ void wdial_close(int dwhndl) { wind_close(dwhndl); /* Fenster schliessen */ wind_delete(dwhndl); /* Fenster abmelden */ }
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); graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); tmpx = gr_mkmx; tmpy = gr_mkmy; vswr_mode(handle, 3); v_enter_cur(handle); v_exit_cur(handle); graf_mouse(M_OFF, 0x0L); drawicon(gr_mkmx,gr_mkmy); graf_mouse(M_ON, 0x0L); drawicon(gr_mkmx+65,gr_mkmy); drawicon(gr_mkmx+65,gr_mkmy+65); drawicon(gr_mkmx+130,gr_mkmy); drawicon(gr_mkmx+130,gr_mkmy+130); drawicon(gr_mkmx+195,gr_mkmy); drawicon(gr_mkmx+195,gr_mkmy+195); drawicon(gr_mkmx+260,gr_mkmy); drawicon(gr_mkmx+260,gr_mkmy+260); drawicon(gr_mkmx+325,gr_mkmy); drawicon(gr_mkmx+325,gr_mkmy+325); drawicon(gr_mkmx+390,gr_mkmy); drawicon(gr_mkmx,gr_mkmy+65); drawicon(gr_mkmx+130,gr_mkmy+65); drawicon(gr_mkmx+195,gr_mkmy+65); drawicon(gr_mkmx+260,gr_mkmy+65); drawicon(gr_mkmx+325,gr_mkmy+65); drawicon(gr_mkmx+390,gr_mkmy+65); drawicon(gr_mkmx,gr_mkmy+130); drawicon(gr_mkmx+65,gr_mkmy+130); drawicon(gr_mkmx+195,gr_mkmy+130); drawicon(gr_mkmx+260,gr_mkmy+130); drawicon(gr_mkmx+325,gr_mkmy+130); drawicon(gr_mkmx+390,gr_mkmy+130); drawicon(gr_mkmx,gr_mkmy+195); drawicon(gr_mkmx+65,gr_mkmy+195); drawicon(gr_mkmx+130,gr_mkmy+195); drawicon(gr_mkmx+260,gr_mkmy+195); drawicon(gr_mkmx+325,gr_mkmy+195); drawicon(gr_mkmx+390,gr_mkmy+195); drawicon(gr_mkmx,gr_mkmy+260); drawicon(gr_mkmx+65,gr_mkmy+260); drawicon(gr_mkmx+130,gr_mkmy+260); drawicon(gr_mkmx+195,gr_mkmy+260); drawicon(gr_mkmx+325,gr_mkmy+260); drawicon(gr_mkmx+390,gr_mkmy+260); drawicon(gr_mkmx,gr_mkmy+325); drawicon(gr_mkmx+65,gr_mkmy+325); drawicon(gr_mkmx+130,gr_mkmy+325); drawicon(gr_mkmx+195,gr_mkmy+325); drawicon(gr_mkmx+260,gr_mkmy+325); drawicon(gr_mkmx+390,gr_mkmy+325); while(!(0x0002&gr_mkmstate)) { graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); tmpx1 = gr_mkmx; tmpy1 = gr_mkmy; tmpx2 = gr_mkmx; tmpy2 = gr_mkmy; graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); while (((tmpx1 != gr_mkmx) || (tmpy1 != gr_mkmy)) && ((abs(tmpx1, tmpx2) < 6) || (abs(tmpy1, tmpy2) < 6)) && (0x0001&gr_mkmstate)) { graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); tmpx1 = gr_mkmx; tmpy1 = gr_mkmy; graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate); draw = 1; } if (draw) { /* v_enter_cur(handle); graf_mouse(M_OFF, 0x0L); graf_mouse(M_ON, 0x0L); */ v_exit_cur(handle); drawicon(gr_mkmx,gr_mkmy); drawicon(gr_mkmx+65,gr_mkmy); drawicon(gr_mkmx+65,gr_mkmy+65); drawicon(gr_mkmx+130,gr_mkmy); drawicon(gr_mkmx+130,gr_mkmy+130); drawicon(gr_mkmx+195,gr_mkmy); drawicon(gr_mkmx+195,gr_mkmy+195); drawicon(gr_mkmx+260,gr_mkmy); drawicon(gr_mkmx+260,gr_mkmy+260); drawicon(gr_mkmx+325,gr_mkmy); drawicon(gr_mkmx+325,gr_mkmy+325); drawicon(gr_mkmx+390,gr_mkmy); drawicon(gr_mkmx,gr_mkmy+65); drawicon(gr_mkmx+130,gr_mkmy+65); drawicon(gr_mkmx+195,gr_mkmy+65); drawicon(gr_mkmx+260,gr_mkmy+65); drawicon(gr_mkmx+325,gr_mkmy+65); drawicon(gr_mkmx+390,gr_mkmy+65); drawicon(gr_mkmx,gr_mkmy+130); drawicon(gr_mkmx+65,gr_mkmy+130); drawicon(gr_mkmx+195,gr_mkmy+130); drawicon(gr_mkmx+260,gr_mkmy+130); drawicon(gr_mkmx+325,gr_mkmy+130); drawicon(gr_mkmx+390,gr_mkmy+130); drawicon(gr_mkmx,gr_mkmy+195); drawicon(gr_mkmx+65,gr_mkmy+195); drawicon(gr_mkmx+130,gr_mkmy+195); drawicon(gr_mkmx+260,gr_mkmy+195); drawicon(gr_mkmx+325,gr_mkmy+195); drawicon(gr_mkmx+390,gr_mkmy+195); drawicon(gr_mkmx,gr_mkmy+260); drawicon(gr_mkmx+65,gr_mkmy+260); drawicon(gr_mkmx+130,gr_mkmy+260); drawicon(gr_mkmx+195,gr_mkmy+260); drawicon(gr_mkmx+325,gr_mkmy+260); drawicon(gr_mkmx+390,gr_mkmy+260); drawicon(gr_mkmx,gr_mkmy+325); drawicon(gr_mkmx+65,gr_mkmy+325); drawicon(gr_mkmx+130,gr_mkmy+325); drawicon(gr_mkmx+195,gr_mkmy+325); drawicon(gr_mkmx+260,gr_mkmy+325); drawicon(gr_mkmx+390,gr_mkmy+325); draw = 0; } } wind_delete(wi_handle); v_clsvwk(handle); appl_exit(); }
int handle_message(int pipe[8]) { static int first_open=0; int wnr,error; /* ,avmsg[8]; */ char *vamsg,*o; #ifdef DEBUG char tmp[128]; #endif switch (pipe[0]) { case AC_OPEN: if (pipe[4] == acc_id) { if(first_open) { if(windforms[WIND_CTRL].wind_open) wind_set(windforms[WIND_CTRL].whandle,WF_TOP); else fgbg=FG; } else { fg_init(&windforms[WIND_CTRL]); fgbg=FG; first_open=1; } } #ifdef DEBUG form_alert(1,"[1][Got AC_OPEN][Ok]"); #endif break; case AC_CLOSE: /* if (pipe[4] == acc_id) */ { #ifdef DEBUG sprintf(tmp,"[1][Got AC_CLOSE|ACC id: %d|pipe4: %d][Ok]",acc_id,pipe[4]); form_alert(1,tmp); #endif if(windforms[WIND_CTRL].wind_open) { wind_close(windforms[WIND_CTRL].whandle); wind_delete(windforms[WIND_CTRL].whandle); windforms[WIND_CTRL].wind_open=0; } if(windforms[WIND_INFO].wind_open) { wind_close(windforms[WIND_INFO].whandle); wind_delete(windforms[WIND_INFO].whandle); windforms[WIND_INFO].wind_open=0; } #ifdef DEBUG sprintf(tmp,"[1][Filepos: %ld][Ok]",filepos); form_alert(1,tmp); #endif file_was_open=file_open; if(file_open) close_file(fd); closed_acc=1; return 1; } /* break; */ case AP_TERM: quit=1; return 1; /* switch(pipe[5]) { case AP_RESCHG: printf("Got AP_RESCHG!\n"); break; case AP_TERM: printf("Got AP_TERM!"); break; default: printf("Got unknown AP_TERM!"); } */ /* break; */ case RESCHG_COMPLETED: /* printf("Got RESCHG_COMPLETED!"); */ break; case WM_REDRAW: if((wnr=find_windform(pipe[3]))>=0) update_objects(&windforms[wnr],windforms[wnr].firstobj, windforms[wnr].objdepth,pipe); break; case WM_MOVED: if((wnr=find_windform(pipe[3]))>=0) { wind_set(windforms[wnr].whandle,WF_CURRXYWH,pipe[4],pipe[5],pipe[6],pipe[7]); windforms[wnr].wind.x=pipe[4]; windforms[wnr].wind.y=pipe[5]; windforms[wnr].wind.w=pipe[6]; windforms[wnr].wind.h=pipe[7]; wind_calc(WC_WORK,windforms[wnr].windkind, windforms[wnr].wind.x,windforms[wnr].wind.y, windforms[wnr].wind.w,windforms[wnr].wind.h, &windforms[wnr].form.x,&windforms[wnr].form.y, &windforms[wnr].form.w,&windforms[wnr].form.h); windforms[wnr].formtree[windforms[wnr].firstobj].ob_x=windforms[wnr].form.x; windforms[wnr].formtree[windforms[wnr].firstobj].ob_y=windforms[wnr].form.y; windforms[wnr].formtree[windforms[wnr].firstobj].ob_width=windforms[wnr].form.w; windforms[wnr].formtree[windforms[wnr].firstobj].ob_height=windforms[wnr].form.h; if(replay) update_time(); } break; case WM_CLOSED: if((wnr=find_windform(pipe[3]))>=0) { wind_close(windforms[wnr].whandle); windforms[wnr].wind_open=0; if(wnr==WIND_CTRL) { if(windforms[WIND_INFO].wind_open) { wind_close(windforms[WIND_INFO].whandle); windforms[WIND_INFO].wind_open=0; } return 1; } else wind_delete(windforms[wnr].whandle); } break; case WM_TOPPED: if((wnr=find_windform(pipe[3]))>=0) wind_set(pipe[3],WF_TOP); break; case AP_DRAGDROP: if(wind_find(pipe[4],pipe[5]) == windforms[WIND_CTRL].whandle) { if(do_dragdrop(pipe,DD_OK)) { exit_replay(); if(windforms[WIND_CTRL].formtree[CTRL_FF].ob_state & SELECTED) toggle_object(&windforms[WIND_CTRL],CTRL_FF,SET_NORMAL); Dsp_Hf1(0); if(windforms[WIND_CTRL].formtree[CTRL_PAUSE].ob_state & SELECTED) toggle_object(&windforms[WIND_CTRL],CTRL_PAUSE,SET_NORMAL); replay_pause=0; filepos=0; fd=reopen_file(); filesize=Fseek(0L,fd,2); Fseek(0L,fd,0); if((error=getmp2info(fd))==MP2_NOERR) { update_time(); setfilename(filename); if(!(pipe[6] & K_ALT)) init_replay(); } else { exit_replay(); show_mp2_error(error); close_file(fd); strcpy(windforms[WIND_CTRL].wind_title,"MPEG"); wind_set(windforms[WIND_CTRL].whandle,WF_NAME, windforms[WIND_CTRL].wind_title); setfilename("MPEGFILE"); } } } else { do_dragdrop(pipe,DD_NAK); } break; case VA_START: vamsg=*((char **)&pipe[3]); strcpy(path,vamsg); /* This *should* be sent to the application which sent the VA_START msg, but it seems to hang Thing doing it. */ /* avmsg[0]=AV_STARTED; avmsg[1]=app_id; avmsg[2]=0; avmsg[3]=pipe[3]; avmsg[4]=pipe[4]; appl_write(pipe[1],5*2,avmsg); */ if((o=strchr(path,' '))!=NULL) o[0]='\0'; o=strrchr(path,'\\'); strcpy(filename,&o[1]); o=strrchr(path,'\\'); strncpy(o,"\\*.MP?",6); o[6] = '\0'; exit_replay(); if(windforms[WIND_CTRL].formtree[CTRL_FF].ob_state & SELECTED) toggle_object(&windforms[WIND_CTRL],CTRL_FF,SET_NORMAL); Dsp_Hf1(0); if(windforms[WIND_CTRL].formtree[CTRL_PAUSE].ob_state & SELECTED) toggle_object(&windforms[WIND_CTRL],CTRL_PAUSE,SET_NORMAL); replay_pause=0; filepos=0; fd=reopen_file(); filesize=Fseek(0L,fd,2); Fseek(0L,fd,0); if((error=getmp2info(fd))==MP2_NOERR) { update_time(); setfilename(filename); init_replay(); } else { exit_replay(); show_mp2_error(error); close_file(fd); strcpy(windforms[WIND_CTRL].wind_title,"MPEG"); wind_set(windforms[WIND_CTRL].whandle,WF_NAME, windforms[WIND_CTRL].wind_title); setfilename("MPEGFILE"); } break; default: #ifdef DEBUG sprintf(tmp,"[1][Unimplemented| message: %d][Ok]",pipe[0]); form_alert(1,tmp); #endif break; } return 0; }
void do_menu( const int *msg, int *event ) { WORD ret; WORD puntmsg[8]; WINFO *w; menu_tnormal( menu, MnTitle(msg), TRUE ); switch( MnItem(msg) ) { case TEST: ret = new_window( &w, tree ); if( ret == (int)ENHNDL ) { form_alert( 1, "[1][Sorry, no more windows| are available.|Please close one| you aren't using.][ OK ]" ); } else if( ret == (int)ENSMEM ) { form_alert( 1, "[1][Sorry, not enough| free memory for| another window.][ OK ]" ); } else { ++nwindows; ObX(ROOT) = w->work.g_x; ObY(ROOT) = w->work.g_y; redraw( w, &w->work ); do { ret = xform_do( w, 0, puntmsg ); if( ret == -1 ) { switch( MsgType(puntmsg) ) { case MN_SELECTED: do_menu( (int *)puntmsg, event ); if( *event == 0 ) { ret = 0; } else { wind_get( 0, WF_TOP, &ret ); w = id_2winfo( ret ); if( w == NULL ) { form_alert( 1, "[3][Error topping window][ OK ]" ); ret = *event = 0; } else { ObX(ROOT) = w->work.g_x; ObY(ROOT) = w->work.g_y; ret = -1; } } break; case WM_TOPPED: case WM_NEWTOP: w = id_2winfo( WmId(puntmsg) ); if( w == NULL ) { form_alert( 1, "[3][Error topping window][ OK ]" ); ret = *event = 0; } wind_set( w->id, WF_TOP ); ObX(ROOT) = w->work.g_x; ObY(ROOT) = w->work.g_y; break; case WM_CLOSED: wind_close( w->id ); wind_unlink( w ); wind_delete( w->id ); free( w ); --nwindows; ret = 0; break; } } else { wind_close( w->id ); wind_unlink( w ); wind_delete( w->id ); free( w ); } } while( ret == -1 ); Deselect(ret & 0x7fff); } break; case QUIT: *event = 0; break; } }
void slideshow() { VEIL *tv; LEDP *led; int i,j,k,l; typedef int t_rgb[3]; t_rgb *col; int pal; long len; int wha,wx,wy,ww,wh; wind_update(BEG_MCTRL); graf_mouse(M_OFF,NULL); time(&t2); shift=(int)Kbshift(-1); if (glb.opt.deskfull) { wx=glb.aes.desk.x; wy=glb.aes.desk.y; ww=glb.aes.desk.w; wh=glb.aes.desk.h; } else { wx=0; wy=0; ww=1+glb.vdi.wscr; wh=1+glb.vdi.hscr; } wha=wind_create(0,0,0,1+glb.vdi.wscr,1+glb.vdi.hscr); if (wha<=0) { form_alert(1,glb.rsc.head.frstr[NOWIN]); graf_mouse(M_ON,NULL); graf_mouse(ARROW,NULL); wind_update(END_MCTRL); return; } _menuBar(glb.aes.tree.menu,FALSE); wind_open(wha,wx,wy,ww,wh); wind_get(wha,WF_CURRXYWH,&wx,&wy,&ww,&wh); if (glb.opt.is_tv && glb.opt.sl_tv) { tv=(VEIL *)_cookie('VeiL'); j=(int)tv->stop; tv->stop=0xFF; } if (glb.opt.is_led && glb.opt.sl_led) { led=(LEDP *)_cookie('LEDP'); k=led->active; led->active&=~1; } len=(long)glb.vdi.out[13]*(long)sizeof(t_rgb); pal=_mAlloc(len,FALSE); glb.opt.mask=0; if (pal!=NO_MEMORY) { col=(t_rgb *)glb.mem.adr[pal]; for (i=0;i<glb.vdi.out[13];i++) vq_color(glb.vdi.ha,i,1,(int *)col[i]); } glb.div.slide=TRUE; l=Balaie_Path(glb.opt.sl_path,wx,wy,ww,wh); if (!l && glb.opt.sl_loop && num>0) do { l=Balaie_Path(glb.opt.sl_path,wx,wy,ww,wh); } while (!l); glb.div.slide=FALSE; updFreeMem(); if (pal!=NO_MEMORY) { col=(t_rgb *)glb.mem.adr[pal]; for (i=0;i<glb.vdi.out[13];i++) vs_color(glb.vdi.ha,i,(int *)col[i]); _mFree(pal); } if (glb.opt.is_tv && glb.opt.sl_tv) { tv=(VEIL *)_cookie('VeiL'); tv->stop=j; } if (glb.opt.is_led && glb.opt.sl_led) { led=(LEDP *)_cookie('LEDP'); led->active=k; } wind_close(wha); wind_delete(wha); _menuBar(glb.aes.tree.menu,TRUE); graf_mouse(M_ON,NULL); graf_mouse(ARROW,NULL); wind_update(END_MCTRL); }