Changeset 18b6a88 in mainline for uspace/srv/hid
- Timestamp:
- 2018-04-15T09:35:04Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1f44ca
- Parents:
- 8ebe212
- Location:
- uspace/srv/hid
- Files:
-
- 2 edited
-
compositor/compositor.c (modified) (12 diffs)
-
rfb/rfb.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/compositor/compositor.c
r8ebe212 r18b6a88 488 488 if (y_bnd_ghost == y_dmg_ghost) { 489 489 for (sysarg_t x = x_dmg_ghost - vp->pos.x; 490 x < x_dmg_ghost - vp->pos.x + w_dmg_ghost; ++x) {490 x < x_dmg_ghost - vp->pos.x + w_dmg_ghost; ++x) { 491 491 ghost_color = surface_get_pixel(vp->surface, 492 492 x, y_dmg_ghost - vp->pos.y); … … 498 498 if (y_bnd_ghost + h_bnd_ghost == y_dmg_ghost + h_dmg_ghost) { 499 499 for (sysarg_t x = x_dmg_ghost - vp->pos.x; 500 x < x_dmg_ghost - vp->pos.x + w_dmg_ghost; ++x) {500 x < x_dmg_ghost - vp->pos.x + w_dmg_ghost; ++x) { 501 501 ghost_color = surface_get_pixel(vp->surface, 502 502 x, y_dmg_ghost - vp->pos.y + h_dmg_ghost - 1); … … 508 508 if (x_bnd_ghost == x_dmg_ghost) { 509 509 for (sysarg_t y = y_dmg_ghost - vp->pos.y; 510 y < y_dmg_ghost - vp->pos.y + h_dmg_ghost; ++y) {510 y < y_dmg_ghost - vp->pos.y + h_dmg_ghost; ++y) { 511 511 ghost_color = surface_get_pixel(vp->surface, 512 512 x_dmg_ghost - vp->pos.x, y); … … 518 518 if (x_bnd_ghost + w_bnd_ghost == x_dmg_ghost + w_dmg_ghost) { 519 519 for (sysarg_t y = y_dmg_ghost - vp->pos.y; 520 y < y_dmg_ghost - vp->pos.y + h_dmg_ghost; ++y) {520 y < y_dmg_ghost - vp->pos.y + h_dmg_ghost; ++y) { 521 521 ghost_color = surface_get_pixel(vp->surface, 522 522 x_dmg_ghost - vp->pos.x + w_dmg_ghost - 1, y); … … 562 562 while (count-- != 0) { 563 563 *dst = (*src & 0xff000000) ? *src : *dst; 564 ++dst; ++src; 564 ++dst; 565 ++src; 565 566 } 566 567 } … … 1347 1348 if (fy > 0) { 1348 1349 #if ANIMATE_WINDOW_TRANSFORMS == 0 1349 if (scale) win->fy *= fy; 1350 if (scale) 1351 win->fy *= fy; 1350 1352 #endif 1351 1353 #if ANIMATE_WINDOW_TRANSFORMS == 1 … … 1449 1451 1450 1452 if (w_i == 0 || h_i == 0) { 1451 rect1->x = x_u; rect2->x = 0; rect3->x = 0; rect4->x = 0; 1452 rect1->y = y_u; rect2->y = 0; rect3->y = 0; rect4->y = 0; 1453 rect1->w = w_u; rect2->w = 0; rect3->w = 0; rect4->w = 0; 1454 rect1->h = h_u; rect2->h = 0; rect3->h = 0; rect4->h = 0; 1453 rect1->x = x_u; 1454 rect2->x = 0; 1455 rect3->x = 0; 1456 rect4->x = 0; 1457 1458 rect1->y = y_u; 1459 rect2->y = 0; 1460 rect3->y = 0; 1461 rect4->y = 0; 1462 1463 rect1->w = w_u; 1464 rect2->w = 0; 1465 rect3->w = 0; 1466 rect4->w = 0; 1467 1468 rect1->h = h_u; 1469 rect2->h = 0; 1470 rect3->h = 0; 1471 rect4->h = 0; 1455 1472 } else { 1456 1473 rect1->x = x_u; … … 1477 1494 #endif 1478 1495 1479 static errno_t comp_abs_move(input_t *input, unsigned x , unsigned y,1496 static errno_t comp_abs_move(input_t *input, unsigned x, unsigned y, 1480 1497 unsigned max_x, unsigned max_y) 1481 1498 { … … 1526 1543 sysarg_t cursor_height; 1527 1544 surface_get_resolution(pointer->cursor.states[pointer->state], 1528 &cursor_width, &cursor_height);1545 &cursor_width, &cursor_height); 1529 1546 1530 1547 if (pointer->pos.x + dx < viewport_bound_rect.x) … … 1788 1805 1789 1806 #if ANIMATE_WINDOW_TRANSFORMS == 0 1790 comp_damage(dmg_rect1.x, dmg_rect1.y, dmg_rect1.w, dmg_rect1.h);1791 comp_damage(dmg_rect2.x, dmg_rect2.y, dmg_rect2.w, dmg_rect2.h);1792 comp_damage(dmg_rect3.x, dmg_rect3.y, dmg_rect3.w, dmg_rect3.h);1793 comp_damage(dmg_rect4.x, dmg_rect4.y, dmg_rect4.w, dmg_rect4.h);1807 comp_damage(dmg_rect1.x, dmg_rect1.y, dmg_rect1.w, dmg_rect1.h); 1808 comp_damage(dmg_rect2.x, dmg_rect2.y, dmg_rect2.w, dmg_rect2.h); 1809 comp_damage(dmg_rect3.x, dmg_rect3.y, dmg_rect3.w, dmg_rect3.h); 1810 comp_damage(dmg_rect4.x, dmg_rect4.y, dmg_rect4.w, dmg_rect4.h); 1794 1811 #endif 1795 1812 … … 1826 1843 keymod_t mods, wchar_t c) 1827 1844 { 1828 bool win_transform = (mods & KM_ALT) && (1829 key == KC_W || key == KC_S || key == KC_A || key == KC_D ||1845 bool win_transform = (mods & KM_ALT) && 1846 (key == KC_W || key == KC_S || key == KC_A || key == KC_D || 1830 1847 key == KC_Q || key == KC_E || key == KC_R || key == KC_F); 1831 bool win_resize = (mods & KM_ALT) && ( 1832 key == KC_T || key == KC_G || key == KC_B || key == KC_N); 1833 bool win_opacity = (mods & KM_ALT) && ( 1834 key == KC_C || key == KC_V); 1848 bool win_resize = (mods & KM_ALT) && 1849 (key == KC_T || key == KC_G || key == KC_B || key == KC_N); 1850 bool win_opacity = (mods & KM_ALT) && (key == KC_C || key == KC_V); 1835 1851 bool win_close = (mods & KM_ALT) && (key == KC_X); 1836 1852 bool win_switch = (mods & KM_ALT) && (key == KC_TAB); 1837 bool viewport_move = (mods & KM_ALT) && ( 1838 key == KC_I || key == KC_K || key == KC_J || key == KC_L); 1839 bool viewport_change = (mods & KM_ALT) && ( 1840 key == KC_O || key == KC_P); 1853 bool viewport_move = (mods & KM_ALT) && 1854 (key == KC_I || key == KC_K || key == KC_J || key == KC_L); 1855 bool viewport_change = (mods & KM_ALT) && (key == KC_O || key == KC_P); 1841 1856 bool kconsole_switch = (key == KC_PAUSE) || (key == KC_BREAK); 1842 1857 bool filter_switch = (mods & KM_ALT) && (key == KC_Y); … … 2120 2135 if (filter_index == 0) { 2121 2136 filter = filter_nearest; 2122 } 2123 else { 2137 } else { 2124 2138 filter = filter_bilinear; 2125 2139 } -
uspace/srv/hid/rfb/rfb.c
r8ebe212 r18b6a88 83 83 84 84 /** Receive count characters (with buffering) */ 85 __attribute__((warn_unused_result))86 static errno_trecv_chars(tcp_conn_t *conn, char *c, size_t count)85 static errno_t __attribute__((warn_unused_result)) 86 recv_chars(tcp_conn_t *conn, char *c, size_t count) 87 87 { 88 88 for (size_t i = 0; i < count; i++) { … … 217 217 } 218 218 219 __attribute__((warn_unused_result))220 static errno_trecv_message(tcp_conn_t *conn, char type, void *buf, size_t size)219 static errno_t __attribute__((warn_unused_result)) 220 recv_message(tcp_conn_t *conn, char type, void *buf, size_t size) 221 221 { 222 222 memcpy(buf, &type, 1); 223 return recv_chars(conn, ((char *) buf) + 1, size - 1);223 return recv_chars(conn, ((char *) buf) + 1, size - 1); 224 224 } 225 225 … … 236 236 if (free && first_free_index == -1) { 237 237 first_free_index = i; 238 } 239 else if (!free && RED(rfb->palette[i]) == RED(pixel) && 238 } else if (!free && RED(rfb->palette[i]) == RED(pixel) && 240 239 GREEN(rfb->palette[i]) == GREEN(pixel) && 241 240 BLUE(rfb->palette[i]) == BLUE(pixel)) { … … 268 267 uint8_t pix8 = pix; 269 268 memcpy(buf, &pix8, 1); 270 } 271 else if (pf->bpp == 16) { 269 } else if (pf->bpp == 16) { 272 270 uint16_t pix16 = pix; 273 271 if (pf->big_endian) { 274 272 pix16 = host2uint16_t_be(pix16); 275 } 276 else { 273 } else { 277 274 pix16 = host2uint16_t_le(pix16); 278 275 } 279 276 memcpy(buf, &pix16, 2); 280 } 281 else if (pf->bpp == 32) { 277 } else if (pf->bpp == 32) { 282 278 if (pf->big_endian) { 283 279 pix = host2uint32_t_be(pix); 284 } 285 else { 280 } else { 286 281 pix = host2uint32_t_le(pix); 287 282 } … … 294 289 if (rfb->pixel_format.true_color) { 295 290 rfb_encode_true_color(&rfb->pixel_format, buf, pixel); 296 } 297 else { 291 } else { 298 292 rfb_encode_index(rfb, buf, pixel); 299 293 } … … 366 360 367 361 typedef enum { 368 COMP_NONE, COMP_SKIP_START, COMP_SKIP_END 362 COMP_NONE, 363 COMP_SKIP_START, 364 COMP_SKIP_END 369 365 } cpixel_compress_type_t; 370 366 … … 387 383 if (pixel_format->big_endian) { 388 384 mask = host2uint32_t_be(mask); 389 } 390 else { 385 } else { 391 386 mask = host2uint32_t_le(mask); 392 387 } … … 396 391 ctx->compress_type = COMP_SKIP_START; 397 392 ctx->size = 3; 398 } 399 else if (mask_data[3] == 0) { 393 } else if (mask_data[3] == 0) { 400 394 ctx->compress_type = COMP_SKIP_END; 401 395 ctx->size = 3; … … 509 503 size_t buf_size = sizeof(rfb_framebuffer_update_t) + 510 504 sizeof(rfb_rectangle_t) * 1 + 511 rfb_rect_encode_raw(rfb, &rfb->damage_rect, NULL) 512 ; 505 rfb_rect_encode_raw(rfb, &rfb->damage_rect, NULL); 513 506 514 507 void *buf = malloc(buf_size); … … 534 527 rect->enctype = RFB_ENCODING_TRLE; 535 528 pos += rfb_rect_encode_trle(rfb, rect, pos); 536 } 537 else { 529 } else { 538 530 rect->enctype = RFB_ENCODING_RAW; 539 531 pos += rfb_rect_encode_raw(rfb, rect, pos); … … 583 575 pixel_format->g_max, pixel_format->g_shift, pixel_format->b_max, 584 576 pixel_format->b_shift); 585 } 586 else { 577 } else { 587 578 if (rfb->palette == NULL) { 588 579 rfb->palette = malloc(sizeof(pixel_t) * 256); … … 675 666 server_init->width = rfb->width; 676 667 server_init->height = rfb->height; 677 server_init->pixel_format = rfb->pixel_format ,668 server_init->pixel_format = rfb->pixel_format; 678 669 server_init->name_length = name_length; 679 670 rfb_server_init_to_be(server_init, server_init);
Note:
See TracChangeset
for help on using the changeset viewer.
