Пример #1
0
short draw_multiline(PARMBLK *parmblock) {
    GRECT clip_area;
    short sizing = 4;

    //Set up clipping
    OUTPUT_WINDOW *window = (OUTPUT_WINDOW*)parmblock->pb_parm;
    short handle = window->workstation;
    char buffer[255];
    short last_index = 0;

    short draw_region[4] = {
        parmblock->pb_x, parmblock->pb_y, parmblock->pb_x + parmblock->pb_w, parmblock->pb_y + parmblock->pb_h
    };
    short clip_region[4] = {
        parmblock->pb_xc, parmblock->pb_yc, parmblock->pb_xc + parmblock->pb_wc, parmblock->pb_yc + parmblock->pb_hc
    };

    vs_clip(handle, 1, clip_region);
    vsf_interior(handle, 1);
    //vsf_color(handle, 6);
    //vr_recfl(handle, draw_region);   // clear entire message area
    vsl_color(handle, 1);

    vst_height(handle, sizing, &sizing, &sizing, &sizing, &sizing);

    short position = 6;
    while (tokenize_multiline(buffer, window->text, parmblock->pb_w, sizing, &last_index)) {
        v_gtext(handle, parmblock->pb_x, parmblock->pb_y + position, buffer);
        position += sizing;
    }
    vs_clip(handle, 0, clip_region);

    return 0;
}
Пример #2
0
static int str_width( FONT_PLOTTER self,const plot_font_style_t *fstyle, const char * str,
					  size_t length, int * width  )
{
	short cw, ch, cellw, cellh;
	short pxsize;
	short fx=0;
	lstr = (char*)str;
	utf8_to_enc(str, "ATARIST", length, &lstr );
	assert( lstr != NULL );
	int slen = strlen(lstr);

	if( fstyle->flags & FONTF_ITALIC )
		fx |= 4;
	if( fstyle->flags & FONTF_OBLIQUE )
		fx |= 16;
	if( fstyle->weight > 450 )
		fx |= 1;
	vst_effects( self->vdi_handle, fx );
	/* TODO: replace 90 with global dpi setting */
	pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
	vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
	*width = slen * cellw;
	free( (void*)lstr );
	lstr = NULL;
	return( 0 );
}
Пример #3
0
/* ----------------------- */
void show_testtext(int xpos, int ypos, int font_nr, int font_hg)
{
int dummy, height;

vst_font(vdi_handle, font_nr);
vst_height(vdi_handle, font_hg, &dummy, &dummy, &dummy, &height);
v_gtext(vdi_handle, xpos, ypos + height, "                ");
v_gtext(vdi_handle, xpos, ypos,   			 "Testtext        ");
}
Пример #4
0
WORD gsx_start(VOID)
{
	WORD		char_height, nc, attrib[10];

	gl_xclip = 0;
	gl_yclip = 0;
	gl_width = gl_wclip = gl_ws.ws_xres + 1;
	gl_height = gl_hclip = gl_ws.ws_yres + 1;

	nc = gl_ws.ws_ncolors;
	gl_nplanes = 0;
	while (nc != 1)
	{
		nc >>= 1;
		gl_nplanes++;
	}
	vqt_attributes( gl_handle, &attrib[0] );
	gl_ws.ws_chmaxh = attrib[7];
	gl_ws.ws_pts2 = attrib[6];
	char_height = gl_ws.ws_chminh;
	vst_height( gl_handle, char_height,
				&gl_wsptschar, &gl_hsptschar, 
				&gl_wschar, &gl_hschar );
	char_height = gl_ws.ws_chmaxh;
	vst_height( gl_handle, char_height,
				&gl_wptschar, &gl_hptschar, 
				&gl_wchar, &gl_hchar );
	gl_ncols = gl_width / gl_wchar;
	gl_nrows = gl_height / gl_hchar;
	gl_hbox = gl_hchar + 3;
	gl_wbox = (gl_hbox * gl_ws.ws_hpixel) / gl_ws.ws_wpixel;
	vsl_type( gl_handle, 7 );
	vsl_width( gl_handle, 1 );
	vsl_udsty( gl_handle, 0xffff );
	rc_set(&gl_rscreen, 0, 0, gl_width, gl_height);
	rc_set(&gl_rfull, 0, gl_hbox, gl_width, (gl_height - gl_hbox));
	rc_set(&gl_rzero, 0, 0, 0, 0);
	rc_set(&gl_rcenter, (gl_width-gl_wbox)/2, (gl_height-(2*gl_hbox))/2, 
			gl_wbox, gl_hbox);
	rc_set(&gl_rmenu, 0, 0, gl_width, gl_hbox);
	ad_intin = (LONG)ADDR(&intin[0]);
	return (TRUE);
}
Пример #5
0
/*! loads ASCII text in  window */
void charge_texte(void) {
	char chemin[125], fname[13] = "", fichier[125], *selec, *ptr;
	long longueur;
	int fh, count = 1, dummy, w_cell, h_cell;

	if(win[TEXTE].w_icon > BLANK)
		return;

	if((fgdos) &&(fid != 1)) {	
		/* take size of character box */
		vst_font(work_display.handle, fid);
		vst_arbpt(work_display.handle, size, &dummy, &dummy, &dummy, &h_cell);
		vst_setsize(work_display.handle, size, &dummy, &dummy, &w_cell, &dummy);
	}
	
	else
		vst_height(work_display.handle, size, &dummy, &dummy, &w_cell, &h_cell);
	strcpy(chemin, pathapp);					/* Chemin de l'application */
	selec = get_string(CHARGETXT);		/* Récupérer message sélecteur */
	if(selector(chemin, "\*.TXT", fname, selec) == TRUE && strlen(fname)) {	
		/* if file selected */
		strcpy(fichier, chemin);
		strcat(fichier, fname);					/* recreate access path */
		longueur = exist(fichier, ZERO);
		if(longueur) {							/* if exist */
			if(win[TEXTE].w_cont.w_adr)
				free(win[TEXTE].w_cont.w_adr);	/* Libérer le précédent s'il y en a */
			win[TEXTE].w_cont.w_adr =(char *)malloc(longueur);	/* Réserver mémoire */
			if(win[TEXTE].w_cont.w_adr) {
				fh =(int)Fopen(fichier, FO_READ);	/* open file */
				Fread(fh, longueur, win[TEXTE].w_cont.w_adr);	/* load */
				Fclose(fh);							/* close file */

				for(ptr = win[TEXTE].w_cont.w_adr ; 
						ptr < win[TEXTE].w_cont.w_adr + longueur ; ptr++) {
					if(*ptr == '\r') {
						*ptr = '\0';
						count++;
					}
				}
				open_window(TEXTE, WTYP_NORM, WATR_CURRB,
					bureau.xd + 10, bureau.yd +(bureau.hd / 4), bureau.wd - 20, 
					bureau.hd / 2,
					100, 100, BLANK, BLANK, w_cell, h_cell,
					(WFARROW|WFGROUP), TEXT_CRSR,
					winicn, aff_texte, close_txt, get_string(TIT_TXT), "",
					(long)((long) MAX_LEN *(long) w_cell),
					(long)((long) count *(long) h_cell),
					FALSE, TRUE, TOOL, ZERO, WHITE);
			}
		}
	}
Пример #6
0
static int str_split( FONT_PLOTTER self, const plot_font_style_t * fstyle, const char *string,
					  size_t length,int x, size_t *char_offset, int *actual_x )
{
	short cw, ch, cellw, cellh;
	short pxsize;
	short fx=0;
	int i;
	lstr = (char*)string;
	int slen = 0;
	int last_space_x = 0;
	int last_space_idx = 0;

	utf8_to_enc(string, "ATARIST", length, &lstr );
	assert( lstr != NULL );

	slen = strlen(lstr);
	if( fstyle->flags & FONTF_ITALIC )
		fx |= 4;
	if( fstyle->flags & FONTF_OBLIQUE )
		fx |= 16;
	if( fstyle->weight > 450 )
		fx |= 1;
	vst_effects( self->vdi_handle, fx );
	pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
	vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
	*actual_x = 0;
	*char_offset = 0;
	int cpos=0;
	for( i=0; i<slen; i++) {
		if( lstr[i] == ' ' ) {
			last_space_x = *actual_x;
			last_space_idx = cpos;
		}
		if( *actual_x > x ) {
			*actual_x = last_space_x;
			*char_offset = last_space_idx;
			return true;
		}
		*actual_x += cellw;
		cpos++;
	}
	*char_offset = cpos;
	free( (void*)lstr );
	lstr = NULL;
	return( 0 );
}
Пример #7
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));
}
Пример #8
0
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 );
}
Пример #9
0
static int pixel_pos( FONT_PLOTTER self, const plot_font_style_t * fstyle,const char *string,
						size_t length,int x, size_t *char_offset, int *actual_x )
{
	short cw, ch, cellw, cellh;
	short pxsize=0;
	short fx=0;

	lstr = (char*)string;
	int i=0;
	int curpx=0;
	utf8_to_enc(string, "ATRIST", length, &lstr );
	assert( lstr != NULL );
	int slen = strlen(lstr);
	if( fstyle->flags & FONTF_ITALIC )
		fx |= 4;
	if( fstyle->flags & FONTF_OBLIQUE )
		fx |= 16;
	if( fstyle->weight > 450 )
		fx |= 1;
	vst_effects( self->vdi_handle, fx );
	pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
	vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
	*actual_x = 0;
	*char_offset = 0;
	for( i=0; i<slen; i++) {
		*actual_x += cellw;
		if( *actual_x > x) {
			*actual_x -= cellw;
			*char_offset = i;
			break;
		}
	}
	free( (void*)lstr );
	lstr = NULL;
	return( 0 );
}
Пример #10
0
static
void __CDECL evnt_sb_redraw( COMPONENT *c, long buff[8] )
{
	size_t i;
	struct gui_window * gw = (struct gui_window *)mt_CompDataSearch(&app, c, CDT_OWNER);
	assert(gw != NULL);
	CMP_STATUSBAR sb = gw->root->statusbar;
	assert( sb != NULL );
	if( sb == NULL )
		return;

	if( sb->attached == false )
		return;

	LGRECT work, lclip;
	short pxy[8], d, pxyclip[4];

	mt_CompGetLGrect(&app, sb->comp, WF_WORKXYWH, &work);
	lclip = work;
	if ( !rc_lintersect( (LGRECT*)&buff[4], &lclip ) ) {
		return;
	}
	vsf_interior(atari_plot_vdi_handle, FIS_SOLID );
	vsl_color(atari_plot_vdi_handle, BLACK );
	vsl_type(atari_plot_vdi_handle, 1);
	vsl_width(atari_plot_vdi_handle, 1 );
	vst_color(atari_plot_vdi_handle, BLACK);

	vst_height(atari_plot_vdi_handle, atari_sysinfo.medium_sfont_pxh, &pxy[0], &pxy[1], &pxy[2], &pxy[3] );
	vst_alignment(atari_plot_vdi_handle, 0, 5, &d, &d );
	vst_effects(atari_plot_vdi_handle, 0 );
	pxyclip[0] = lclip.g_x;
	pxyclip[1] = lclip.g_y;
	pxyclip[2] = lclip.g_x + lclip.g_w-1;
	pxyclip[3] = lclip.g_y + lclip.g_h-1;

	vs_clip(atari_plot_vdi_handle, 1, (short*)&pxyclip );
	vswr_mode(atari_plot_vdi_handle, MD_REPLACE );

	if( lclip.g_y <= work.g_y ) {
		pxy[0] = work.g_x;
		pxy[1] = work.g_y;
		pxy[2] = MIN( work.g_x + work.g_w, lclip.g_x + lclip.g_w );
		pxy[3] = work.g_y;
		v_pline(atari_plot_vdi_handle, 2, (short*)&pxy );
	}

	if(app.nplanes > 2) {
		vsf_color(atari_plot_vdi_handle, LWHITE);
	} else {
		vsf_color(atari_plot_vdi_handle, WHITE );
	}

	pxy[0] = work.g_x;
	pxy[1] = work.g_y+1;
	pxy[2] = work.g_x + work.g_w-1;
	pxy[3] = work.g_y + work.g_h-1;
	v_bar(atari_plot_vdi_handle, pxy );


	if( sb->textlen > 0 ) {
		short curx;
		short vqw[4];
		char t[2];
		short cw = 8;
		t[1]=0;
		if( atari_sysinfo.sfont_monospaced ) {
			t[0]='A';
			int r = vqt_width(atari_plot_vdi_handle, t[0], &vqw[0], &vqw[1], &vqw[2] );
			cw = vqw[0];
		}
		vswr_mode(atari_plot_vdi_handle, MD_TRANS );
		for( curx = work.g_x + 2, i=0 ; (curx+cw < work.g_x+work.g_w ) && i < sb->textlen; i++ ){
			t[0] = sb->text[i];
			if( !atari_sysinfo.sfont_monospaced ) {
				vqt_width(atari_plot_vdi_handle, t[0], &vqw[0], &vqw[1], &vqw[2] );
				cw = vqw[0];
			}
			if( curx >= lclip.g_x - cw ) {
				v_gtext(atari_plot_vdi_handle, curx, work.g_y + 5, (char*)&t );
			}
			curx += cw;
			if( curx >= lclip.g_x + lclip.g_w )
				break;
		}
	}
	vswr_mode(atari_plot_vdi_handle, MD_REPLACE );
	pxy[0] = work.g_x + work.g_w;
	pxy[1] = work.g_y + work.g_h;
	pxy[2] = work.g_x + work.g_w;
	pxy[3] = work.g_y + work.g_h-work.g_h;
	v_pline(atari_plot_vdi_handle, 2, (short*)&pxy );

	vs_clip(atari_plot_vdi_handle, 0, (short*)&pxyclip );
	return;
}
Пример #11
0
void small_scale_draw(ALWINDOW *alw, CURRENT_STATUS *cs)
	{
	register int loop1,loop2;
	int cf;
	short coord[4];
	register int curx,cury;

	int inc_res;
	int half_fret_height=frets_height/2,half_fret_length=frets_length/2;

	register int circle_radius;
	int h,saveh;
	int tadd;
	short ch,cw,clh,clw,maxcw;
	char albuff[10];
	char info_buffer[120];
	int combination_note,note_val;
	int frets_x_offset_and_frets_length;
	int half_fret_height_and_frets_y_offset;
	int frets_height_and_frets_y_offset;
	int frets_length_times_loop2;
	int frets_height_times_7;
	short tatts[10]; /* text attributes */
	NOTE *np;
	
#ifdef PRINTER_TEST
/* gdos test stuff*/
	short work_in[11],work_out[57],thandle,lop;

#endif

#define draw(X1,Y1,X2,Y2);	coord[0]=X1;coord[1]=Y1;coord[2]=X2;coord[3]=Y2;v_pline(handle,2,coord);

#ifdef PRINTER_TEST
if(vq_gdos()==0)
	fatal_error("GDOS NOT LOADED!");

#endif


#ifndef PRINTER_TEST
if(scale_name_flag && !key_name_flag)
	{
	sprintf(info_buffer," %s",cs->current_scale->name);
	wind_info(scale_window.handle,info_buffer);
	}
else
	{
	if(!scale_name_flag && key_name_flag)
		{
		sprintf(info_buffer," %s",cs->key->note_name);
		wind_info(scale_window.handle,info_buffer);
		}
	else
		{
		if(scale_name_flag && key_name_flag)
			{
			sprintf(info_buffer," %s in %s",cs->current_scale->name,cs->key->note_name);
			wind_info(scale_window.handle,info_buffer);
			}
		else
			{
			sprintf(info_buffer,"                                                                                       ");
			wind_info(scale_window.handle,info_buffer);
			}
		}
	}
#endif


	scale_offsets(alw,&frets_x_offset,&frets_y_offset);
	frets_y_offset=frets_y_offset+big_y_offset;
	frets_height_and_frets_y_offset=frets_height+frets_y_offset;
	frets_x_offset_and_frets_length=frets_length+frets_x_offset;
	half_fret_height_and_frets_y_offset=half_fret_height+frets_y_offset;


#ifndef PRINTER_TEST
h=0;cw=0;ch=0;maxcw=0;
while(cw<((frets_length/2)-2) && h<99)
	{
		
		if(cw>maxcw)
			saveh=h;
		h++;
		vst_height(handle,h,&cw,&ch,&clw,&clh);
	}

set_hor();


if(h>=99)
	vst_height(handle,saveh,&cw,&ch,&clw,&clh);
#endif

#ifdef PRINTER_TEST
clh=0;
#endif

	vqt_attributes(handle,tatts);

	frets_height_times_7=7*frets_height;

	total_y_dist=clh+(frets_height_times_7);


	set_ver(total_y_dist);


	if(frets_length>frets_height)
		circle_radius=(frets_height/2)-1-2;
	else
		circle_radius=(frets_length/2)-1-2;

	curx=0;

#ifdef PRINTER_TEST
work_in[0]=21; /*printer ?*/
for(lop=1;lop<10;lop++)
	work_in[lop]=1;
	work_in[10]=2;

for(lop=21;lop<31;lop++)
{
	work_in[0]=lop;
	v_opnwk(work_in,&handle,work_out);
	if(handle)
{
		error("GOT A PRINTER HANDLE");
		lop=32;
	}
	else
		error("NOT GOT A PRINTER HANDLE");
}


#endif

	wclip(alw);
	graf_mouse(M_OFF,NULL);
	for(loop2=0;loop2<global_frets && loop2+start_fret<global_frets;loop2++)
		{
		frets_length_times_loop2=frets_length*loop2;

		for(loop1=0;loop1<6;loop1++)
			{
			if(curx<desk_x+frets_height)
			{
				cf=loop2+start_fret;

				curx=/*alw->wx+*/(frets_length_times_loop2);
				cury=/*alw->wy+*/(loop1*frets_height);
				if(cf!=0)
					{

						draw(curx+frets_x_offset,cury+half_fret_height_and_frets_y_offset,
							 curx+frets_x_offset_and_frets_length,cury+half_fret_height_and_frets_y_offset);

					}


				switch(loop1)
				{
				case 0:				
					draw(curx+frets_x_offset_and_frets_length,cury+frets_y_offset+half_fret_height,
					 curx+frets_x_offset_and_frets_length,cury+frets_height_and_frets_y_offset);						
					break;

			 	case 5:					
					draw(curx+frets_x_offset_and_frets_length,cury+frets_y_offset,
					 curx+frets_x_offset_and_frets_length,cury+half_fret_height_and_frets_y_offset);						
					break;

				default:			
					draw(curx+frets_x_offset_and_frets_length,cury+frets_y_offset,
					 curx+frets_x_offset_and_frets_length,cury+frets_height_and_frets_y_offset);						
				}

#ifndef PRINTER_TEST
	if(numbers_flag==1)
	{

	if(cf==first_fret || (((inc_res=cf%fret_inc)==0) && cf>first_fret))
		{
		if((tadd=clh-frets_height)>0)
			{
			sprintf(albuff,"%d",cf);
			if(strlen(albuff)==1)
			v_gtext(handle,frets_x_offset+(frets_length_times_loop2)+half_fret_length-(tatts[6]/2),frets_y_offset+(frets_height_times_7)+tadd,albuff);
			else
			v_gtext(handle,frets_x_offset+(frets_length_times_loop2)+half_fret_length-tatts[6],frets_y_offset+(frets_height_times_7)+tadd,albuff);
			}
		else
			{
			sprintf(albuff,"%d",cf);
			if(strlen(albuff)==1)
			v_gtext(handle,frets_x_offset+(frets_length_times_loop2)+half_fret_length-(tatts[6]/2),frets_y_offset+(frets_height_times_7),albuff);
			else
			v_gtext(handle,frets_x_offset+(frets_length_times_loop2)+half_fret_length-tatts[6],
								frets_y_offset+(frets_height_times_7),albuff);
			}
		}
	}
#endif

		if(text_notes==1)
		{

			combination_note=0;
			if(cs->display_fretboard[loop1][cf]>RELATIVE_NOTE)
				{
					combination_note=1;
					note_val=cs->display_fretboard[loop1][cf]-RELATIVE_NOTE;
				}
			else
				{
					note_val=cs->display_fretboard[loop1][cf];
				}

			switch(note_val)
			{
						case NO_NOTE: break;
						case NORMAL_NOTE:
							if(combination_note)
								vst_effects(handle,0|UNDERLINED);
							else
								vst_effects(handle,0);
							break;
						case FILLED_NOTE:
							if(combination_note)
								vst_effects(handle,OUTLINE|UNDERLINED);
							else
								vst_effects(handle,OUTLINE);
							break;
						case RELATIVE_NOTE:
							vst_effects(handle,SHADED|UNDERLINED); 
							break;
			}

			/* draw as text */
			if(cs->display_fretboard[loop1][cf]!=NO_NOTE)
			{
				np=cs->current_fretboard[loop1][cf];
				sprintf(albuff,"%s",np->note_name);
				if(strlen(albuff)==1)
					v_gtext(handle,frets_x_offset+frets_length_times_loop2+half_fret_length-(tatts[6]/2),
										cury+half_fret_height_and_frets_y_offset+(tatts[7]/2)/*cury+frets_y_offset+frets_height*/,albuff);
				else
					v_gtext(handle,/*curx+frets_x_offset*/frets_x_offset+(frets_length_times_loop2)+half_fret_length-tatts[6],
										cury+half_fret_height_and_frets_y_offset+(tatts[7]/2)/*cury+frets_y_offset+frets_height*/,albuff);
			}
		
			vst_effects(handle,0);

		}
		else
		{
			combination_note=0;
			if(cs->display_fretboard[loop1][cf]>RELATIVE_NOTE)
				{
					combination_note=1;
					note_val=cs->display_fretboard[loop1][cf]-RELATIVE_NOTE;
				}
			else
				{
					note_val=cs->display_fretboard[loop1][cf];
				}

			if(combination_note)
				{
					vsf_color(handle,BLACK);
					vsf_interior(handle,FIS_HOLLOW);
					vsf_style(handle,0);

					alcircle(handle, 
								curx+half_fret_length+frets_x_offset,
								cury+half_fret_height+frets_y_offset, 
								circle_radius+2);
 		
					vsf_color(handle,BLACK);					
					vsf_interior(handle,8);
					vsf_style(handle,2);
				}

				switch(note_val)		
					{
						case NO_NOTE: break;
						case NORMAL_NOTE:
							vsf_color(handle,BLACK); 
							vsf_interior(handle,2);
							vsf_style(handle,2);

							alcircle(handle,
							curx+half_fret_length+frets_x_offset,
							cury+half_fret_height_and_frets_y_offset,
							circle_radius); 

							vsf_color(handle,BLACK);
							vsf_interior(handle,8);
							vsf_style(handle,2);
							break;
						case FILLED_NOTE:
							vsf_color(handle,BLACK);
							vsf_interior(handle,FIS_SOLID);
							vsf_style(handle,2);

							alcircle(handle, 
							curx+half_fret_length+frets_x_offset,
							cury+half_fret_height_and_frets_y_offset, 
							circle_radius);
 		
							vsf_color(handle,BLACK);					
							break;
						case RELATIVE_NOTE: 
							vsf_color(handle,BLACK);
							vsf_interior(handle,FIS_HOLLOW);
							vsf_style(handle,2);
							alcircle(handle, 
							curx+half_fret_length+frets_x_offset,
							cury+half_fret_height_and_frets_y_offset, 
							circle_radius);
 		
							vsf_color(handle,BLACK);					
							vsf_interior(handle,8);
							vsf_style(handle,2);
							break;
/*						case COMMON_NOTE: 
							vsf_color(handle,BLACK);
							vsf_interior(handle,4);
							vsf_style(handle,2);
							alcircle(handle, 
							curx+half_fret_length+frets_x_offset,
							cury+half_fret_height_and_frets_y_offset, 
							circle_radius);
 		
							vsf_color(handle,BLACK);					
							vsf_interior(handle,8);
							vsf_style(handle,2);
							break;*/
					}
			}

			}
			}

	
		}
	

graf_mouse(M_ON,NULL);
#ifdef PRINTER_TEST
v_clswk(handle);
#endif
	}
