void init_os_info(void) { int16_t out[4]; long cookie_FSMC = 0; atari_sysinfo.gemdos_version = Sversion(); if( tos_getcookie (C_FSMC, &cookie_FSMC ) == C_FOUND ) { atari_sysinfo.gdos_FSMC = 1; } else { atari_sysinfo.gdos_FSMC = 0; } atari_sysinfo.large_sfont_pxh = 13; atari_sysinfo.medium_sfont_pxh = 6; atari_sysinfo.small_sfont_pxh = 4; /* todo: detect if system font is monospaced */ atari_sysinfo.sfont_monospaced = true; if( appl_xgetinfo(AES_LARGEFONT, &out[0], &out[1], &out[2], &out[3] ) > 0 ) { atari_sysinfo.large_sfont_pxh = out[0]; } if( appl_xgetinfo(AES_SMALLFONT, &out[0], &out[1], &out[2], &out[3] ) > 0 ) { atari_sysinfo.small_sfont_pxh = out[0]; } atari_sysinfo.aes_max_win_title_len = 79; if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) { if (sys_NAES()) { atari_sysinfo.aes_max_win_title_len = 127; } if (sys_XAAES()) { atari_sysinfo.aes_max_win_title_len = 200; } } }
void check_info(void) { int check,dummy; has_agi = ((_GemParBlk.global[0] == 0x0399 && get_cookie('MagX',NULL)) || (_GemParBlk.global[0] >= 0x0400) || (appl_find("?AGI") >= 0)); if (appl_xgetinfo(10,&check,&dummy,&dummy,&dummy)) { if (((check & 0x00ff) >= 9) || (mgxver >= 0x0300)) shutdown = 1; if (((check & 0x00ff) >= 7) && (!magix)) broadcast = 1; } else { if (_GemParBlk.global[0] >= 0x0400) { shutdown = 1; broadcast = 1; } } if (appl_xgetinfo(4,&dummy,&dummy,&check,&dummy)) { if (check) search = 1; } else { if (_GemParBlk.global[0] >= 0x0400) search = 1; } if (appl_xgetinfo(6,&dummy,&dummy,&check,&dummy)) { if (check) mbar = 1; } }
void init_rsrc( void ) { int16 work_out[57]; int16 ag1, ag2, ag3, ag4; vdi_handle = open_vwork(work_out); if (gl_gdos) vst_load_fonts(vdi_handle, 0); if ( (_GemParBlk.global[0] >= 0x0400) || (_app == 0) ) menu_id = menu_register(gl_apid, " Control Center"); rsrc_gaddr( R_TREE, MENUTREE, &menu ); /* get tree pointer */ if(_app) create_menu(menu); rsrc_gaddr( R_TREE, MAINDIAL, &maindial ); rsrc_gaddr( R_TREE, WINICON, &wicon ); rsrc_gaddr( R_TREE, ABOUT, &about ); rsrc_gaddr( R_TREE, TOOLS, &tools ); rsrc_gaddr( R_TREE, ICONS, &icons ); rsrc_gaddr( R_FRSTR, WRITE_ERROR, &fstring_addr ); /* get first alert */ fix_popup( tools, 1 ); if ( appl_xgetinfo( 13, &ag1, &ag2, &ag3, &ag4 )) /* Unterfunktion 13, Objekte */ { if ( ag4 & 0x08 ) /* G_SHORTCUT unterst�tzt ? */ aes_flags |= GAI_GSHORTCUT; if ( ag1 && ag2 ) /* 3D-Objekte und objc_sysvar() vorhanden? */ { if ( objc_sysvar( 0, AD3DVALUE, 0, 0, &h3d, &v3d )) /* 3D-Look eingeschaltet? */ { if ( gl_planes >= 4 ) /* mindestens 16 Farben? */ { int16 radio_bgcol, dummy; aes_flags |= GAI_3D; objc_sysvar( 0, BACKGRCOL, 0, 0, &radio_bgcol, &dummy ); } } } } }
void handle_msg(int *msg) { WINDOWP window; wake_mouse(); window= get_window(msg[3]); /* Zugeh�riges Fenster */ switch (msg[0]) /* Art der Nachricht */ { case MN_SELECTED: if (makro_rec) /* Makro wird Tastendruck vorgegaukelt */ { int kstate, kreturn; char str[50]; get_string(menu, msg[4], str); if (str_to_key(str, &kstate, &kreturn)) { kstate |= (kstate & 3); to_makro(kstate, kreturn); } } handle_menu(msg[3], msg[4], menu_ctrl); menu_ctrl = FALSE; break; case WM_REDRAW : if (msg[3] == akt_handle) redraw_aktion(); else redraw_window (window, (GRECT*)(msg+4)); break; case WM_CLOSED : do_icon(window->handle, DO_DELETE); break; case WM_FULLED : full_window (window); break; case WM_ARROWED : arrow_window (window, msg[4], 1); break; case WM_HSLID : h_slider (window, msg[4]); break; case WM_VSLID : v_slider (window, msg[4]); break; case WM_SIZED : size_window (window, (GRECT*)(msg+4), TRUE); break; case WM_MOVED : move_window (window, (GRECT*)(msg+4)); break; case WM_NEWTOP : /* Fenster von qed ist irgendwie nach oben gekommen */ case WM_ONTOP : ontop_window(window); break; case WM_TOPPED : top_window (window); break; case WM_UNTOPPED: /* qed hat jetzt nicht mehr das Top-Fenster */ untop_window (window); break; case WM_BOTTOMED: /* AES 4.00 MagiC 3 : Fenster nach hinten */ case WM_M_BDROPPED : /* Magic 2 */ bottom_window (window, msg[0]); break; case WM_ICONIFY: iconify_window(window, (GRECT*)(msg+4)); break; case WM_ALLICONIFY: all_iconify(window, (GRECT*)(msg+4)); break; case WM_UNICONIFY: if (all_iconified) all_uniconify(NULL, (GRECT*)(msg+4)); else uniconify_window(window, (GRECT*)(msg+4)); break; case WM_SHADED : case WM_UNSHADED : shade_window(window, msg[0]); break; case AP_TERM: if (all_iconified) all_uniconify(NULL, NULL); quick_close = TRUE; if (prepare_quit()) do_quit(); break; case AP_DRAGDROP : if (all_iconified) Bconout(2, 7); else handle_dd(msg); break; case SC_CHANGED : /* * Ignorieren, da wir vor dem Paste sowieso neu laden. */ break; case VA_START : case VA_PROTOSTATUS : case VA_DRAG_COMPLETE : case VA_DRAGACCWIND : case AV_SENDKEY : handle_av(msg); break; case SE_INIT: case SE_OK: case SE_ACK: case SE_OPEN: case SE_ERROR: case SE_ERRFILE: case SE_PROJECT: case SE_QUIT: case SE_TERMINATE: case SE_CLOSE : case SE_MENU : if (all_iconified) all_uniconify(NULL, NULL); handle_se(msg); break; case OLGA_INIT : case OLE_NEW : case OLGA_ACK : case OLE_EXIT : handle_olga(msg); break; case SH_WDRAW: /* schickt Freedom st�ndig */ case DHST_ACK: /* SMU antwortet */ /* ignore */ break; case FONT_CHANGED : if (msg[4] != 0) font_id = msg[4]; if (msg[5] != 0) font_pts = msg[5]; font_change(); break; default: if (debug_level) { char str[12]; int d, i, id; if ((appl_xgetinfo(4, &d, &d, &i, &d)) && (i == 1)) /* gibts appl_search? */ { i = appl_search(0, str, &d, &id); while (i != 0) { if (id == msg[1]) break; i = appl_search( 1, str, &d, &id); } } else { strcpy(str, ""); id = msg[1]; } debug("Unbekannte Msg %d (0x%X) von %s (%d)\n", msg[0], msg[0], str, id); } break; } }