DT_GTK,
DT_NOGRAPHIC,
#ifdef CONFIG_MARU
+# ifdef CONFIG_JAVA_UI
DT_MARU_SDL,
DT_MARU_SHM,
+# endif
+# ifdef CONFIG_QT
DT_MARU_QT_ONSCREEN,
DT_MARU_QT_OFFSCREEN,
+# endif
#endif
DT_NONE,
} DisplayType;
static Notifier maru_display_exit = { .notify = maru_display_notify_exit };
-void maru_display_early_init(DisplayType display_type)
-{
- 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
- default:
- break;
- }
-}
-
// FIXME
#ifdef SDL_THREAD
QemuMutex sdl_mutex;
maru_shm_pre_init(mdcl);
break;
#endif
-#endif
-#ifdef CONFIG_QT
- case DT_MARU_QT_ONSCREEN:
- case DT_MARU_QT_OFFSCREEN:
- #ifdef SDL_THREAD
- // FIXME
- qemu_mutex_init(&sdl_mutex);
- #endif
-
- maru_qt5_display_init(mdcl, full_screen);
- break;
#endif
default:
ERR("can not enter here.\n");
bool ready;
} MaruScreenShot;
-void maru_display_early_init(DisplayType display_type);
void maru_display_init(DisplayState *ds, DisplayType display_type,
int full_screen);
void maru_display_resize(void);
/* maru_shm */
void maru_shm_pre_init(MaruDisplayChangeListener *mdcl);
-
-/* maru_qt */
-void maru_qt5_display_early_init(bool isOnscreen);
-
-void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen);
-
-void maru_qt5_display_quit(void);
#endif /* __MARU_DISPLAY_H__ */
*/
#include "ui/console.h"
+
+#include "qt5.h"
#include "emul_state.h"
-#include "maru_display.h"
#include "qt5_supplement.h"
#include "hw/pci/maru_brightness.h"
+#ifdef CONFIG_DARWIN
+#include "ns_event.h"
+#endif
+
#include "util/new_debug_ch.h"
DECLARE_DEBUG_CHANNEL(qt5_console);
-/* static Notifier mouse_mode_notifier; */
static int qt5_num_outputs;
static struct qt5_state {
.dpy_cursor_define = qt5_mouse_define,
};
-#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)
+void maru_early_qt5_display_init(bool isOnscreen)
{
#ifdef CONFIG_DARWIN
ns_run_in_event_loop_with_bool(&qt5_early_prepare, isOnscreen);
#else
qt5_early_prepare(isOnscreen);
#endif
+ if (isOnscreen) {
+ LOG_INFO("Display Type: QT5 Onscreen\n");
+ } else {
+ LOG_INFO("Display Type: QT5 Offscreen\n");
+ }
}
-void maru_qt5_display_quit(void)
+static void maru_qt5_display_fini(void)
{
if (qt5_console) {
g_free(qt5_console);
qt5_console = NULL;
}
+ qt5_destroy();
}
-void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen)
+void maru_qt5_display_init(DisplayState *ds, int full_screen)
{
int i;
if (full_screen) {
/* TODO */
}
- atexit(qt5_destroy);
+ atexit(maru_qt5_display_fini);
/* TODO
mouse_mode_notifier.notify = qt2_mouse_mode_change;
--- /dev/null
+/*
+ * QT5 display driver
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef __QT5_H__
+#define __QT5_H__
+
+#include <stdbool.h>
+
+#include "sysemu/sysemu.h"
+
+void maru_early_qt5_display_init(bool isOnscreen);
+void maru_qt5_display_init(DisplayState *ds, int full_screen);
+
+void set_display_pixel_density(int dpi);
+
+#endif // __QT5_H__
#include "exec/memory.h"
#ifdef CONFIG_MARU
+#include "sysemu/sysemu.h"
+
extern int initial_resolution_width;
extern int initial_resolution_height;
# ifdef SDL_THREAD
}
if (dcl->ops->dpy_gfx_switch) {
#ifdef SDL_THREAD
- qemu_mutex_lock(&sdl_mutex);
+ if (display_type == DT_MARU_SDL) {
+ qemu_mutex_lock(&sdl_mutex);
+ }
#endif
if (con) {
}
#ifdef SDL_THREAD
- qemu_mutex_unlock(&sdl_mutex);
+ if (display_type == DT_MARU_SDL) {
+ qemu_mutex_unlock(&sdl_mutex);
+ }
#endif
}
text_console_update_cursor(NULL);
DisplayChangeListener *dcl;
#ifdef SDL_THREAD
- qemu_mutex_lock(&sdl_mutex);
+ if (display_type == DT_MARU_SDL) {
+ qemu_mutex_lock(&sdl_mutex);
+ }
#endif
con->surface = surface;
}
#ifdef SDL_THREAD
- qemu_mutex_unlock(&sdl_mutex);
+ if (display_type == DT_MARU_SDL) {
+ qemu_mutex_unlock(&sdl_mutex);
+ }
#endif
qemu_free_displaysurface(old_surface);
#ifdef CONFIG_MARU
#include "tizen/src/emulator.h"
#include "tizen/src/emul_state.h"
-#include "tizen/src/display/maru_display.h"
+#include "tizen/src/display/qt5.h"
#include "tizen/src/skin/maruskin_operation.h"
#include "tizen/src/ecs/ecs.h"
+# ifdef CONFIG_JAVA_UI
+#include "tizen/src/display/maru_display.h"
+# endif
#endif
#define DEFAULT_RAM_SIZE 128
#endif
#ifdef CONFIG_MARU
- if (display_type == DT_MARU_QT_ONSCREEN ||
- display_type == DT_MARU_QT_OFFSCREEN) {
- maru_display_early_init(display_type);
+# if defined(CONFIG_QT)
+ if (display_type == DT_MARU_QT_ONSCREEN) {
+ maru_early_qt5_display_init(true);
+ } else if (display_type == DT_MARU_QT_OFFSCREEN) {
+ maru_early_qt5_display_init(false);
}
+# endif
#endif
socket_init();
#if defined(CONFIG_QT)
case DT_MARU_QT_ONSCREEN:
case DT_MARU_QT_OFFSCREEN:
- maru_display_init(ds, display_type, full_screen);
+ maru_qt5_display_init(ds, full_screen);
break;
#endif
#endif