coastline 0.0.4
Loading...
Searching...
No Matches
setupwizard.h File Reference

The first-run setup wizard locates and imports disc and ROM images on screens drawn on a TextGrid with the blue and grey palette of text-mode Windows Setup. More...

#include <array>
#include <cstdint>
#include <filesystem>
#include <functional>
#include <future>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include "filebrowser.h"
#include "textgrid.h"
Include dependency graph for setupwizard.h:

Go to the source code of this file.

Classes

struct  coastline::WizardImport
 The files an import of the wizard reads. More...
struct  coastline::WizardServices
 The routines the wizard calls to check and import its files. More...
struct  coastline::WizardSearchResult
 The images found during a directory search, indexed by detected release. More...
struct  coastline::WizardEvent
 An event of the keyboard or the mouse. More...
struct  coastline::WizardControl
 A control positioned on the grid. More...
class  coastline::SetupWizard
 Manage setup screens, their controls and focus, the file browser, and the import. More...

Namespaces

namespace  coastline

Typedefs

using coastline::WizardProgress = std::function<bool(const std::string &step, double fraction)>
 Reports the step of an import and its share done from 0 to 1, and returns false to cancel.
using coastline::WizardSearchProgress
 Report search progress and return false to cancel.

Enumerations

enum class  coastline::WizardCartridge { coastline::Usa , coastline::Eur , coastline::Jpn }
 A supported ROM release. More...
enum class  coastline::WizardKey {
  coastline::Tab , coastline::Enter , coastline::Space , coastline::Escape ,
  coastline::Up , coastline::Down , coastline::Left , coastline::Right ,
  coastline::PageUp , coastline::PageDown , coastline::Home , coastline::End ,
  coastline::Backspace , coastline::Delete , coastline::SelectAll , coastline::DeleteWord ,
  coastline::DeleteNextWord , coastline::WordLeft , coastline::WordRight
}
 A key of the keyboard the wizard reads. More...
enum class  coastline::WizardScreen {
  coastline::Reimport , coastline::SourceSelection , coastline::Files , coastline::SearchDirectory ,
  coastline::Search , coastline::Import , coastline::Done
}
 A screen of the wizard, in order. More...
enum class  coastline::WizardEnd { coastline::Running , coastline::Quit , coastline::Finished }
 How the wizard ended. More...
enum class  coastline::WizardControlId {
  coastline::DiscText , coastline::DiscBrowse , coastline::DiscClear , coastline::Rom1Text ,
  coastline::Rom2Text , coastline::Rom3Text , coastline::Rom1Browse , coastline::Rom2Browse ,
  coastline::Rom3Browse , coastline::Rom1Clear , coastline::Rom2Clear , coastline::Rom3Clear ,
  coastline::SearchAssets , coastline::SpecifyPaths , coastline::Portable , coastline::SearchText ,
  coastline::SearchBrowse , coastline::SearchClear , coastline::StartSearch , coastline::RetrySearch ,
  coastline::UseFound , coastline::Back , coastline::Next , coastline::Quit ,
  coastline::Cancel , coastline::Finish , coastline::BrowserList , coastline::BrowserFilter ,
  coastline::BrowserOk , coastline::BrowserUseDirectory , coastline::BrowserCancel , coastline::MessageOk ,
  coastline::MessageYes , coastline::MessageNo
}
 A control of a screen or a dialog of the wizard. More...

Functions

std::optional< WizardCartridge > coastline::BaseCartridge (const std::array< bool, WIZARD_CARTRIDGES > &checked)
 Choose the base release for the default pack.
WizardSearchResult coastline::SearchWizardDirectory (const std::filesystem::path &directory, const WizardServices &services, const WizardSearchProgress &progress)
 Search recursively, including hidden directories, for validated disc and ROM images.
char coastline::AcceleratorOf (const std::string &label)

Variables

constexpr int coastline::WIZARD_CARTRIDGES = 3
 The number of supported ROM releases.

Detailed Description

The first-run setup wizard locates and imports disc and ROM images on screens drawn on a TextGrid with the blue and grey palette of text-mode Windows Setup.

The wizard processes events and produces a grid without calling SDL.