- Timestamp:
- 2006-06-02T13:30:37Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb51e9a8
- Parents:
- bd929cfb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/fb.c
rbd929cfb r83b1d61 41 41 #include <kernel/errno.h> 42 42 #include <async.h> 43 43 44 #include "font-8x16.h" 44 45 #include "helenos.xbm" 45 46 #include "fb.h" 47 #include "main.h" 48 #include "../console/screenbuffer.h" 46 49 47 50 #define DEFAULT_BGCOLOR 0x000080 … … 459 462 } 460 463 464 static void draw_text_data(int vp, keyfield_t *data) 465 { 466 viewport_t *vport = &viewports[vp]; 467 int i; 468 char c; 469 470 clear_port(vp); 471 for (i=0; i < vport->cols * vport->rows; i++) { 472 if (data[i].character == ' ') /* TODO: && data[i].style==vport->style */ 473 continue; 474 draw_char(vp, data[i].character, i/vport->rows, i % vport->cols); 475 } 476 cursor_print(vp); 477 } 478 479 461 480 /** Function for handling connections to FB 462 481 * … … 470 489 unsigned int row,col; 471 490 char c; 491 keyfield_t *interbuffer = NULL; 492 size_t intersize = 0; 472 493 473 494 int vp = 0; … … 495 516 ipc_answer_fast(callid,0,0,0); 496 517 return; /* Exit thread */ 518 case IPC_M_AS_AREA_SEND: 519 /* We accept one area for data interchange */ 520 intersize = IPC_GET_ARG2(call); 521 receive_comm_area(callid,&call,(void **)&interbuffer, 522 sizeof(*interbuffer)*viewports[0].cols*viewports[0].rows); 523 continue; 524 525 case FB_DRAW_TEXT_DATA: 526 if (!interbuffer) { 527 retval = EINVAL; 528 break; 529 } 530 if (intersize < vport->cols*vport->rows*sizeof(*interbuffer)) { 531 retval = EINVAL; 532 break; 533 } 534 draw_text_data(vp, interbuffer); 535 retval = 0; 536 break; 497 537 case FB_PUTCHAR: 498 538 c = IPC_GET_ARG1(call);
Note:
See TracChangeset
for help on using the changeset viewer.