FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::Application Class Reference

Class holding most of the data required to launch FuncDoodle. More...

#include <App.h>

Public Types

enum class  Where { Before = 0 , After = 1 }
 Controls whether imported content is inserted before or after the current frame. More...

Public Member Functions

 Application ()
 ~Application ()
void Run ()
 Runs the main application loop.
void InitImGui ()
 Initializes ImGui for the application window.
void RenderImGui ()
 Renders one ImGui frame.
void OpenFileDialog (std::function< void()> done)
 Opens the project open dialog.
void SaveFileDialog (std::function< void()> done)
 Opens the project save dialog.
void ReadProjectFile ()
 Reads the currently selected project file from disk.
void SaveProjectFile ()
 Saves the current project using its active path.
void RegisterKeybinds ()
 Registers application-level keybinds.
void OpenSaveChangesDialog ()
 Opens the unsaved-changes confirmation dialog.
bool SaveChangesDialogOpen ()
 Returns whether the save-changes dialog is open.
void HideCursor ()
 Hides the application cursor.
void ShowCursor ()
 Shows the application cursor.
SharedPtr< ProjectFileGetCurProj ()
 Returns the currently open project.
void SetCurProj (SharedPtr< ProjectFile > proj)
 Sets the currently open project.
SharedPtr< ProjectFileGetCacheProj ()
 Returns the cached project used during prompts and swaps.
void SetCacheProj (SharedPtr< ProjectFile > proj)
 Sets the cached project reference.
AssetLoaderGetAssetLoader ()
 Returns the global asset loader.
bool GetShouldClose () const
 Returns whether the application should exit.
UUID GetTheme ()
 Returns the currently selected theme UUID.
void SetTheme (UUID theme)
 Sets the current theme UUID.
void SetFrameLimit (double frameLimit)
 Sets the main-loop frame cap.
void SetShouldClose (bool shouldClose)
 Sets whether the application should exit.
Platform::WindowGetWindow ()
 Returns the mutable application window.
AppSettingsGetSettings ()
 Returns mutable application settings.
double GetFrameTime () const
 Returns target frame time derived from the frame limit.
KeybindsRegistryGetKeybinds ()
 Returns the application keybind registry.
int GetExportFormat () const
 Returns the selected export format identifier.
UIManagerGetUiManager ()
 Returns the top-level UI manager.
int & GetExportFormatPtr ()
 Returns a mutable reference to the export format field.
std::filesystem::path GetThemesPath ()
 Returns the directory used for theme files.
double & GetFrameLimitCache ()
 Returns the cached previous frame limit.
void SetExportFormat (int format)
 Sets the export format identifier.
AnimationManagerGetManager ()
 Returns the animation manager.
SharedPtr< EditorControllerGetController ()
 Returns the shared editor controller.
Platform::Window GetWindow () const
 Returns a copy of the application window wrapper.
void UpdateFPS (double deltaTime)
 Updates FPS tracking from frame delta time.
void DropCallback (int count, const char **paths)
 Handles file-drop events from the window.
void Update ()
 Updates per-frame application state outside direct rendering.
void Save (bool exit=false)
 Saves the current project and optionally exits.
void CloseCurrentProject ()
 Releases the active project and clears dependent UI state.
void SaveAt (const char *path)
 Saves the current project at an explicit path.
void RenderRotate ()
 Renders the rotate-project UI.
void Rotate (int32_t deg)
 Rotates the active frame or selection by degrees.
void Import (Where where)
 Imports content relative to the current frame.
void DeleteCurrentSelection ()
 Deletes the active selection contents.
void MoveCurrentSelection (Direction direction)
 Moves the active selection by one step.

Static Public Member Functions

static ApplicationGet ()
 Returns the active application singleton.
static void ApplyThemeStyle (const ImGuiStyle &themeStyle)
 Applies an ImGui style to the application.
static void ApplyThemeUuid (const FuncDoodle::UUID &uuid)
 Applies a theme by UUID, falling back to the default theme.
static bool IsPosInFrame (ImVec2 pos)
 Returns whether a screen-space point lies within the frame view.

