Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1525 → Rev 1526

/uspace/trunk/console/console.c
47,8 → 47,12
 
#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 */
55,20 → 59,23
ipcarg_t cols; /**< Framebuffer columns */
} fb_info;
 
 
typedef struct {
keybuffer_t keybuffer;
FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED);
int keyrequest_counter;
int client_phone;
int used;
screenbuffer_t screenbuffer;
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. */
} 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 */
 
 
connection_t connections[CONSOLE_COUNT];
keyfield_t *interbuffer = NULL;
/** Find unused virtual console.
*
*/
static int find_free_connection()
{
int i = 0;
81,7 → 88,9
return CONSOLE_COUNT;
}
 
 
/** Find index of virtual console used by client with given phone.
*
*/
static int find_connection(int client_phone)
{
int i = 0;
151,7 → 160,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,8 → 46,9
 
/** Initilize screenbuffer. Allocate space for screen content in accordance to given size.
* @param scr initialized screenbuffer
* @param size_x
* @param size_y
* @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)
{
65,6 → 66,9
return scr;
}
 
/** Clear screenbuffer.
* @param scr screenbuffer
*/
void screenbuffer_clear(screenbuffer_t *scr)
{
unsigned int i;
79,7 → 83,7
scr->position_x = 0;
}
 
/** Clear one buffer line
/** Clear one buffer line.
* @param scr
* @param line One buffer line (not a screen line!)
*/
93,6 → 97,10
}
}
 
/** 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;
102,6 → 110,11
}
}
 
/** 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;
108,6 → 121,11
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;