Exemplo n.º 1
0
void fb_button(button_t button){
	int title_size = 8*strlen(button.label);
	// On dessine le tour
	fb_rect(button.y, button.y + button.height, button.x, button.x + button.width, LU_GREY);
	// On dessine le rebord gauche
	fb_line(button.x + 1, button.y + 2, button.x + 1, button.y + button.height - 1, LU_BLACK);
	// On dessine le rebord inférieur
	fb_line(button.x + 1, button.y + button.height - 1, button.x + button.width - 1, button.y + button.height - 1, LU_BLACK);
	// On fait le calcul pour le placement du titre
	if(button.width > title_size && button.height > 10){
		// On affiche le titre
		fb_print_string_transparent(LU_GREY, button.label, button.x + (button.width-title_size)/2, button.y + (button.height-8)/2);
	}
}
Exemplo n.º 2
0
void fb_progress_bar(progress_bar_t pb){
	int effective_width;
	// On dessine le fond
	fb_rect_fill(pb.y + 1, pb.y + pb.height - 1, pb.x + 1, pb.x + pb.width - 1, LU_BRT_WHITE);
	// On dessine le tour
	fb_rect(pb.y, pb.y + pb.height, pb.x, pb.x + pb.width, LU_BLACK);
	// On calcule la largeur effective de la progress bar
	if(pb.max_value > 0){
		effective_width = (pb.width - 4)*pb.current_value/pb.max_value;
		if(effective_width > 0){
			// On dessine la progress bar
			fb_rect_fill(pb.y + 2, pb.y + pb.height - 2, pb.x + 2, pb.x + 2 + effective_width, pb.couleur);
		}
	}else{
		effective_width = 0;
	}
}
Exemplo n.º 3
0
static void
fb_docmd(WINDISPLAY *mod, struct TVRequest *req)
{
	switch (req->tvr_Req.io_Command)
	{
		case TVCMD_OPENWINDOW:
			fb_openwindow(mod, req);
			break;
		case TVCMD_CLOSEWINDOW:
			fb_closewindow(mod, req);
			break;
		case TVCMD_OPENFONT:
			fb_openfont(mod, req);
			break;
		case TVCMD_CLOSEFONT:
			fb_closefont(mod, req);
			break;
		case TVCMD_GETFONTATTRS:
			fb_getfontattrs(mod, req);
			break;
		case TVCMD_TEXTSIZE:
			fb_textsize(mod, req);
			break;
		case TVCMD_QUERYFONTS:
			fb_queryfonts(mod, req);
			break;
		case TVCMD_GETNEXTFONT:
			fb_getnextfont(mod, req);
			break;
		case TVCMD_SETINPUT:
			fb_setinput(mod, req);
			break;
		case TVCMD_GETATTRS:
			fb_getattrs(mod, req);
			break;
		case TVCMD_SETATTRS:
			fb_setattrs(mod, req);
			break;
		case TVCMD_ALLOCPEN:
			fb_allocpen(mod, req);
			break;
		case TVCMD_FREEPEN:
			fb_freepen(mod, req);
			break;
		case TVCMD_SETFONT:
			fb_setfont(mod, req);
			break;
		case TVCMD_CLEAR:
			fb_clear(mod, req);
			break;
		case TVCMD_RECT:
			fb_rect(mod, req);
			break;
		case TVCMD_FRECT:
			fb_frect(mod, req);
			break;
		case TVCMD_LINE:
			fb_line(mod, req);
			break;
		case TVCMD_PLOT:
			fb_plot(mod, req);
			break;
		case TVCMD_TEXT:
			fb_drawtext(mod, req);
			break;
		case TVCMD_DRAWSTRIP:
			fb_drawstrip(mod, req);
			break;
		case TVCMD_DRAWTAGS:
			fb_drawtags(mod, req);
			break;
		case TVCMD_DRAWFAN:
			fb_drawfan(mod, req);
			break;
		case TVCMD_COPYAREA:
			fb_copyarea(mod, req);
			break;
		case TVCMD_SETCLIPRECT:
			fb_setcliprect(mod, req);
			break;
		case TVCMD_UNSETCLIPRECT:
			fb_unsetcliprect(mod, req);
			break;
		case TVCMD_DRAWBUFFER:
			fb_drawbuffer(mod, req);
			break;
		default:
			TDBPRINTF(TDB_INFO,("Unknown command code: %08x\n",
			req->tvr_Req.io_Command));
	}
}