Private Attributes

std::string m_FilePath
UIManager m_UiManager
AppSettings m_Settings
KeybindsRegistry m_Keybinds
SharedPtr< ProjectFilem_CurrentProj
SharedPtr< ProjectFilem_CacheProj
UniquePtr< AnimationManagerm_Manager
Platform::Window m_Window
UniquePtr< AssetLoaderm_AssetLoader
SharedPtr< EditorControllerm_EditorController
int m_ExportFormat = 0
UUID m_Theme
bool m_ShouldClose = false
bool m_ShowTests = true
double m_FrameLimitCache = 1000.0
double m_LastFrameTime = 0.0
std::chrono::time_point< std::chrono::high_resolution_clock > m_LastFrame
double m_FPS = 0.0
std::array< float, 3 > m_CacheBGCol
std::filesystem::path m_ThemesPath

Static Private Attributes

static Applications_Instance = nullptr

Detailed Description

Class holding most of the data required to launch FuncDoodle.

Main application class.

Invariant
s_Instance != nullptr when application is running
GetCurProj() may be nullptr but will never be invalid pointer
Note
Constructing multiple Application instances is unsupported, because it is a semi-singleton.

Member Enumeration Documentation

◆ Where

enum class FuncDoodle::Application::Where
strong

Controls whether imported content is inserted before or after the current frame.

Enumerator
Before 
After 

Constructor & Destructor Documentation

◆ Application()

FuncDoodle::Application::Application ( )

◆ ~Application()

FuncDoodle::Application::~Application ( )

Member Function Documentation

◆ ApplyThemeStyle()

void FuncDoodle::Application::ApplyThemeStyle ( const ImGuiStyle & themeStyle)
inlinestatic

Applies an ImGui style to the application.

Parameters
themeStyleTheme style to copy into ImGui.

◆ ApplyThemeUuid()

void FuncDoodle::Application::ApplyThemeUuid ( const FuncDoodle::UUID & uuid)
inlinestatic

Applies a theme by UUID, falling back to the default theme.

Parameters
uuidTheme UUID to apply.

◆ CloseCurrentProject()

void FuncDoodle::Application::CloseCurrentProject ( )

Releases the active project and clears dependent UI state.

◆ DeleteCurrentSelection()

void FuncDoodle::Application::DeleteCurrentSelection ( )

Deletes the active selection contents.

◆ DropCallback()

void FuncDoodle::Application::DropCallback ( int count,
const char ** paths )

Handles file-drop events from the window.

Parameters
countNumber of dropped paths.
pathsArray of dropped file paths.

◆ Get()

Application * FuncDoodle::Application::Get ( )
inlinestatic

Returns the active application singleton.

Returns
Current application instance.

◆ GetAssetLoader()

AssetLoader * FuncDoodle::Application::GetAssetLoader ( )
inline

Returns the global asset loader.

Returns
Asset loader pointer.

◆ GetCacheProj()

SharedPtr< ProjectFile > FuncDoodle::Application::GetCacheProj ( )
inline

Returns the cached project used during prompts and swaps.

Returns
Cached project pointer.

◆ GetController()

SharedPtr< EditorController > FuncDoodle::Application::GetController ( )
inline

Returns the shared editor controller.

Returns
Editor controller pointer.

◆ GetCurProj()

SharedPtr< ProjectFile > FuncDoodle::Application::GetCurProj ( )
inline

Returns the currently open project.

Returns
Shared pointer to the active project.

◆ GetExportFormat()

int FuncDoodle::Application::GetExportFormat ( ) const
inline

Returns the selected export format identifier.

Returns
Export format value.

◆ GetExportFormatPtr()

int & FuncDoodle::Application::GetExportFormatPtr ( )
inline

Returns a mutable reference to the export format field.

Returns
Export format reference.

◆ GetFrameLimitCache()

double & FuncDoodle::Application::GetFrameLimitCache ( )
inline

Returns the cached previous frame limit.

Returns
Cached frame limit reference.

◆ GetFrameTime()

