yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
ios_platform_state.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
5
namespace
yaze
{
6
namespace
platform {
7
namespace
ios {
8
9
struct
SafeAreaInsets
{
10
float
left
= 0.0f;
11
float
right
= 0.0f;
12
float
top
= 0.0f;
13
float
bottom
= 0.0f;
14
};
15
16
// Snapshot of current editor state, pushed to SwiftUI overlay each frame.
17
struct
EditorStateSnapshot
{
18
bool
can_undo
=
false
;
19
bool
can_redo
=
false
;
20
bool
can_save
=
false
;
21
bool
is_dirty
=
false
;
22
std::string
editor_type
;
23
std::string
rom_title
;
24
};
25
26
// Post editor state to the SwiftUI overlay via NSNotification.
27
// Only posts when the state has actually changed (diffed internally).
28
void
PostEditorStateUpdate
(
const
EditorStateSnapshot
& state);
29
30
void
SetMetalView
(
void
* view);
31
void
*
GetMetalView
();
32
33
void
SetSafeAreaInsets
(
float
left,
float
right,
float
top,
float
bottom);
34
SafeAreaInsets
GetSafeAreaInsets
();
35
36
void
SetOverlayTopInset
(
float
top);
37
float
GetOverlayTopInset
();
38
39
void
SetTouchScale
(
float
scale);
40
float
GetTouchScale
();
41
42
// Post a command to the SwiftUI overlay (iOS only).
43
// Commands map to OverlayCommand in `src/ios/iOS/YazeOverlayView.swift`.
44
void
PostOverlayCommand
(
const
char
* command);
45
46
// Haptic feedback (iOS only, no-op on other platforms).
47
enum class
HapticStyle
{
48
kLight
,
49
kMedium
,
50
kHeavy
,
51
kSelection
,
// Subtle tick for selection changes
52
kSuccess
,
// Notification: success
53
kWarning
,
// Notification: warning
54
kError
,
// Notification: error
55
};
56
void
TriggerHaptic
(
HapticStyle
style);
57
58
// Post an undo/redo request to the application layer.
59
void
PostUndoCommand
();
60
void
PostRedoCommand
();
61
62
// Post a sidebar toggle request.
63
void
PostToggleSidebar
();
64
65
}
// namespace ios
66
}
// namespace platform
67
}
// namespace yaze
yaze::platform::ios::TriggerHaptic
void TriggerHaptic(HapticStyle style)
Definition
ios_platform_state.mm:86
yaze::platform::ios::PostUndoCommand
void PostUndoCommand()
Definition
ios_platform_state.mm:135
yaze::platform::ios::PostOverlayCommand
void PostOverlayCommand(const char *command)
Definition
ios_platform_state.mm:59
yaze::platform::ios::SetOverlayTopInset
void SetOverlayTopInset(float top)
Definition
ios_platform_state.mm:43
yaze::platform::ios::GetOverlayTopInset
float GetOverlayTopInset()
Definition
ios_platform_state.mm:47
yaze::platform::ios::PostRedoCommand
void PostRedoCommand()
Definition
ios_platform_state.mm:145
yaze::platform::ios::PostEditorStateUpdate
void PostEditorStateUpdate(const EditorStateSnapshot &state)
Definition
ios_platform_state.mm:165
yaze::platform::ios::GetSafeAreaInsets
SafeAreaInsets GetSafeAreaInsets()
Definition
ios_platform_state.mm:39
yaze::platform::ios::PostToggleSidebar
void PostToggleSidebar()
Definition
ios_platform_state.mm:155
yaze::platform::ios::SetSafeAreaInsets
void SetSafeAreaInsets(float left, float right, float top, float bottom)
Definition
ios_platform_state.mm:35
yaze::platform::ios::GetMetalView
void * GetMetalView()
Definition
ios_platform_state.mm:31
yaze::platform::ios::SetMetalView
void SetMetalView(void *view)
Definition
ios_platform_state.mm:27
yaze::platform::ios::SetTouchScale
void SetTouchScale(float scale)
Definition
ios_platform_state.mm:51
yaze::platform::ios::HapticStyle
HapticStyle
Definition
ios_platform_state.h:47
yaze::platform::ios::HapticStyle::kSelection
@ kSelection
yaze::platform::ios::HapticStyle::kMedium
@ kMedium
yaze::platform::ios::HapticStyle::kHeavy
@ kHeavy
yaze::platform::ios::HapticStyle::kLight
@ kLight
yaze::platform::ios::HapticStyle::kSuccess
@ kSuccess
yaze::platform::ios::HapticStyle::kError
@ kError
yaze::platform::ios::HapticStyle::kWarning
@ kWarning
yaze::platform::ios::GetTouchScale
float GetTouchScale()
Definition
ios_platform_state.mm:55
yaze
Definition
patch_export_usage.cc:8
yaze::platform::ios::EditorStateSnapshot
Definition
ios_platform_state.h:17
yaze::platform::ios::EditorStateSnapshot::can_redo
bool can_redo
Definition
ios_platform_state.h:19
yaze::platform::ios::EditorStateSnapshot::is_dirty
bool is_dirty
Definition
ios_platform_state.h:21
yaze::platform::ios::EditorStateSnapshot::rom_title
std::string rom_title
Definition
ios_platform_state.h:23
yaze::platform::ios::EditorStateSnapshot::can_undo
bool can_undo
Definition
ios_platform_state.h:18
yaze::platform::ios::EditorStateSnapshot::editor_type
std::string editor_type
Definition
ios_platform_state.h:22
yaze::platform::ios::EditorStateSnapshot::can_save
bool can_save
Definition
ios_platform_state.h:20
yaze::platform::ios::SafeAreaInsets
Definition
ios_platform_state.h:9
yaze::platform::ios::SafeAreaInsets::left
float left
Definition
ios_platform_state.h:10
yaze::platform::ios::SafeAreaInsets::right
float right
Definition
ios_platform_state.h:11
yaze::platform::ios::SafeAreaInsets::top
float top
Definition
ios_platform_state.h:12
yaze::platform::ios::SafeAreaInsets::bottom
float bottom
Definition
ios_platform_state.h:13
src
app
platform
ios
ios_platform_state.h
Generated by
1.10.0