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; } } }
static void gui_init2(int argc, char** argv) { deskmenu_init(); menu_register( -1, theapp); if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) { menu_register( _AESapid, (char*)" NetSurf "); } gemtk_wm_init(); global_history_init(); hotlist_init(); toolbar_init(); }
static bool process_cmdline(int argc, char** argv) { int opt; bool set_default_dimensions = true; LOG(("argc %d, argv %p", argc, argv)); if ((nsoption_int(window_width) != 0) && (nsoption_int(window_height) != 0)) { option_window_width = nsoption_int(window_width); option_window_height = nsoption_int(window_height); option_window_x = nsoption_int(window_x); option_window_y = nsoption_int(window_y); if (option_window_width <= desk_area.g_w && option_window_height < desk_area.g_h) { set_default_dimensions = false; } } if (set_default_dimensions) { if( sys_type() == SYS_TOS ) { /* on single tasking OS, start as fulled window: */ option_window_width = desk_area.g_w; option_window_height = desk_area.g_h; option_window_x = desk_area.g_w/2-(option_window_width/2); option_window_y = (desk_area.g_h/2)-(option_window_height/2); } else { option_window_width = 600; option_window_height = 360; option_window_x = 10; option_window_y = 30; } } if (nsoption_charp(homepage_url) != NULL) option_homepage_url = nsoption_charp(homepage_url); else option_homepage_url = NETSURF_HOMEPAGE; while((opt = getopt(argc, argv, "w:h:")) != -1) { switch (opt) { case 'w': option_window_width = atoi(optarg); break; case 'h': option_window_height = atoi(optarg); break; default: fprintf(stderr, "Usage: %s [w,h,v] url\n", argv[0]); return false; } } if (optind < argc) { option_homepage_url = argv[optind]; } return true; }
/** * Initialise atari gui. */ static void gui_init(int argc, char** argv) { char buf[PATH_MAX]; OBJECT * cursors; atari_find_resource(buf, "netsurf.rsc", "./res/netsurf.rsc"); LOG("Using RSC file: %s ", (char *)&buf); if (rsrc_load(buf)==0) { char msg[1024]; snprintf(msg, 1024, "Unable to open GEM Resource file (%s)!", buf); die(msg); } wind_get_grect(0, WF_WORKXYWH, &desk_area); create_cursor(0, POINT_HAND, NULL, &gem_cursors.hand ); create_cursor(0, TEXT_CRSR, NULL, &gem_cursors.ibeam ); create_cursor(0, THIN_CROSS, NULL, &gem_cursors.cross); create_cursor(0, BUSY_BEE, NULL, &gem_cursors.wait); create_cursor(0, ARROW, NULL, &gem_cursors.arrow); create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizeall); create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenesw); create_cursor(0, OUTLN_CROSS, NULL, &gem_cursors.sizenwse); cursors = gemtk_obj_get_tree(CURSOR); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_APPSTART, cursors, &gem_cursors.appstarting); gem_set_cursor( &gem_cursors.appstarting ); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_SIZEWE, cursors, &gem_cursors.sizewe); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_SIZENS, cursors, &gem_cursors.sizens); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_NODROP, cursors, &gem_cursors.nodrop); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_DENY, cursors, &gem_cursors.deny); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_MENU, cursors, &gem_cursors.menu); create_cursor(MFORM_EX_FLAG_USERFORM, CURSOR_HELP, cursors, &gem_cursors.help); LOG("Enabling core select menu"); nsoption_set_bool(core_select_menu, true); LOG("Loading url.db from: %s", nsoption_charp(url_file)); if( strlen(nsoption_charp(url_file)) ) { urldb_load(nsoption_charp(url_file)); } LOG("Loading cookies from: %s", nsoption_charp(cookie_file)); if( strlen(nsoption_charp(cookie_file)) ) { urldb_load_cookies(nsoption_charp(cookie_file)); } if (process_cmdline(argc,argv) != true) die("unable to process command line.\n"); LOG("Initializing NKC..."); nkc_init(); LOG("Initializing plotters..."); plot_init(nsoption_charp(atari_font_driver)); aes_event_in.emi_m1leave = MO_LEAVE; aes_event_in.emi_m1.g_w = 1; aes_event_in.emi_m1.g_h = 1; //next_poll = clock() + (CLOCKS_PER_SEC>>3); deskmenu_init(); menu_register( -1, theapp); if (sys_type() & (SYS_MAGIC|SYS_NAES|SYS_XAAES)) { menu_register( _AESapid, (char*)" NetSurf "); } gemtk_wm_init(); /* Initialize the specific treeview windows: */ atari_global_history_init(); atari_hotlist_init(); atari_cookie_manager_init(); /* Initialize the toolbar framework: */ toolbar_init(); }