Changeset 7bdcc45 in mainline for uspace/srv/hid/fb
- Timestamp:
- 2010-12-16T16:38:49Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7837101
- Parents:
- 8e58f94 (diff), eb221e5 (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. - Location:
- uspace/srv/hid/fb
- Files:
-
- 5 edited
-
ega.c (modified) (5 diffs)
-
fb.c (modified) (9 diffs)
-
main.c (modified) (1 diff)
-
serial_console.c (modified) (9 diffs)
-
serial_console.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/ega.c
r8e58f94 r7bdcc45 230 230 static int save_screen(void) 231 231 { 232 ipcarg_t i;232 sysarg_t i; 233 233 234 234 /* Find empty screen */ … … 245 245 } 246 246 247 static int print_screen( ipcarg_t i)247 static int print_screen(sysarg_t i) 248 248 { 249 249 if ((i >= MAX_SAVED_SCREENS) || (saved_screens[i].data)) … … 276 276 wchar_t c; 277 277 278 ipcarg_t col;279 ipcarg_t row;280 ipcarg_t w;281 ipcarg_t h;278 sysarg_t col; 279 sysarg_t row; 280 sysarg_t w; 281 sysarg_t h; 282 282 283 283 ssize_t rows; … … 290 290 uint32_t bg_rgb; 291 291 292 ipcarg_t scr;292 sysarg_t scr; 293 293 int retval; 294 294 295 switch (IPC_GET_ METHOD(call)) {295 switch (IPC_GET_IMETHOD(call)) { 296 296 case IPC_M_PHONE_HUNGUP: 297 297 client_connected = 0; … … 370 370 371 371 if (rows >= 0) { 372 if (( ipcarg_t) rows > scr_height) {372 if ((sysarg_t) rows > scr_height) { 373 373 retval = EINVAL; 374 374 break; 375 375 } 376 376 } else { 377 if (( ipcarg_t) (-rows) > scr_height) {377 if ((sysarg_t) (-rows) > scr_height) { 378 378 retval = EINVAL; 379 379 break; -
uspace/srv/hid/fb/fb.c
r8e58f94 r7bdcc45 199 199 static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a); 200 200 static int rgb_from_style(attr_rgb_t *rgb, int style); 201 static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,202 ipcarg_t bg_color, ipcarg_t flags);203 204 static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,205 ipcarg_t bg_color, ipcarg_t attr);201 static int rgb_from_idx(attr_rgb_t *rgb, sysarg_t fg_color, 202 sysarg_t bg_color, sysarg_t flags); 203 204 static int fb_set_color(viewport_t *vport, sysarg_t fg_color, 205 sysarg_t bg_color, sysarg_t attr); 206 206 207 207 static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor, … … 1072 1072 1073 1073 static unsigned char *shm = NULL; 1074 static ipcarg_t shm_id = 0;1074 static sysarg_t shm_id = 0; 1075 1075 static size_t shm_size; 1076 1076 … … 1083 1083 unsigned int h; 1084 1084 1085 switch (IPC_GET_ METHOD(*call)) {1085 switch (IPC_GET_IMETHOD(*call)) { 1086 1086 case IPC_M_SHARE_OUT: 1087 1087 /* We accept one area for data interchange */ … … 1360 1360 int newval; 1361 1361 1362 switch (IPC_GET_ METHOD(*call)) {1362 switch (IPC_GET_IMETHOD(*call)) { 1363 1363 case FB_ANIM_CREATE: 1364 1364 nvp = IPC_GET_ARG1(*call); … … 1435 1435 break; 1436 1436 } 1437 newval = (IPC_GET_ METHOD(*call) == FB_ANIM_START);1437 newval = (IPC_GET_IMETHOD(*call) == FB_ANIM_START); 1438 1438 if (newval ^ animations[i].enabled) { 1439 1439 animations[i].enabled = newval; … … 1459 1459 int i, nvp; 1460 1460 1461 switch (IPC_GET_ METHOD(*call)) {1461 switch (IPC_GET_IMETHOD(*call)) { 1462 1462 case FB_VP_DRAW_PIXMAP: 1463 1463 nvp = IPC_GET_ARG1(*call); … … 1529 1529 } 1530 1530 1531 static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,1532 ipcarg_t bg_color, ipcarg_t flags)1531 static int rgb_from_idx(attr_rgb_t *rgb, sysarg_t fg_color, 1532 sysarg_t bg_color, sysarg_t flags) 1533 1533 { 1534 1534 fg_color = (fg_color & 7) | ((flags & CATTR_BRIGHT) ? 8 : 0); … … 1562 1562 } 1563 1563 1564 static int fb_set_style(viewport_t *vport, ipcarg_t style)1564 static int fb_set_style(viewport_t *vport, sysarg_t style) 1565 1565 { 1566 1566 return rgb_from_style(&vport->attr, (int) style); 1567 1567 } 1568 1568 1569 static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,1570 ipcarg_t bg_color, ipcarg_t flags)1569 static int fb_set_color(viewport_t *vport, sysarg_t fg_color, 1570 sysarg_t bg_color, sysarg_t flags) 1571 1571 { 1572 1572 return rgb_from_idx(&vport->attr, fg_color, bg_color, flags); … … 1621 1621 continue; 1622 1622 1623 switch (IPC_GET_ METHOD(call)) {1623 switch (IPC_GET_IMETHOD(call)) { 1624 1624 case IPC_M_PHONE_HUNGUP: 1625 1625 client_connected = false; -
uspace/srv/hid/fb/main.c
r8e58f94 r7bdcc45 114 114 return -1; 115 115 116 ipcarg_t phonead;116 sysarg_t phonead; 117 117 if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) 118 118 return -1; -
uspace/srv/hid/fb/serial_console.c
r8e58f94 r7bdcc45 47 47 #include <io/style.h> 48 48 #include <str.h> 49 #include <inttypes.h> 49 50 #include <io/screenbuffer.h> 50 51 … … 54 55 #define MAX_CONTROL 20 55 56 56 static ipcarg_t scr_width;57 static ipcarg_t scr_height;57 static sysarg_t scr_width; 58 static sysarg_t scr_height; 58 59 static bool color = true; /**< True if producing color output. */ 59 60 static bool utf8 = false; /**< True if producing UTF8 output. */ 60 61 static putc_function_t putc_function; 61 62 62 static ipcarg_t lastcol = 0;63 static ipcarg_t lastrow = 0;63 static sysarg_t lastcol = 0; 64 static sysarg_t lastrow = 0; 64 65 static attrs_t cur_attr = { 65 66 .t = at_style, … … 129 130 } 130 131 131 void serial_goto(const ipcarg_t col, const ipcarg_t row)132 void serial_goto(const sysarg_t col, const sysarg_t row) 132 133 { 133 134 if ((col > scr_width) || (row > scr_height)) … … 135 136 136 137 char control[MAX_CONTROL]; 137 snprintf(control, MAX_CONTROL, "\033[%u;%uf", row + 1, col + 1); 138 snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f", 139 row + 1, col + 1); 138 140 serial_puts(control); 139 141 } … … 250 252 251 253 /** Set scrolling region. */ 252 void serial_set_scroll_region( ipcarg_t last_row)254 void serial_set_scroll_region(sysarg_t last_row) 253 255 { 254 256 char control[MAX_CONTROL]; 255 snprintf(control, MAX_CONTROL, "\033[0;% ur", last_row);257 snprintf(control, MAX_CONTROL, "\033[0;%" PRIun "r", last_row); 256 258 serial_puts(control); 257 259 } … … 267 269 } 268 270 269 void serial_console_init(putc_function_t putc_fn, ipcarg_t w, ipcarg_t h)271 void serial_console_init(putc_function_t putc_fn, sysarg_t w, sysarg_t h) 270 272 { 271 273 scr_width = w; … … 284 286 * 285 287 */ 286 static void draw_text_data(keyfield_t *data, ipcarg_t x0, ipcarg_t y0,287 ipcarg_t width, ipcarg_t height)288 static void draw_text_data(keyfield_t *data, sysarg_t x0, sysarg_t y0, 289 sysarg_t width, sysarg_t height) 288 290 { 289 291 attrs_t *a0 = &data[0].attrs; 290 292 serial_set_attrs(a0); 291 293 292 ipcarg_t y;294 sysarg_t y; 293 295 for (y = 0; y < height; y++) { 294 296 serial_goto(x0, y0 + y); 295 297 296 ipcarg_t x;298 sysarg_t x; 297 299 for (x = 0; x < width; x++) { 298 300 attrs_t *attr = &data[y * width + x].attrs; … … 335 337 336 338 wchar_t c; 337 ipcarg_t col;338 ipcarg_t row;339 ipcarg_t w;340 ipcarg_t h;339 sysarg_t col; 340 sysarg_t row; 341 sysarg_t w; 342 sysarg_t h; 341 343 ssize_t rows; 342 344 343 345 int retval; 344 346 345 switch (IPC_GET_ METHOD(call)) {347 switch (IPC_GET_IMETHOD(call)) { 346 348 case IPC_M_PHONE_HUNGUP: 347 349 client_connected = 0; … … 440 442 441 443 if (rows >= 0) { 442 if (( ipcarg_t) rows > scr_height) {444 if ((sysarg_t) rows > scr_height) { 443 445 retval = EINVAL; 444 446 break; 445 447 } 446 448 } else { 447 if (( ipcarg_t) (-rows) > scr_height) {449 if ((sysarg_t) (-rows) > scr_height) { 448 450 retval = EINVAL; 449 451 break; -
uspace/srv/hid/fb/serial_console.h
r8e58f94 r7bdcc45 44 44 45 45 extern void serial_puts(const char *); 46 extern void serial_goto(const ipcarg_t, const ipcarg_t);46 extern void serial_goto(const sysarg_t, const sysarg_t); 47 47 extern void serial_clrscr(void); 48 48 extern void serial_scroll(ssize_t); 49 49 extern void serial_cursor_disable(void); 50 50 extern void serial_cursor_enable(void); 51 extern void serial_set_scroll_region( ipcarg_t);52 extern void serial_console_init(putc_function_t, ipcarg_t, ipcarg_t);51 extern void serial_set_scroll_region(sysarg_t); 52 extern void serial_console_init(putc_function_t, sysarg_t, sysarg_t); 53 53 extern void serial_client_connection(ipc_callid_t, ipc_call_t *); 54 54
Note:
See TracChangeset
for help on using the changeset viewer.
