Changeset 89c57b6 in mainline for uspace/srv/hid/console/gcons.c
- Timestamp:
- 2011-04-13T14:45:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 88634420
- Parents:
- cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/gcons.c
rcefb126 r89c57b6 34 34 35 35 #include <ipc/fb.h> 36 #include <ipc/ipc.h>37 36 #include <async.h> 38 37 #include <stdio.h> … … 82 81 83 82 static bool use_gcons = false; 84 static ipcarg_t xres;85 static ipcarg_t yres;83 static sysarg_t xres; 84 static sysarg_t yres; 86 85 87 86 enum butstate { … … 107 106 static size_t active_console = 0; 108 107 109 static ipcarg_t mouse_x = 0;110 static ipcarg_t mouse_y= 0;108 static sysarg_t mouse_x = 0; 109 static sysarg_t mouse_y= 0; 111 110 112 111 static bool btn_pressed = false; 113 static ipcarg_t btn_x = 0;114 static ipcarg_t btn_y = 0;112 static sysarg_t btn_x = 0; 113 static sysarg_t btn_y = 0; 115 114 116 115 static void vp_switch(int vp) … … 120 119 121 120 /** Create view port */ 122 static int vp_create( ipcarg_t x, ipcarg_t y, ipcarg_t width, ipcarg_t height)121 static int vp_create(sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height) 123 122 { 124 123 return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y, … … 137 136 138 137 /** Transparent putchar */ 139 static void tran_putch(wchar_t ch, ipcarg_t col, ipcarg_t row)138 static void tran_putch(wchar_t ch, sysarg_t col, sysarg_t row) 140 139 { 141 140 async_msg_3(fbphone, FB_PUTCHAR, ch, col, row); … … 157 156 158 157 char data[5]; 159 snprintf(data, 5, "% u", index + 1);158 snprintf(data, 5, "%zu", index + 1); 160 159 161 160 size_t i; … … 287 286 ssize_t ny = (ssize_t) mouse_y + dy; 288 287 288 /* Until gcons is initalized we don't have the screen resolution */ 289 if (xres == 0 || yres == 0) 290 return; 291 289 292 mouse_x = (size_t) limit(nx, 0, xres); 290 293 mouse_y = (size_t) limit(ny, 0, yres); … … 294 297 } 295 298 296 static int gcons_find_conbut( ipcarg_t x, ipcarg_t y)297 { 298 ipcarg_t status_start = STATUS_START + (xres - 800) / 2;299 static int gcons_find_conbut(sysarg_t x, sysarg_t y) 300 { 301 sysarg_t status_start = STATUS_START + (xres - 800) / 2; 299 302 300 303 if ((y < STATUS_TOP) || (y >= STATUS_TOP + STATUS_HEIGHT)) … … 310 313 return -1; 311 314 312 ipcarg_t btn = (x - status_start) / (STATUS_WIDTH + STATUS_SPACE);315 sysarg_t btn = (x - status_start) / (STATUS_WIDTH + STATUS_SPACE); 313 316 314 317 if (btn < CONSOLE_COUNT) … … 360 363 * 361 364 */ 362 static void draw_pixmap(char *logo, size_t size, ipcarg_t x, ipcarg_t y)365 static void draw_pixmap(char *logo, size_t size, sysarg_t x, sysarg_t y) 363 366 { 364 367 /* Create area */ … … 371 374 372 375 /* Send area */ 373 int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, ( ipcarg_t) shm);376 int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm); 374 377 if (rc) 375 378 goto exit; … … 433 436 434 437 /* Send area */ 435 int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, ( ipcarg_t) shm);438 int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm); 436 439 if (rc) 437 440 goto exit; … … 510 513 511 514 /* Create status buttons */ 512 ipcarg_t status_start = STATUS_START + (xres - 800) / 2;515 sysarg_t status_start = STATUS_START + (xres - 800) / 2; 513 516 size_t i; 514 517 for (i = 0; i < CONSOLE_COUNT; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.