Changes in uspace/lib/gui/widget.c [6d5e378:10cb47e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/widget.c
r6d5e378 r10cb47e 36 36 #include "widget.h" 37 37 38 void widget_init(widget_t *widget, widget_t *parent) 38 /** Link widget with parent and initialize default position and size. */ 39 void widget_init(widget_t *widget, widget_t *parent, const void *data) 39 40 { 40 41 link_initialize(&widget->link); 41 42 list_initialize(&widget->children); 43 42 44 if (parent) { 43 45 widget->parent = parent; … … 48 50 widget->window = NULL; 49 51 } 50 52 53 widget->data = data; 54 51 55 widget->hpos = 0; 52 56 widget->vpos = 0; 53 57 widget->width = 0; 54 58 widget->height = 0; 55 59 56 60 widget->width_min = 0; 57 61 widget->height_min = 0; … … 62 66 } 63 67 68 /** Change position and size of the widget. */ 64 69 void widget_modify(widget_t *widget, sysarg_t hpos, sysarg_t vpos, 65 70 sysarg_t width, sysarg_t height) … … 71 76 } 72 77 78 /** Get custom client data */ 79 const void *widget_get_data(widget_t *widget) 80 { 81 return widget->data; 82 } 83 84 /** Unlink widget from its parent. */ 73 85 void widget_deinit(widget_t *widget) 74 86 { 75 if (widget->parent) {87 if (widget->parent) 76 88 list_remove(&widget->link); 77 }78 89 } 79 90
Note:
See TracChangeset
for help on using the changeset viewer.