From: sungmin ha Date: Mon, 28 Jul 2014 10:13:08 +0000 (+0900) Subject: hwkey: added hwkey operation X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=053c9b970fe4ae229ba322499fcd2ff40ca31962;p=sdk%2Femulator%2Fqemu.git hwkey: added hwkey operation Change-Id: I70e6379355012ade3e205ac3fad3475df1533843 Signed-off-by: sungmin ha --- diff --git a/tizen/src/ui/Makefile.objs b/tizen/src/ui/Makefile.objs index 2e5a8e47e7..a47da03dca 100644 --- a/tizen/src/ui/Makefile.objs +++ b/tizen/src/ui/Makefile.objs @@ -1,5 +1,5 @@ TIZEN_UI = $(SRC_PATH)/tizen/src/ui -QEMU_CFLAGS += -fPIC $(QT_CFLAGS) -I$(TIZEN_UI) -DCONFIG_MARU +QEMU_CFLAGS += -fPIC $(QT_CFLAGS) -I$(TIZEN_UI) $(TIZEN_UI)/qrc_resource.o: $(TIZEN_UI)/qrc_resource.cpp $(TIZEN_UI)/qrc_resource.cpp: diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index 9e30a4ff18..690dfe21dc 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -5,9 +5,8 @@ #include "detailedinfodialog.h" #include "aboutdialog.h" -#ifdef CONFIG_MARU extern "C" void shutdown_qemu_gracefully(void); -#endif +extern "C" void request_close(void); ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent) @@ -210,10 +209,8 @@ void ContextMenu::slotForceClose() if (*reply == QMessageBox::Yes) { qDebug() << "exit!"; -#ifdef CONFIG_MARU /* force close */ shutdown_qemu_gracefully(); -#endif // MainWindow *win = (MainWindow *)this->parent(); // win->~MainWindow(); } else { @@ -239,6 +236,7 @@ void ContextMenu::slotForceClose() void ContextMenu::slotClose() { qDebug("close"); + request_close(); } ContextMenu::~ContextMenu() diff --git a/tizen/src/ui/skinkeyitem.cpp b/tizen/src/ui/skinkeyitem.cpp index 3797284fa5..3075e098be 100644 --- a/tizen/src/ui/skinkeyitem.cpp +++ b/tizen/src/ui/skinkeyitem.cpp @@ -1,5 +1,7 @@ #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) { @@ -23,6 +25,8 @@ void SkinKeyItem::mousePressEvent(QGraphicsSceneMouseEvent *event) pen.setColor(Qt::transparent); update(); + + do_hw_key_event(KEY_PRESSED, key->keycode); } void SkinKeyItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) @@ -33,6 +37,8 @@ void SkinKeyItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) isPressed = false; update(); + + do_hw_key_event(KEY_RELEASED, key->keycode); } void SkinKeyItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) diff --git a/tizen/src/ui/skinkeyitem.h b/tizen/src/ui/skinkeyitem.h index 4386270624..49d19535f0 100644 --- a/tizen/src/ui/skinkeyitem.h +++ b/tizen/src/ui/skinkeyitem.h @@ -6,6 +6,12 @@ #include "hardwarekey.h" +/* keep it consistent with emulator-skin definition */ +enum { + KEY_PRESSED = 1, + KEY_RELEASED = 2, +}; + class SkinKeyItem : public QGraphicsRectItem { public: