Changeset 38e5f36c in mainline
- Timestamp:
- 2019-11-28T14:23:51Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cf32dbd
- Parents:
- 670cfcf
- git-author:
- Jiri Svoboda <jiri@…> (2019-11-27 18:23:41)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-11-28 14:23:51)
- Location:
- uspace/srv/hid/display
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/display.c
r670cfcf r38e5f36c 31 31 */ 32 32 /** 33 * @file Display management33 * @file Display server display 34 34 */ 35 35 36 #include <disp_srv.h>37 36 #include <errno.h> 38 37 #include <gfx/context.h> … … 42 41 #include "window.h" 43 42 #include "display.h" 44 45 static errno_t disp_window_create(void *, sysarg_t *);46 static errno_t disp_window_destroy(void *, sysarg_t);47 static errno_t disp_get_event(void *, sysarg_t *, display_wnd_ev_t *);48 49 display_ops_t display_srv_ops = {50 .window_create = disp_window_create,51 .window_destroy = disp_window_destroy,52 .get_event = disp_get_event53 };54 55 static errno_t disp_window_create(void *arg, sysarg_t *rwnd_id)56 {57 errno_t rc;58 ds_client_t *client = (ds_client_t *) arg;59 ds_window_t *wnd;60 61 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create()");62 63 rc = ds_window_create(client, &wnd);64 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create() - ds_window_create -> %d", rc);65 if (rc != EOK)66 return rc;67 68 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create() -> EOK, id=%zu",69 wnd->id);70 71 wnd->dpos.x = ((wnd->id - 1) & 1) * 400;72 wnd->dpos.y = ((wnd->id - 1) & 2) / 2 * 300;73 74 *rwnd_id = wnd->id;75 return EOK;76 }77 78 static errno_t disp_window_destroy(void *arg, sysarg_t wnd_id)79 {80 ds_client_t *client = (ds_client_t *) arg;81 ds_window_t *wnd;82 83 wnd = ds_client_find_window(client, wnd_id);84 if (wnd == NULL)85 return ENOENT;86 87 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_destroy()");88 ds_client_remove_window(wnd);89 ds_window_destroy(wnd);90 return EOK;91 }92 93 static errno_t disp_get_event(void *arg, sysarg_t *wnd_id,94 display_wnd_ev_t *event)95 {96 ds_client_t *client = (ds_client_t *) arg;97 ds_window_t *wnd;98 errno_t rc;99 100 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_get_event()");101 102 rc = ds_client_get_event(client, &wnd, event);103 if (rc != EOK)104 return rc;105 106 *wnd_id = wnd->id;107 return EOK;108 }109 43 110 44 /** Create display. -
uspace/srv/hid/display/display.h
r670cfcf r38e5f36c 31 31 */ 32 32 /** 33 * @file 34 * @brief 33 * @file Display server display 35 34 */ 36 35 … … 38 37 #define DISPLAY_H 39 38 40 #include <disp_srv.h>41 39 #include <errno.h> 42 40 #include <gfx/context.h> … … 44 42 #include "types/display/client.h" 45 43 #include "types/display/display.h" 46 47 extern display_ops_t display_srv_ops;48 44 49 45 extern errno_t ds_display_create(gfx_context_t *, ds_display_t **); -
uspace/srv/hid/display/main.c
r670cfcf r38e5f36c 47 47 #include "client.h" 48 48 #include "display.h" 49 #include "dsops.h" 49 50 #include "main.h" 50 51 #include "output.h" -
uspace/srv/hid/display/meson.build
r670cfcf r38e5f36c 32 32 'client.c', 33 33 'display.c', 34 'dsops.c', 34 35 'main.c', 35 36 'output.c',
Note:
See TracChangeset
for help on using the changeset viewer.