comparison libui/ui/frame.h @ 152:1008a796a9e7

ui: make UI widgets usable as actions While here add a example-ui program with move support.
author David Demelier <markand@malikania.fr>
date Thu, 15 Oct 2020 18:09:45 +0200
parents b19d076856d2
children 6992085d47fd
comparison
equal deleted inserted replaced
151:b19d076856d2 152:1008a796a9e7
20 #define MOLKO_FRAME_H 20 #define MOLKO_FRAME_H
21 21
22 /** 22 /**
23 * \file frame.h 23 * \file frame.h
24 * \brief GUI frame. 24 * \brief GUI frame.
25 * \ingroup ui
25 */ 26 */
26 27
28 struct action;
27 struct theme; 29 struct theme;
28 30
29 /** 31 /**
30 * \brief Frame style. 32 * \brief Frame style.
31 */ 33 */
64 * \param frame the frame to draw 66 * \param frame the frame to draw
65 */ 67 */
66 void 68 void
67 frame_draw(const struct frame *frame); 69 frame_draw(const struct frame *frame);
68 70
71 /**
72 * Convert the frame into an action.
73 *
74 * The following field will be set into the action:
75 *
76 * - act->data: points to frame (reference),
77 * - act->draw: a wrapper to checkbox_draw.
78 *
79 * The frame being an UI element is considered to never completes, as such
80 * you will need to handle this case or to use a custom update function.
81 *
82 * \pre frame != NULL
83 * \pre act != NULL
84 * \param frame the frame to reference
85 * \param act the action to fill
86 */
87 void
88 frame_action(struct frame *frame, struct action *act);
89
69 #endif /* !MOLKO_FRAME_H */ 90 #endif /* !MOLKO_FRAME_H */