Changeset b3c185b6 in mainline for uspace/srv/hid/display/main.c
- Timestamp:
- 2019-11-04T14:05:35Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be15256
- Parents:
- 22faaf2
- git-author:
- Jiri Svoboda <jiri@…> (2019-10-03 18:05:09)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-11-04 14:05:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/main.c
r22faaf2 rb3c185b6 45 45 #include <stdio.h> 46 46 #include <task.h> 47 #include "client.h" 47 48 #include "display.h" 49 #include "main.h" 48 50 #include "output.h" 49 51 #include "window.h" 50 52 51 #define NAME "display" 53 static void display_client_conn(ipc_call_t *, void *); 52 54 53 static void display_client_conn(ipc_call_t *, void *); 55 static void display_kbd_event(void *arg, kbd_event_t *event) 56 { 57 ds_display_t *disp = (ds_display_t *) arg; 58 59 printf("display_kbd_event\n"); 60 ds_display_post_kbd_event(disp, event); 61 } 54 62 55 63 /** Initialize display server */ … … 60 68 errno_t rc; 61 69 62 rc = output_init(&gc); 70 log_msg(LOG_DEFAULT, LVL_DEBUG, "display_srv_init()"); 71 72 rc = ds_display_create(NULL, &disp); 63 73 if (rc != EOK) 64 74 goto error; 65 75 66 rc = ds_display_create(gc, &disp);76 rc = output_init(display_kbd_event, (void *) disp, &gc); 67 77 if (rc != EOK) 68 78 goto error; 69 79 70 log_msg(LOG_DEFAULT, LVL_DEBUG, "display_srv_init()"); 71 80 disp->gc = gc; 81 #if 0 82 rc = ds_input_open(disp); 83 if (rc != EOK) 84 goto error; 85 #endif 72 86 async_set_fallback_port_handler(display_client_conn, disp); 73 87 … … 88 102 return EOK; 89 103 error: 104 #if 0 105 if (disp->input != NULL) 106 ds_input_close(disp); 107 #endif 90 108 if (gc != NULL) 91 109 gfx_context_delete(gc); … … 101 119 sysarg_t wnd_id; 102 120 sysarg_t svc_id; 121 ds_client_t *client = NULL; 103 122 ds_window_t *wnd; 104 123 ds_display_t *disp = (ds_display_t *) arg; 105 124 gfx_context_t *gc; 125 errno_t rc; 106 126 107 127 log_msg(LOG_DEFAULT, LVL_NOTE, "display_client_conn arg1=%zu arg2=%zu arg3=%zu arg4=%zu.", … … 116 136 117 137 if (svc_id != 0) { 118 /* Display management */ 138 /* Create client object */ 139 rc = ds_client_create(disp, &srv, &client); 140 if (rc != EOK) { 141 async_answer_0(icall, ENOMEM); 142 return; 143 } 144 145 /* Set up protocol structure */ 119 146 srv.ops = &display_srv_ops; 120 srv.arg = disp;147 srv.arg = client; 121 148 149 /* Handle connection */ 122 150 display_conn(icall, &srv); 151 152 ds_client_destroy(client); 123 153 } else { 124 /* Window GC */ 154 /* Window GC connection */ 155 125 156 wnd = ds_display_find_window(disp, wnd_id); 126 157 if (wnd == NULL) { … … 132 163 gc_conn(icall, gc); 133 164 } 165 134 166 } 135 167
Note:
See TracChangeset
for help on using the changeset viewer.