double FuncDoodle::Application::GetFrameTime ( ) const
inline

Returns target frame time derived from the frame limit.

Returns
Seconds per frame.

◆ GetKeybinds()

KeybindsRegistry & FuncDoodle::Application::GetKeybinds ( )
inline

Returns the application keybind registry.

Returns
Keybind registry reference.

◆ GetManager()

AnimationManager * FuncDoodle::Application::GetManager ( )
inline

Returns the animation manager.

Returns
Animation manager pointer.

◆ GetSettings()

AppSettings & FuncDoodle::Application::GetSettings ( )
inline

Returns mutable application settings.

Returns
Settings reference.

◆ GetShouldClose()

bool FuncDoodle::Application::GetShouldClose ( ) const
inline

Returns whether the application should exit.

Returns
Close flag.

◆ GetTheme()

UUID FuncDoodle::Application::GetTheme ( )
inline

Returns the currently selected theme UUID.

Returns
Active theme UUID.

◆ GetThemesPath()

std::filesystem::path FuncDoodle::Application::GetThemesPath ( )
inline

Returns the directory used for theme files.

Returns
Themes directory path.

◆ GetUiManager()

UIManager & FuncDoodle::Application::GetUiManager ( )
inline

Returns the top-level UI manager.

Returns
UI manager reference.

◆ GetWindow() [1/2]

Platform::Window * FuncDoodle::Application::GetWindow ( )
inline

Returns the mutable application window.

Returns
Window pointer.

◆ GetWindow() [2/2]

Platform::Window FuncDoodle::Application::GetWindow ( ) const
inlinenodiscard

Returns a copy of the application window wrapper.

Returns
Window wrapper copy.

◆ HideCursor()

void FuncDoodle::Application::HideCursor ( )

Hides the application cursor.

◆ Import()

void FuncDoodle::Application::Import ( Where where)

Imports content relative to the current frame.

Parameters
whereWhether to insert before or after.

◆ InitImGui()

void FuncDoodle::Application::InitImGui ( )

Initializes ImGui for the application window.

◆ IsPosInFrame()

bool FuncDoodle::Application::IsPosInFrame ( ImVec2 pos)
static

Returns whether a screen-space point lies within the frame view.

Parameters
posPosition to test.
Returns
Whether the position is inside the frame area.

◆ MoveCurrentSelection()

void FuncDoodle::Application::MoveCurrentSelection ( Direction direction)

Moves the active selection by one step.

Parameters
directionDirection to move in.

◆ OpenFileDialog()

void FuncDoodle::Application::OpenFileDialog ( std::function< void()> done)

Opens the project open dialog.

Parameters
doneCallback invoked after dialog handling completes.

◆ OpenSaveChangesDialog()

void FuncDoodle::Application::OpenSaveChangesDialog ( )

Opens the unsaved-changes confirmation dialog.

◆ ReadProjectFile()

void FuncDoodle::Application::ReadProjectFile ( )

Reads the currently selected project file from disk.

◆ RegisterKeybinds()

void FuncDoodle::Application::RegisterKeybinds ( )

Registers application-level keybinds.

◆ RenderImGui()

void FuncDoodle::Application::RenderImGui ( )

Renders one ImGui frame.

◆ RenderRotate()

void FuncDoodle::Application::RenderRotate ( )

Renders the rotate-project UI.

◆ Rotate()

void FuncDoodle::Application::Rotate ( int32_t deg)

Rotates the active frame or selection by degrees.

Parameters
degRotation angle in degrees.

◆ Run()

void FuncDoodle::Application::Run ( )

Runs the main application loop.

◆ Save()

void FuncDoodle::Application::Save ( bool exit = false)

Saves the current project and optionally exits.

Parameters
exitWhether to close the app after saving.

◆ SaveAt()

void FuncDoodle::Application::SaveAt ( const char * path)

Saves the current project at an explicit path.

Parameters
pathOutput project path.

◆ SaveChangesDialogOpen()

bool FuncDoodle::Application::SaveChangesDialogOpen ( )
inline

Returns whether the save-changes dialog is open.

