Closed tobozo closed 3 months ago
Mixing C macros with cpp templates was a bad idea so I got rid of the macro and moved the template to a single location instead:
/// @brief LovyanGFX class.
/// that depend on the include order of the environment, such as file system, are inherited from LGFX_FILESYSTEM_Support.
class LovyanGFX : public
#ifdef LGFX_FILESYSTEM_SUPPORT_HPP_
LGFX_FILESYSTEM_Support<
#endif
LGFXBase
#ifdef LGFX_FILESYSTEM_SUPPORT_HPP_
>
#endif
{
public:
template<typename Fun, typename ...Args>
auto userFunc(Fun& fn, Args&&... arg) -> void{ fn(this, std::forward<Args>(arg)...); }
};
I'll close this PR and work on a plugin example.
This change adds the possibility to call LGFX object with a user function, it can make life easier when creating plugins that work on top of LovyanGFX.
Example: