60#if defined(__APPLE__) && (TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1)
61 if (!command || command[0] ==
'\0') {
64 NSString* cmd = [NSString stringWithUTF8String:command];
65 if (!cmd || cmd.length == 0) {
70 [[NSNotificationCenter defaultCenter]
71 postNotificationName:
@"yaze.overlay.command"
73 userInfo:@{
@"command" : cmd}];
76 if ([NSThread isMainThread]) {
79 dispatch_async(dispatch_get_main_queue(), post);
87#if defined(__APPLE__) && (TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1)
88 dispatch_async(dispatch_get_main_queue(), ^{
91 auto* gen = [[UIImpactFeedbackGenerator alloc]
92 initWithStyle:UIImpactFeedbackStyleLight];
97 auto* gen = [[UIImpactFeedbackGenerator alloc]
98 initWithStyle:UIImpactFeedbackStyleMedium];
103 auto* gen = [[UIImpactFeedbackGenerator alloc]
104 initWithStyle:UIImpactFeedbackStyleHeavy];
105 [gen impactOccurred];
109 auto* gen = [[UISelectionFeedbackGenerator alloc] init];
110 [gen selectionChanged];
114 auto* gen = [[UINotificationFeedbackGenerator alloc] init];
115 [gen notificationOccurred:UINotificationFeedbackTypeSuccess];
119 auto* gen = [[UINotificationFeedbackGenerator alloc] init];
120 [gen notificationOccurred:UINotificationFeedbackTypeWarning];
124 auto* gen = [[UINotificationFeedbackGenerator alloc] init];
125 [gen notificationOccurred:UINotificationFeedbackTypeError];
166#if defined(__APPLE__) && (TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1)
176 g_last_editor_state = state;
179 NSNumber* canUndo = @(state.
can_undo);
180 NSNumber* canRedo = @(state.
can_redo);
181 NSNumber* canSave = @(state.
can_save);
182 NSNumber* isDirty = @(state.
is_dirty);
183 NSString* editorType = [NSString stringWithUTF8String:state.
editor_type.c_str()];
184 NSString* romTitle = [NSString stringWithUTF8String:state.
rom_title.c_str()];
193 [[NSNotificationCenter defaultCenter]
194 postNotificationName:
@"yaze.state.editor"
197 @"canUndo" : canUndo,
198 @"canRedo" : canRedo,
199 @"canSave" : canSave,
200 @"isDirty" : isDirty,
201 @"editorType" : editorType,
202 @"romTitle" : romTitle,
206 if ([NSThread isMainThread]) {
209 dispatch_async(dispatch_get_main_queue(), post);