Returns
Popup open state.

◆ SaveFileDialog()

void FuncDoodle::Application::SaveFileDialog ( std::function< void()> done)

Opens the project save dialog.

Parameters
doneCallback invoked after dialog handling completes.

◆ SaveProjectFile()

void FuncDoodle::Application::SaveProjectFile ( )

Saves the current project using its active path.

◆ SetCacheProj()

void FuncDoodle::Application::SetCacheProj ( SharedPtr< ProjectFile > proj)
inline

Sets the cached project reference.

Parameters
projProject to cache.

◆ SetCurProj()

void FuncDoodle::Application::SetCurProj ( SharedPtr< ProjectFile > proj)
inline

Sets the currently open project.

Parameters
projProject to make active.

◆ SetExportFormat()

void FuncDoodle::Application::SetExportFormat ( int format)
inline

Sets the export format identifier.

Parameters
formatExport format value.

◆ SetFrameLimit()

void FuncDoodle::Application::SetFrameLimit ( double frameLimit)
inline

Sets the main-loop frame cap.

Parameters
frameLimitTarget frame limit.

◆ SetShouldClose()

void FuncDoodle::Application::SetShouldClose ( bool shouldClose)
inline

Sets whether the application should exit.

Parameters
shouldCloseNew close flag value.

◆ SetTheme()

void FuncDoodle::Application::SetTheme ( UUID theme)
inline

Sets the current theme UUID.

Parameters
themeTheme UUID to store.

◆ ShowCursor()

void FuncDoodle::Application::ShowCursor ( )

Shows the application cursor.

◆ Update()

void FuncDoodle::Application::Update ( )

Updates per-frame application state outside direct rendering.

◆ UpdateFPS()

void FuncDoodle::Application::UpdateFPS ( double deltaTime)

Updates FPS tracking from frame delta time.

Parameters
deltaTimeFrame time in seconds.

Member Data Documentation

◆ m_AssetLoader

UniquePtr<AssetLoader> FuncDoodle::Application::m_AssetLoader
private

◆ m_CacheBGCol

std::array<float, 3> FuncDoodle::Application::m_CacheBGCol
private

◆ m_CacheProj

SharedPtr<ProjectFile> FuncDoodle::Application::m_CacheProj
private

◆ m_CurrentProj

SharedPtr<ProjectFile> FuncDoodle::Application::m_CurrentProj
private

◆ m_EditorController

SharedPtr<EditorController> FuncDoodle::Application::m_EditorController
private

◆ m_ExportFormat

int FuncDoodle::Application::m_ExportFormat = 0
private

◆ m_FilePath

std::string FuncDoodle::Application::m_FilePath
private

◆ m_FPS

double FuncDoodle::Application::m_FPS = 0.0
private

◆ m_FrameLimitCache

double FuncDoodle::Application::m_FrameLimitCache = 1000.0
private

◆ m_Keybinds

KeybindsRegistry FuncDoodle::Application::m_Keybinds
private

◆ m_LastFrame

std::chrono::time_point<std::chrono::high_resolution_clock> FuncDoodle::Application::m_LastFrame
private

◆ m_LastFrameTime

double FuncDoodle::Application::m_LastFrameTime = 0.0
private

◆ m_Manager

UniquePtr<AnimationManager> FuncDoodle::Application::m_Manager
private

◆ m_Settings

AppSettings FuncDoodle::Application::m_Settings
private

◆ m_ShouldClose

bool FuncDoodle::Application::m_ShouldClose = false
private

◆ m_ShowTests

bool FuncDoodle::Application::m_ShowTests = true
private

◆ m_Theme

UUID FuncDoodle::Application::m_Theme
private

◆ m_ThemesPath

std::filesystem::path FuncDoodle::Application::m_ThemesPath
private

◆ m_UiManager

UIManager FuncDoodle::Application::m_UiManager
private

◆ m_Window

Platform::Window FuncDoodle::Application::m_Window
private

◆ s_Instance

Application * FuncDoodle::Application::s_Instance = nullptr
staticprivate

The documentation for this class was generated from the following files: