Changeset b71c0fc in mainline for uspace/lib/ui/src/fixed.c
- Timestamp:
- 2020-11-07T16:07:22Z (3 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d55ab823
- Parents:
- fa01c05
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/fixed.c
rfa01c05 rb71c0fc 44 44 #include "../private/fixed.h" 45 45 46 static void ui_fixed_ctl_destroy(void *); 47 static errno_t ui_fixed_ctl_paint(void *); 48 static ui_evclaim_t ui_fixed_ctl_pos_event(void *, pos_event_t *); 49 50 /** Push button control ops */ 51 ui_control_ops_t ui_fixed_ops = { 52 .destroy = ui_fixed_ctl_destroy, 53 .paint = ui_fixed_ctl_paint, 54 .pos_event = ui_fixed_ctl_pos_event 55 }; 56 46 57 /** Create new fixed layout. 47 58 * … … 52 63 { 53 64 ui_fixed_t *fixed; 65 errno_t rc; 54 66 55 67 fixed = calloc(1, sizeof(ui_fixed_t)); 56 68 if (fixed == NULL) 57 69 return ENOMEM; 70 71 rc = ui_control_new(&ui_fixed_ops, (void *) fixed, &fixed->control); 72 if (rc != EOK) { 73 free(fixed); 74 return rc; 75 } 58 76 59 77 list_initialize(&fixed->elem); … … 83 101 } 84 102 103 ui_control_delete(fixed->control); 85 104 free(fixed); 105 } 106 107 /** Get base control from fixed layout. 108 * 109 * @param fixed Fixed layout 110 * @return Control 111 */ 112 ui_control_t *ui_fixed_ctl(ui_fixed_t *fixed) 113 { 114 return fixed->control; 86 115 } 87 116 … … 203 232 } 204 233 234 /** Destroy fixed layout control. 235 * 236 * @param arg Argument (ui_fixed_t *) 237 */ 238 void ui_fixed_ctl_destroy(void *arg) 239 { 240 ui_fixed_t *fixed = (ui_fixed_t *) arg; 241 242 ui_fixed_destroy(fixed); 243 } 244 245 /** Paint fixed layout control. 246 * 247 * @param arg Argument (ui_fixed_t *) 248 * @return EOK on success or an error code 249 */ 250 errno_t ui_fixed_ctl_paint(void *arg) 251 { 252 ui_fixed_t *fixed = (ui_fixed_t *) arg; 253 254 return ui_fixed_paint(fixed); 255 } 256 257 /** Handle fixed layout control position event. 258 * 259 * @param arg Argument (ui_fixed_t *) 260 * @param pos_event Position event 261 * @return @c ui_claimed iff the event is claimed 262 */ 263 ui_evclaim_t ui_fixed_ctl_pos_event(void *arg, pos_event_t *event) 264 { 265 ui_fixed_t *fixed = (ui_fixed_t *) arg; 266 267 return ui_fixed_pos_event(fixed, event); 268 } 269 205 270 /** @} 206 271 */
Note:
See TracChangeset
for help on using the changeset viewer.