/* * Some nice macro definitions of Ralf Schramm & Markus Nick. * --------------------------------------------------------------- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the documentation `docs\ruby.tex' for more details. --------------------------------------------------------------- * 91/05/05 mmn * Did some changes for the new and Turbo-C. * The changes are switched off when OLD_AES is defined. */ /** rs **/ #ifdef OLD_AES #define TEMPLEN(x,y) (((TEDINFO *)(x)[(y)].ob_spec)->te_tmplen) #define TEMPADR(x,y) ((char*)(((TEDINFO *)(x)[(y)].ob_spec)->te_ptmplt)) #define TEXTLEN(x,y) (((TEDINFO *)(x)[(y)].ob_spec)->te_txtlen) #define TEXTADR(x,y) ((char*)(((TEDINFO *)(x)[(y)].ob_spec)->te_ptext)) #define BUTTONLEN(x,y) strlen((x)[(y)].ob_spec) #define BUTTONADR(x,y) ((char*)((x)[(y)].ob_spec)) #define pBoxChar(tree,obj) ((char *)&((tree)[obj].ob_spec)) #else /* no OLD_AES */ #define TEMPLEN(x,y) ((x)[(y)].ob_spec.tedinfo->te_tmplen) #define TEMPADR(x,y) ((x)[(y)].ob_spec.tedinfo->te_ptmplt) #define TEXTLEN(x,y) ((x)[(y)].ob_spec.tedinfo->te_txtlen) #define TEXTADR(x,y) ((char*)((x)[(y)].ob_spec.tedinfo->te_ptext)) #define BUTTONLEN(x,y) (strlen((x)[(y)].ob_spec.free_string)) #define BUTTONADR(x,y) ((char*)((x)[(y)].ob_spec.free_string)) #define pBoxChar(tree,obj) ((tree)[obj].ob_spec.ob_spec.character)) #endif /* no OLD_AES */ #define Selected(x,y) ((x)[(y)].ob_state & SELECTED) #define Select(x,y) ((x)[(y)].ob_state |= SELECTED) #define Deselect(x,y) ((x)[(y)].ob_state &= ~SELECTED) /* 19.10.88: ob_state -> ob_flags, HIDDEN -> HIDETREE!!!! mn. */ #define Hidden(x,y) ((x)[(y)].ob_flags & HIDETREE) #define Hide(x,y) ((x)[(y)].ob_flags |= HIDETREE) #define Unhide(x,y) ((x)[(y)].ob_flags &= ~ HIDETREE) #define Disabled(x,y) ((x)[(y)].ob_state & DISABLED) #define Disable(x,y) ((x)[(y)].ob_state |= DISABLED) #define Enable(x,y) ((x)[(y)].ob_state &= ~ DISABLED) #define READONLY 0x01 #define HIDDEN 0x02 #define SYSTEM 0x04 #define LABEL 0x08 #define FOLDER 0x10 #define ARCHIV 0x20 #define LOW_REZ 0 #define HIGH_REZ 1 #define MEDIUM_REZ 2 /** mn **/ #define Checked(x,y) ((x)[(y)].ob_state & CHECKED) #define Check(x,y) ((x)[(y)].ob_state |= CHECKED) #define Notcheck(x,y) ((x)[(y)].ob_state &= ~ CHECKED) #define Type(x,y) ((x)[(y)].ob_type) #define Flags(x,y) ((x)[(y)].ob_flags) #ifdef OLD_AES #define TEDADR(x,y) ((TEDINFO *)(x)[(y)].ob_spec) #define VALIDADR(x,y) (((TEDINFO *)(x)[(y)].ob_spec)->te_pvalid) #define XOBSPEC(x,y) (((EXAPPLBLK *)(x)[(y)].ob_spec)->ub_spec) #define XOBTYPE(x,y) (((EXAPPLBLK *)(x)[(y)].ob_spec)->ub_type) #else /* no OLD_AES */ #define TEDADR(x,y) ((x)[(y)].ob_spec.tedinfo) #define VALIDADR(x,y) ((x)[(y)].ob_spec.tedinfo->te_pvalid) #define XOBSPEC(x,y) (((EXAPPLBLK *)(x)[(y)].ob_spec.userblk)->ub_spec) #define XOBTYPE(x,y) (((EXAPPLBLK *)(x)[(y)].ob_spec.userblk)->ub_type) #endif /* no OLD_AES */ #define Selectable(x,y) ((x)[(y)].ob_flags & SELECTABLE) #define ObSpec(x,y) (*(long*)&((x)[(y)].ob_spec)) /** vrt_cpyfm/vswr_mode modes **/ #define modeREPLACE 1 #define modeTRANS 2 #define modeXOR 3 #define modeRTRANS 4 /* Shorthand macro to pass parameters for objc_draw() */ #define PTRS(r) r->g_x, r->g_y, r->g_w, r->g_h #define ELTS(r) r.g_x, r.g_y, r.g_w, r.g_h /* other shorthand macros */ #define SET_GRECT(r,x,y,w,h) ((r).g_x = (x), (r).g_y = (y), (r).g_w = (w), (r).g_h = (h)) /* ^ mit ',' statt ';' kann man es auch in Ausdrcken verwenden */ #define OBJPTRS(tree, obj) (tree)[obj].ob_x, (tree)[obj].ob_y, (tree)[obj].ob_width, (tree)[obj].ob_height #define pt_in_rect(x,y,r) ((r).g_x <= (x) && (x) < (r).g_x + (r).g_w \ && (r).g_y <= (y) && (y) < (r).g_y + (r).g_h) /** EOF **/