Changeset 159776f in mainline
- Timestamp:
- 2019-10-10T10:17:17Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 78a71936
- Parents:
- bef51cf
- git-author:
- Jiri Svoboda <jiri@…> (2019-10-09 17:07:14)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-10-10 10:17:17)
- Location:
- uspace/srv/hid/display
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/display.c
rbef51cf r159776f 36 36 #include <disp_srv.h> 37 37 #include <errno.h> 38 #include <gfx/context.h> 38 39 #include <io/log.h> 39 40 #include <stdlib.h> … … 85 86 /** Create display. 86 87 * 88 * @param gc Graphics context for displaying output 87 89 * @param rdisp Place to store pointer to new display. 88 90 * @return EOK on success, ENOMEM if out of memory 89 91 */ 90 errno_t ds_display_create( ds_display_t **rdisp)92 errno_t ds_display_create(gfx_context_t *gc, ds_display_t **rdisp) 91 93 { 92 94 ds_display_t *disp; … … 98 100 list_initialize(&disp->windows); 99 101 disp->next_wnd_id = 1; 102 disp->gc = gc; 100 103 *rdisp = disp; 101 104 return EOK; -
uspace/srv/hid/display/display.h
rbef51cf r159776f 27 27 */ 28 28 29 /** @addtogroup inet29 /** @addtogroup display 30 30 * @{ 31 31 */ … … 40 40 #include <disp_srv.h> 41 41 #include <errno.h> 42 #include <gfx/context.h> 42 43 #include "types/display/display.h" 43 44 #include "types/display/window.h" … … 45 46 extern display_ops_t display_srv_ops; 46 47 47 extern errno_t ds_display_create( ds_display_t **);48 extern errno_t ds_display_create(gfx_context_t *, ds_display_t **); 48 49 extern void ds_display_destroy(ds_display_t *); 49 50 extern errno_t ds_display_add_window(ds_display_t *, ds_window_t *); -
uspace/srv/hid/display/main.c
rbef51cf r159776f 7 7 * are met: 8 8 * 9 * - Redistribution s of source code must retain the above copyright9 * - Redistribution1s of source code must retain the above copyright 10 10 * notice, this list of conditions and the following disclaimer. 11 11 * - Redistributions in binary form must reproduce the above copyright … … 46 46 #include <task.h> 47 47 #include "display.h" 48 #include "output.h" 48 49 #include "window.h" 49 50 … … 56 57 { 57 58 ds_display_t *disp = NULL; 59 gfx_context_t *gc = NULL; 58 60 errno_t rc; 59 61 60 rc = ds_display_create(&disp); 62 rc = output_init(&gc); 63 if (rc != EOK) 64 goto error; 65 66 rc = ds_display_create(gc, &disp); 61 67 if (rc != EOK) 62 68 goto error; … … 82 88 return EOK; 83 89 error: 90 if (gc != NULL) 91 gfx_context_delete(gc); 84 92 if (disp != NULL) 85 93 ds_display_destroy(disp); -
uspace/srv/hid/display/meson.build
rbef51cf r159776f 32 32 'display.c', 33 33 'main.c', 34 'output.c', 34 35 'window.c', 35 36 ) -
uspace/srv/hid/display/test/display.c
rbef51cf r159776f 45 45 errno_t rc; 46 46 47 rc = ds_display_create( &disp);47 rc = ds_display_create(NULL, &disp); 48 48 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 49 49 … … 59 59 errno_t rc; 60 60 61 rc = ds_display_create( &disp);61 rc = ds_display_create(NULL, &disp); 62 62 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 63 63 -
uspace/srv/hid/display/test/window.c
rbef51cf r159776f 47 47 errno_t rc; 48 48 49 rc = ds_display_create( &disp);49 rc = ds_display_create(NULL, &disp); 50 50 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 51 51 -
uspace/srv/hid/display/types/display/display.h
rbef51cf r159776f 38 38 39 39 #include <adt/list.h> 40 #include <gfx/context.h> 40 41 #include "window.h" 41 42 … … 45 46 /** Next ID to assign to a window */ 46 47 ds_wnd_id_t next_wnd_id; 48 /** Output GC */ 49 gfx_context_t *gc; 47 50 } ds_display_t; 48 51 -
uspace/srv/hid/display/window.c
rbef51cf r159776f 65 65 ds_window_t *wnd = (ds_window_t *) arg; 66 66 67 (void) wnd;68 67 log_msg(LOG_DEFAULT, LVL_NOTE, "gc_set_color"); 69 return EOK;68 return gfx_set_color(wnd->display->gc, color); 70 69 } 71 70 … … 81 80 ds_window_t *wnd = (ds_window_t *) arg; 82 81 83 (void) wnd;84 82 log_msg(LOG_DEFAULT, LVL_NOTE, "gc_fill_rect"); 85 return EOK;83 return gfx_fill_rect(wnd->display->gc, rect); 86 84 } 87 85
Note:
See TracChangeset
for help on using the changeset viewer.