2025-08-18 22:39:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2025-09-13 14:49:59 +02:00
|
|
|
#include <cstddef>
|
2025-08-18 22:39:43 +00:00
|
|
|
|
|
|
|
|
#include "AppGLFW.hpp"
|
2025-10-11 01:29:33 +02:00
|
|
|
#include "app/PixelariumGallery.hpp"
|
2025-08-18 22:39:43 +00:00
|
|
|
#include "imgui.h"
|
|
|
|
|
#include "resources/resource.hpp"
|
|
|
|
|
#include "utilities/ILog.hpp"
|
|
|
|
|
|
2025-10-11 01:29:33 +02:00
|
|
|
namespace pixelarium::application
|
2025-08-18 22:39:43 +00:00
|
|
|
{
|
2025-09-26 21:09:51 +02:00
|
|
|
/// @brief Default implementation of AppGLFW.
|
|
|
|
|
/// This can either be used as is, as an example or as a base class
|
|
|
|
|
/// providing some defaults for a more custom implementation.
|
2025-10-11 01:29:33 +02:00
|
|
|
class DefaultApp : public AppGLFW
|
2025-08-18 22:39:43 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2025-09-22 23:13:28 +02:00
|
|
|
DefaultApp(const utils::log::ILog& log, pixelarium::resources::ImageResourcePool& pool)
|
2025-10-11 17:23:58 +02:00
|
|
|
: application::AppGLFW(log), pool_(pool), gallery_(log, pool)
|
2025-08-18 22:39:43 +00:00
|
|
|
{
|
2025-10-11 17:23:58 +02:00
|
|
|
gallery_.SetLoadFunction([&]() -> void { this->LoadImage(); });
|
2025-08-18 22:39:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void MenuBarOptionsColumn1() override;
|
|
|
|
|
void MenuBarOptionsColumn2() override;
|
|
|
|
|
void Run() override;
|
|
|
|
|
|
2025-10-11 17:23:58 +02:00
|
|
|
protected:
|
|
|
|
|
resources::ImageResourcePool& pool_;
|
|
|
|
|
application::PixelariumImageGallery gallery_;
|
|
|
|
|
|
|
|
|
|
protected:
|
2025-09-22 23:13:28 +02:00
|
|
|
void LoadImage();
|
2025-08-18 22:39:43 +00:00
|
|
|
|
|
|
|
|
private:
|
2025-09-13 14:49:59 +02:00
|
|
|
bool image_listp_{true};
|
2025-08-18 22:39:43 +00:00
|
|
|
bool demop_{false};
|
|
|
|
|
ImVec2 curr_dim_;
|
|
|
|
|
};
|
2025-10-11 01:29:33 +02:00
|
|
|
} // namespace pixelarium::application
|