Changeset fd777a2 in mainline
- Timestamp:
- 2019-11-29T23:58:15Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 879d7245
- Parents:
- cf32dbd
- Location:
- uspace/srv/hid/display
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/client.c
rcf32dbd rfd777a2 93 93 * @param client client 94 94 * @param wnd Window 95 * @return EOK on success, ENOMEM if there are no free window identifiers 96 */ 97 errno_t ds_client_add_window(ds_client_t *client, ds_window_t *wnd) 95 */ 96 void ds_client_add_window(ds_client_t *client, ds_window_t *wnd) 98 97 { 99 98 assert(wnd->client == NULL); 100 assert(!link_used(&wnd->l windows));99 assert(!link_used(&wnd->lcwindows)); 101 100 102 101 wnd->client = client; 103 102 wnd->id = client->display->next_wnd_id++; 104 list_append(&wnd->lwindows, &client->windows); 105 106 return EOK; 103 list_append(&wnd->lcwindows, &client->windows); 107 104 } 108 105 … … 122 119 } 123 120 124 list_remove(&wnd->l windows);121 list_remove(&wnd->lcwindows); 125 122 wnd->client = NULL; 126 123 } … … 162 159 return NULL; 163 160 164 return list_get_instance(link, ds_window_t, l windows);161 return list_get_instance(link, ds_window_t, lcwindows); 165 162 } 166 163 … … 172 169 ds_window_t *ds_client_next_window(ds_window_t *wnd) 173 170 { 174 link_t *link = list_next(&wnd->l windows, &wnd->client->windows);171 link_t *link = list_next(&wnd->lcwindows, &wnd->client->windows); 175 172 176 173 if (link == NULL) 177 174 return NULL; 178 175 179 return list_get_instance(link, ds_window_t, l windows);176 return list_get_instance(link, ds_window_t, lcwindows); 180 177 } 181 178 -
uspace/srv/hid/display/client.h
rcf32dbd rfd777a2 45 45 ds_client_t **); 46 46 extern void ds_client_destroy(ds_client_t *); 47 extern errno_tds_client_add_window(ds_client_t *, ds_window_t *);47 extern void ds_client_add_window(ds_client_t *, ds_window_t *); 48 48 extern void ds_client_remove_window(ds_window_t *); 49 49 extern ds_window_t *ds_client_find_window(ds_client_t *, ds_wnd_id_t); -
uspace/srv/hid/display/display.c
rcf32dbd rfd777a2 61 61 disp->next_wnd_id = 1; 62 62 list_initialize(&disp->seats); 63 list_initialize(&disp->windows); 63 64 *rdisp = disp; 64 65 return EOK; … … 163 164 } 164 165 166 /** Add window to display. 167 * 168 * @param display Display 169 * @param wnd Window 170 */ 171 void ds_display_add_window(ds_display_t *display, ds_window_t *wnd) 172 { 173 assert(wnd->display == NULL); 174 assert(!link_used(&wnd->ldwindows)); 175 176 wnd->display = display; 177 list_prepend(&wnd->ldwindows, &display->windows); 178 } 179 180 /** Remove window from display. 181 * 182 * @param wnd Window 183 */ 184 void ds_display_remove_window(ds_window_t *wnd) 185 { 186 list_remove(&wnd->ldwindows); 187 wnd->display = NULL; 188 } 189 190 /** Get first window in display. 191 * 192 * @param display Display 193 * @return First window or @c NULL if there is none 194 */ 195 ds_window_t *ds_display_first_window(ds_display_t *display) 196 { 197 link_t *link = list_first(&display->windows); 198 199 if (link == NULL) 200 return NULL; 201 202 return list_get_instance(link, ds_window_t, ldwindows); 203 } 204 205 /** Get next window in client. 206 * 207 * @param wnd Current window 208 * @return Next window or @c NULL if there is none 209 */ 210 ds_window_t *ds_display_next_window(ds_window_t *wnd) 211 { 212 link_t *link = list_next(&wnd->ldwindows, &wnd->display->windows); 213 214 if (link == NULL) 215 return NULL; 216 217 return list_get_instance(link, ds_window_t, ldwindows); 218 } 219 165 220 /** Post keyboard event to a display. 166 221 * -
uspace/srv/hid/display/display.h
rcf32dbd rfd777a2 51 51 extern ds_client_t *ds_display_next_client(ds_client_t *); 52 52 extern ds_window_t *ds_display_find_window(ds_display_t *, ds_wnd_id_t); 53 extern void ds_display_add_window(ds_display_t *, ds_window_t *); 54 extern void ds_display_remove_window(ds_window_t *); 55 extern ds_window_t *ds_display_first_window(ds_display_t *); 56 extern ds_window_t *ds_display_next_window(ds_window_t *); 53 57 extern errno_t ds_display_post_kbd_event(ds_display_t *, kbd_event_t *); 54 58 extern void ds_display_add_seat(ds_display_t *, ds_seat_t *); -
uspace/srv/hid/display/seat.c
rcf32dbd rfd777a2 82 82 83 83 if (seat->focus == wnd) { 84 /* Focus a different window. XXX Need list of all windows*/85 nwnd = ds_ client_next_window(wnd);84 /* Focus a different window. XXX Delegate to WM */ 85 nwnd = ds_display_next_window(wnd); 86 86 if (nwnd == NULL) 87 nwnd = ds_ client_first_window(wnd->client);87 nwnd = ds_display_first_window(wnd->display); 88 88 if (nwnd == wnd) 89 89 nwnd = NULL; -
uspace/srv/hid/display/types/display/display.h
rcf32dbd rfd777a2 62 62 /** Seats (of ds_seat_t) */ 63 63 list_t seats; 64 65 /** Windows (of ds_window_t) in stacking order */ 66 list_t windows; 64 67 } ds_display_t; 65 68 -
uspace/srv/hid/display/types/display/window.h
rcf32dbd rfd777a2 49 49 struct ds_client *client; 50 50 /** Link to @c client->windows */ 51 link_t lwindows; 51 link_t lcwindows; 52 /** Containing display */ 53 struct ds_display *display; 54 /** Link to @c display->windows */ 55 link_t ldwindows; 52 56 /** Display position */ 53 57 gfx_coord2_t dpos; -
uspace/srv/hid/display/window.c
rcf32dbd rfd777a2 205 205 206 206 ds_client_add_window(client, wnd); 207 ds_display_add_window(client->display, wnd); 207 208 208 209 wnd->gc = gc; … … 223 224 { 224 225 ds_client_remove_window(wnd); 226 ds_display_remove_window(wnd); 225 227 (void) gfx_context_delete(wnd->gc); 226 228
Note:
See TracChangeset
for help on using the changeset viewer.