const unsigned long timeStamp(132);
const Integration::KeyEvent::State keyState(Integration::KeyEvent::Up);
const std::string deviceName("hwKeyboard");
- const DevelKeyEvent::DeviceClass::Type deviceClass = DevelKeyEvent::DeviceClass::KEYBOARD;
+ const DevelDevice::Class::Type deviceClass = DevelDevice::Class::KEYBOARD;
+ const DevelDevice::Subclass::Type deviceSubclass = DevelDevice::Subclass::NONE;
- Integration::KeyEvent keyEvent(keyName, keyString, keyCode, keyModifier, timeStamp, keyState, deviceName, deviceClass );
+ Integration::KeyEvent keyEvent(keyName, keyString, keyCode, keyModifier, timeStamp, keyState, deviceName, deviceClass, deviceSubclass );
DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
DALI_TEST_CHECK( keyEvent.keyName == keyName );
DALI_TEST_CHECK( keyEvent.keyString == keyString );
DALI_TEST_EQUALS( keyEvent.state, keyState, TEST_LOCATION);
DALI_TEST_EQUALS( keyEvent.deviceName, deviceName, TEST_LOCATION);
DALI_TEST_EQUALS( keyEvent.deviceClass, deviceClass, TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.deviceSubclass, deviceSubclass, TEST_LOCATION);
}
END_TEST;
}
DALI_TEST_EQUALS( keyEvent.time, 0lu, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.state, Integration::KeyEvent::Down, TEST_LOCATION);
DALI_TEST_EQUALS( keyEvent.deviceName, "", TEST_LOCATION);
- DALI_TEST_EQUALS( keyEvent.deviceClass, DevelKeyEvent::DeviceClass::NONE, TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.deviceClass, DevelDevice::Class::NONE, TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.deviceSubclass, DevelDevice::Subclass::NONE, TEST_LOCATION);
END_TEST;
}
KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
- DALI_TEST_EQUALS( DevelKeyEvent::GetDeviceClass( event ), DevelKeyEvent::DeviceClass::NONE, TEST_LOCATION);
+ DALI_TEST_EQUALS( DevelKeyEvent::GetDeviceClass( event ), DevelDevice::Class::NONE, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliKeyEventSetDeviceSubclass(void)
+{
+ TestApplication application;
+
+ KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
+
+ DALI_TEST_EQUALS( DevelKeyEvent::GetDeviceSubclass( event ), DevelDevice::Subclass::NONE, TEST_LOCATION);
END_TEST;
}
KeyEventGeneratedReceivedFunctor functor2( data2 );
GetImplementation( stage ).ConnectSignal( &application, "keyEventGenerated", functor2 );
- Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- Integration::KeyEvent event2( "i", "i", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event2( "i", "i", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- Integration::KeyEvent event3( "a", "a", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event3( "a", "a", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- Integration::KeyEvent event4( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event4( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
KeyEventReceivedFunctor functor( data );
stage.KeyEventSignal().Connect( &application, functor );
- Integration::KeyEvent event( "i", "i", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event( "i", "i", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- Integration::KeyEvent event2( "i", "i", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event2( "i", "i", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- Integration::KeyEvent event3( "a", "a", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event3( "a", "a", 0, 0, 0, Integration::KeyEvent::Down, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- Integration::KeyEvent event4( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelKeyEvent::DeviceClass::NONE );
+ Integration::KeyEvent event4( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, DEFAULT_DEVICE_NAME, DevelDevice::Class::NONE, DevelDevice::Subclass::NONE );
application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/system-overlay.h>
+#include <dali/devel-api/events/touch-event-devel.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
Vector2 ellipseRadius;
float pressure;
Degree angle;
+ DevelDevice::Class::Type deviceClass;
+ DevelDevice::Subclass::Type deviceSubclass;
TestPoint()
: deviceId(-1), state(PointState::FINISHED), radius(0), pressure(0)
p.ellipseRadius = touchData.GetEllipseRadius(i);
p.pressure = touchData.GetPressure(i);
p.angle = touchData.GetAngle(i);
+ p.deviceClass = DevelTouchData::GetDeviceClass(touchData, i);
+ p.deviceSubclass = DevelTouchData::GetDeviceSubclass(touchData, i);
signalData.touchData.points.push_back(p);
}
Integration::Point point;
point.SetState( state );
point.SetScreenPosition( screenPosition );
+ point.SetDeviceClass( DevelDevice::Class::TOUCH );
+ point.SetDeviceSubclass( DevelDevice::Subclass::NONE );
touchEvent.points.push_back( point );
return touchEvent;
}
DALI_TEST_EQUALS( true, touchEventFunctorCalled, TEST_LOCATION );
END_TEST;
+}
+int UtcDaliTouchDataGetDeviceAPINegative(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+ actor.SetSize(100.0f, 100.0f);
+ actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ Stage::GetCurrent().Add(actor);
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ // Connect to actor's touched signal
+ HandleData handleData;
+ TouchDataHandleFunctor functor( handleData );
+ actor.TouchSignal().Connect( &application, functor );
+
+ Vector2 screenCoordinates( 10.0f, 10.0f );
+ Vector2 localCoordinates;
+ actor.ScreenToLocal( localCoordinates.x, localCoordinates.y, screenCoordinates.x, screenCoordinates.y );
+
+ // Emit a down signal
+ application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, screenCoordinates ) );
+
+ TouchData data = handleData.touchData;
+ DALI_TEST_EQUALS( DevelTouchData::GetDeviceClass( data, -1 ), DevelDevice::Class::NONE, TEST_LOCATION );
+ DALI_TEST_EQUALS( DevelTouchData::GetDeviceSubclass( data, -1 ), DevelDevice::Subclass::NONE, TEST_LOCATION );
+ END_TEST;
}
--- /dev/null
+#ifndef DALI_DEVICE_H
+#define DALI_DEVICE_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Dali
+{
+
+/**
+ * @brief Information about device types
+ *
+ * These types are for widget viewer applications.
+ * A widget viewer application by Dali have to deliver events to widget applications
+ * Server for handling events actually delivers any events to widget applications
+ * The server needs to know input device information such as type to deliver events of proper type to widget applications
+ */
+namespace DevelDevice
+{
+
+/**
+ * @brief Categorization type about input Device
+ */
+namespace Class
+{
+
+/**
+ * @brief An enum of Device Class types.
+ */
+enum Type
+{
+ NONE, ///< Not a device
+ USER, ///< The user/seat (the user themselves)
+ KEYBOARD, ///< A regular keyboard, numberpad or attached buttons
+ MOUSE, ///< A mouse, trackball or touchpad relative motion device
+ TOUCH, ///< A touchscreen with fingers or stylus
+ PEN, ///< A special pen device
+ POINTER, ///< A pointing device based on laser, infrared or similar technology
+ GAMEPAD ///< A gamepad controller or joystick
+};
+
+} // namespace DeviceClass
+
+/**
+ * @brief Subcategorization type about input device
+ */
+namespace Subclass
+{
+
+/**
+ * @brief An enum of Device Subclass types.
+ */
+enum Type
+{
+ NONE, ///< Not a device
+ FINGER, ///< The normal flat of your finger
+ FINGERNAIL, ///< A fingernail
+ KNUCKLE, ///< A Knuckle
+ PALM, ///< The palm of a users hand
+ HAND_SIDE, ///< The side of your hand
+ HAND_FLAT, ///< The flat of your hand
+ PEN_TIP, ///< The tip of a pen
+ TRACKPAD, ///< A trackpad style mouse
+ TRACKPOINT, //< A trackpoint style mouse
+ TRACKBALL, ///< A trackball style mouse
+};
+
+} // namespace DeviceSubclass
+
+} // namespace DevelDevice
+
+} // namespace Dali
+
+#endif //DALI_KEY_EVENT_DEVEL_H
// INTERNAL_INCLUDES
#include <dali/public-api/events/key-event.h>
+#include <dali/devel-api/events/device.h>
namespace Dali
{
namespace DevelKeyEvent
{
-namespace DeviceClass
-{
-
-/**
- * @brief An enum of Device Classe types.
- */
-enum Type
-{
- NONE, ///< Not a device
- USER, ///< The user/seat (the user themselves)
- KEYBOARD, ///< A regular keyboard, numberpad or attached buttons
- MOUSE, ///< A mouse, trackball or touchpad relative motion device
- TOUCH, ///< A touchscreen with fingers or stylus
- PEN, ///< A special pen device
- POINTER, ///< A laser pointer, wii-style or 7"minority report" pointing device
- GAMEPAD ///< A gamepad controller or joystick
-};
-
-} // namespace DeviceClass
-
/**
* @brief Get the device name the key event originated from
*
/**
* @brief Get the device class the key event originated from
*
+ * The device class type is classification type of the input device of event received
* @param[in] keyEvent The KeyEvent to retrieve the device class from
- * @return The device class
+ * @return The type of the device class
+ */
+DALI_IMPORT_API DevelDevice::Class::Type GetDeviceClass( const KeyEvent& keyEvent );
+
+/**
+ * @brief Get the device subclass the key event originated from
+ *
+ * The device subclass type is subclassification type of the input device of event received.
+ * @param[in] keyEvent The KeyEvent to retrieve the device subclass from
+ * @return The type of the device subclass
*/
-DALI_IMPORT_API DeviceClass::Type GetDeviceClass( const KeyEvent& keyEvent );
+DALI_IMPORT_API DevelDevice::Subclass::Type GetDeviceSubclass( const KeyEvent& keyEvent );
} // namespace DevelKeyEvent
--- /dev/null
+#ifndef DALI_TOUCH_DATA_DEVEL_H
+#define DALI_TOUCH_DATA_DEVEL_H
+
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL_INCLUDES
+#include <dali/public-api/events/touch-data.h>
+#include <dali/devel-api/events/device.h>
+
+namespace Dali
+{
+
+namespace DevelTouchData
+{
+
+/**
+ * @brief Get the device class type the mouse/touch event originated from
+ *
+ * The device class type is classification type of the input device of event received.
+ * @param[in] touch The TouchData to retrieve the device class from
+ * @param[in] point The point required
+ * @return The type of the device class
+ */
+DALI_IMPORT_API DevelDevice::Class::Type GetDeviceClass( const TouchData& touch, std::size_t point );
+
+/**
+ * @brief Get the device subclass type the mouse/touch event originated from
+ *
+ * The device subclass type is subclassification type of the input device of event received.
+ * @param[in] touch The TouchData to retrieve the device subclass from
+ * @param[in] point The point required
+ * @return The type of the device subclass
+ */
+DALI_IMPORT_API DevelDevice::Subclass::Type GetDeviceSubclass( const TouchData& touch, std::size_t point );
+
+} // namespace DevelTouchData
+
+} // namespace Dali
+
+#endif //DALI_TOUCH_DATA_DEVEL_H
devel_api_core_events_header_files = \
$(devel_api_src_dir)/events/hit-test-algorithm.h \
+ $(devel_api_src_dir)/events/device.h \
+ $(devel_api_src_dir)/events/touch-event-devel.h \
$(devel_api_src_dir)/events/key-event-devel.h
devel_api_core_images_header_files = \
time( 0 ),
state( KeyEvent::Down ),
deviceName( "" ),
- deviceClass( DevelKeyEvent::DeviceClass::NONE )
+ deviceClass( DevelDevice::Class::NONE ),
+ deviceSubclass( DevelDevice::Subclass::NONE )
{
}
KeyEvent::KeyEvent( const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier,
- unsigned long timeStamp, const State& keyState, const std::string deviceName, const DevelKeyEvent::DeviceClass::Type deviceClass )
+ unsigned long timeStamp, const State& keyState, const std::string deviceName,
+ const DevelDevice::Class::Type deviceClass, const DevelDevice::Subclass::Type deviceSubclass )
: Event( Key ),
keyName( keyName ),
keyString( keyString ),
time( timeStamp ),
state( keyState ),
deviceName( deviceName ),
- deviceClass( deviceClass )
+ deviceClass( deviceClass ),
+ deviceSubclass( deviceSubclass )
{
}
time( event.time ),
state( static_cast< Integration::KeyEvent::State >( event.state ) ),
deviceName( "" ),
- deviceClass( DevelKeyEvent::DeviceClass::NONE )
+ deviceClass( DevelDevice::Class::NONE ),
+ deviceSubclass( DevelDevice::Subclass::NONE )
{
}
unsigned long timeStamp,
const State& keyState,
const std::string deviceName,
- const DevelKeyEvent::DeviceClass::Type deviceClass );
+ const DevelDevice::Class::Type deviceClass,
+ const DevelDevice::Subclass::Type deviceSubclass );
/*
* Constructor, creates a Integration::KeyEvent from a Dali::KeyEvent
/**
* Class of device KeyEvent originated from
*/
- DevelKeyEvent::DeviceClass::Type deviceClass;
+ DevelDevice::Class::Type deviceClass;
+
+ /**
+ * Subclass of device KeyEvent originated from
+ */
+ DevelDevice::Subclass::Type deviceSubclass;
};
} // namespace Integration
: mTouchPoint( 0, TouchPoint::Started, 0.0f, 0.0f ),
mEllipseRadius(),
mAngle( 0.0f ),
+ mDeviceClass( DevelDevice::Class::NONE ),
+ mDeviceSubclass( DevelDevice::Subclass::NONE ),
mPressure( 1.0f ),
mRadius( 0.0f )
{
: mTouchPoint( touchPoint ),
mEllipseRadius(),
mAngle( 0.0f ),
+ mDeviceClass( DevelDevice::Class::NONE ),
+ mDeviceSubclass( DevelDevice::Subclass::NONE ),
mPressure( 1.0f ),
mRadius( 0.0f )
{
return mTouchPoint;
}
+void Point::SetDeviceClass( DevelDevice::Class::Type deviceClass )
+{
+ mDeviceClass = deviceClass;
+}
+
+void Point::SetDeviceSubclass( DevelDevice::Subclass::Type deviceSubclass )
+{
+ mDeviceSubclass = deviceSubclass;
+}
+
+DevelDevice::Class::Type Point::GetDeviceClass() const
+{
+ return mDeviceClass;
+}
+
+DevelDevice::Subclass::Type Point::GetDeviceSubclass() const
+{
+ return mDeviceSubclass;
+}
+
} // namespace Integration
} // namespace Dali
#include <dali/public-api/math/degree.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/events/touch-point.h>
+#include <dali/devel-api/events/device.h>
namespace Dali
{
void SetAngle( Degree angle );
/**
+ * @brief Sets the class of the device for the event
+ * @param[in] deviceClass The class of the device.
+ */
+ void SetDeviceClass( DevelDevice::Class::Type deviceClass );
+
+ /**
+ * @brief Sets the subclass of the device for the event
+ * @param[in] deviceSubclass The subclass of the device.
+ */
+ void SetDeviceSubclass( DevelDevice::Subclass::Type deviceSubclass );
+
+ /**
* @brief Retrieve the Unique Device ID of the point.
* @return The Unique Device ID of the point.
*/
*/
Degree GetAngle() const;
+ /**
+ * @brief Retrieve the class of the device for the event.
+ * @return The class of the device
+ */
+ DevelDevice::Class::Type GetDeviceClass() const;
+
+ /**
+ * @brief Retrieve the subclass of the device for the event.
+ * @return The subclass of the device
+ */
+ DevelDevice::Subclass::Type GetDeviceSubclass() const;
+
+
+
public: // Not intended for Integration API developers
/**
TouchPoint mTouchPoint; ///< Stores screen position, device Id, local & screen positions and the hit-actor. @see TouchPoint
Vector2 mEllipseRadius; ///< Radius of both the horizontal and vertical radius (useful if an ellipse).
Degree mAngle; ///< The angle of the press point, relative to the Y-Axis.
+ DevelDevice::Class::Type mDeviceClass;
+ DevelDevice::Subclass::Type mDeviceSubclass;
float mPressure; ///< The touch pressure.
float mRadius; ///< Radius of the press point, an average of the ellipse radius.
};
KeyEventImpl::KeyEventImpl( KeyEvent* keyEvent )
: mDeviceName( "" ),
- mDeviceClass( DevelKeyEvent::DeviceClass::NONE )
+ mDeviceClass( DevelDevice::Class::NONE ),
+ mDeviceSubclass( DevelDevice::Subclass::NONE )
{
keyEventImplMap[keyEvent] = this;
}
{
mDeviceName = rhs.mDeviceName;
mDeviceClass = rhs.mDeviceClass;
+ mDeviceSubclass = rhs.mDeviceSubclass;
}
return *this;
mDeviceName = deviceName;
}
-DevelKeyEvent::DeviceClass::Type KeyEventImpl::GetDeviceClass() const
+DevelDevice::Class::Type KeyEventImpl::GetDeviceClass() const
{
return mDeviceClass;
}
-void KeyEventImpl::SetDeviceClass( const DevelKeyEvent::DeviceClass::Type& deviceClass )
+void KeyEventImpl::SetDeviceClass( DevelDevice::Class::Type deviceClass )
{
mDeviceClass = deviceClass;
}
+DevelDevice::Subclass::Type KeyEventImpl::GetDeviceSubclass() const
+{
+ return mDeviceSubclass;
+}
+
+void KeyEventImpl::SetDeviceSubclass( DevelDevice::Subclass::Type deviceSubclass )
+{
+ mDeviceSubclass = deviceSubclass;
+}
+
} // namsespace Internal
Internal::KeyEventImpl* GetImplementation( KeyEvent* keyEvent )
/**
* @brief Get the device name the key event originated from
*
- * @param[in] keyEvent The KeyEvent to retrieve the device name from
* @return The device name
*/
std::string GetDeviceName() const;
/**
* @brief Set the device name to the KeyEvent
*
- * @param[in] keyEvent The KeyEvent to set the device name on
* @param[in] deviceName Device name string to set
*/
void SetDeviceName( const std::string& deviceName );
/**
* @brief Get the device class the key event originated from
*
- * @param[in] keyEvent The KeyEvent to retrieve the device class from
* @return The device class
*/
- DevelKeyEvent::DeviceClass::Type GetDeviceClass() const;
+ DevelDevice::Class::Type GetDeviceClass() const;
/**
* @brief Set the device class to the KeyEvent
*
- * @param[in] keyEvent The KeyEvent to set the device class on
* @param[in] deviceClass Device class to set
*/
- void SetDeviceClass( const DevelKeyEvent::DeviceClass::Type& deviceClass );
+ void SetDeviceClass( DevelDevice::Class::Type deviceClass );
+
+ /**
+ * @brief Get the device subclass the key event originated from
+ *
+ * @return The device subclass
+ */
+ DevelDevice::Subclass::Type GetDeviceSubclass() const;
+
+ /**
+ * @brief Set the device subclass to the KeyEvent
+ *
+ * @param[in] deviceClass Device subclass to set
+ */
+ void SetDeviceSubclass( DevelDevice::Subclass::Type deviceSubclass );
private:
private:
std::string mDeviceName;
- DevelKeyEvent::DeviceClass::Type mDeviceClass;
+ DevelDevice::Class::Type mDeviceClass;
+ DevelDevice::Subclass::Type mDeviceSubclass;
};
} // namespace Internal
GetImplementation( &keyEvent )->SetDeviceName( event.deviceName );
GetImplementation( &keyEvent )->SetDeviceClass( event.deviceClass );
+ GetImplementation( &keyEvent )->SetDeviceSubclass( event.deviceSubclass );
// Emit the key event signal from stage.
consumed = mStage.EmitKeyEventGeneratedSignal( keyEvent );
mPoints.push_back( point );
}
+DevelDevice::Class::Type TouchData::GetDeviceClass( std::size_t point ) const
+{
+ if( point < mPoints.size() )
+ {
+ return mPoints[ point ].GetDeviceClass();
+ }
+ return DevelDevice::Class::NONE;
+}
+
+DevelDevice::Subclass::Type TouchData::GetDeviceSubclass( std::size_t point ) const
+{
+ if( point < mPoints.size() )
+ {
+ return mPoints[ point ].GetDeviceSubclass();
+ }
+ return DevelDevice::Subclass::NONE;
+}
+
} // namsespace Internal
} // namespace Dali
*/
void AddPoint( const Integration::Point& point );
+ /**
+ * @brief Get the device class the mouse/touch event originated from
+ *
+ * @return The device class
+ */
+ DevelDevice::Class::Type GetDeviceClass( std::size_t point ) const;
+
+ /**
+ * @brief Get the device subclass the mouse/touch event originated from
+ *
+ * @return The device subclass
+ */
+ DevelDevice::Subclass::Type GetDeviceSubclass( std::size_t point ) const;
+
private:
/// Undefined Copy constructor
/// Undefined
TouchData& operator=( const TouchData& other );
+private:
+
std::vector< Integration::Point > mPoints; ///< Container of the points for this touch event.
unsigned long mTime; ///< The time (in ms) that the touch event occurred.
};
return GetImplementation( &keyEvent )->GetDeviceName();
}
-DevelKeyEvent::DeviceClass::Type DevelKeyEvent::GetDeviceClass( const KeyEvent& keyEvent )
+DevelDevice::Class::Type DevelKeyEvent::GetDeviceClass( const KeyEvent& keyEvent )
{
return GetImplementation( &keyEvent )->GetDeviceClass();
}
+DevelDevice::Subclass::Type DevelKeyEvent::GetDeviceSubclass( const KeyEvent& keyEvent )
+{
+ return GetImplementation( &keyEvent )->GetDeviceSubclass();
+}
+
+
} // namespace Dali
// INTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
+#include <dali/devel-api/events/touch-event-devel.h>
#include <dali/internal/event/events/touch-data-impl.h>
#include <cstdio>
return GetImplementation( *this ).GetAngle( point );
}
+DevelDevice::Class::Type DevelTouchData::GetDeviceClass( const TouchData& touch, std::size_t point )
+{
+ return GetImplementation( touch ).GetDeviceClass( point );
+}
+
+DevelDevice::Subclass::Type DevelTouchData::GetDeviceSubclass( const TouchData& touch, std::size_t point )
+{
+ return GetImplementation( touch ).GetDeviceSubclass( point );
+}
+
TouchData::TouchData( Internal::TouchData* internal )
: BaseHandle( internal )
{