Changeset e1f2079 in mainline for uspace/srv/hid/display
- Timestamp:
- 2020-02-14T19:54:40Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b0a94854
- Parents:
- b252e87
- Location:
- uspace/srv/hid/display
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/ddev.c
rb252e87 re1f2079 37 37 #include <ddev.h> 38 38 #include <errno.h> 39 #include <io/log.h> 39 40 #include <stdio.h> 40 41 #include <stdlib.h> … … 53 54 { 54 55 ds_ddev_t *ddev; 56 ddev_info_t info; 55 57 gfx_context_t *gc; 56 58 ddev_t *dd = NULL; … … 71 73 return rc; 72 74 } 75 76 rc = ddev_get_info(dd, &info); 77 if (rc != EOK) { 78 printf("Error getting information for display device '%s'.\n", 79 name); 80 free(name); 81 ddev_close(dd); 82 return rc; 83 } 84 85 log_msg(LOG_DEFAULT, LVL_NOTE, "Device rectangle for '%s': " 86 "%d,%d,%d,%d\n", name, info.rect.p0.x, info.rect.p0.y, 87 info.rect.p1.x, info.rect.p1.y); 73 88 74 89 rc = ddev_get_gc(dd, &gc); … … 91 106 ddev->dd = dd; 92 107 ddev->gc = gc; 108 ddev->info = info; 93 109 94 110 ds_display_add_ddev(display, ddev); -
uspace/srv/hid/display/display.c
rb252e87 re1f2079 384 384 assert(!link_used(&ddev->lddevs)); 385 385 386 /* Set display dimensions to dimensions of first display device */ 387 if (gfx_rect_is_empty(&disp->rect)) 388 disp->rect = ddev->info.rect; 389 386 390 ddev->display = disp; 387 391 list_append(&ddev->lddevs, &disp->ddevs); … … 447 451 errno_t ds_display_paint_bg(ds_display_t *disp, gfx_rect_t *rect) 448 452 { 449 gfx_rect_t dsrect;450 453 gfx_rect_t crect; 451 454 gfx_context_t *gc; 452 455 errno_t rc; 453 456 454 dsrect.p0.x = 0;455 dsrect.p0.y = 0;456 dsrect.p1.x = 1024;457 dsrect.p1.y = 768;458 459 457 if (rect != NULL) 460 gfx_rect_clip(&d srect, rect, &crect);458 gfx_rect_clip(&disp->rect, rect, &crect); 461 459 else 462 crect = d srect;460 crect = disp->rect; 463 461 464 462 gc = ds_display_get_gc(disp); // XXX -
uspace/srv/hid/display/seat.c
rb252e87 re1f2079 253 253 errno_t ds_seat_post_ptd_event(ds_seat_t *seat, ptd_event_t *event) 254 254 { 255 ds_display_t *disp = seat->display; 255 256 gfx_coord2_t npos; 256 257 ds_window_t *wnd; … … 287 288 288 289 gfx_coord2_add(&seat->pntpos, &event->dmove, &npos); 289 if (npos.x < 0) 290 npos.x = 0; 291 if (npos.y < 0) 292 npos.y = 0; 293 if (npos.x > 1024) 294 npos.x = 1024; 295 if (npos.y > 768) 296 npos.y = 768; 290 gfx_coord2_clip(&npos, &disp->rect, &npos); 297 291 298 292 printf("clear pointer\n"); -
uspace/srv/hid/display/types/display/ddev.h
rb252e87 re1f2079 52 52 /** Device GC */ 53 53 gfx_context_t *gc; 54 /** Display device information */ 55 ddev_info_t info; 54 56 /** Service ID */ 55 57 service_id_t svc_id; -
uspace/srv/hid/display/types/display/display.h
rb252e87 re1f2079 39 39 #include <adt/list.h> 40 40 #include <gfx/color.h> 41 #include <gfx/coord.h> 41 42 #include <io/input.h> 42 43 #include "window.h" … … 69 70 /** Background color */ 70 71 gfx_color_t *bg_color; 72 73 /** Bounding rectangle */ 74 gfx_rect_t rect; 71 75 } ds_display_t; 72 76
Note:
See TracChangeset
for help on using the changeset viewer.