Files
utun2/tools/chatgui/src/debug_ui.h
T
Evgeny 291b4a0d54 chatgui: rlottie animated emoji with hover-to-animate, drag-to-select
- Add LottieIcon class (TGS gzip decompress + rlottie C API render)
- Add AnimTimer singleton (33ms tick, activate/deactivate refcount)
- Add EmojiButton (hover-triggered animation in emoji picker)
- Add AnimatedEmoji support to EmojiData (5 TGS mappings)
- MessageDelegate: QTextLayout-based animated emoji overlay (text + reactions)
- ChatView: drag-to-select (click deselects, 5px drag starts selection)
- ChatView: hoveredIndexChanged signal for hover-triggered animations
- MessageList: wire AnimTimer tick to viewport update, hover → activate
- CMake: AUTORCC, rlottie, zlib dependencies
- Add 5 TGS animations as Qt resources
2026-06-24 13:45:25 +03:00

47 lines
1.4 KiB
C++

#pragma once
#if !defined(NDEBUG) && !defined(GUI_DEBUG_DISABLE)
#include <cstdio>
#include <cstdarg>
namespace GuiDebugPriv {
inline FILE *s_file = stderr;
inline void setFile(const char *path) {
if (s_file && s_file != stderr) fclose(s_file);
s_file = path ? fopen(path, "w") : nullptr;
if (!s_file) s_file = stderr;
}
}
inline void guiDebugFile(const char *path) { GuiDebugPriv::setFile(path); }
inline void guiDebugLog(char lvl, const char *file, int line,
const char *func, const char *fmt, ...) {
const char *base = strrchr(file, '/');
if (!base) base = strrchr(file, '\\');
fprintf(GuiDebugPriv::s_file, "[%c] %s:%d %s(): ",
lvl, base ? base + 1 : file, line, func);
va_list ap;
va_start(ap, fmt);
vfprintf(GuiDebugPriv::s_file, fmt, ap);
va_end(ap);
fprintf(GuiDebugPriv::s_file, "\n");
fflush(GuiDebugPriv::s_file);
}
#define GUI_ERROR(fmt, ...) guiDebugLog('E', __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__)
#define GUI_WARN(fmt, ...) guiDebugLog('W', __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__)
#define GUI_INFO(fmt, ...) guiDebugLog('I', __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__)
#define GUI_DEBUG(fmt, ...) guiDebugLog('D', __FILE__, __LINE__, __func__, fmt, ##__VA_ARGS__)
#else
#define GUI_ERROR(...) ((void)0)
#define GUI_WARN(...) ((void)0)
#define GUI_INFO(...) ((void)0)
#define GUI_DEBUG(...) ((void)0)
#endif