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
5namespace yaze {
6namespace platform {
7namespace ios {
8
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.
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).
29
30void SetMetalView(void* view);
31void* GetMetalView();
32
33void SetSafeAreaInsets(float left, float right, float top, float bottom);
35
36void SetOverlayTopInset(float top);
37float GetOverlayTopInset();
38
39void SetTouchScale(float scale);
40float GetTouchScale();
41
42// Post a command to the SwiftUI overlay (iOS only).
43// Commands map to OverlayCommand in `src/ios/iOS/YazeOverlayView.swift`.
44void PostOverlayCommand(const char* command);
45
46// Haptic feedback (iOS only, no-op on other platforms).
47enum 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};
56void TriggerHaptic(HapticStyle style);
57
58// Post an undo/redo request to the application layer.
59void PostUndoCommand();
60void PostRedoCommand();
61
62// Post a sidebar toggle request.
64
65} // namespace ios
66} // namespace platform
67} // namespace yaze
void TriggerHaptic(HapticStyle style)
void PostOverlayCommand(const char *command)
void SetOverlayTopInset(float top)
void PostEditorStateUpdate(const EditorStateSnapshot &state)
SafeAreaInsets GetSafeAreaInsets()
void SetSafeAreaInsets(float left, float right, float top, float bottom)
void SetMetalView(void *view)
void SetTouchScale(float scale)