Changeset 7c3fb9b in mainline for uspace/lib/gui
- Timestamp:
- 2018-05-17T08:29:01Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ff23ff
- Parents:
- fac0ac7
- git-author:
- Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
- Location:
- uspace/lib/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/widget.h
rfac0ac7 r7c3fb9b 72 72 * Virtual destructor. Apart from deallocating the resources specific for 73 73 * the particular widget, each widget shall remove itself from parents 74 * children and deallocate itself. */ 74 * children and deallocate itself. 75 */ 75 76 void (*destroy)(widget_t *); 76 77 … … 82 83 * to be changed. If not, widget shall calculate new layout for its children 83 84 * and call rearrange() on each of them. Otherwise, widget shall change its 84 * own properties and call reconfigure() on its parent. */ 85 * own properties and call reconfigure() on its parent. 86 */ 85 87 void (*reconfigure)(widget_t *); 86 88 … … 90 92 * position and size according to provided arguments, paint itself, 91 93 * calculate new layout for its children and call rearrange() on each 92 * of them. */ 94 * of them. 95 */ 93 96 void (*rearrange)(widget_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t); 94 97 … … 97 100 * in top-bottom order and repaint() is called on each widget. Widget shall 98 101 * either paint itself or copy its private buffer onto window surface. 99 * Widget shall also post damage event into window event loop. */ 102 * Widget shall also post damage event into window event loop. 103 */ 100 104 void (*repaint)(widget_t *); 101 105 … … 104 108 * reaction to the event, widget might call reconfigure() on its parent or 105 109 * rearrange() on its children. If the widget wants to change its visual 106 * information, refresh event should be posted to the window event loop. */ 110 * information, refresh event should be posted to the window event loop. 111 */ 107 112 void (*handle_keyboard_event)(widget_t *, kbd_event_t); 108 113 … … 114 119 * should be posted to the window event loop. If the widget accepts 115 120 * keyboard events, it should take ownership of keyboard focus. Widget can 116 * also acquire or release mouse grab. */ 121 * also acquire or release mouse grab. 122 */ 117 123 void (*handle_position_event)(widget_t *, pos_event_t); 118 124 }; -
uspace/lib/gui/window.h
rfac0ac7 r7c3fb9b 73 73 * compositor and asks all widgets in the tree to calculate their new properties 74 74 * and to paint themselves on the new surface (top-bottom order). Should be 75 * called also after opening new window to obtain surface. */ 75 * called also after opening new window to obtain surface. 76 */ 76 77 extern void window_resize(window_t *, sysarg_t, sysarg_t, sysarg_t, sysarg_t, 77 78 window_placement_flags_t); … … 84 85 * are asked to repaint themselves in top-bottom order. Should be called by 85 86 * widget after such change of its internal state that does not need resizing 86 * of neither parent nor children (). */ 87 * of neither parent nor children (). 88 */ 87 89 extern void window_refresh(window_t *); 88 90 … … 90 92 * Post damage event into event loop. Handler informs compositor to update the 91 93 * window surface on the screen. Should be called by widget after painting 92 * itself or copying its buffer onto window surface. */ 94 * itself or copying its buffer onto window surface. 95 */ 93 96 extern void window_damage(window_t *); 94 97 95 98 /** 96 99 * Retrieve dummy root widget of the window widget tree. Intended to be called 97 * by proper top-level widget to set his parent. */ 100 * by proper top-level widget to set his parent. 101 */ 98 102 extern widget_t *window_root(window_t *); 99 103 100 104 /** 101 105 * Prepare and enqueue window fibrils for event loop and input fetching. When 102 * async_manager() function is called, event loop is executed. */ 106 * async_manager() function is called, event loop is executed. 107 */ 103 108 extern void window_exec(window_t *); 104 109 105 110 /** 106 111 * Claim protected window surface. Intended for widgets painting from their 107 * internal fibrils (e.g. terminal, animation, video). */ 112 * internal fibrils (e.g. terminal, animation, video). 113 */ 108 114 extern surface_t *window_claim(window_t *); 109 115 110 116 /** 111 * Yield protected window surface after painting. */ 117 * Yield protected window surface after painting. 118 */ 112 119 extern void window_yield(window_t *); 113 120 … … 119 126 * terminates. When event loop fibril handles closing event, all window 120 127 * resources are deallocated and fibril also terminates. Moreover, if the 121 * window is main window of the application, whole task terminates. */ 128 * window is main window of the application, whole task terminates. 129 */ 122 130 extern void window_close(window_t *); 123 131
Note:
See TracChangeset
for help on using the changeset viewer.