/* * Common.cpp * * Created on: 8 maj 2019 * Author: robert */ #include #include #include "Common.hpp" namespace gui { static timeSecondsFunctionPtr timeSecondsFunction = nullptr; bool operator&(const gui::RectangleEdgeFlags &lhs, const gui::RectangleEdgeFlags &rhs) { return static_cast(lhs) & static_cast(rhs); } RectangleEdgeFlags operator|(const RectangleEdgeFlags &lhs, const RectangleEdgeFlags &rhs) { using T = std::underlying_type_t; return static_cast(static_cast(lhs) | static_cast(rhs)); } RectangleEdgeFlags operator|=(RectangleEdgeFlags &lhs, const RectangleEdgeFlags &rhs) { lhs = lhs | rhs; return lhs; } uint32_t getTime() { if (timeSecondsFunction != nullptr) return timeSecondsFunction(); return 0; } void setTimeFunction(timeSecondsFunctionPtr fptr) { timeSecondsFunction = fptr; } } // namespace gui