예제 #1
0
static void draw_icns(ICND *icns, int n, int mx, int my, int *clip)
{
	int i, j, c[18], x, y;

	clip_coords(clip, mx, my, &x, &y);

	vswr_mode(vdi_handle, MD_XOR);

	vsl_color(vdi_handle, 1);
	vsl_ends(vdi_handle, 0, 0);
	vsl_type(vdi_handle, 7);
	vsl_udsty(vdi_handle, 0xCCCC);
	vsl_width(vdi_handle, 1);

	graf_mouse(M_OFF, NULL);

	for (i = 0; i < n; i++)
	{
		for (j = 0; j < icns[i].np; j++)
		{
			c[j * 2] = icns[i].coords[j * 2] + x;
			c[j * 2 + 1] = icns[i].coords[j * 2 + 1] + y;
		}
		v_pline(vdi_handle, icns[i].np, c);
	}

	graf_mouse(M_ON, NULL);
}
예제 #2
0
void
iw_xdraw(ICONWIND iw)
{
	WORD	xy[4], bxy[10];

	wind_update(BEG_UPDATE);
	graf_mouse(M_OFF, NULL);

	rc_getpts(&iw->w.rwind, xy);
	vs_clip(iw->w.wsid, 1, xy);
	vswr_mode(iw->w.wsid, MD_XOR);

	vsl_color(iw->w.wsid, BLACK);
	vsl_ends(iw->w.wsid, 0, 0);
	vsl_type(iw->w.wsid, 1);
	vsl_width(iw->w.wsid, 1);
	rc_boxpts(&iw->w.rwind, bxy);
	bxy[9]--;
	v_pline(iw->w.wsid, 5, bxy);

	vsf_color(iw->w.wsid, BLACK);
	vsf_interior(iw->w.wsid, FIS_SOLID);
	vsf_perimeter(iw->w.wsid, 0);
	xy[0]++, xy[2]--;
	xy[3] = xy[1]++ + 7;
	v_bar(iw->w.wsid, xy);

	graf_mouse(M_ON, NULL);
	wind_update(END_UPDATE);
}
예제 #3
0
int redoinpb(short hand,GRECT box)
{
int xy[4];
char *point;
short junk2;
char temps[2048];
if(hand==-1)return 0;
xy[0]=box.g_x;xy[1]=box.g_y;xy[2]=box.g_x+box.g_w-1;xy[3]=box.g_y+box.g_h-1;
vs_clip(ws.handle,1,xy);
clearwin(box.g_x,box.g_y,box.g_w,box.g_h,col[CINPBACK]);
writeinpinfo(hand);
point=wn[hand].inp+strlen(wn[hand].inp);
vst_font(ws.handle,(WORD)inpfont);
vst_point(ws.handle,(WORD)inppoint,&junk2,&junk2,&junk2,&junk2);
vst_color(ws.handle,col[CINPTEXT]);
point=point-wn[hand].ihc[wn[hand].cvof];
stccpy(temps,point,wn[hand].ihc[wn[hand].cvof]+1);
vswr_mode(ws.handle,MD_TRANS);
v_gtext(ws.handle,wn[hand].wwa.g_x,wn[hand].wwa.g_y+wn[hand].wwa.g_h-1,temps);
if(wn[hand].cvof>0){
point=point-wn[hand].ihc[wn[hand].cvof-1];
stccpy(temps,point,wn[hand].ihc[wn[hand].cvof-1]+1);
v_gtext(ws.handle,wn[hand].wwa.g_x,wn[hand].wwa.g_y+wn[hand].wwa.g_h-ith-1,temps);
}
docursor(hand);
vs_clip(ws.handle,0,NULL);
return 0;
}
예제 #4
0
int cdecl draw_currentcolor(PARMBLK *parmblock)
{ 
  WEXTENSION_PAL *wext = (WEXTENSION_PAL *) parmblock->pb_parm ;
  int            xyc[4], xy[4] ;
  	
  if (parmblock->pb_prevstate != parmblock->pb_currstate) return(0) ;
  
  xyc[0] = parmblock->pb_xc ;
  xyc[1] = parmblock->pb_yc ;
  xyc[2] = xyc[0]+parmblock->pb_wc ;
  xyc[3] = xyc[1]+parmblock->pb_hc ;
  vs_clip(handle, 1, xyc);
	
  vswr_mode(handle, MD_REPLACE) ;
  vsf_interior(handle, FIS_SOLID) ;	
  vsf_style(handle, 7) ;
  vsf_perimeter(handle, 1) ;
  vsf_color(handle, wext->index) ;
  xy[0] = parmblock->pb_x ;
  xy[1] = parmblock->pb_y ;
  xy[2] = parmblock->pb_x+parmblock->pb_w-1 ;
  xy[3] = parmblock->pb_y+parmblock->pb_h-1 ;
  v_hide_c(handle) ;
  v_bar(handle, xy) ;
  v_show_c(handle, 1) ;
  vs_clip(handle, 0, xyc) ;

  return(0) ;
}
예제 #5
0
global
void wr_mode(int m)
{
	static int mode = -1;		/* we must set the mode once at least. */
	if (m ne mode)
		vswr_mode(C.vh, mode = m);
}
예제 #6
0
static void OnDraw(void *wnd, int xywh[4])
{
  GEM_WINDOW *gwnd = (GEM_WINDOW *) wnd ;
  HEX_DUMP   *hex_dump = (HEX_DUMP *) gwnd->Extension ;
  char       *txt ;
  int        x, y, w, h ;
  int        htline ;
  long       line, sline, eline, char_offset ;

  set_texttype( &hex_dump->ttype ) ;
  vswr_mode( handle, MD_REPLACE ) ;
  sline  = eline = hex_dump->ystart ;
  htline = hex_dump->h_char + hex_dump->interline ;
  GWGetWorkXYWH( gwnd, &x, &y, &w, &h ) ;
  sline += ( xywh[1] - y ) / htline ;
  eline += ( xywh[1] - y + xywh[3] - 1 ) / htline ;
  y          += (int)(sline - hex_dump->ystart) * htline ;
  char_offset = ( xywh[0] - x ) / hex_dump->w_char ;
  x          += (int)char_offset * hex_dump->w_char ;
  if ( ( hex_dump->ycursor >= sline ) && ( hex_dump->ycursor <= eline ) )
    ShowCursor( gwnd, 0 ) ;
  for ( line = sline; line <= eline; line++, y += htline )
  {
    txt  = (char*) hex_dump->formatted_txt[line-hex_dump->ystart] ;
    txt += char_offset ;
    v_gtext( handle, x, y, txt ) ;
  }
}
예제 #7
0
int dobar(DIALOG *wdh,long bytes,long dclen,short temp){
OBJECT *tree;
GRECT rect;
long r;
char temps[2048];
if(is_dw_open(wdh)){
wdlg_get_tree(wdh,&tree,&rect);
strcpy(temps,"\0");sprintf(temps,"%lu",bytes);
strcpy(tree[dc0bytes].ob_spec.tedinfo->te_ptext,temps);
r=(200*bytes)/dclen;
tree[dc0bar].ob_width=(short)r;
vswr_mode(ws.handle,MD_REPLACE);
wdlg_redraw(wdh,&rect,dc0bar,MAX_DEPTH);
wdlg_redraw(wdh,&rect,dc0bytes,MAX_DEPTH);
vswr_mode(ws.handle,MD_TRANS);
}
return 0;
}
예제 #8
0
void set_rect_default(void)
{
	vswr_mode(vdi_handle, MD_XOR);

	vsl_color(vdi_handle, 1);
	vsl_ends(vdi_handle, 0, 0);
	vsl_type(vdi_handle, 7);
	vsl_udsty(vdi_handle, 0xCCCC);
	vsl_width(vdi_handle, 1);
}
예제 #9
0
void clear(RECT *r)		/* HR 021202: use v_bar for a white rectangle (for true colour) */
{
	int pxy[4];

	vsf_color(vdi_handle, WHITE);
	vsf_interior(vdi_handle, FIS_SOLID);
	vsf_perimeter(vdi_handle, 0);
	vswr_mode(vdi_handle, MD_REPLACE);
	xd_rect2pxy(r, pxy);
	v_bar(vdi_handle, pxy);
}
예제 #10
0
int docursor(short w)
{
short xy[8];
short blah;
vsl_color(ws.handle,col[CCURSOR]);
if(cwin==-1)return 0;
/* Remember to check that cursor output is applicable */
if(wn[cwin].stat==WMCLEAR){
if(blink>3){
blah=fdtc();
xy[0]=wn[cwin].wwa.g_x+blah+1;xy[1]=wn[cwin].wwa.g_y+wn[cwin].wwa.g_h-ith/8-1;
xy[2]=wn[cwin].wwa.g_x+blah+1;xy[3]=wn[cwin].wwa.g_y+wn[cwin].wwa.g_h-ith+1;
vswr_mode(ws.handle,MD_XOR);
v_pline(ws.handle,2,xy);
vswr_mode(ws.handle,MD_REPLACE);
}
}

return 0;
}
예제 #11
0
/*******************************************************************************
	G_LINE in popup menu
*******************************************************************************/
int cdecl _drawNiceLine(PARMBLK *parm)
{
   vqf_attributes(glb.vdi.ha,fattr);
	vql_attributes(glb.vdi.ha,lattr);
	my1.g_x=parm->pb_x;
	my1.g_y=parm->pb_y;
	my1.g_w=parm->pb_w;
	my1.g_h=parm->pb_h;
	my2.g_x=parm->pb_xc;
	my2.g_y=parm->pb_yc;
	my2.g_w=parm->pb_wc;
	my2.g_h=parm->pb_hc;
	_rcIntersect(&my1,&my2);
	tab_clip[0]=my2.g_x;
	tab_clip[1]=my2.g_y;
	tab_clip[2]=tab_clip[0]+my2.g_w-1;
	tab_clip[3]=tab_clip[1]+my2.g_h-1;
	vs_clip(glb.vdi.ha,TRUE,tab_clip);
	bar[0]=my1.g_x;
	bar[1]=my1.g_y;
	bar[2]=bar[0]+my1.g_w-1;
	bar[3]=bar[1]+my1.g_h-1;

	vswr_mode(glb.vdi.ha,MD_REPLACE);
	vsf_perimeter(glb.vdi.ha,FALSE);
	vsf_interior(glb.vdi.ha,FIS_SOLID);
	vsf_style(glb.vdi.ha,0);
	vsf_color(glb.vdi.ha,WHITE);
	v_bar(glb.vdi.ha,bar);

	vsl_type(glb.vdi.ha,USERLINE);
	vsl_width(glb.vdi.ha,1);
	vsl_udsty(glb.vdi.ha,(int)0x5555);
	x=parm->pb_x;
	y=parm->pb_y+parm->pb_h/2;
	bar[0]=x;
	bar[1]=y;
	bar[2]=x+parm->pb_w;
	bar[3]=y;
	v_pline(glb.vdi.ha,2,bar);
	bar[1]+=1;
	bar[3]+=1;
	vsl_udsty(glb.vdi.ha,(int)0xAAAA);
	v_pline(glb.vdi.ha,2,bar);

	vs_clip(glb.vdi.ha,FALSE,tab_clip);
	vsl_type(glb.vdi.ha,lattr[0]);
	vsl_color(glb.vdi.ha,lattr[1]);
	vsf_interior(glb.vdi.ha,fattr[2]);
	vsf_style(glb.vdi.ha,fattr[0]);
	vsf_perimeter(glb.vdi.ha,fattr[4]);
	return parm->pb_currstate&~DISABLED;
}
예제 #12
0
int updinpak()
{
char *point;
char temps[2048];
startupdate();
point=wn[cwin].inp+findcurpos()-1;
stccpy(temps,point,wn[cwin].ihc[wn[cwin].cvof]-wn[cwin].cx);
vswr_mode(ws.handle,MD_TRANS);
v_gtext(ws.handle,wn[cwin].wwa.g_x+fdtc(),wn[cwin].wwa.g_y+wn[cwin].wwa.g_h-1,temps);
finishupdate();
return 0;
}
예제 #13
0
void set_txt_default(int font, int height)
{
	int dummy;

	vswr_mode(vdi_handle, MD_REPLACE);

	vst_font(vdi_handle, font);
	vst_color(vdi_handle, 1);
	vst_rotation(vdi_handle, 0);
	vst_alignment(vdi_handle, 0, 5, &dummy, &dummy);
	vst_point(vdi_handle, height, &dummy, &dummy, &dummy, &dummy);
	vst_effects(vdi_handle, 0);
}
예제 #14
0
int writeblock(char *dp,short nchar,short hof,short vof,short coll,short hand){
long effects=0;
char a;
short chof;
short pts[8];
if(bold)effects=effects+THICKENED;
if(reversed)vswr_mode(ws.handle,MD_ERASE);
else{vswr_mode(ws.handle,MD_TRANS);}
if(underlined)effects=effects+UNDERLINED;
if(reset){effects=0;red=0;underlined=0;bold=0;reversed=0;reset=0;vswr_mode(ws.handle,MD_TRANS);}
vst_effects(ws.handle,effects);
if(red)vst_color(ws.handle,2);
else
vst_color(ws.handle,coll);
a=*(dp+nchar+1);
*(dp+nchar+1)=0;
vqt_extent(ws.handle,dp,pts);
chof=pts[2]-pts[0];
v_gtext(ws.handle,wn[hand].wwa.g_x+hof,wn[hand].wwa.g_y+wn[hand].wwa.g_h-ith*2-VT-vof*th,dp);
vswr_mode(ws.handle,MD_TRANS);
*(dp+nchar+1)=a;
return chof;
}
예제 #15
0
static void xw_redraw_menu(WINDOW *w, int object, RECT *r)
{
	RECT r1, r2, in;
	OBJECT *menu = w->xw_menu;
	int pxy[4];

	if (menu != NULL)
	{
/*		xw_bar_rect(w,&r1);*/

		xd_objrect(w->xw_menu, object, &r1);
		if (object == w->xw_bar)
			r1.h += 1;

		/* Begin en eind coordinaten van lijn onder de menubalk. */

		pxy[0] = w->xw_work.x;
		pxy[1] = pxy[3] = w->xw_work.y + r1.h - 1;
		pxy[2] = w->xw_work.x + w->xw_work.w - 1;

		if (xd_rcintersect(r, &r1, &r1) == TRUE)
		{
			xd_wdupdate(BEG_UPDATE);
			xd_mouse_off();

			vswr_mode(xd_vhandle, MD_REPLACE);

			vsl_color(xd_vhandle, 1);
			vsl_ends(xd_vhandle, 0, 0);
			vsl_type(xd_vhandle, 1);
			vsl_width(xd_vhandle, 1);

			xw_get(w, WF_FIRSTXYWH, &r2);

			while ((r2.w != 0) && (r2.h != 0))
			{
				if (xd_rcintersect(&r1, &r2, &in) == TRUE)
				{
					objc_draw(menu, w->xw_bar, MAX_DEPTH, in.x, in.y, in.w, in.h);
					xd_clip_on(&in);
					v_pline(xd_vhandle, 2, pxy);
					xd_clip_off();
				}
				xw_get(w, WF_NEXTXYWH, &r2);
			}
			xd_mouse_on();
			xd_wdupdate(END_UPDATE);
		}
	}
}
예제 #16
0
main()
{
	int gr_mkmx, gr_mkmy;
	int gr_mkmstate, gr_mkkstate;
	int tmpx, tmpy;
	int tmpx1, tmpy1;
	int tmpx2, tmpy2;
	int index, rgb_in[3];
	int draw;

	appl_init();
	phys_handle = graf_handle(&gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox);
	wind_get(0, WF_WORKXYWH, &xdesk, &ydesk, &wdesk, &hdesk);
	open_vwork();
	wi_handle = wind_create(0x0040&0x0080, xdesk, ydesk, wdesk, hdesk);
	graf_mouse(3, 0x0L);
	vswr_mode(handle, 3);
	graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
	while(!(0x0002&gr_mkmstate))	{
		graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
		if (0x0001&gr_mkmstate)	{
			tmpy = gr_mkmy;
			tmpx = gr_mkmx;
			graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
			graf_mouse(M_OFF, 0x0L);
			tmpy1 = gr_mkmy;
			tmpx1 = gr_mkmx;
			drawframe(tmpx, tmpy, tmpx1, tmpy1);
			graf_mouse(M_ON, 0x0L);
			while (0x0001&gr_mkmstate)	{
				graf_mkstate(&gr_mkmx, &gr_mkmy, &gr_mkmstate, &gr_mkkstate);
				if (((tmpx1 != gr_mkmx) || (tmpy1 != gr_mkmy)) &&
					(0x0001&gr_mkmstate))	{
					graf_mouse(M_OFF, 0x0L);
					drawframe(tmpx, tmpy, tmpx1, tmpy1);
					drawframe(tmpx, tmpy, gr_mkmx, gr_mkmy);
					graf_mouse(M_ON, 0x0L);
					tmpy1 = gr_mkmy;
					tmpx1 = gr_mkmx;
				}
			}
			graf_mouse(M_OFF, 0x0L);
			drawframe(tmpx, tmpy, tmpx1, tmpy1);
			graf_mouse(M_ON, 0x0L);
		}
	}
	wind_delete(wi_handle);
	v_clsvwk(handle);
	appl_exit();
}
예제 #17
0
void aff_text(char *text, int x, int y, int color)
{
  TEXT_TYPE old_ttype ;

  memcpy( &old_ttype, &ttype, sizeof(TEXT_TYPE) ) ;
  ttype.angle     = 0 ;
  ttype.color     = color ;
  ttype.attribute = 0 ;
/*  ttype.font      = 1 ;  SystŠme */
/*  ttype.hcar      = 6 ;*/
  set_texttype( &ttype ) ;
  vswr_mode( handle, MD_TRANS ) ;
  v_gtext( handle, x, y, text ) ;
  memcpy( &ttype, &old_ttype, sizeof(TEXT_TYPE) ) ;
  set_texttype( &ttype ) ;
}
예제 #18
0
static int cdecl draw_underline(PARMBLK *p)
{
	char	*str;
	int	d, wBox, hBox, effect = 0;

	set_clipping(vdi_handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
	vswr_mode(vdi_handle, MD_TRANS);

	/* Font */
	vst_alignment(vdi_handle, 0, 5, &d, &d);
	vst_font(vdi_handle, sys_big_id);
	vst_height(vdi_handle, sys_big_height, &d, &d, &wBox, &hBox);

	/* Text ausgeben */
	str = (char *)p->pb_parm;
	vst_color(vdi_handle, 12);
	
	if(p->pb_tree[p->pb_obj].ob_state & DISABLED)
		effect |= TXT_LIGHT;

	if(p->pb_tree[p->pb_obj].ob_state & CHECKED)
		effect |= TXT_UNDERLINED;

	if(p->pb_tree[p->pb_obj].ob_state & SELECTED)
		vst_color(vdi_handle, 2);

	vst_effects(vdi_handle, effect);
	v_gtext(vdi_handle, p->pb_x, p->pb_y, str);

	/* Linie */
/*	len = get_txtlen(str);*/
/*	len = p->pb_w;

	vsl_color(vdi_handle, 9);

	pxy[0] = p->pb_x;			pxy[1] = p->pb_y + hBox;
	pxy[2] = p->pb_x + len; pxy[3] = pxy[1];
	v_pline(vdi_handle, 2, pxy);

	vsl_color(vdi_handle, 0);
	pxy[1]--; pxy[3]--;
	v_pline(vdi_handle, 2, pxy); */

	return (p->pb_currstate & ~(CHECKED|DISABLED|SELECTED));
}
예제 #19
0
static int cdecl draw_aquaback(PARMBLK *p)
{
	int16 pxy[8];
	int16	x0;
	int16 y0;

	set_clipping(vdi_handle, p->pb_xc, p->pb_yc, p->pb_wc, p->pb_hc, TRUE);
	vswr_mode(vdi_handle, MD_REPLACE);

	pxy[0] = x0 = p->pb_x;				pxy[1] = y0 = p->pb_y;
	pxy[2] = p->pb_x + p->pb_w -1 ;	pxy[3] = p->pb_y + p->pb_h - 1;

	vsf_interior(vdi_handle, FIS_PATTERN); /* FIS_PATTERN */
	vsf_color(vdi_handle, LWHITE );
	vsf_style(vdi_handle, 4);
	v_bar(vdi_handle, pxy);

	pxy[3] = pxy[1];

/*	while( (pxy[1]-y0) < (p->pb_h) )
	{
		vsl_color(vdi_handle, WHITE);
		v_pline(vdi_handle, 2, pxy);
		pxy[1]+=2;	pxy[3]+=2;
	}
*/	
	while( (pxy[1]-y0+2) < (p->pb_h) )
	{
		vsl_color(vdi_handle, LWHITE); 
		v_pline(vdi_handle, 2, pxy);
		pxy[1]+=2;	pxy[3]+=2;
		vsl_color(vdi_handle, WHITE);
		v_pline(vdi_handle, 2, pxy);
		pxy[1]+=2;	pxy[3]+=2;
	}
	
	if( (pxy[1]-y0) < (p->pb_h) )
	{
		vsl_color(vdi_handle, LWHITE);
		v_pline(vdi_handle, 2, pxy);
	}
	
	return (p->pb_currstate);
}
예제 #20
0
파일: font_vdi.c 프로젝트: pcwalton/NetSurf
static int text( FONT_PLOTTER self,  int x, int y, const char *text, size_t length,
				 const plot_font_style_t *fstyle )
{
	/* todo: either limit the string to max 80 chars, or use v_ftext instead of v_gtext */
	short cw, ch, cellw, cellh;
	short pxsize=8;
	short fx=0;
	lstr = (char*)text;
	utf8_to_enc(text, "ATARIST", length, &lstr );
	assert( lstr != NULL );
	int slen = strlen(lstr);
	size_t mylen = MIN(511, slen );
	char textcpy[mylen+1];

	textcpy[mylen] = 0;
	strncpy((char*)&textcpy, lstr, mylen+1 );
	if( fstyle != NULL){
		if( fstyle->flags & FONTF_ITALIC )
			fx |= 4;
		if( fstyle->flags & FONTF_OBLIQUE )
			fx |= 4;
		if( fstyle->weight > 450 )
			fx |= 1;

		/* TODO: netsurf uses 90 as default dpi ( somewhere defined in libcss),
			use that value or pass it as arg, to reduce netsurf dependency */
		pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
	}
	x += CURFB(self->plotter).x;
	y += CURFB(self->plotter).y;
	vst_effects( self->vdi_handle, fx );
	vst_alignment(vdih, 0, 4, &cw, &ch );
	vst_height( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
	vswr_mode( self->vdi_handle, MD_TRANS );
	vst_rgbcolor(self->vdi_handle, fstyle->foreground );

	if( atari_sysinfo.gdos_FSMC ){
		v_ftext( self->vdi_handle, x, y, (char*)&textcpy );
	} else {
		v_gtext( self->vdi_handle, x, y, (char*)&textcpy );
	}
	free( lstr );
	return( 0 );
}
예제 #21
0
int cdecl draw_pencil(PARMBLK *parmblk)
{
  WEXTENSION_PENCIL *wext = (WEXTENSION_PENCIL *) parmblk->pb_parm ;
  int xy[8] ;
  int xc, yc ;

  xy[0] = parmblk->pb_x ;
  xy[1] = parmblk->pb_y ;
  xy[2] = parmblk->pb_x+parmblk->pb_w-1 ;
  xy[3] = parmblk->pb_y+parmblk->pb_h-1 ;
  vs_clip(handle, 1, xy) ;
  xc = (xy[0]+xy[2])/2 ;
  yc = (xy[1]+xy[3])/2 ;
  vswr_mode(handle, MD_REPLACE) ;
  vsf_interior(handle, FIS_SOLID) ;
  vsf_color(handle, 0) ;
  vr_recfl(handle, xy) ;

  vsf_color(handle, wext->pencil.color) ;
  switch( wext->pencil.type )
  {
    case 0 : xy[0] = xc-wext->pencil.height/2 ;
             xy[1] = yc-wext->pencil.height/2 ;
             xy[2] = xc+wext->pencil.height/2 ;
             xy[3] = yc+wext->pencil.height/2 ;
             vr_recfl(handle, xy) ;
             break ;
    case 1 : v_circle(handle, xc, yc, wext->pencil.height/2) ;
             break ;
    case 2 : xy[0] = xc ;
             xy[1] = yc-wext->pencil.height/2 ;
             xy[2] = xc+wext->pencil.height/2 ;
             xy[3] = yc ;
             xy[4] = xc ;
             xy[5] = yc+wext->pencil.height/2 ;
             xy[6] = xc-wext->pencil.height/2 ;
             xy[7] = yc ;
             v_fillarea(handle, 4, xy) ;
             break ;
  }
  vs_clip(handle, 0, xy) ;

  return(0) ;
}
예제 #22
0
int cdecl draw_colors(PARMBLK *parmblock)
{ 
  WEXTENSION_PAL *wext = (WEXTENSION_PAL *) parmblock->pb_parm ;
  int            xyc[4], xy[4] ;
  int            nb_col_y, col_y, col_x, ind_col ;
  	
  nb_col_y = wext->nb_col_x = (int)sqrt((double)nb_colors) ;
  wext->ww = (int)(parmblock->pb_w/wext->nb_col_x) ;
  wext->hh = (int)(parmblock->pb_h/nb_col_y) ;

  if (parmblock->pb_prevstate != parmblock->pb_currstate) return(0) ;

  xyc[0] = parmblock->pb_xc ;
  xyc[1] = parmblock->pb_yc ;
  xyc[2] = xyc[0]+parmblock->pb_wc ;
  xyc[3] = xyc[1]+parmblock->pb_hc ;
  vs_clip(handle, 1, xyc) ;

  vswr_mode(handle, MD_REPLACE) ;
  vsf_interior(handle, FIS_SOLID) ;
  vsf_style(handle, 7) ;
  vsf_perimeter(handle, 1) ;

  xy[1] = parmblock->pb_y ;
  xy[3] = xy[1]+wext->hh ;
  for (col_y = 0, ind_col = 0; col_y < nb_col_y; col_y++)
  {
    xy[0] = parmblock->pb_x ;
    xy[2] = xy[0]+wext->ww ;
    for (col_x = 0; col_x < wext->nb_col_x; col_x++, ind_col++)
    {
      vsf_color(handle, ind_col) ;
	  v_bar(handle, xy) ;
      xy[0] += wext->ww ;
      xy[2] += wext->ww ;
    }
    xy[1] += wext->hh ;
	xy[3] += wext->hh ;
  }
  vs_clip(handle, 0, xyc);

  return(0) ;
}
예제 #23
0
/* Similar to clear() above but clears with pattern and colour */
void pclear(RECT *r)
{
	int pxy[4];

	vsf_color(vdi_handle, options.V2_2.win_color);

	if ( options.V2_2.win_pattern != 0 )
	{
		vsf_interior(vdi_handle, FIS_PATTERN);
		vsf_style(vdi_handle, options.V2_2.win_pattern);
	}
	else
		vsf_interior(vdi_handle, FIS_SOLID); /* maybe a little faster so? */

	vsf_perimeter(vdi_handle, 0);
	vswr_mode(vdi_handle, MD_REPLACE);
	xd_rect2pxy(r, pxy);
	v_bar(vdi_handle, pxy);
}
예제 #24
0
void OnDrawRTZoom(void *wnd, int xycoords[4])
{
  int xy[8] ;
  int index ;
  int must_fill = ( rtoffx > 0 ) || ( rtoffy > 0 ) ;

  if ( must_fill )
  {
    if ( !Truecolor ) index = 0 ;
    else
    {
      int rgb[3] = { 1000, 1000, 1000 } ;

      index = 19 ;
      vs_color( handle, index, rgb ) ;
    }
    vswr_mode( handle, MD_REPLACE ) ;
    vsf_color( handle, index ) ;
    vsf_interior( handle, FIS_SOLID ) ;
    vsf_perimeter( handle, 0 ) ;
  }

  if ( intersect( rtx + rtoffx, rty + rtoffy, rtw - rtoffx, rth - rtoffy,
                  xycoords[0], xycoords[1], xycoords[2], xycoords[3],
                  &xy[4] )
     )
  {
    xy[0] = smart_offx + xy[4] - rtx - rtoffx ;
    xy[1] = xy[5] - rty - rtoffy ;
    xy[2] = smart_offx + xy[6] - rtx - rtoffx ;
    xy[3] = xy[7] - rty - rtoffy ;
    vro_cpyfm( handle, S_ONLY, xy, &RTZoomDst, &screen ) ;

    if ( must_fill )
    {
      if ( intersect( rtx, rty, rtoffx, rth, xycoords[0], xycoords[1], xycoords[2], xycoords[3], xy ) )
        vr_recfl( handle, xy ) ;
      if ( intersect( rtx, rty, rtw, rtoffy, xycoords[0], xycoords[1], xycoords[2], xycoords[3], xy ) )
        vr_recfl( handle, xy ) ;
    }
  }
}
예제 #25
0
static int arc(GEM_PLOTTER self,int x, int y, int radius, int angle1, int angle2, const plot_style_t * pstyle)
{
	//plotter_vdi_clip( self, 1);
	vswr_mode( self->vdi_handle, MD_REPLACE );
	if( pstyle->fill_type == PLOT_OP_TYPE_NONE )
		return 1;
	if( pstyle->fill_type != PLOT_OP_TYPE_SOLID) {
		vsl_rgbcolor( self->vdi_handle, pstyle->stroke_colour);
		vsf_perimeter( self->vdi_handle, 1);
		vsf_interior( self->vdi_handle, 1 );
		v_arc( self->vdi_handle, VIEW(self).x + x, VIEW(self).y + y, radius, angle1*10, angle2*10 );
	} else {
		vsf_rgbcolor( self->vdi_handle, pstyle->fill_colour);
		vsl_width( self->vdi_handle, 1 );
		vsf_perimeter( self->vdi_handle, 1);
		v_arc( self->vdi_handle, VIEW(self).x + x, VIEW(self).y + y, radius, angle1*10, angle2*10 );
	}
	//plotter_vdi_clip( self, 0);
	return ( 1 );
}
예제 #26
0
void dodirty(int hand,GRECT box)
{
int xy[4];
int tpa,tpb,junk2,mcto=0;
int x,y,w,h;
x=box.g_x;y=box.g_y;w=box.g_w;h=box.g_h;
xy[0]=x;xy[1]=y;xy[2]=x+w-1;xy[3]=y+h-1;
vs_clip(ws.handle,1,xy);
clearwin(x,y,w,h,col[CBACK]);
tpa=(wn[hand].wwa.g_y+wn[hand].wwa.g_h-ith*2-VT-3)-(y+h-1);
tpb=tpa/th;
tpa=(h+th/2)/th;
junk2=wn[hand].clcnt-tpb-wn[hand].scb;
if(junk2<0)junk2=150+junk2;
vswr_mode(ws.handle,MD_TRANS);
while(tpa>-1){
writeoutput(hand,wn[hand].cl[junk2],tpb+mcto-1,wn[hand].clc[junk2]);
mcto++;tpa--;junk2--;
if(junk2<0)junk2=149;
}
vs_clip(ws.handle,0,NULL);
}
예제 #27
0
void
redraw( const WINFO *w, GRECT *clip )
{
	OBJECT	*tree;
	int		savex, savey;
	GRECT	rect;
	int		pxy[4];

	rect = w->work;
	wind_adjust( w, &rect );
	rc_2xy( clip, (WORD *)pxy );
	vs_clip( vhandle, 1, pxy );

	graf_mouse( M_OFF, NULL );
#if SILLY_PATTERN
	vsf_interior( vhandle, FIS_PATTERN );
	vsf_style( vhandle, 19 ); /* balls */
	vsf_color( vhandle, BLACK );
#else
	vsf_interior( vhandle, FIS_SOLID );
	vsf_color( vhandle, WHITE );
#endif
	vsf_perimeter( vhandle, FALSE );
	vswr_mode( vhandle, MD_REPLACE );
	v_bar( vhandle, pxy );
	graf_mouse( M_ON, NULL );

	tree = (OBJECT *)(w->x);
	savex = ObX(ROOT);
	savey = ObY(ROOT);

	ObX(ROOT) = rect.g_x - w->vir.g_x * gl_wchar;
	ObY(ROOT) = rect.g_y - w->vir.g_y * gl_hchar;
	Objc_draw( tree, ROOT, MAX_DEPTH, clip );
	ObX(ROOT) = savex;
	ObY(ROOT) = savey;

}
예제 #28
0
void drawnicklist(int hand,GRECT box)
{
short mcto=0,junk=1,junk2;
short maxj;
short xy[4];
if(hand==-1)return;
xy[0]=box.g_x;xy[1]=box.g_y;xy[2]=box.g_x+box.g_w-1;xy[3]=box.g_y+box.g_h-1;
vs_clip(ws.handle,1,xy);
clearwin(box.g_x,box.g_y,box.g_w,box.g_h,col[CNLBACK]);
xy[0]=wn[hand].wwa.g_x+wn[hand].wwa.g_w-NLW;
xy[1]=wn[hand].wwa.g_y;
xy[2]=wn[hand].wwa.g_x+wn[hand].wwa.g_w-NLW;
xy[3]=wn[hand].wwa.g_y+wn[hand].wwa.g_h-ith*2-VT+4;
vsl_color(ws.handle,col[CNLDIVIDE]);
v_pline(ws.handle,2,xy);
xy[0]+=1;
xy[2]+=1;
v_pline(ws.handle,2,xy);
if(wn[hand].chan==-1)return;
vst_font(ws.handle,1);
vst_point(ws.handle,8,&junk2,&junk2,&junk2,&junk2);
maxj=(wn[hand].wwa.g_h-ith*2-VT)/8;
vst_color(ws.handle,col[CNICKLIST]);
vswr_mode(ws.handle,MD_TRANS);
while(mcto<128){
if(strlen(chan[wn[hand].chan].nl[mcto])){
v_gtext(ws.handle,wn[hand].wwa.g_x+wn[hand].wwa.g_w-NLW+4,wn[hand].wwa.g_y+junk*8,chan[wn[hand].chan].nl[mcto]);
junk++;
if(junk>maxj){
mcto=128;
v_gtext(ws.handle,wn[hand].wwa.g_x+wn[hand].wwa.g_w-NLW+4,wn[hand].wwa.g_y+junk*8,"    ");
}
}
mcto++;
}
vs_clip(ws.handle,0,NULL);
return;
}
예제 #29
0
void writeinpinfo(short w)
{
short junk2;
short xy[8];
vsl_color(ws.handle,col[CDIVIDEB]);
xy[0]=wn[w].wwa.g_x;
xy[1]=wn[w].wwa.g_y+wn[w].wwa.g_h-ith*2-1;
xy[2]=wn[w].wwa.g_x+wn[w].wwa.g_w-1;
xy[3]=wn[w].wwa.g_y+wn[w].wwa.g_h-ith*2-1;
v_pline(ws.handle,2,xy);
xy[1]=xy[1]-10;xy[3]=xy[3]-10;
vsl_color(ws.handle,col[CDIVIDET]);
v_pline(ws.handle,2,xy);
vst_font(ws.handle,1);
vst_point(ws.handle,8,&junk2,&junk2,&junk2,&junk2);
vst_color(ws.handle,col[CINPINFO]);
vst_effects(ws.handle,THICKENED);
vswr_mode(ws.handle,MD_TRANS);
v_gtext(ws.handle,wn[w].wwa.g_x,wn[w].wwa.g_y+wn[w].wwa.g_h-ith*2-3,wn[w].info2);
vst_effects(ws.handle,0);
vst_font(ws.handle,inpfont);
vst_point(ws.handle,inppoint,&junk2,&junk2,&junk2,&junk2);
}
예제 #30
0
VOID gsx_attr(WORD text, WORD mode, WORD color)
{
	if (mode != gl_mode)
	{
		vswr_mode( gl_handle, mode );
		gl_mode = mode;
	}
	if (text)
	{
		if (color != gl_tcolor)
		{
			vst_color(gl_handle, color);
			gl_tcolor = color;
		}
	}	
	else
	{
		if (color != gl_lcolor)
		{
			vsl_color(gl_handle, color);
			gl_lcolor = color;
		}
	}
}