# HG changeset patch # User David Demelier # Date 1692818416 -7200 # Node ID bbf30f16727443a9c3da2ec8d9bc8bd6ce0d5c8a # Parent 20b818193ce0a2d134c2189dfa02dc8cd1bdacff ui: improve button documentation diff -r 20b818193ce0 -r bbf30f167274 libmlk-ui/mlk/ui/button.h --- a/libmlk-ui/mlk/ui/button.h Wed Aug 23 20:01:00 2023 +0200 +++ b/libmlk-ui/mlk/ui/button.h Wed Aug 23 21:20:16 2023 +0200 @@ -19,12 +19,21 @@ #ifndef MLK_UI_BUTTON_H #define MLK_UI_BUTTON_H -union mlk_event; +/** + * \file mlk/ui/button.h + * \brief GUI button + */ struct mlk_button; struct mlk_button_style; struct mlk_font; +union mlk_event; + +/** + * \struct mlk_button + * \brief GUI button structure. + */ struct mlk_button { /** * (read-write) @@ -83,7 +92,7 @@ }; /** - * \struct mlk_label_button + * \struct mlk_button_style * \brief Button style. */ struct mlk_button_style { @@ -132,7 +141,7 @@ /** * (read-write, optional) * - * Update this label. + * Update this button. * * \param self this style * \param button the button to update @@ -176,7 +185,7 @@ extern struct mlk_button_style mlk_button_style_light; /** - * \brief Default style for all labels. + * \brief Default style for all buttons. */ extern struct mlk_button_style *mlk_button_style; @@ -184,14 +193,35 @@ extern "C" { #endif +/** + * Handle event. + * + * \pre button != NULL + * \pre ev != NULL + * \param button the button + * \param ev the event + */ int -mlk_button_handle(struct mlk_button *, const union mlk_event *); +mlk_button_handle(struct mlk_button *button, const union mlk_event *ev); +/** + * Update the button. + * + * \pre button != NULL + * \param button the button update + * \param ticks frame ticks + */ void -mlk_button_update(struct mlk_button *, unsigned int); +mlk_button_update(struct mlk_button *button, unsigned int ticks); +/** + * Draw the button. + * + * \pre button != NULL + * \param button the button to draw + */ void -mlk_button_draw(struct mlk_button *); +mlk_button_draw(struct mlk_button *button); #if defined(__cplusplus) }