switch (display_type) {
#ifdef CONFIG_QT
case DT_MARU_QT_ONSCREEN:
+ INFO("Display Type: Qt5 Onscreen\n");
maru_qt5_display_early_init(true);
break;
case DT_MARU_QT_OFFSCREEN:
+ INFO("Display Type: Qt5 Offscreen\n");
maru_qt5_display_early_init(false);
break;
#endif
switch (display_type) {
#ifdef CONFIG_SDL
case DT_MARU_SDL:
+ INFO("Display Type: SDL\n");
maru_sdl_pre_init(mdcl);
break;
#endif
#ifdef CONFIG_USE_SHM
case DT_MARU_SHM:
+ INFO("Display Type: SHM\n");
maru_shm_pre_init(mdcl);
break;
#endif
#ifdef CONFIG_DARWIN
void ns_run_in_event_loop(void (*func)());
+void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue);
void set_application_icon(char *path);
#endif
void maru_qt5_display_early_init(bool isOnscreen)
{
#ifdef CONFIG_DARWIN
- ns_run_in_event_loop(&qt5_early_prepare);
+ ns_run_in_event_loop_with_bool(&qt5_early_prepare, isOnscreen);
/* set emulator icon */
#define ICON_RESOURCE_PATH "../icons/"
void qt5_early_prepare(bool isOnscreen)
{
- qt5IsOnscreen = isOnscreen;
Q_INIT_RESOURCE(resource);
qInstallMessageHandler(qMessageOutput);
+ qt5IsOnscreen = isOnscreen;
#ifdef CONFIG_DARWIN
#define LIBQCOCOA "libqcocoa.dylib"
void ns_run_in_event_loop(void (*func)());
+void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue);
+
void set_application_icon(char *path);
#endif /* _NS_EVENT_H_ */
@interface Runner : NSObject
{
- @public void (*func)();
+ @public void (*func_void)();
+ @public void (*func_bool)(bool bArg);
+ @public bool isTrue;
}
- (void)run;
@end
@implementation Runner
- (void)run;
{
- self->func();
+ if (self->func_void) {
+ self->func_void();
+ }
+ if (self->func_bool) {
+ self->func_bool(self->isTrue);
+ }
}
@end
void ns_run_in_event_loop(void (*func)())
{
Runner *runner = [[Runner alloc] init];
- runner->func = func;
+ runner->func_void = func;
+ [runner performSelectorOnMainThread:@selector(run) withObject:nil waitUntilDone:YES];
+ [runner release];
+}
+
+void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue)
+{
+ Runner *runner = [[Runner alloc] init];
+ runner->func_bool = func;
+ runner->isTrue = isTrue;
[runner performSelectorOnMainThread:@selector(run) withObject:nil waitUntilDone:YES];
[runner release];
}