static void ob_text(XA_TREE *wt, RECT *r, RECT *o, OBJC_COLOURS *c, char *t, int state, int und) { if (t) if (*t) { OBJECT *ob = wt->tree + wt->current; bool fits = !o or (o and (o->h >= r->h - (d3_foreground(ob) ? 4 : 0))); /* HR 300602 */ if (c) /* set according to circumstances. */ { /* HR 051002: more restrictions */ if ( c->opaque and !MONO and d3_any(ob) and ( c->pattern eq IP_HOLLOW or ( c->pattern eq IP_SOLID and c->fillc eq WHITE ) ) ) { f_color(screen.dial_colours.bg_col); wr_mode(MD_REPLACE); gbar(0, o ? o : r); wr_mode(MD_TRANS); } else wr_mode(c->opaque ? MD_REPLACE : MD_TRANS); } if (!MONO and (state&DISABLED) != 0) { done(DISABLED); if (fits) { t_color(screen.dial_colours.lit_col); v_gtext(C.vh, r->x+1, r->y+1, t); t_color(screen.dial_colours.shadow_col); } } if (fits) v_gtext(C.vh, r->x, r->y, t); /* Now underline the shortcut character, if any. */ if (und >= 0) { int l = strlen(t); if (und < l) { G_i x = r->x + und*screen.c_max_w, y = r->y + screen.c_max_h - 1; line(x, y, x + screen.c_max_w - 1, y, RED); } } } }
global void write_selection(int d, RECT *r) { wr_mode(MD_XOR); f_color(BLACK); f_interior(FIS_SOLID); gbar(d, r); wr_mode(MD_TRANS); }
void Meta::replay (void *ps, int clip) /* Redraw the graphics as noted in notespace */ { Active=0; char *p=Start; double c,r,c1,r1,cc[16],hue; int col,st,width,n,i,co[16]; while (p<End) { int command=nextcommand(p); switch(command) { case 1 : gclear(p); break; case 2 : c=nextlong(p); r=nextlong(p); c1=nextlong(p); r1=nextlong(p); if (clip) gclip(ps,c,r,c1,r1); break; case 10 : c=nextlong(p); r=nextlong(p); c1=nextlong(p); r1=nextlong(p); col=nextint(p); st=nextint(p); width=nextint(p); gline(ps,c,r,c1,r1,col,st,width); break; case 20 : c=nextlong(p); r=nextlong(p); col=nextint(p); st=nextint(p); gmarker(ps,c,r,col,st); break; case 30 : n=nextint(p); for (i=0; i<n; i++) { cc[2*i]=nextlong(p); cc[2*i+1]=nextlong(p); co[i]=nextint(p); } st=nextint(p); gfill(ps,cc,st,n,co); break; case 31 : for (i=0; i<8; i++) cc[i]=nextlong(p); hue=nextlong(p); col=nextint(p); st=nextint(p); gfillh(ps,cc,hue,col,st); break; case 32 : c=nextlong(p); r=nextlong(p); c1=nextlong(p); r1=nextlong(p); hue=nextlong(p); col=nextint(p); st=nextint(p); gbar(ps,c,r,c1,r1,hue,col,st); break; case 33 : c=nextlong(p); r=nextlong(p); c1=nextlong(p); r1=nextlong(p); col=nextint(p); st=nextint(p); gbar1(ps,c,r,c1,r1,col,st); break; case 40 : c=nextlong(p); r=nextlong(p); col=nextint(p); st=nextint(p); gtext(ps,c,r,p,col,st); p+=strlen(p)+1; break; case 41 : c=nextlong(p); r=nextlong(p); col=nextint(p); st=nextint(p); gvtext(ps,c,r,p,col,st); p+=strlen(p)+1; break; case 42 : c=nextlong(p); r=nextlong(p); col=nextint(p); st=nextint(p); gvutext(ps,c,r,p,col,st); p+=strlen(p)+1; break; case 50 : nextlong(p); break; default : Active=1; return; } } Active=1; }
global void d3_pushbutton(int d, RECT *r, OBJC_COLOURS *col, int state, int thick, int mode) { G_u selected = state&SELECTED; int t, j, outline; thick = -thick; /* make thick same direction as d (positive value --> LARGER!) */ if (thick > 0) /* outside thickness */ d += thick; d += 2; if (mode&1) /* fill ? */ { if (col == nil) f_color(screen.dial_colours.bg_col); /* otherwise set by set_colours() */ gbar(d, r); /* inside bar */ } j = d; t = abs(thick); outline = j; #if NAES3D if (default_options.naes and !(mode&2)) { l_color(screen.dial_colours.fg_col); while (t > 0) { gbox(j, r); /* outside box */ t--, j--; } br_hook(j, r, selected ? screen.dial_colours.lit_col : screen.dial_colours.shadow_col); tl_hook(j, r, selected ? screen.dial_colours.shadow_col : screen.dial_colours.lit_col); } else #endif { do { br_hook(j, r, selected ? screen.dial_colours.lit_col : screen.dial_colours.shadow_col); tl_hook(j, r, selected ? screen.dial_colours.shadow_col : screen.dial_colours.lit_col); t--, j--; } while (t >= 0); if ( thick and !(mode&2) /* full outline ? */ ) { l_color(screen.dial_colours.fg_col); gbox(outline, r); /* outside box */ } } shadow_object(outline, state, r, screen.dial_colours.border_col, thick); l_color(screen.dial_colours.border_col); }