46 lines
824 B
C
Raw Permalink Normal View History

2024-05-11 17:43:38 +08:00
#pragma once
#include "stdafx.h"
//#include <Windows.h>
#include <list>
//#include <string>
#include "external/imgui/imgui.h"
struct ToastBean{
std::string content;
unsigned long duration;
uint64_t liveBegin;
uint64_t liveEnd;
ImVec4 color;
bool isAssic;
ToastBean(string strcontent,unsigned long dduration, ImVec4 icolor = ImVec4(1,1,1,1),bool isa=false)
{
content = strcontent;
duration = dduration;
liveBegin = 0;
liveEnd = 0;
color = icolor;
isAssic = isa;
}
};
class Toast
{
public:
Toast();
~Toast();
void AddToast(ToastBean* tbean);
ToastBean* GetToast();
private:
list<ToastBean*> m_ToastList;
CRITICAL_SECTION m_cs;
const int MAX_LENGTH = 100;
public:
static const ImVec4 COLOR_ORANGE;
static const ImVec4 COLOR_RED;
static const ImVec4 COLOR_GREEN;
};
extern Toast* g_Toast;