#ifndef MBUOY_UI_BUTTON_HPP #define MBUOY_UI_BUTTON_HPP #include "attr/dimensions.hpp" #include "attr/ondraw.hpp" #include "attr/position.hpp" #include "attr/string.hpp" #include "find.hpp" #include "port.hpp" namespace mbuoy { template struct button { static constexpr auto point = find(Attr...); static constexpr auto dims = find(Attr...); static constexpr auto text = find(Attr...); static constexpr auto draw = find(Attr...); static consteval void init(unsigned char *(&ptr)) { *ptr++ = 0; // pressed? } static void render() { (*draw)(*point, *dims); } static consteval int size() { return 1; } }; } // namespace mbuoy #endif // MBUOY_UI_BUTTON_HPP