/trunk/uspace/srv/console/nameic.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/anim_4.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/anim_3.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/anim_2.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/anim_1.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/helenos.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/cons_selected.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/cons_idle.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/cons_kernel.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/cons_has_data.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
-application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/screenbuffer.h |
---|
32,8 → 32,8 |
/** @file |
*/ |
#ifndef __SCREENBUFFER_H__ |
#define __SCREENBUFFER_H__ |
#ifndef SCREENBUFFER_H__ |
#define SCREENBUFFER_H__ |
#include <stdint.h> |
#include <sys/types.h> |
78,19 → 78,32 |
/** Structure for buffering state of one virtual console. |
*/ |
typedef struct { |
keyfield_t *buffer; /**< Screen content - characters and their attributes. Used as a circular buffer. */ |
unsigned int size_x, size_y; /**< Number of columns and rows */ |
unsigned int position_x, position_y; /**< Coordinates of last printed character for determining cursor position */ |
keyfield_t *buffer; /**< Screen content - characters and |
their attributes (used as a circular buffer) */ |
unsigned int size_x; /**< Number of columns */ |
unsigned int size_y; /**< Number of rows */ |
/** Coordinates of last printed character for determining cursor position */ |
unsigned int position_x; |
unsigned int position_y; |
attrs_t attrs; /**< Current attributes. */ |
unsigned int top_line; /**< Points to buffer[][] line that will be printed at screen as the first line */ |
unsigned int top_line; /**< Points to buffer[][] line that will |
be printed at screen as the first line */ |
unsigned char is_cursor_visible; /**< Cursor state - default is visible */ |
} screenbuffer_t; |
/** Returns keyfield for position on screen. Screenbuffer->buffer is cyclic buffer so we must couted in index of the topmost line. |
* @param scr screenbuffer |
* @param x position on screen |
* @param y position on screen |
* @return keyfield structure with character and its attributes on x,y |
/** Returns keyfield for position on screen |
* |
* Screenbuffer->buffer is cyclic buffer so we |
* must couted in index of the topmost line. |
* |
* @param scr Screenbuffer |
* @param x Position on screen |
* @param y Position on screen |
* |
* @return Keyfield structure with character and its attributes on x, y |
* |
*/ |
static inline keyfield_t *get_field_at(screenbuffer_t *scr, unsigned int x, unsigned int y) |
{ |
98,21 → 111,28 |
} |
/** Compares two sets of attributes. |
* @param s1 first style |
* @param s2 second style |
* @return nonzero on equality |
* |
* @param s1 First style |
* @param s2 Second style |
* |
* @return Nonzero on equality |
* |
*/ |
static inline int attrs_same(attrs_t a1, attrs_t a2) |
{ |
if (a1.t != a2.t) return 0; |
if (a1.t != a2.t) |
return 0; |
switch (a1.t) { |
case at_style: return a1.a.s.style == a2.a.s.style; |
case at_idx: return a1.a.i.fg_color == a2.a.i.fg_color && |
a1.a.i.bg_color == a2.a.i.bg_color && |
a1.a.i.flags == a2.a.i.flags; |
case at_rgb: return a1.a.r.fg_color == a2.a.r.fg_color && |
a1.a.r.bg_color == a2.a.r.bg_color; |
case at_style: |
return (a1.a.s.style == a2.a.s.style); |
case at_idx: |
return (a1.a.i.fg_color == a2.a.i.fg_color) |
&& (a1.a.i.bg_color == a2.a.i.bg_color) |
&& (a1.a.i.flags == a2.a.i.flags); |
case at_rgb: |
return (a1.a.r.fg_color == a2.a.r.fg_color) |
&& (a1.a.r.bg_color == a2.a.r.bg_color); |
} |
} |
132,7 → 152,5 |
#endif |
/** @} |
*/ |
/trunk/uspace/srv/console/console.c |
---|
55,9 → 55,12 |
#include "console.h" |
#include "gcons.h" |
#define NAME "console" |
#define MAX_KEYREQUESTS_BUFFERED 32 |
#define NAME "console" |
/** Size of cwrite_buf. */ |
#define CWRITE_BUF_SIZE 256 |
/** Index of currently used virtual console. |
*/ |
76,40 → 79,36 |
typedef struct { |
keybuffer_t keybuffer; /**< Buffer for incoming keys. */ |
/** Buffer for unsatisfied request for keys. */ |
FIFO_CREATE_STATIC(keyrequests, ipc_callid_t, |
MAX_KEYREQUESTS_BUFFERED); |
int keyrequest_counter; /**< Number of requests in buffer. */ |
int client_phone; /**< Phone to connected client. */ |
int used; /**< 1 if this virtual console is |
* connected to some client.*/ |
connected to some client. */ |
screenbuffer_t screenbuffer; /**< Screenbuffer for saving screen |
* contents and related settings. */ |
contents and related settings. */ |
} connection_t; |
static connection_t connections[CONSOLE_COUNT]; /**< Array of data for virtual |
* consoles */ |
static keyfield_t *interbuffer = NULL; /**< Pointer to memory shared |
* with framebufer used for |
* faster virtual console |
* switching */ |
/** Array of data for virtual consoles */ |
static connection_t connections[CONSOLE_COUNT]; |
/** Pointer to memory shared with framebufer used for |
faster virtual console switching */ |
static keyfield_t *interbuffer = NULL; |
/** Information on row-span yet unsent to FB driver. */ |
struct { |
int row; /**< Row where the span lies. */ |
int col; /**< Leftmost column of the span. */ |
int n; /**< Width of the span. */ |
int cnt; /**< Width of the span. */ |
} fb_pending; |
/** Size of cwrite_buf. */ |
#define CWRITE_BUF_SIZE 256 |
/** Buffer for receiving data via the CONSOLE_WRITE call from the client. */ |
static char cwrite_buf[CWRITE_BUF_SIZE]; |
static void fb_putchar(wchar_t c, int row, int col); |
/** Find unused virtual console. |
* |
*/ |
121,6 → 120,7 |
if (!connections[i].used) |
return i; |
} |
return -1; |
} |
185,12 → 185,10 |
case at_style: |
set_style(attrs->a.s.style); |
break; |
case at_idx: |
set_color(attrs->a.i.fg_color, attrs->a.i.bg_color, |
attrs->a.i.flags); |
break; |
case at_rgb: |
set_rgb_color(attrs->a.r.fg_color, attrs->a.r.bg_color); |
break; |
200,8 → 198,8 |
/** Send an area of screenbuffer to the FB driver. */ |
static void fb_update_area(connection_t *conn, int x, int y, int w, int h) |
{ |
int i, j; |
int rc; |
int i; |
int j; |
attrs_t *attrs; |
keyfield_t *field; |
209,46 → 207,25 |
for (j = 0; j < h; j++) { |
for (i = 0; i < w; i++) { |
interbuffer[i + j * w] = |
*get_field_at(&conn->screenbuffer, |
x + i, y + j); |
*get_field_at(&conn->screenbuffer, x + i, y + j); |
} |
} |
rc = async_req_4_0(fb_info.phone, FB_DRAW_TEXT_DATA, |
async_req_4_0(fb_info.phone, FB_DRAW_TEXT_DATA, |
x, y, w, h); |
} else { |
rc = ENOTSUP; |
} |
if (rc != 0) { |
/* |
attrs = &conn->screenbuffer.attrs; |
for (j = 0; j < h; j++) { |
for (i = 0; i < w; i++) { |
field = get_field_at(&conn->screenbuffer, |
x + i, y + j); |
if (!attrs_same(*attrs, field->attrs)) |
set_attrs(&field->attrs); |
attrs = &field->attrs; |
fb_putchar(field->character, y + j, x + i); |
} |
}*/ |
} |
} |
/** Flush pending cells to FB. */ |
static void fb_pending_flush(void) |
{ |
screenbuffer_t *scr; |
screenbuffer_t *scr |
= &(connections[active_console].screenbuffer); |
scr = &(connections[active_console].screenbuffer); |
if (fb_pending.n > 0) { |
if (fb_pending.cnt > 0) { |
fb_update_area(&connections[active_console], fb_pending.col, |
fb_pending.row, fb_pending.n, 1); |
fb_pending.n = 0; |
fb_pending.row, fb_pending.cnt, 1); |
fb_pending.cnt = 0; |
} |
} |
256,25 → 233,25 |
* |
* This adds the cell to the pending rowspan if possible. Otherwise |
* the old span is flushed first. |
* |
*/ |
static void cell_mark_changed(int row, int col) |
{ |
if (fb_pending.n != 0) { |
if (row != fb_pending.row || |
col != fb_pending.col + fb_pending.n) { |
if (fb_pending.cnt != 0) { |
if ((row != fb_pending.row) |
|| (col != fb_pending.col + fb_pending.cnt)) { |
fb_pending_flush(); |
} |
} |
if (fb_pending.n == 0) { |
if (fb_pending.cnt == 0) { |
fb_pending.row = row; |
fb_pending.col = col; |
} |
++fb_pending.n; |
fb_pending.cnt++; |
} |
/** Print a character to the active VC with buffering. */ |
static void fb_putchar(wchar_t c, int row, int col) |
{ |
340,7 → 317,9 |
static void change_console(int newcons) |
{ |
connection_t *conn; |
int i, j, rc; |
int i; |
int j; |
int rc; |
keyfield_t *field; |
attrs_t *attrs; |
408,8 → 387,7 |
set_attrs(&field->attrs); |
attrs = &field->attrs; |
if ((field->character == ' ') && |
(attrs_same(field->attrs, |
conn->screenbuffer.attrs))) |
(attrs_same(field->attrs, conn->screenbuffer.attrs))) |
continue; |
fb_putchar(field->character, j, i); |
435,7 → 413,7 |
int newcon; |
/* Ignore parameters, the connection is alread opened */ |
while (1) { |
while (true) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
460,8 → 438,7 |
ev.mods = IPC_GET_ARG3(call); |
ev.c = IPC_GET_ARG4(call); |
/* switch to another virtual console */ |
/* Switch to another virtual console */ |
conn = &connections[active_console]; |
if ((ev.key >= KC_F1) && (ev.key < KC_F1 + |
473,7 → 450,7 |
break; |
} |
/* if client is awaiting key, send it */ |
/* If client is awaiting key, send it */ |
if (conn->keyrequest_counter > 0) { |
conn->keyrequest_counter--; |
ipc_answer_4(fifo_pop(conn->keyrequests), EOK, |
552,7 → 529,7 |
/* Accept the connection */ |
ipc_answer_0(iid, EOK); |
while (1) { |
while (true) { |
async_serialize_end(); |
callid = async_get_call(&call); |
async_serialize_start(); |
748,7 → 725,7 |
ib_size = sizeof(keyfield_t) * fb_info.cols * fb_info.rows; |
interbuffer = as_get_mappable_page(ib_size); |
fb_pending.n = 0; |
fb_pending.cnt = 0; |
if (as_area_create(interbuffer, ib_size, AS_AREA_READ | |
AS_AREA_WRITE | AS_AREA_CACHEABLE) != interbuffer) { |
/trunk/uspace/srv/console/gfx/anim_1.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/anim_2.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/anim_3.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/cons_has_data.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/anim_4.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/cons_selected.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/nameic.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/helenos.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/cons_idle.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/gfx/cons_kernel.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/uspace/srv/console/console.h |
---|
35,10 → 35,9 |
#ifndef __CONSOLE_H__ |
#define __CONSOLE_H__ |
#define CONSOLE_COUNT 12 |
#define KERNEL_CONSOLE 11 |
#define CONSOLE_COUNT 12 |
#endif |
/** @} |
/trunk/uspace/srv/console/screenbuffer.c |
---|
37,34 → 37,40 |
#include <malloc.h> |
#include <unistd.h> |
/** Store one character to screenbuffer. Its position is determined by |
* scr->position_x and scr->position_y. |
/** Store one character to screenbuffer. |
* |
* @param scr screenbuffer |
* @param c stored character |
* Its position is determined by scr->position_x |
* and scr->position_y. |
* |
* @param scr Screenbuffer |
* @param c Stored character |
* |
*/ |
void screenbuffer_putchar(screenbuffer_t *scr, wchar_t ch) |
{ |
keyfield_t *field; |
keyfield_t *field = |
get_field_at(scr, scr->position_x, scr->position_y); |
field = get_field_at(scr, scr->position_x, scr->position_y); |
field->character = ch; |
field->attrs = scr->attrs; |
} |
/** Initilize screenbuffer. Allocate space for screen content in accordance to given size. |
* @param scr initialized screenbuffer |
* @param size_x width in characters |
* @param size_y height in characters |
* @return pointer to screenbuffer (same as scr parameter) or NULL |
/** Initilize screenbuffer. |
* |
* Allocate space for screen content in accordance to given size. |
* |
* @param scr Initialized screenbuffer |
* @param size_x Width in characters |
* @param size_y Height in characters |
* |
* @return Pointer to screenbuffer (same as scr parameter) or NULL |
* |
*/ |
screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y) |
{ |
scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y); |
if (!scr->buffer) { |
if (!scr->buffer) |
return NULL; |
} |
scr->size_x = size_x; |
scr->size_y = size_y; |
78,7 → 84,9 |
} |
/** Clear screenbuffer. |
* @param scr screenbuffer |
* |
* @param scr Screenbuffer |
* |
*/ |
void screenbuffer_clear(screenbuffer_t *scr) |
{ |
95,8 → 103,10 |
} |
/** Clear one buffer line. |
* |
* @param scr |
* @param line One buffer line (not a screen line!) |
* |
*/ |
void screenbuffer_clear_line(screenbuffer_t *scr, unsigned int line) |
{ |
109,22 → 119,25 |
} |
/** Copy content buffer from screenbuffer to given memory. |
* @param scr source screenbuffer |
* @param dest destination |
* |
* @param scr Source screenbuffer |
* @param dest Destination |
* |
*/ |
void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest) |
{ |
unsigned int i; |
for (i = 0; i < scr->size_x * scr->size_y; i++) { |
for (i = 0; i < scr->size_x * scr->size_y; i++) |
dest[i] = scr->buffer[i]; |
} |
} |
/** Set new cursor position in screenbuffer. |
* |
* @param scr |
* @param x |
* @param y |
* |
*/ |
void screenbuffer_goto(screenbuffer_t *scr, unsigned int x, unsigned int y) |
{ |
133,9 → 146,11 |
} |
/** Set new style. |
* |
* @param scr |
* @param fg_color |
* @param bg_color |
* |
*/ |
void screenbuffer_set_style(screenbuffer_t *scr, int style) |
{ |
144,9 → 159,11 |
} |
/** Set new color. |
* |
* @param scr |
* @param fg_color |
* @param bg_color |
* |
*/ |
void screenbuffer_set_color(screenbuffer_t *scr, unsigned int fg_color, unsigned int bg_color, unsigned int flags) |
{ |
157,9 → 174,11 |
} |
/** Set new RGB color. |
* |
* @param scr |
* @param fg_color |
* @param bg_color |
* |
*/ |
void screenbuffer_set_rgb_color(screenbuffer_t *scr, unsigned int fg_color, unsigned int bg_color) |
{ |
168,6 → 187,5 |
scr->attrs.a.r.bg_color = bg_color; |
} |
/** @} |
*/ |
/trunk/uspace/srv/console/gcons.c |
---|
166,8 → 166,8 |
if (!use_gcons) |
return; |
if (consnum == active_console || |
console_state[consnum] == CONS_HAS_DATA) |
if ((consnum == active_console) || |
(console_state[consnum] == CONS_HAS_DATA)) |
return; |
console_state[consnum] = CONS_HAS_DATA; |
185,6 → 185,7 |
{ |
if (!use_gcons) |
return; |
if (active_console == consnum) |
console_state[consnum] = CONS_DISCONNECTED_SEL; |
else |
202,6 → 203,7 |
{ |
if (!use_gcons) |
return; |
if (active_console == consnum) |
console_state[consnum] = CONS_SELECTED; |
else |
254,7 → 256,7 |
{ |
int status_start = STATUS_START + (xres - 800) / 2; |
if (y < STATUS_TOP || y >= STATUS_TOP + STATUS_HEIGHT) |
if ((y < STATUS_TOP) || (y >= STATUS_TOP + STATUS_HEIGHT)) |
return -1; |
if (x < status_start) |
285,13 → 287,16 |
} |
return -1; |
} |
if (!state && !btn_pressed) |
if ((!state) && (!btn_pressed)) |
return -1; |
btn_pressed = 0; |
conbut = gcons_find_conbut(mouse_x, mouse_y); |
if (conbut == gcons_find_conbut(btn_x, btn_y)) |
return conbut; |
return -1; |
} |
315,27 → 320,32 |
return; |
memcpy(shm, logo, size); |
/* Send area */ |
rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
if (rc) |
goto exit; |
rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
if (rc) |
goto drop; |
/* Draw logo */ |
async_msg_2(fbphone, FB_DRAW_PPM, x, y); |
drop: |
/* Drop area */ |
async_msg_0(fbphone, FB_DROP_SHM); |
exit: |
/* Remove area */ |
munmap(shm, size); |
} |
extern char _binary_helenos_ppm_start[0]; |
extern int _binary_helenos_ppm_size; |
extern char _binary_nameic_ppm_start[0]; |
extern int _binary_nameic_ppm_size; |
extern char _binary_gfx_helenos_ppm_start[0]; |
extern int _binary_gfx_helenos_ppm_size; |
extern char _binary_gfx_nameic_ppm_start[0]; |
extern int _binary_gfx_nameic_ppm_size; |
/** Redraws console graphics */ |
void gcons_redraw_console(void) |
348,13 → 358,14 |
vp_switch(0); |
set_rgb_color(MAIN_COLOR, MAIN_COLOR); |
clear(); |
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); |
draw_pixmap(_binary_gfx_helenos_ppm_start, |
(size_t) &_binary_gfx_helenos_ppm_size, xres - 66, 2); |
draw_pixmap(_binary_gfx_nameic_ppm_start, |
(size_t) &_binary_gfx_nameic_ppm_size, 5, 17); |
for (i = 0; i < CONSOLE_COUNT; i++) |
redraw_state(i); |
vp_switch(console_vp); |
} |
377,10 → 388,12 |
return -1; |
memcpy(shm, data, size); |
/* Send area */ |
rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
if (rc) |
goto exit; |
rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
if (rc) |
goto drop; |
389,10 → 402,13 |
rc = async_req_0_0(fbphone, FB_SHM2PIXMAP); |
if (rc < 0) |
goto drop; |
pxid = rc; |
drop: |
/* Drop area */ |
async_msg_0(fbphone, FB_DROP_SHM); |
exit: |
/* Remove area */ |
munmap(shm, size); |
400,38 → 416,35 |
return pxid; |
} |
extern char _binary_anim_1_ppm_start[0]; |
extern int _binary_anim_1_ppm_size; |
extern char _binary_anim_2_ppm_start[0]; |
extern int _binary_anim_2_ppm_size; |
extern char _binary_anim_3_ppm_start[0]; |
extern int _binary_anim_3_ppm_size; |
extern char _binary_anim_4_ppm_start[0]; |
extern int _binary_anim_4_ppm_size; |
extern char _binary_gfx_anim_1_ppm_start[0]; |
extern int _binary_gfx_anim_1_ppm_size; |
extern char _binary_gfx_anim_2_ppm_start[0]; |
extern int _binary_gfx_anim_2_ppm_size; |
extern char _binary_gfx_anim_3_ppm_start[0]; |
extern int _binary_gfx_anim_3_ppm_size; |
extern char _binary_gfx_anim_4_ppm_start[0]; |
extern int _binary_gfx_anim_4_ppm_size; |
static void make_anim(void) |
{ |
int an; |
int pm; |
an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); |
int an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); |
if (an < 0) |
return; |
pm = make_pixmap(_binary_anim_1_ppm_start, |
(int) &_binary_anim_1_ppm_size); |
int pm = make_pixmap(_binary_gfx_anim_1_ppm_start, |
(int) &_binary_gfx_anim_1_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
pm = make_pixmap(_binary_anim_2_ppm_start, |
(int) &_binary_anim_2_ppm_size); |
pm = make_pixmap(_binary_gfx_anim_2_ppm_start, |
(int) &_binary_gfx_anim_2_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
pm = make_pixmap(_binary_anim_3_ppm_start, |
(int) &_binary_anim_3_ppm_size); |
pm = make_pixmap(_binary_gfx_anim_3_ppm_start, |
(int) &_binary_gfx_anim_3_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
pm = make_pixmap(_binary_anim_4_ppm_start, |
(int) &_binary_anim_4_ppm_size); |
pm = make_pixmap(_binary_gfx_anim_4_ppm_start, |
(int) &_binary_gfx_anim_4_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
async_msg_1(fbphone, FB_ANIM_START, an); |
439,14 → 452,14 |
animation = an; |
} |
extern char _binary_cons_selected_ppm_start[0]; |
extern int _binary_cons_selected_ppm_size; |
extern char _binary_cons_idle_ppm_start[0]; |
extern int _binary_cons_idle_ppm_size; |
extern char _binary_cons_has_data_ppm_start[0]; |
extern int _binary_cons_has_data_ppm_size; |
extern char _binary_cons_kernel_ppm_start[0]; |
extern int _binary_cons_kernel_ppm_size; |
extern char _binary_gfx_cons_selected_ppm_start[0]; |
extern int _binary_gfx_cons_selected_ppm_size; |
extern char _binary_gfx_cons_idle_ppm_start[0]; |
extern int _binary_gfx_cons_idle_ppm_size; |
extern char _binary_gfx_cons_has_data_ppm_start[0]; |
extern int _binary_gfx_cons_has_data_ppm_size; |
extern char _binary_gfx_cons_kernel_ppm_start[0]; |
extern int _binary_gfx_cons_kernel_ppm_size; |
/** Initialize nice graphical console environment */ |
void gcons_init(int phone) |
464,7 → 477,8 |
if ((xres < 800) || (yres < 600)) |
return; |
/* create console viewport */ |
/* Create console viewport */ |
/* Align width & height to character size */ |
console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP, |
ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8), |
486,18 → 500,20 |
/* Initialize icons */ |
ic_pixmaps[CONS_SELECTED] = |
make_pixmap(_binary_cons_selected_ppm_start, |
(int) &_binary_cons_selected_ppm_size); |
ic_pixmaps[CONS_IDLE] = make_pixmap(_binary_cons_idle_ppm_start, |
(int) &_binary_cons_idle_ppm_size); |
make_pixmap(_binary_gfx_cons_selected_ppm_start, |
(int) &_binary_gfx_cons_selected_ppm_size); |
ic_pixmaps[CONS_IDLE] = |
make_pixmap(_binary_gfx_cons_idle_ppm_start, |
(int) &_binary_gfx_cons_idle_ppm_size); |
ic_pixmaps[CONS_HAS_DATA] = |
make_pixmap(_binary_cons_has_data_ppm_start, |
(int) &_binary_cons_has_data_ppm_size); |
make_pixmap(_binary_gfx_cons_has_data_ppm_start, |
(int) &_binary_gfx_cons_has_data_ppm_size); |
ic_pixmaps[CONS_DISCONNECTED] = |
make_pixmap(_binary_cons_idle_ppm_start, |
(int) &_binary_cons_idle_ppm_size); |
ic_pixmaps[CONS_KERNEL] = make_pixmap(_binary_cons_kernel_ppm_start, |
(int) &_binary_cons_kernel_ppm_size); |
make_pixmap(_binary_gfx_cons_idle_ppm_start, |
(int) &_binary_gfx_cons_idle_ppm_size); |
ic_pixmaps[CONS_KERNEL] = |
make_pixmap(_binary_gfx_cons_kernel_ppm_start, |
(int) &_binary_gfx_cons_kernel_ppm_size); |
ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED]; |
make_anim(); |
/trunk/uspace/srv/console/Makefile |
---|
42,6 → 42,7 |
# |
OUTPUT = console |
GENERIC_SOURCES = \ |
console.c \ |
screenbuffer.c \ |
48,17 → 49,22 |
../kbd/generic/key_buffer.c \ |
gcons.c |
IMAGES = helenos.ppm nameic.ppm cons_selected.ppm cons_idle.ppm \ |
cons_has_data.ppm cons_kernel.ppm anim_1.ppm anim_2.ppm anim_3.ppm \ |
anim_4.ppm |
IMAGES = \ |
gfx/helenos.ppm \ |
gfx/nameic.ppm \ |
gfx/cons_selected.ppm \ |
gfx/cons_idle.ppm \ |
gfx/cons_has_data.ppm \ |
gfx/cons_kernel.ppm \ |
gfx/anim_1.ppm \ |
gfx/anim_2.ppm \ |
gfx/anim_3.ppm \ |
gfx/anim_4.ppm |
ARCH_SOURCES = |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) \ |
$(addsuffix .o,$(basename $(IMAGES))) |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
OBJECTS := $(GENERIC_OBJECTS) |
.PHONY: all clean depend disasm |