Пример #12
0
static void __CDECL cert_info_draw( WINDOW * win, short buf[8], void * data)
{
	struct ssl_info_draw_param * dp = (struct ssl_info_draw_param *)data;
	GRECT work;
	short pxy[4];
	int maxchars;
	short d, cbh, cbw;
	int i = 0;
	short x,y,w,h;
	int px_ypos, px_xpos;
	char * line = malloc(512);
	if( line == NULL )
		return;

	LOG(("Cert info draw, win: %p, data: %p, scrollx: %d", win, data, dp->scrollx ));

	WindGet( win, WF_WORKXYWH, &x, &y, &w, &h );
	/*using static values here, as RsrcUserDraw has mem leaks & a very small stack */
	pxy[0] = work.g_x = x + 8;
	pxy[1] = work.g_y = y + 80;
	pxy[2] = x + 8 + 272;
	pxy[3] = y + 80 + 176;
	work.g_w = 272;
	work.g_h = 176;

	maxchars = (work.g_w / 8)+1;
	vs_clip( atari_plot_vdi_handle, 1,(short*) &pxy );
	vswr_mode( atari_plot_vdi_handle, MD_REPLACE );
	vsf_interior( atari_plot_vdi_handle, 1 );
	vsf_color( atari_plot_vdi_handle, LWHITE );
	v_bar( atari_plot_vdi_handle, (short*)&pxy );
	vst_height( atari_plot_vdi_handle, 16, &d, &d, &cbw, &cbh );
	vst_alignment(atari_plot_vdi_handle, 0, 5, &d, &d );
	vst_color( atari_plot_vdi_handle, BLACK );
	vst_effects( atari_plot_vdi_handle, 0 );
	px_ypos = px_xpos = 0;
	for(i=0; i<CERT_INF_LINES; i++ ) {
		switch( i ) {
			case 0:
				sprintf(line, "Cert Version:   %d", dp->cert_infos_n[dp->current].version  );
				break;

			case 1:
				sprintf(line, "Invalid before: %s", &dp->cert_infos_n[dp->current].not_before );
				break;

			case 2:
				sprintf(line, "Invalid after:  %s", &dp->cert_infos_n[dp->current].not_after );
				break;

			case 3:
				sprintf(line, "Signature type: %d", dp->cert_infos_n[dp->current].sig_type );
				break;

			case 4:
				sprintf(line, "Serial:         %d", dp->cert_infos_n[dp->current].serial );
				break;

			case 5:
				sprintf(line, "Issuer:         %s", &dp->cert_infos_n[dp->current].issuer );
				break;

			case 6:
				sprintf(line, "Subject:        %s", &dp->cert_infos_n[dp->current].subject );
				break;

			case 7:
				sprintf(line, "Cert type:      %d", dp->cert_infos_n[dp->current].cert_type );
				break;

			default:
				break;
		}
		if( (int)strlen(line) > dp->scrollx ) {
			if( dp->scrollx + maxchars < 511 && ( (signed int)strlen(line) - dp->scrollx) > maxchars )
				line[dp->scrollx + maxchars] = 0;
			v_gtext(atari_plot_vdi_handle, work.g_x + 1, work.g_y + px_ypos, &line[dp->scrollx]);
		}
		px_ypos += cbh;
	}
	vst_alignment(atari_plot_vdi_handle, 0, 0, &d, &d );
	vs_clip( atari_plot_vdi_handle, 0, (short*)&pxy );
	free( line );
}