return;
}
- qt5_update_internal(surface_data(surf), surface_width(surf), surface_height(surf));
+// qt5_update_internal(surface_data(surf), surface_width(surf), surface_height(surf));
}
static void qt5_switch(DisplayChangeListener *dcl,
#include "displaywidget.h"
#include "mainwindow.h"
-extern "C" {
-void do_mouse_event(int button_type, int event_type,
- int origin_x, int origin_y, int x, int y, int z);
-}
-
uint32_t qt5_window_width = 0;
uint32_t qt5_window_height = 0;
int qt5_window_angle = 0;
#include "skinlayout.h"
#include "skincontrollerview.h"
-#ifdef CONFIG_MARU
-extern "C" void shutdown_qemu_gracefully(void);
-#endif
-
QOpenGLContext *qt5GLContext = NULL;
QSurfaceFormat qt5GLFormat;
QMessageBox::Yes | QMessageBox::Default,
QMessageBox::No);
if (r == QMessageBox::Yes) {
-#ifdef CONFIG_MARU
/* force close */
shutdown_qemu_gracefully();
-#endif
} else {
event->ignore();
}
#include "uiinformation.h"
#include "skincontrollerview.h"
+extern "C" {
+#include "skin/maruskin_operation.h"
+}
+
QT_BEGIN_NAMESPACE
class QLabel;
QT_END_NAMESPACE
#include "detailedinfodialog.h"
#include "aboutdialog.h"
-extern "C" void shutdown_qemu_gracefully(void);
-extern "C" void request_close(void);
-
ContextMenu::ContextMenu(QWidget *parent) :
QMenu(parent)
{
addSeparator();
/* Close menu */
+ longPressTimer = new QTimer(this);
action = addAction("&Close");
action->setIcon(QIcon(QPixmap(":/icons/close.png")));
connect(action, SIGNAL(triggered()), this, SLOT(slotClose()));
*/
}
+void ContextMenu::slotPwkeyRelease()
+{
+ do_hw_key_event(KEY_RELEASED, HARD_KEY_POWER);
+}
+
void ContextMenu::slotClose()
{
qDebug("close");
- request_close();
+ do_hw_key_event(KEY_PRESSED, HARD_KEY_POWER);
+
+ this->longPressTimer->setInterval(CLOSE_POWER_KEY_INTERVAL);
+ this->longPressTimer->setSingleShot(true);
+ connect(longPressTimer, SIGNAL(timeout()), this, SLOT(slotPwkeyRelease()));
+ this->longPressTimer->start();
}
ContextMenu::~ContextMenu()
#define CONTEXTMENU_H
#include <QMenu>
+#include <QTimer>
+
+extern "C" {
+#include "skin/maruskin_operation.h"
+#include "emul_state.h"
+}
+
+#define CLOSE_POWER_KEY_INTERVAL 1200 /* milli-seconds */
class ContextMenu : public QMenu
{
void slotAbout();
void slotForceClose();
void slotClose();
+ void slotPwkeyRelease();
private:
+ QTimer *longPressTimer;
};
-
#endif // CONTEXTMENU_H
#include "skinkeyitem.h"
-extern "C" void do_hw_key_event(int event_type, int keycode);
-
SkinKeyItem::SkinKeyItem(QImage pressedImg, HardwareKey *key, QGraphicsItem *parent) :
QGraphicsRectItem(key->region, parent)
{
#include "hardwarekey.h"
-/* keep it consistent with emulator-skin definition */
-enum {
- KEY_PRESSED = 1,
- KEY_RELEASED = 2,
-};
+extern "C" {
+#include "skin/maruskin_operation.h"
+#include "emul_state.h"
+}
class SkinKeyItem : public QGraphicsRectItem
{