Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1557 → Rev 1558

/uspace/trunk/console/cons_has_data.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/uspace/trunk/console/cons_selected.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/uspace/trunk/console/cons_idle.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/uspace/trunk/console/gcons.c
99,11 → 99,13
nsend_call_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor);
}
 
static void putch(char c, int row, int col)
/** Transparent putchar */
static void tran_putch(char c, int row, int col)
{
nsend_call_3(fbphone, FB_PUTCHAR, c, row, col);
nsend_call_3(fbphone, FB_TRANS_PUTCHAR, c, row, col);
}
 
/** Redraw the button showing state of a given console */
static void redraw_state(int consnum)
{
char data[5];
117,7 → 119,7
if (state != CONS_DISCONNECTED && state != CONS_KERNEL && state != CONS_DISCONNECTED_SEL) {
snprintf(data, 5, "%d", consnum+1);
for (i=0;data[i];i++)
putch(data[i], 1, 2+i);
tran_putch(data[i], 1, 2+i);
}
}
 
170,6 → 172,7
vp_switch(console_vp);
}
 
/** Notification function called on console connect */
void gcons_notify_connect(int consnum)
{
if (!use_gcons)
238,6 → 241,7
extern int _binary_helenos_ppm_size;
extern char _binary_nameic_ppm_start[0];
extern int _binary_nameic_ppm_size;
/** Redraws console graphics */
static void gcons_redraw_console(void)
{
int i;
252,12 → 256,17
draw_pixmap(_binary_helenos_ppm_start, (size_t)&_binary_helenos_ppm_size, xres-66, 2);
draw_pixmap(_binary_nameic_ppm_start, (size_t)&_binary_nameic_ppm_size, 5, 17);
 
 
for (i=0;i < CONSOLE_COUNT; i++)
redraw_state(i);
vp_switch(console_vp);
}
 
/** Creates a pixmap on framebuffer
*
* @param data PPM data
* @param size PPM data size
* @return Pixmap identification
*/
static int make_pixmap(char *data, int size)
{
char *shm;
/uspace/trunk/console/cons_kernel.ppm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/uspace/trunk/fb/fb.c
266,8 → 266,16
/***************************************************************/
/* Character-console functions */
 
/** Draw character at given position */
static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy, style_t style)
/** Draw character at given position
*
* @param vp Viewport where the character is printed
* @param sx Coordinates of top-left of the character
* @param sy Coordinates of top-left of the character
* @param style Color of the character
* @param transparent If false, print background color
*/
static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy,
style_t style, int transparent)
{
int i;
unsigned int y;
278,7 → 286,7
for (i = 0; i < 8; i++) {
if (glline & (1 << (7 - i)))
putpixel(vp, sx + i, sy + y, style.fg_color);
else
else if (!transparent)
putpixel(vp, sx + i, sy + y, style.bg_color);
}
}
426,8 → 434,9
* @param c Character to print
* @param row Screen position relative to viewport
* @param col Screen position relative to viewport
* @param transparent If false, print background color with character
*/
static void draw_char(int vp, char c, unsigned int row, unsigned int col, style_t style)
static void draw_char(int vp, char c, unsigned int row, unsigned int col, style_t style, int transparent)
{
viewport_t *vport = &viewports[vp];
 
436,7 → 445,7
(vport->cur_col != col || vport->cur_row != row))
invert_char(vp, vport->cur_row, vport->cur_col);
draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES, style);
draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES, style, transparent);
 
vport->cur_col = col;
vport->cur_row = row;
469,7 → 478,8
continue;
col = i % vport->cols;
row = i / vport->cols;
draw_glyph(vp, data[i].character, col * COL_WIDTH, row * FONT_SCANLINES, data[i].style);
draw_glyph(vp, data[i].character, col * COL_WIDTH, row * FONT_SCANLINES,
data[i].style, style_same(data[i].style,vport->style));
}
cursor_print(vp);
}
778,6 → 788,7
return; /* Exit thread */
 
case FB_PUTCHAR:
case FB_TRANS_PUTCHAR:
c = IPC_GET_ARG1(call);
row = IPC_GET_ARG2(call);
col = IPC_GET_ARG3(call);
787,7 → 798,7
}
ipc_answer_fast(callid,0,0,0);
 
draw_char(vp, c, row, col, vport->style);
draw_char(vp, c, row, col, vport->style, IPC_GET_METHOD(call) == FB_TRANS_PUTCHAR);
continue; /* msg already answered */
case FB_CLEAR:
clear_port(vp);
/uspace/trunk/libc/include/ipc/fb.h
29,4 → 29,6
#define FB_VP2PIXMAP 1043
#define FB_DROP_PIXMAP 1044
 
#define FB_TRANS_PUTCHAR 1045
 
#endif