/* * SPDX-FileCopyrightText: 2020-2020 CSSlayer * * SPDX-License-Identifier: LGPL-2.1-or-later * */ #ifndef _FCITX5_UI_CLASSIC_COMMON_H_ #define _FCITX5_UI_CLASSIC_COMMON_H_ #include #include #include #include "fcitx-utils/log.h" #include "fcitx-utils/misc.h" namespace fcitx::m3ui { template using GObjectUniquePtr = UniqueCPtr; template float absolute(YGNodeRef node) { float offset = 0.0F; while (node) { offset += Getter(node); node = YGNodeGetParent(node); } return offset; } template float absolute(const std::unique_ptr &node) { return absolute(node.get()); } FCITX_DECLARE_LOG_CATEGORY(m3ui_logcategory); #define CLASSICUI_DEBUG() \ FCITX_LOGC(::fcitx::m3ui::m3ui_logcategory, Debug) #define CLASSICUI_ERROR() \ FCITX_LOGC(::fcitx::m3ui::m3ui_logcategory, Error) #define CLASSICUI_INFO() \ FCITX_LOGC(::fcitx::m3ui::m3ui_logcategory, Info) } // namespace fcitx::m3ui #endif // _FCITX5_UI_CLASSIC_COMMON_H_