Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
SamplePickerPresenter.h File Reference
#include <cstddef>
#include <functional>
#include <string>
#include <string_view>
#include "donner/base/Vector2.h"
#include "donner/editor/EditorSampleCatalog.h"
#include "donner/editor/ImGuiIncludes.h"
Include dependency graph for SamplePickerPresenter.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::SamplePickerLayout
 Pure geometry for the sample grid. Values are logical pixels in the pane. More...
struct  donner::editor::SamplePickerState
struct  donner::editor::SamplePickerActions
 Edge-triggered requests emitted by one rendered picker frame. More...
struct  donner::editor::SamplePickerThumbnail
 Donner-rendered sample artwork uploaded to a texture the picker can blit. More...
class  donner::editor::SamplePickerPresenter
 Draw the welcome/sample surface inside the current ImGui pane. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Typedefs

using donner::editor::SamplePickerThumbnailProvider
 Resolve one catalog entry to its already-rendered thumbnail texture.

Enumerations

enum class  SamplePickerLayoutMode {
  Narrow ,
  Wide
}
enum class  SamplePickerCommand {
  Dismiss ,
  OpenFile ,
  LoadSample ,
  OpenGitHub
}

Functions

SamplePickerLayout donner::editor::ComputeSamplePickerLayout (float availableWidth, std::size_t sampleCount) noexcept
 Compute a bounded, touch-sized grid without requiring an ImGui context.
std::string_view donner::editor::SamplePickerDescription (std::string_view sampleId) noexcept
 Return the concise description used for a catalog sample card.
void donner::editor::ApplySamplePickerCommand (bool activated, SamplePickerCommand command, std::string_view sampleId, SamplePickerActions *actions)
 Apply a semantic picker command to an action accumulator.

Variables

constexpr float donner::editor::kSamplePickerMinTouchTarget = 44.0f
 Minimum logical height used by every primary picker action.
constexpr float donner::editor::kSamplePickerNarrowBreakpoint = 640.0f
 Width below which the picker keeps its sample actions in one column.
constexpr std::size_t donner::editor::kSamplePickerMaxColumns = 3
 Maximum number of columns and visible catalog entries in the bounded surface.
constexpr std::size_t donner::editor::kSamplePickerMaxVisibleSamples = 8
constexpr std::string_view donner::editor::kSamplePickerGitHubUrl = "https://github.com/jwmcglynn/donner"
 Public destination for the presenter's GitHub action. The presenter only reports the action; the host decides whether and how to navigate to it.

Typedef Documentation

◆ SamplePickerThumbnailProvider

Initial value:
std::function<SamplePickerThumbnail(const EditorSample& sample, std::size_t index)>
One built-in SVG document that can be loaded by editor UI surfaces.
Definition EditorSampleCatalog.h:13
Donner-rendered sample artwork uploaded to a texture the picker can blit.
Definition SamplePickerPresenter.h:67

Resolve one catalog entry to its already-rendered thumbnail texture.

Function Documentation

◆ ApplySamplePickerCommand()

void donner::editor::ApplySamplePickerCommand ( bool activated,
SamplePickerCommand command,
std::string_view sampleId,
SamplePickerActions * actions )

Apply a semantic picker command to an action accumulator.

This helper is deliberately independent of ImGui so command routing can be tested and kept separate from the presenter's drawing code.