## Summary
Fix redefinition of `FILE_*` macro.
Note that there will still be 2 warning:
```
.pio/libdeps/default/WebSockets/src/WebSocketsClient.cpp: In member function 'void WebSocketsClient::clientDisconnect(WSclient_t*, const char*)':
.pio/libdeps/default/WebSockets/src/WebSocketsClient.cpp:573:31: warning: 'virtual void NetworkClient::flush()' is deprecated: Use clear() instead. [-Wdeprecated-declarations]
573 | client->tcp->flush();
| ~~~~~~~~~~~~~~~~~~^~
```
--> I assume the upstream library need to fix it
And:
```
src/activities/Activity.cpp:8:1: warning: 'noreturn' function does return
8 | }
| ^
```
Will be fixed in #1016
---
### AI Usage
While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? **NO**
32 lines
776 B
C++
32 lines
776 B
C++
#pragma once
|
|
#include <HalStorage.h>
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "Block.h"
|
|
|
|
class ImageBlock final : public Block {
|
|
public:
|
|
ImageBlock(const std::string& imagePath, int16_t width, int16_t height);
|
|
~ImageBlock() override = default;
|
|
|
|
const std::string& getImagePath() const { return imagePath; }
|
|
int16_t getWidth() const { return width; }
|
|
int16_t getHeight() const { return height; }
|
|
|
|
bool imageExists() const;
|
|
|
|
BlockType getType() override { return IMAGE_BLOCK; }
|
|
bool isEmpty() override { return false; }
|
|
|
|
void render(GfxRenderer& renderer, const int x, const int y);
|
|
bool serialize(FsFile& file);
|
|
static std::unique_ptr<ImageBlock> deserialize(FsFile& file);
|
|
|
|
private:
|
|
std::string imagePath;
|
|
int16_t width;
|
|
int16_t height;
|
|
};
|