- u_async.c: process immediate_queue BEFORE epoll_wait in uasync_poll - stcp_link.c: defensive NULL etcp_conn/etcp_link in stcp_link_close - utun_instance.c: move stcp_server_list_destroy_all to Phase J (before ETCP), add deferred drain in both Phase J and L - stcp.h/c: STCP_HS_ENC_CLIENT 6→38, STCP_HS_ENC_SERVER 7→39, exchange ed25519_pubkey in both handshake directions - etcp_connections.c: copy peer_ed25519 from STCP to ETCP_CONN in etcp_link_enter_ready_tcp; guard link->etcp in tcp_link_close_cb - chat_sync.c: fix lk->conn NULL dereference for TCP links - test_stcp.c: update stcp_server_create/stcp_client_connect callsites - tools/chat_tcp_test: change transport udp→tcp
34 lines
979 B
C++
34 lines
979 B
C++
#pragma once
|
|
|
|
#include <QImage>
|
|
#include <QByteArray>
|
|
#include <QSize>
|
|
#include <cstdint>
|
|
|
|
class LottieIcon {
|
|
public:
|
|
explicit LottieIcon(const QByteArray &tgsData, const QString &key);
|
|
~LottieIcon();
|
|
|
|
bool isValid() const { return m_valid; }
|
|
QSize originalSize() const { return QSize((int)m_w, (int)m_h); }
|
|
int frameCount() const { return m_totalFrames; }
|
|
double frameRate() const { return m_frameRate; }
|
|
int currentFrame() const { return m_currentFrame; }
|
|
int tgsSize() const { return m_tgsSize; }
|
|
void setTgsSize(int sz) { m_tgsSize = sz; }
|
|
|
|
QImage renderFrame(int frameNum, QSize targetSize) const;
|
|
void advanceFrame() { m_currentFrame = (m_currentFrame + 1) % m_totalFrames; }
|
|
|
|
private:
|
|
bool m_valid = false;
|
|
struct Lottie_Animation_S *m_anim = nullptr;
|
|
int m_currentFrame = 0;
|
|
int m_totalFrames = 0;
|
|
int m_tgsSize = 0;
|
|
double m_frameRate = 60.0;
|
|
size_t m_w = 0, m_h = 0;
|
|
QByteArray m_jsonData;
|
|
};
|