Rev 1525 | Rev 1528 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1525 | Rev 1526 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | 45 | ||
46 | #define MAX_KEYREQUESTS_BUFFERED 32 |
46 | #define MAX_KEYREQUESTS_BUFFERED 32 |
47 | 47 | ||
48 | #define NAME "CONSOLE" |
48 | #define NAME "CONSOLE" |
49 | 49 | ||
- | 50 | /** Index of currently used virtual console. |
|
- | 51 | */ |
|
50 | int active_console = 0; |
52 | int active_console = 0; |
51 | 53 | ||
- | 54 | /** Information about framebuffer |
|
- | 55 | */ |
|
52 | struct { |
56 | struct { |
53 | int phone; /**< Framebuffer phone */ |
57 | int phone; /**< Framebuffer phone */ |
54 | ipcarg_t rows; /**< Framebuffer rows */ |
58 | ipcarg_t rows; /**< Framebuffer rows */ |
55 | ipcarg_t cols; /**< Framebuffer columns */ |
59 | ipcarg_t cols; /**< Framebuffer columns */ |
56 | } fb_info; |
60 | } fb_info; |
57 | 61 | ||
- | 62 | ||
58 | typedef struct { |
63 | typedef struct { |
59 | keybuffer_t keybuffer; |
64 | keybuffer_t keybuffer; /**< Buffer for incoming keys. */ |
60 | FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED); |
65 | FIFO_CREATE_STATIC(keyrequests, ipc_callid_t , MAX_KEYREQUESTS_BUFFERED); /**< Buffer for unsatisfied request for keys. */ |
61 | int keyrequest_counter; |
66 | int keyrequest_counter; /**< Number of requests in buffer. */ |
62 | int client_phone; |
67 | int client_phone; /**< Phone to connected client. */ |
63 | int used; |
68 | int used; /**< 1 if this virtual console is connected to some client.*/ |
64 | screenbuffer_t screenbuffer; |
69 | screenbuffer_t screenbuffer; /**< Screenbuffer for saving screen contents and related settings. */ |
65 | } connection_t; |
70 | } connection_t; |
66 | 71 | ||
- | 72 | connection_t connections[CONSOLE_COUNT]; /**< Array of data for virtual consoles */ |
|
- | 73 | keyfield_t *interbuffer = NULL; /**< Pointer to memory shared with framebufer used for faster virt. console switching */ |
|
67 | 74 | ||
68 | 75 | ||
69 | connection_t connections[CONSOLE_COUNT]; |
- | |
70 | keyfield_t *interbuffer = NULL; |
76 | /** Find unused virtual console. |
71 | 77 | * |
|
- | 78 | */ |
|
72 | static int find_free_connection() |
79 | static int find_free_connection() |
73 | { |
80 | { |
74 | int i = 0; |
81 | int i = 0; |
75 | 82 | ||
76 | while (i < CONSOLE_COUNT) { |
83 | while (i < CONSOLE_COUNT) { |
Line 79... | Line 86... | ||
79 | ++i; |
86 | ++i; |
80 | } |
87 | } |
81 | return CONSOLE_COUNT; |
88 | return CONSOLE_COUNT; |
82 | } |
89 | } |
83 | 90 | ||
- | 91 | /** Find index of virtual console used by client with given phone. |
|
84 | 92 | * |
|
- | 93 | */ |
|
85 | static int find_connection(int client_phone) |
94 | static int find_connection(int client_phone) |
86 | { |
95 | { |
87 | int i = 0; |
96 | int i = 0; |
88 | 97 | ||
89 | while (i < CONSOLE_COUNT) { |
98 | while (i < CONSOLE_COUNT) { |
Line 149... | Line 158... | ||
149 | send_call_2(fb_info.phone, FB_CURSOR_GOTO, scr->position_y, scr->position_x); |
158 | send_call_2(fb_info.phone, FB_CURSOR_GOTO, scr->position_y, scr->position_x); |
150 | 159 | ||
151 | } |
160 | } |
152 | 161 | ||
153 | 162 | ||
154 | /* Handler for keyboard */ |
163 | /** Handler for keyboard */ |
155 | static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall) |
164 | static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall) |
156 | { |
165 | { |
157 | ipc_callid_t callid; |
166 | ipc_callid_t callid; |
158 | ipc_call_t call; |
167 | ipc_call_t call; |
159 | int retval; |
168 | int retval; |