hwkey: added hwkey operation 60/25060/1
authorsungmin ha <sungmin82.ha@samsung.com>
Mon, 28 Jul 2014 10:13:08 +0000 (19:13 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Mon, 28 Jul 2014 10:17:26 +0000 (19:17 +0900)
Change-Id: I70e6379355012ade3e205ac3fad3475df1533843
Signed-off-by: sungmin ha <sungmin82.ha@samsung.com>
tizen/src/ui/Makefile.objs
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/skinkeyitem.cpp
tizen/src/ui/skinkeyitem.h

index 2e5a8e47e700a18a41a311b1f2da22af48f50566..a47da03dca3a17696defcb4aa5691692e8e538b5 100644 (file)
@@ -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:
index 9e30a4ff187b3bef8fa3de71ed6f17b8720e4c67..690dfe21dc8e9db694cc712bc90f34dab2b8b32b 100644 (file)
@@ -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()
index 3797284fa59bd0c1708e7821be36c94ce7436e98..3075e098beab75287e856237d04fe87d7cd0cf9d 100644 (file)
@@ -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)
index 43862706244cad347ae7c07c7719d1ee11783de9..49d19535f063ff3b12ecf6cbaef3b5256849ba72 100644 (file)
@@ -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: