void print_people( int ref ) { int reference ; /* person selected for printing */ char *alert_ptr, alert_str[200] ; short i, count = 0 ; Str_prt_params params ; while( !count ) { if( !ref ) { reference = get_person_reference( NULL, TRUE ) ; if( !reference ) return ; /* exit if nobody selected */ count = entries ; /* entries is number of people selected */ if( count > 1 ) { rsrc_gaddr( R_STRING, PRINT_MANY, &alert_ptr ) ; sprintf( alert_str, alert_ptr, count ) ; if( form_alert( 0, alert_str ) == 2 ) count = 0 ; } } else { matches[0] = ref ; /* force selector list */ count = 1 ; } if( count ) { if( open_printer( ¶ms ) ) { params.ref2 = 0 ; /* Do not print second reference. */ if( params.use_gdos ) setup_font( ¶ms, fontinfo ) ; if( params.chs_across < 40 ) { rsrc_gaddr( R_STRING, GROSS_FONT, &alert_ptr ) ; rsrc_form_alert( 1, GROSS_FONT ) ; } else { busy( BUSY_MORE ) ; start_print_checking( ¶ms ) ; i = 0 ; while( printing_ok( ¶ms ) && ( reference = matches[i++] ) ) print_person( reference, ¶ms ) ; close_printer( ¶ms ) ; busy( BUSY_LESS ) ; } } } } }
void select_progeny( short prog_num, GRECT box ) { int prog ; /* progeny reference */ char names[IDX_NAM_MAX*2 + DATE_LENGTH + 2] ; char alert_str[200], *alert_ptr ; prog = -1 ; if( prog_array[prog_num + prog_oset] ) /* If child there already, */ /* does it want deleting. */ { rsrc_gaddr( R_STRING, PROG_DEL, &alert_ptr ) ; names_only( prog_array[prog_num + prog_oset] , names, 30, FALSE ) ; sprintf( alert_str, alert_ptr, names ) ; if( form_alert( 1, alert_str ) == 2 ) prog = 0 ; } else prog = get_person_reference( people[male].family_name, FALSE ) ; if( prog != -1 ) { prog_array[prog_num + prog_oset] = prog ; names_date( prog, names, 40, FALSE ) ; strcpy( c_form_addrs.child[prog_num], names ) ; objc_draw( coup_form.fm_ptr, PROGENY, MAX_DEPTH, (int) box.g_x,(int) box.g_y, (int) box.g_w, (int) box.g_h ) ; } }
void start_aktion(char *str, bool inter, long max) { int d; GRECT r1, r2; if (aktion == NULL) { rsrc_gaddr(R_TREE, AKTION, &aktion); fix_dial(aktion); } max_value = max(max, 1); set_string(aktion, ATEXT, str); aktion[ABOX2].ob_width = 1; set_flag(aktion, AESC, HIDETREE, !inter); interupt = inter; /* Zentrieren, nur beim ersten Mal */ if (aktion[0].ob_x == 0 && aktion[0].ob_y == 0) form_center(aktion, &d, &d, &d, &d); r1.g_x = aktion[0].ob_x; r1.g_y = aktion[0].ob_y; r1.g_w = aktion[0].ob_width; r1.g_h = aktion[0].ob_height; wind_calc_grect(WC_BORDER, (NAME|MOVER|BACKDROP), &r1, &r2); akt_handle = wind_create_grect((NAME|MOVER|BACKDROP), &r1); if (akt_handle > 0) { /* Men� abschalten */ disable_menu(); wind_set_str(akt_handle, WF_NAME, " qed "); wind_open_grect(akt_handle, &r2); } }
void CycleHoraire(void) /* Change the NVRam.DateTime part of structure to set the date format.(12h/24h) This affect only the bit 5. */ { OBJECT *Arbre; rsrc_gaddr(R_TREE,FMAIN,&Arbre); switch(F_NameObject) { case C12H: F_Select(FMAIN,C12H); F_UnSelect(FMAIN,C24H); F_RedrawObject(Arbre,C12H); F_RedrawObject(Arbre,C24H); NVRam.DateTime &= 0xEF; /* Bit5 = 0 */ break; case C24H: F_Select(FMAIN,C24H); F_UnSelect(FMAIN,C12H); F_RedrawObject(Arbre,C12H); F_RedrawObject(Arbre,C24H); NVRam.DateTime |= 0x10; /* Bit5 = 1 */ break; } }
/* ---------------- | Check cookie | ---------------- */ void cookie_chk(void) { OBJECT *ausg_tree; unsigned long val; int ret, set = OP_PSG; play_mode = PSG; rsrc_gaddr(R_TREE, AUSG_SEL, &ausg_tree); ret = get_cookie('_SND', &val); if (!ret || !(val & 2)) { ausg_tree[OP_DMA].ob_state |= DISABLED; ausg_tree[OT_DMA].ob_state |= DISABLED; menu_adr[SET_MW].ob_state |= DISABLED; } else { set = OP_DMA; play_mode = DMA; send_mwire(); } if (ret && !(val & 1)) { ausg_tree[OP_PSG].ob_state |= DISABLED; ausg_tree[OT_PSG].ob_state |= DISABLED; } ausg_tree[set].ob_state |= SELECTED; if (get_cookie('_CPU', &cpu_type)) cpu_type += 68000L; get_cookie('_MCH', &machine); }
/* -------------------------------- */ void install_prg(void) { register int i; ap_id = appl_init(); open_vwork(); kb_rec = (int *)Iorec(1); for (i = 0; i < 5; i++) old_kb[i] = kb_rec[i + 2]; kb_rec[2] = 10; kb_rec[3] = 0; kb_rec[4] = 0; kb_rec[5] = 2; kb_rec[6] = 8; rsrc_load("M_TEXT.RSC"); rsrc_gaddr(ROOT, TXT_MENU, &menu_adr); graf_mouse(ARROW, 0L); init_mtext(); init_rsc(); menu_bar(menu_adr, TRUE); }
LONG string_addr(WORD which) { LONG where; rsrc_gaddr(R_STRING, which, &where); return (where); }
LONG image_addr(WORD which) { LONG where; rsrc_gaddr(R_IMAGEDATA, which, &where); return (where); }
void progress_init( const char * title_msg, long max ) { rsrc_gaddr( 0, PROC_BOX, &progress_tree ); progress_tree[PB_PROGBAR].ob_width = 0; progress_tree[PB_CANCEL].ob_state &= ~SELECTED; strcpy( ObjcString( progress_tree, PB_ELATIME, NULL ), "--:--" ); strcpy( ObjcString( progress_tree, PB_REMTIME, NULL ), "--:--" ); ObjcString( progress_tree, PB_STATUS, "" ); if( preferences.pref_flags.multitask ) { progress_tree[0].ob_state &= ~OUTLINED; progress_tree[PB_CANCEL].ob_flags &= ~HIDETREE; progress_tree[PB_ESC].ob_flags |= HIDETREE; progress_win = FormWindBegin( progress_tree, get_string( title_msg ) ); } else { /* MouseWork(); */ graf_mouse( BUSYBEE, NULL ); progress_tree[0].ob_state |= OUTLINED; progress_tree[PB_CANCEL].ob_flags |= HIDETREE; progress_tree[PB_ESC].ob_flags &= ~HIDETREE; FormBegin( progress_tree, NULL ); } progress_exitflag = 0; progress_max = max; progress_count = 0; progress_info = NULL; progress_start_time = 0; progress_next_refresh = 0; }
/* ** Description ** Show information about oAESis ** ** 1999-01-10 CG ** 1999-01-11 CG */ static void show_information (void) { OBJECT * information; int x; int y; int w; int h; /* Get address if information resource */ rsrc_gaddr (R_TREE, INFORM, &information); /* Fix version number :-) */ sprintf(information[INFOVERSION].ob_spec.tedinfo->te_ptext, OAESIS_VERSION); /* Calculate area of resource */ form_center (information, &x, &y, &w, &h); /* Reserve area for dialog */ form_dial (FMD_START, x, y, w, h, x, y, w, h); /* Draw dialog */ objc_draw (information, 0, 9, x, y, w, h); /* Let the user handle the dialog */ form_do (information, 0); /* Free area used by dialog */ form_dial (FMD_FINISH, x, y, w, h, x, y, w, h); /* Restore ok button */ information[INFOOK].ob_state &= ~SELECTED; }
void create_path() { OBJECT *tree; char *edit, *work; int remain; rsrc_gaddr (R_TREE, LOGCTRL, & tree); if (strlen (path) <= 30) { strcpy (tree[FILENAM].ob_spec.tedinfo->te_ptext, path); } else { edit = tree[FILENAM].ob_spec.tedinfo->te_ptext; remain = 27; if (path[1] == ':' && path[2] == '\\') { remain -= 3; *edit++ = path[0]; *edit++ = path[1]; *edit++ = path[2]; } strcpy (edit, "..."); edit += 3; work = & path[strlen(path) - remain]; if (strchr (work, '\\')) strcpy (edit, strchr (work, '\\')); else strcpy (edit, work); } }
void gem_prgm() { OBJECT *tree; int box_x, box_y, box_w, box_h, button, end = FALSE; int work_in[11], work_out[57], count, dummy; for (count = 0; count < 10; count++) work_in[count] = 1; work_in[10] = 2; vdi_handle = graf_handle (& dummy, & dummy, & dummy, & dummy); v_opnvwk (work_in, & vdi_handle, work_out); vq_extnd (vdi_handle, 1, work_out); planes = work_out[4]; rsrc_gaddr (R_TREE, LOGCTRL, & tree); form_center (tree, & box_x, & box_y, & box_w, & box_h); form_dial (FMD_START, 0,0,0,0, box_x, box_y, box_w, box_h); objc_draw (tree, ROOT, MAX_DEPTH, box_x, box_y, box_w, box_h); do { button = form_do (tree, 0) & 0x7fffu; evnt_timer (60, 0); tree[button].ob_state &= ~SELECTED; objc_draw (tree, button, 1, box_x, box_y, box_w, box_h); switch (button) { case FILENAM : modify_fname(); objc_draw (tree, ROOT, MAX_DEPTH, box_x, box_y, box_w, box_h); break; case CLIENT : case MODULE : form_dial (FMD_FINISH, 0,0,0,0, box_x, box_y, box_w, box_h); do_dialog ((button == CLIENT) ? CLI_API : MOD_API); form_dial (FMD_START, 0,0,0,0, box_x, box_y, box_w, box_h); objc_draw (tree, ROOT, MAX_DEPTH, box_x, box_y, box_w, box_h); break; case TERM : if (form_alert (1, "[2][ | Remove LogSTinG and | leave LogCTRL ?][ Yes | No ]") == 1) { if ((long) (*sting_drivers->get_dftab) ("LOGSTING : REMOVE") == 'OkOk') end = TRUE; else form_alert (1, "[1][ | Could not remove LogSTinG ! ][ Hmmm ]"); } break; case FIX : if (form_alert (1, "[2][ | Activate new settings ? ][ Yes | No ]") == 1) do_settings(); break; case CANCEL : if (form_alert (1, "[2][ | Leave LogCTRL ? ][ Yes | No ]") == 1) end = TRUE; break; } } while (! end); form_dial (FMD_FINISH, 0,0,0,0, box_x, box_y, box_w, box_h); v_clsvwk (vdi_handle); }
/* ------------------------- */ void set_pfont(void ) { register int eo; rsrc_gaddr(ROOT, PRT_FONT, &form_adr); eo = dialog(0); }
/* ------------------------------- | Initialize Microwire dialog | ------------------------------- */ void init_mwdia(void) { int i; rsrc_gaddr(R_TREE, SET_MW, &setmw_dia.tree); for (i = 0; i < 5; i++) set_mwsld(i); }
/*--------------------------------------------------------------*/ WORD _ovlerr() { LONG al_addr ; rsrc_gaddr( 5, NOOVLERR, &al_addr ) ; form_alert( 1,al_addr ) ; } /* _ovlerr */
/* ----------------- | Change volume | ----------------- */ void set_loud(void) { OBJECT *loud_sel; rsrc_gaddr(R_TREE, SET_VAL, &loud_sel); if (dialog(loud_sel) == LOUD_OK) vol_calc(atoi(loud_sel[LOUD_VAL].ob_spec.tedinfo->te_ptext)); }
BYTE *ini_str(WORD stnum) { LONG lstr; rsrc_gaddr(R_STRING, stnum, &lstr); LSTCPY(ADDR(&gl_lngstr[0]), lstr); return(&gl_lngstr[0]); }
/* ------------- | Give Info | ------------- */ void do_info(void) { OBJECT *info_fm; rsrc_gaddr(R_TREE, SND_INFO, &info_fm); if (dialog(info_fm) == DO_STAT) check_sample(); }
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; }
/* * Issue an alert after merging in an optional character variable */ WORD fun_alert_merge(WORD defbut, WORD stnum, BYTE merge) { rsrc_gaddr(R_STRING, stnum, (void **)&G.a_alert); strcpy(G.g_2text, G.a_alert); sprintf(G.g_1text, G.g_2text, merge); G.a_alert = G.g_1text; return form_alert(defbut, G.a_alert); }
OBJECT *gemtk_obj_get_tree(int idx) { OBJECT *tree; rsrc_gaddr(R_TREE, idx, &tree); return tree; }
/* Added for DESKTOP v1.2 */ void win_sinfo(WNODE *pwin) { PNODE *pn; pn = pwin->w_path; rsrc_gaddr(R_STRING, STINFOST, (void **)&G.a_alert); strlencpy(G.g_1text, G.a_alert); sprintf(pwin->w_info, G.g_1text, pn->p_size, pn->p_count); }
/* ---------------- */ void print_txt(void) { register int eo; rsrc_gaddr(ROOT, PRT_MENU, &form_adr); eo = dialog(0) & 0x7FFF; if (eo == DO_PRT) form_alert(1, "[3][Drucken noch nicht |m”glich!][ OK ]"); }
/**************************************************************** * * * cr‚e un fichier vide d'une taille donn‚e * * * ****************************************************************/ void creer_fichier(void) { OBJECT *file_size; char nom[FILENAME_MAX] = "EMPTY.NEW", text[FILENAME_MAX]; int ex, size, handle; if(!selecteur(nom, NULL, Messages(TAMPON_1))) return; sprintf(text, Messages(TAMPON_2), nom); ajoute(Firstwindow, text); rsrc_gaddr(R_TREE, TAILLE_FICHIER, &file_size); strcpy(file_size[CREATE_FILE_SIZE].ob_spec.tedinfo -> te_ptext, "1"); ex = xdialog(Dialog[TAILLE_FICHIER].tree, NULL, NULL, NULL, TRUE, TRUE, DialogInWindow ? AUTO_DIAL|MODAL|NO_ICONIFY : FLY_DIAL|MODAL|NO_ICONIFY|SMART_FRAME); if (ex == CREATE_FILE_ANNU) { ajoute(Firstwindow, Messages(TAMPON_3)); return; } size = atoi(file_size[CREATE_FILE_SIZE].ob_spec.tedinfo -> te_ptext); if ((handle = (int)Fcreate(nom, 0)) >! 0) { int i, err; char buffer[512]; for (i=0; i<512; i++) /* efface le buffer */ buffer[i] = '\0'; for (i=0; i<size; i++) /* copie 'size' fois le buffer */ if ((err = (int)Fwrite(handle, 512L, buffer)) < 0) { error_msg(err); break; } Fclose(handle); sprintf(text, Messages(TAMPON_4), nom, size*512L); ajoute(Firstwindow, text); if (nom[1] == ':') change_disque(toupper(nom[0]) -'A', TRUE); } else { error_msg(handle); sprintf(text, Messages(TAMPON_5), nom); ajoute(Firstwindow, text); } } /* creer_fichier */
void AboutOk(void) /* Procedure called when the OK button of About me is clicked. */ { OBJECT *Arbre; rsrc_gaddr(R_TREE,FINFO,&Arbre); /* Tree address */ Arbre[FUNSHIP].ob_flags |= HIDETREE; /* Hide photo */ F_Close(FINFO); }
/* ------------------------------- | Count correction value down | ------------------------------- */ int pkor_dwn(void) { if (korr_val > 4) { korr_val--; if (!packopt_dia.tree) rsrc_gaddr(R_TREE, PACKOPT, &packopt_dia.tree); if (!mboard_dia.tree) rsrc_gaddr(R_TREE, ALLINONE, &mboard_dia.tree); itoa(korr_val, packopt_dia.tree[CVAL].ob_spec.tedinfo->te_ptmplt, 10); itoa(korr_val, mboard_dia.tree[MB_CVAL].ob_spec.tedinfo->te_ptmplt, 10); if (packopt_dia.w_handle) force_oredraw(packopt_dia.w_handle, CVAL); if (mboard_dia.w_handle) force_oredraw(mboard_dia.w_handle, MB_CVAL); } return 0; }
void app_tran(WORD bi_num) { BITBLK *pbi; BITBLK lb; rsrc_gaddr(R_BITBLK, bi_num, (void **)&pbi); memcpy(&lb, pbi, sizeof(BITBLK)); gsx_trans(lb.bi_pdata, lb.bi_wb, lb.bi_pdata, lb.bi_wb, lb.bi_hl); }
//******************************************************************** // 1998-09-16 - Created //******************************************************************** // init_rsc: Loads and initiates the resource-file //******************************************************************** int init_rsc() { short dummy; char filnamn[ MAXSTRING ]; rsrc_free(); strcpy( filnamn , system_dir ); if( screeny > 15 ) strcat( filnamn , RESURSL ); else strcat( filnamn , RESURSH ); dummy = rsrc_load( filnamn ); if( !dummy ) { strcpy( tempvar.errorstring , RESOURCE_ERROR ); alertbox( 1 , tempvar.errorstring ); #ifdef LOGGING Log( LOG_INIT , "Could not load resource-file: %s\n" , filnamn ); #endif Return FALSE; } for( dummy = 0 ; dummy < MAX_ALERTS ; dummy++ ) rsrc_gaddr( R_STRING , dummy , &alerts[ dummy ] ); rsrc_gaddr(R_TREE,ICONS,&icons); init_info_win(); // init_main_win(); #ifdef USE_MENU rsrc_gaddr(R_TREE,MENU,&menu_tree); #endif Return TRUE; }
static boolean check_print(WINDOW *w, int n, int *list) { int i; boolean noerror; char *mes = ""; for (i = 0; i < n; i++) { noerror = FALSE; switch (itm_type(w, list[i])) { case ITM_PRINTER: rsrc_gaddr(R_STRING, MPRINTER, &mes); break; case ITM_TRASH: rsrc_gaddr(R_STRING, MTRASHCN, &mes); break; case ITM_DRIVE: rsrc_gaddr(R_STRING, MDRIVE, &mes); break; case ITM_FOLDER: rsrc_gaddr(R_STRING, MFOLDER, &mes); break; case ITM_PROGRAM: rsrc_gaddr(R_STRING, MPROGRAM, &mes); break; case ITM_FILE: noerror = TRUE; break; } if (noerror == FALSE) break; } if (noerror == FALSE) alert_printf(1, MNOPRINT, mes); return noerror; }