forked from xiaozhi/xiaozhi-esp32
Switch to 2.0 branch (#1152)
* Adapt boards to v2 partition tables * fix esp log error * fix display style * reset emotion after download assets * fix compiling * update assets default url * Add user only tools * Add image cache * smaller cache and buffer, more heap * use MAIN_EVENT_CLOCK_TICK to avoid audio glitches * bump to 2.0.0 * fix compiling errors --------- Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
This commit is contained in:
36
main/display/emoji_collection.h
Normal file
36
main/display/emoji_collection.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef EMOJI_COLLECTION_H
|
||||
#define EMOJI_COLLECTION_H
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
|
||||
// Define interface for emoji collection
|
||||
class EmojiCollection {
|
||||
public:
|
||||
virtual const lv_img_dsc_t* GetEmojiImage(const char* name) const = 0;
|
||||
virtual ~EmojiCollection() = default;
|
||||
};
|
||||
|
||||
class Twemoji32 : public EmojiCollection {
|
||||
public:
|
||||
virtual const lv_img_dsc_t* GetEmojiImage(const char* name) const override;
|
||||
};
|
||||
|
||||
class Twemoji64 : public EmojiCollection {
|
||||
public:
|
||||
virtual const lv_img_dsc_t* GetEmojiImage(const char* name) const override;
|
||||
};
|
||||
|
||||
class CustomEmojiCollection : public EmojiCollection {
|
||||
private:
|
||||
std::map<std::string, lv_img_dsc_t*> emoji_collection_;
|
||||
public:
|
||||
void AddEmoji(const std::string& name, lv_img_dsc_t* image);
|
||||
virtual const lv_img_dsc_t* GetEmojiImage(const char* name) const override;
|
||||
virtual ~CustomEmojiCollection();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user