*
* Contact:
* GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
* Stanislav Vorobiov
*
* This program is free software; you can redistribute it and/or
this->scaleFactor = scaleFactor;
this->isDragging = false;
+ this->tsHelper = NULL;
+ this->mouseHelper = NULL;
+
this->offGuide = NULL;
this->offGuideShown = false;
this->isTsEnabled = is_touchscreen_enabled();
-
- /* touch screen */
- this->tsHelper = new TouchScreenHelper(this);
- win->getMainView()->getKbdHelper()->setMtTracker(tsHelper->getMtTracker());
-
- /* mouse */
- this->mouseHelper = new MouseHelper(this, resolution);
+ if (isTsEnabled == true) {
+ qDebug("touch screen device was enabled");
+
+ /* touch screen */
+ tsHelper = new TouchScreenHelper(this);
+ win->getMainView()->getKbdHelper()->setMtTracker(tsHelper->getMtTracker());
+ } else {
+ qDebug("touch screen device was not enabled");
+
+ /* mouse */
+ mouseHelper = new MouseHelper(this, resolution);
+ widget->setCursor(Qt::BlankCursor);
+ widget->setMouseTracking(true);
+ }
loadOffGuideImg();
guestPos.setY(guestPosX);
break;
case 0:
+ break;
default:
+ qWarning() << "unsupported coordinate system:" << rotateAngle;
break;
}
if (event->button() == Qt::LeftButton) {
isDragging = true;
- if (isTsEnabled == true) {
+ if (tsHelper != NULL) {
tsHelper->mousePressed(event, getGuestPos(event->pos()));
- } else {
+ }
+ if (mouseHelper != NULL) {
mouseHelper->mousePressed(event);
}
}
isDragging = false;
}
- if (isTsEnabled == true) {
+ if (tsHelper != NULL) {
tsHelper->mouseReleased(event, getGuestPos(event->pos()));
- } else {
+ }
+ if (mouseHelper != NULL) {
mouseHelper->mouseReleased(event);
}
}
void DisplayBase::handleMouseMove(QMouseEvent *event)
{
- if (isTsEnabled == true) { /* touch device */
+ /* touch screen device */
+ if (tsHelper != NULL) {
if (isDragging == true) {
int hostPosX = event->x();
int hostPosY = event->y();
tsHelper->mouseMoved(event, getGuestPos(event->pos()));
}
}
- } else { /* mouse device */
+ }
+
+ /* mouse device */
+ if (mouseHelper != NULL) {
const int hostPosX = event->x();
const int hostPosY = event->y();
void DisplayBase::handleMouseEnter(QEvent *event)
{
- if (isTsEnabled == false) {
+ if (mouseHelper != NULL) {
mouseHelper->mouseEnter(event);
}
}
void DisplayBase::handleMouseLeave(QEvent *event)
{
- if (isTsEnabled == false) {
+ if (mouseHelper != NULL) {
mouseHelper->mouseLeave(event);
}
}
*
* Contact:
* GiWoong Kim <giwoong.kim@samsung.com>
- * Sangho Park <sangho1206.park@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
* Stanislav Vorobiov
*
* This program is free software; you can redistribute it and/or
QGLWidget(context, parent), DisplayBase(displayForm, resolution, scaleFactor, this)
{
setAutoBufferSwap(false);
- isTouch = is_touchscreen_enabled();
- /* mouse mode */
- if (!isTouch) {
- setCursor(Qt::BlankCursor);
- setMouseTracking(true);
- }
}
/* override */