Rev 1557 | Rev 1592 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1557 | Rev 1558 | ||
|---|---|---|---|
| Line 97... | Line 97... | ||
| 97 | static void set_style(int fgcolor, int bgcolor) |
97 | static void set_style(int fgcolor, int bgcolor) |
| 98 | { |
98 | { |
| 99 | nsend_call_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor); |
99 | nsend_call_2(fbphone, FB_SET_STYLE, fgcolor, bgcolor); |
| 100 | } |
100 | } |
| 101 | 101 | ||
| - | 102 | /** Transparent putchar */ |
|
| 102 | static void putch(char c, int row, int col) |
103 | static void tran_putch(char c, int row, int col) |
| 103 | { |
104 | { |
| 104 | nsend_call_3(fbphone, FB_PUTCHAR, c, row, col); |
105 | nsend_call_3(fbphone, FB_TRANS_PUTCHAR, c, row, col); |
| 105 | } |
106 | } |
| 106 | 107 | ||
| - | 108 | /** Redraw the button showing state of a given console */ |
|
| 107 | static void redraw_state(int consnum) |
109 | static void redraw_state(int consnum) |
| 108 | { |
110 | { |
| 109 | char data[5]; |
111 | char data[5]; |
| 110 | int i; |
112 | int i; |
| 111 | enum butstate state = console_state[consnum]; |
113 | enum butstate state = console_state[consnum]; |
| Line 115... | Line 117... | ||
| 115 | nsend_call_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], ic_pixmaps[state]); |
117 | nsend_call_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[consnum], ic_pixmaps[state]); |
| 116 | 118 | ||
| 117 | if (state != CONS_DISCONNECTED && state != CONS_KERNEL && state != CONS_DISCONNECTED_SEL) { |
119 | if (state != CONS_DISCONNECTED && state != CONS_KERNEL && state != CONS_DISCONNECTED_SEL) { |
| 118 | snprintf(data, 5, "%d", consnum+1); |
120 | snprintf(data, 5, "%d", consnum+1); |
| 119 | for (i=0;data[i];i++) |
121 | for (i=0;data[i];i++) |
| 120 | putch(data[i], 1, 2+i); |
122 | tran_putch(data[i], 1, 2+i); |
| 121 | } |
123 | } |
| 122 | } |
124 | } |
| 123 | 125 | ||
| 124 | /** Notification run on changing console (except kernel console) */ |
126 | /** Notification run on changing console (except kernel console) */ |
| 125 | void gcons_change_console(int consnum) |
127 | void gcons_change_console(int consnum) |
| Line 168... | Line 170... | ||
| 168 | redraw_state(consnum); |
170 | redraw_state(consnum); |
| 169 | 171 | ||
| 170 | vp_switch(console_vp); |
172 | vp_switch(console_vp); |
| 171 | } |
173 | } |
| 172 | 174 | ||
| - | 175 | /** Notification function called on console connect */ |
|
| 173 | void gcons_notify_connect(int consnum) |
176 | void gcons_notify_connect(int consnum) |
| 174 | { |
177 | { |
| 175 | if (!use_gcons) |
178 | if (!use_gcons) |
| 176 | return; |
179 | return; |
| 177 | if (active_console == consnum) |
180 | if (active_console == consnum) |
| Line 236... | Line 239... | ||
| 236 | 239 | ||
| 237 | extern char _binary_helenos_ppm_start[0]; |
240 | extern char _binary_helenos_ppm_start[0]; |
| 238 | extern int _binary_helenos_ppm_size; |
241 | extern int _binary_helenos_ppm_size; |
| 239 | extern char _binary_nameic_ppm_start[0]; |
242 | extern char _binary_nameic_ppm_start[0]; |
| 240 | extern int _binary_nameic_ppm_size; |
243 | extern int _binary_nameic_ppm_size; |
| - | 244 | /** Redraws console graphics */ |
|
| 241 | static void gcons_redraw_console(void) |
245 | static void gcons_redraw_console(void) |
| 242 | { |
246 | { |
| 243 | int i; |
247 | int i; |
| 244 | size_t hsize = (size_t)&_binary_helenos_ppm_size; |
248 | size_t hsize = (size_t)&_binary_helenos_ppm_size; |
| 245 | 249 | ||
| Line 250... | Line 254... | ||
| 250 | set_style(MAIN_COLOR, MAIN_COLOR); |
254 | set_style(MAIN_COLOR, MAIN_COLOR); |
| 251 | clear(); |
255 | clear(); |
| 252 | draw_pixmap(_binary_helenos_ppm_start, (size_t)&_binary_helenos_ppm_size, xres-66, 2); |
256 | draw_pixmap(_binary_helenos_ppm_start, (size_t)&_binary_helenos_ppm_size, xres-66, 2); |
| 253 | draw_pixmap(_binary_nameic_ppm_start, (size_t)&_binary_nameic_ppm_size, 5, 17); |
257 | draw_pixmap(_binary_nameic_ppm_start, (size_t)&_binary_nameic_ppm_size, 5, 17); |
| 254 | 258 | ||
| 255 | - | ||
| 256 | for (i=0;i < CONSOLE_COUNT; i++) |
259 | for (i=0;i < CONSOLE_COUNT; i++) |
| 257 | redraw_state(i); |
260 | redraw_state(i); |
| 258 | vp_switch(console_vp); |
261 | vp_switch(console_vp); |
| 259 | } |
262 | } |
| 260 | 263 | ||
| - | 264 | /** Creates a pixmap on framebuffer |
|
| - | 265 | * |
|
| - | 266 | * @param data PPM data |
|
| - | 267 | * @param size PPM data size |
|
| - | 268 | * @return Pixmap identification |
|
| - | 269 | */ |
|
| 261 | static int make_pixmap(char *data, int size) |
270 | static int make_pixmap(char *data, int size) |
| 262 | { |
271 | { |
| 263 | char *shm; |
272 | char *shm; |
| 264 | int rc; |
273 | int rc; |
| 265 | int pxid = -1; |
274 | int pxid = -1; |