Changeset 984a9ba in mainline for uspace/lib/c/generic/io/input.c
- Timestamp:
- 2018-07-05T09:34:09Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63d46341
- Parents:
- 76f566d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/input.c
r76f566d r984a9ba 43 43 #include <stdlib.h> 44 44 45 static void input_cb_conn( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg);45 static void input_cb_conn(ipc_call_t *icall, void *arg); 46 46 47 47 errno_t input_open(async_sess_t *sess, input_ev_ops_t *ev_ops, … … 92 92 } 93 93 94 static void input_ev_active(input_t *input, cap_call_handle_t chandle, 95 ipc_call_t *call) 94 static void input_ev_active(input_t *input, ipc_call_t *call) 96 95 { 97 96 errno_t rc = input->ev_ops->active(input); 98 async_answer_0(chandle, rc); 99 } 100 101 static void input_ev_deactive(input_t *input, cap_call_handle_t chandle, 102 ipc_call_t *call) 97 async_answer_0(call, rc); 98 } 99 100 static void input_ev_deactive(input_t *input, ipc_call_t *call) 103 101 { 104 102 errno_t rc = input->ev_ops->deactive(input); 105 async_answer_0(chandle, rc); 106 } 107 108 static void input_ev_key(input_t *input, cap_call_handle_t chandle, 109 ipc_call_t *call) 103 async_answer_0(call, rc); 104 } 105 106 static void input_ev_key(input_t *input, ipc_call_t *call) 110 107 { 111 108 kbd_event_type_t type; … … 121 118 122 119 rc = input->ev_ops->key(input, type, key, mods, c); 123 async_answer_0(chandle, rc); 124 } 125 126 static void input_ev_move(input_t *input, cap_call_handle_t chandle, 127 ipc_call_t *call) 120 async_answer_0(call, rc); 121 } 122 123 static void input_ev_move(input_t *input, ipc_call_t *call) 128 124 { 129 125 int dx; … … 135 131 136 132 rc = input->ev_ops->move(input, dx, dy); 137 async_answer_0(chandle, rc); 138 } 139 140 static void input_ev_abs_move(input_t *input, cap_call_handle_t chandle, 141 ipc_call_t *call) 133 async_answer_0(call, rc); 134 } 135 136 static void input_ev_abs_move(input_t *input, ipc_call_t *call) 142 137 { 143 138 unsigned x; … … 153 148 154 149 rc = input->ev_ops->abs_move(input, x, y, max_x, max_y); 155 async_answer_0(chandle, rc); 156 } 157 158 static void input_ev_button(input_t *input, cap_call_handle_t chandle, 159 ipc_call_t *call) 150 async_answer_0(call, rc); 151 } 152 153 static void input_ev_button(input_t *input, ipc_call_t *call) 160 154 { 161 155 int bnum; … … 167 161 168 162 rc = input->ev_ops->button(input, bnum, press); 169 async_answer_0(c handle, rc);170 } 171 172 static void input_cb_conn( cap_call_handle_t icall_handle,ipc_call_t *icall, void *arg)173 { 174 input_t *input = (input_t *) arg;163 async_answer_0(call, rc); 164 } 165 166 static void input_cb_conn(ipc_call_t *icall, void *arg) 167 { 168 input_t *input = (input_t *) arg; 175 169 176 170 while (true) { 177 171 ipc_call_t call; 178 cap_call_handle_t chandle =async_get_call(&call);172 async_get_call(&call); 179 173 180 174 if (!IPC_GET_IMETHOD(call)) { … … 185 179 switch (IPC_GET_IMETHOD(call)) { 186 180 case INPUT_EVENT_ACTIVE: 187 input_ev_active(input, chandle,&call);181 input_ev_active(input, &call); 188 182 break; 189 183 case INPUT_EVENT_DEACTIVE: 190 input_ev_deactive(input, chandle,&call);184 input_ev_deactive(input, &call); 191 185 break; 192 186 case INPUT_EVENT_KEY: 193 input_ev_key(input, chandle,&call);187 input_ev_key(input, &call); 194 188 break; 195 189 case INPUT_EVENT_MOVE: 196 input_ev_move(input, chandle,&call);190 input_ev_move(input, &call); 197 191 break; 198 192 case INPUT_EVENT_ABS_MOVE: 199 input_ev_abs_move(input, chandle,&call);193 input_ev_abs_move(input, &call); 200 194 break; 201 195 case INPUT_EVENT_BUTTON: 202 input_ev_button(input, chandle,&call);196 input_ev_button(input, &call); 203 197 break; 204 198 default: 205 async_answer_0( chandle, ENOTSUP);199 async_answer_0(&call, ENOTSUP); 206 200 } 207 201 }
Note:
See TracChangeset
for help on using the changeset viewer.