Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1526 → Rev 1525

/uspace/trunk/console/console.c
47,12 → 47,8
 
#define NAME "CONSOLE"
 
/** Index of currently used virtual console.
*/
int active_console = 0;
 
/** Information about framebuffer
*/
struct {
int phone; /**< Framebuffer phone */
ipcarg_t rows; /**< Framebuffer rows */
59,23 → 55,20
ipcarg_t cols; /**< Framebuffer columns */
} fb_info;
 
 
typedef struct {
keybuffer_t keybuffer; /**< Buffer for incoming keys. */
FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED); /**< Buffer for unsatisfied request for keys. */
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.*/
screenbuffer_t screenbuffer; /**< Screenbuffer for saving screen contents and related settings. */
keybuffer_t keybuffer;
FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED);
int keyrequest_counter;
int client_phone;
int used;
screenbuffer_t screenbuffer;
} connection_t;
 
connection_t connections[CONSOLE_COUNT]; /**< Array of data for virtual consoles */
keyfield_t *interbuffer = NULL; /**< Pointer to memory shared with framebufer used for faster virt. console switching */
 
 
/** Find unused virtual console.
*
*/
connection_t connections[CONSOLE_COUNT];
keyfield_t *interbuffer = NULL;
static int find_free_connection()
{
int i = 0;
88,9 → 81,7
return CONSOLE_COUNT;
}
 
/** Find index of virtual console used by client with given phone.
*
*/
 
static int find_connection(int client_phone)
{
int i = 0;
160,7 → 151,7
}
 
 
/** Handler for keyboard */
/* Handler for keyboard */
static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall)
{
ipc_callid_t callid;
/uspace/trunk/console/screenbuffer.c
46,9 → 46,8
 
/** 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
* @param size_x
* @param size_y
*/
screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, int size_x, int size_y)
{
66,9 → 65,6
return scr;
}
 
/** Clear screenbuffer.
* @param scr screenbuffer
*/
void screenbuffer_clear(screenbuffer_t *scr)
{
unsigned int i;
83,7 → 79,7
scr->position_x = 0;
}
 
/** Clear one buffer line.
/** Clear one buffer line
* @param scr
* @param line One buffer line (not a screen line!)
*/
97,10 → 93,6
}
}
 
/** Copy content buffer from screenbuffer to given memory.
* @param scr source screenbuffer
* @param dest destination
*/
void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest)
{
unsigned int i;
110,11 → 102,6
}
}
 
/** Set new cursor position in screenbuffer.
* @param scr
* @param x
* @param y
*/
void screenbuffer_goto(screenbuffer_t *scr, unsigned int x, unsigned int y)
{
scr->position_x = x % scr->size_x;
121,11 → 108,6
scr->position_y = y % scr->size_y;
}
 
/** Set new style.
* @param scr
* @param fg_color
* @param bg_color
*/
void screenbuffer_set_style(screenbuffer_t *scr, unsigned int fg_color, unsigned int bg_color)
{
scr->style.fg_color = fg_color;