DALI_TEST_CHECK( frameBuffer );
frameBuffer.AttachColorTexture( texture, 0u, 1u );
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ Renderer renderer = Renderer::New(geometry, shader);
+
application.SendNotification();
application.Render(16);
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;
}
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
- DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
+ {
+ PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
+ DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
- const float halfQuadSize = .5f;
- struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
- TexturedQuadVertex texturedQuadVertexData[4] = {
- { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
- { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
- { Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f) },
- { Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
+ const float halfQuadSize = .5f;
+ struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+ TexturedQuadVertex texturedQuadVertexData[4] = {
+ { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
+ { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
+ { Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f) },
+ { Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
- propertyBuffer.SetData( texturedQuadVertexData, 4 );
+ propertyBuffer.SetData( texturedQuadVertexData, 4 );
- Geometry geometry = Geometry::New();
- geometry.AddVertexBuffer( propertyBuffer );
+ Geometry geometry = Geometry::New();
+ geometry.AddVertexBuffer( propertyBuffer );
- Shader shader = CreateShader();
- Renderer renderer = Renderer::New(geometry, shader);
- Actor actor = Actor::New();
- actor.SetSize(Vector3::ONE * 100.f);
- actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ Shader shader = CreateShader();
+ Renderer renderer = Renderer::New(geometry, shader);
+ Actor actor = Actor::New();
+ actor.SetSize(Vector3::ONE * 100.f);
+ actor.AddRenderer(renderer);
+ Stage::GetCurrent().Add(actor);
- application.SendNotification();
- application.Render(0);
- application.Render();
- application.SendNotification();
+ application.SendNotification();
+ application.Render(0);
+ application.Render();
+ application.SendNotification();
- const TestGlAbstraction::BufferDataCalls& bufferDataCalls =
- application.GetGlAbstraction().GetBufferDataCalls();
+ const TestGlAbstraction::BufferDataCalls& bufferDataCalls =
+ application.GetGlAbstraction().GetBufferDataCalls();
+
+ DALI_TEST_EQUALS( bufferDataCalls.size(), 1u, TEST_LOCATION );
- DALI_TEST_EQUALS( bufferDataCalls.size(), 1u, TEST_LOCATION );
+ DALI_TEST_EQUALS( bufferDataCalls[0], sizeof(texturedQuadVertexData), TEST_LOCATION );
- DALI_TEST_EQUALS( bufferDataCalls[0], sizeof(texturedQuadVertexData), TEST_LOCATION );
+ }
+ // end of scope to let the buffer and geometry die; do another notification and render to get the deletion processed
+ application.SendNotification();
+ application.Render(0);
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;
}
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
#include <iostream>
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/common/dali-vector-devel.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
END_TEST;
}
+int UtcDaliVectorCpp11ForP(void)
+{
+ Vector< Vector3 > classvector;
+ for ( auto i : classvector )
+ {
+ std::ignore = i;
+ tet_result( TET_FAIL );
+ }
+
+ classvector.PushBack( Vector3( 0.1f, 0.2f, 0.3f ) );
+ classvector.PushBack( Vector3( 0.1f, 0.2f, 0.3f ) );
+ classvector.PushBack( Vector3( 0.1f, 0.2f, 0.3f ) );
+
+ for ( auto i : classvector )
+ {
+ DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), i, TEST_LOCATION );
+ }
+
+ END_TEST;
+}
+
+
/*
* this does not compile at the moment
* Vector< Actor > classvector; this does not compile yet either
--- /dev/null
+#ifndef DALI_VECTOR_DEVEL_H
+#define DALI_VECTOR_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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+
+namespace Dali
+{
+/**
+ * Dali::Vector support for C++11 Range-based for loop: for( item : container )
+ *
+ * @param vector The vector to iterate
+ * @return The start iterator
+ */
+template< class T >
+typename T::Iterator begin( T& vector )
+{
+ return vector.Begin();
+}
+
+/**
+ * Dali::Vector support for C++11 Range-based for loop: for( item : container )
+ *
+ * @param vector The vector to iterate
+ * @return The end iterator
+ */
+template< class T >
+typename T::Iterator end( T& vector )
+{
+ return vector.End();
+}
+
+} // namespace Dali
+
+#endif /* DALI_VECTOR_DEVEL_H */
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/common/dali-vector.h>
+#include <dali/devel-api/common/dali-vector-devel.h>
namespace Dali
{
--- /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_src_dir)/animation/animation-devel.h
devel_api_core_common_header_files = \
+ $(devel_api_src_dir)/common/dali-vector-devel.h \
$(devel_api_src_dir)/common/hash.h \
$(devel_api_src_dir)/common/map-wrapper.h \
$(devel_api_src_dir)/common/owner-container.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.
};
namespace SceneGraph
{
-typedef OwnerContainer< Render::Renderer* > RendererOwnerContainer;
-typedef RendererOwnerContainer::Iterator RendererOwnerIter;
-
-typedef OwnerContainer< Render::Geometry* > GeometryOwnerContainer;
-typedef GeometryOwnerContainer::Iterator GeometryOwnerIter;
-
-typedef OwnerContainer< Render::Sampler* > SamplerOwnerContainer;
-typedef SamplerOwnerContainer::Iterator SamplerOwnerIter;
-
-typedef OwnerContainer< Render::Texture* > TextureOwnerContainer;
-typedef TextureOwnerContainer::Iterator TextureOwnerIter;
-
-typedef OwnerContainer< Render::FrameBuffer* > FrameBufferOwnerContainer;
-typedef FrameBufferOwnerContainer::Iterator FrameBufferOwnerIter;
-
-typedef OwnerContainer< Render::PropertyBuffer* > PropertyBufferOwnerContainer;
-typedef PropertyBufferOwnerContainer::Iterator PropertyBufferOwnerIter;
-
-typedef OwnerContainer< Render::RenderTracker* > RenderTrackerContainer;
-typedef RenderTrackerContainer::Iterator RenderTrackerIter;
-typedef RenderTrackerContainer::ConstIterator RenderTrackerConstIter;
-
/**
* Structure to contain internal data
*/
void UpdateTrackers()
{
- for(RenderTrackerIter iter = mRenderTrackers.Begin(), end = mRenderTrackers.End(); iter != end; ++iter)
+ for( auto&& iter : mRenderTrackers )
{
- (*iter)->PollSyncObject();
+ iter->PollSyncObject();
}
}
// the order is important for destruction,
// programs are owned by context at the moment.
- Context context; ///< holds the GL state
- Integration::GlSyncAbstraction& glSyncAbstraction; ///< GL sync abstraction
- RenderQueue renderQueue; ///< A message queue for receiving messages from the update-thread.
+ Context context; ///< holds the GL state
+ Integration::GlSyncAbstraction& glSyncAbstraction; ///< GL sync abstraction
+ RenderQueue renderQueue; ///< A message queue for receiving messages from the update-thread.
// Render instructions describe what should be rendered during RenderManager::Render()
// Owned by RenderManager. Update manager updates instructions for the next frame while we render the current one
- RenderInstructionContainer instructions;
+ RenderInstructionContainer instructions;
- Vector4 backgroundColor; ///< The glClear color used at the beginning of each frame.
+ Vector4 backgroundColor; ///< The glClear color used at the beginning of each frame.
- unsigned int frameCount; ///< The current frame count
- BufferIndex renderBufferIndex; ///< The index of the buffer to read from; this is opposite of the "update" buffer
+ unsigned int frameCount; ///< The current frame count
+ BufferIndex renderBufferIndex; ///< The index of the buffer to read from; this is opposite of the "update" buffer
- Rect<int> defaultSurfaceRect; ///< Rectangle for the default surface we are rendering to
+ Rect<int> defaultSurfaceRect; ///< Rectangle for the default surface we are rendering to
- RendererOwnerContainer rendererContainer; ///< List of owned renderers
- SamplerOwnerContainer samplerContainer; ///< List of owned samplers
- TextureOwnerContainer textureContainer; ///< List of owned textures
- FrameBufferOwnerContainer frameBufferContainer; ///< List of owned framebuffers
- PropertyBufferOwnerContainer propertyBufferContainer; ///< List of owned property buffers
- GeometryOwnerContainer geometryContainer; ///< List of owned Geometries
+ OwnerContainer< Render::Renderer* > rendererContainer; ///< List of owned renderers
+ OwnerContainer< Render::Sampler* > samplerContainer; ///< List of owned samplers
+ OwnerContainer< Render::Texture* > textureContainer; ///< List of owned textures
+ OwnerContainer< Render::FrameBuffer* > frameBufferContainer; ///< List of owned framebuffers
+ OwnerContainer< Render::PropertyBuffer* > propertyBufferContainer; ///< List of owned property buffers
+ OwnerContainer< Render::Geometry* > geometryContainer; ///< List of owned Geometries
- bool lastFrameWasRendered; ///< Keeps track of the last frame being rendered due to having render instructions
+ bool lastFrameWasRendered; ///< Keeps track of the last frame being rendered due to having render instructions
- RenderTrackerContainer mRenderTrackers; ///< List of render trackers
+ OwnerContainer< Render::RenderTracker* > mRenderTrackers; ///< List of render trackers
- ProgramController programController; ///< Owner of the GL programs
+ ProgramController programController; ///< Owner of the GL programs
};
mImpl->programController.GlContextDestroyed();
//Inform textures
- for( TextureOwnerIter iter = mImpl->textureContainer.Begin(); iter != mImpl->textureContainer.End(); ++iter )
+ for( auto&& texture : mImpl->textureContainer )
{
- (*iter)->GlContextDestroyed();
+ texture->GlContextDestroyed();
}
//Inform framebuffers
- for( FrameBufferOwnerIter iter = mImpl->frameBufferContainer.Begin(); iter != mImpl->frameBufferContainer.End(); ++iter )
+ for( auto&& framebuffer : mImpl->frameBufferContainer )
{
- (*iter)->GlContextDestroyed();
+ framebuffer->GlContextDestroyed();
}
// inform renderers
- RendererOwnerContainer::Iterator end = mImpl->rendererContainer.End();
- RendererOwnerContainer::Iterator iter = mImpl->rendererContainer.Begin();
- for( ; iter != end; ++iter )
+ for( auto&& renderer : mImpl->rendererContainer )
{
- GlResourceOwner* renderer = *iter;
- renderer->GlContextDestroyed(); // Clear up vertex buffers
+ renderer->GlContextDestroyed();
}
}
{
DALI_ASSERT_DEBUG( NULL != texture );
- TextureOwnerContainer& textures = mImpl->textureContainer;
-
- // Find the texture
- for ( TextureOwnerIter iter = textures.Begin(); iter != textures.End(); ++iter )
+ // Find the texture, use reference to pointer so we can do the erase safely
+ for ( auto&& iter : mImpl->textureContainer )
{
- if ( *iter == texture )
+ if ( iter == texture )
{
texture->Destroy( mImpl->context );
- textures.Erase( iter ); // Texture found; now destroy it
- break;
+ mImpl->textureContainer.Erase( &iter ); // Texture found; now destroy it
+ return;
}
}
}
{
DALI_ASSERT_DEBUG( NULL != frameBuffer );
- FrameBufferOwnerContainer& framebuffers = mImpl->frameBufferContainer;
-
- // Find the sampler
- for ( FrameBufferOwnerIter iter = framebuffers.Begin(); iter != framebuffers.End(); ++iter )
+ // Find the sampler, use reference so we can safely do the erase
+ for ( auto&& iter : mImpl->frameBufferContainer )
{
- if ( *iter == frameBuffer )
+ if ( iter == frameBuffer )
{
frameBuffer->Destroy( mImpl->context );
- framebuffers.Erase( iter ); // frameBuffer found; now destroy it
+ mImpl->frameBufferContainer.Erase( &iter ); // frameBuffer found; now destroy it
break;
}
}
{
DALI_ASSERT_DEBUG( NULL != geometry );
- GeometryOwnerContainer& geometries = mImpl->geometryContainer;
-
- // Find the renderer
- for ( GeometryOwnerIter iter = geometries.Begin(); iter != geometries.End(); ++iter )
+ // Find the geometry
+ for ( auto&& iter : mImpl->geometryContainer )
{
- if ( *iter == geometry )
+ if ( iter == geometry )
{
- (*iter)->AddPropertyBuffer( propertyBuffer );
+ iter->AddPropertyBuffer( propertyBuffer );
break;
}
}
{
DALI_ASSERT_DEBUG( NULL != geometry );
- GeometryOwnerContainer& geometries = mImpl->geometryContainer;
-
- // Find the renderer
- for ( GeometryOwnerIter iter = geometries.Begin(); iter != geometries.End(); ++iter )
+ // Find the geometry
+ for ( auto&& iter : mImpl->geometryContainer )
{
- if ( *iter == geometry )
+ if ( iter == geometry )
{
- (*iter)->RemovePropertyBuffer( propertyBuffer );
+ iter->RemovePropertyBuffer( propertyBuffer );
break;
}
}
mImpl->UpdateTrackers();
//Notify RenderGeometries that rendering has finished
- for ( GeometryOwnerIter iter = mImpl->geometryContainer.Begin(); iter != mImpl->geometryContainer.End(); ++iter )
+ for ( auto&& iter : mImpl->geometryContainer )
{
- (*iter)->OnRenderFinished();
+ iter->OnRenderFinished();
}
}
inline void ResetToBaseValues( OwnerContainer<T*>& container, BufferIndex updateBufferIndex )
{
// Reset animatable properties to base values
- typename OwnerContainer<T*>::Iterator iter = container.Begin();
- const typename OwnerContainer<T*>::ConstIterator endIter = container.End();
- for ( ; iter != endIter; ++iter )
+ // use reference to avoid extra copies of the iterator
+ for( auto&& iter : container )
{
- (*iter)->ResetToBaseValues( updateBufferIndex );
+ iter->ResetToBaseValues( updateBufferIndex );
}
}
{
DALI_ASSERT_DEBUG( object && "NULL object not allowed" );
- typename OwnerContainer<T*>::Iterator iter = container.Begin();
- const typename OwnerContainer<T*>::ConstIterator endIter = container.End();
- for ( ; iter != endIter; ++iter )
+ // need to use the reference version of auto as we need the pointer to the pointer for the Release call below
+ for( auto&& iter : container )
{
- if ( *iter == object )
+ if ( iter == object )
{
// Transfer ownership to the discard queue, this keeps the object alive, until the render-thread has finished with it
- discardQueue.Add( updateBufferIndex, container.Release( iter ) );
- return;
+ discardQueue.Add( updateBufferIndex, container.Release( &iter ) ); // take the address of the reference to a pointer (iter)
+ return; // return as we only ever remove one object. Iterators to container are now invalidated as well so cannot continue
}
}
}
}
-typedef OwnerContainer< Shader* > ShaderOwner;
-typedef ShaderOwner::Iterator ShaderIter;
-typedef std::vector<Internal::ShaderDataPtr> ShaderDataBinaryQueue;
-
-typedef OwnerContainer< TextureSet* > TextureSetOwner;
-typedef TextureSetOwner::Iterator TextureSetIter;
-
-typedef OwnerContainer<Renderer*> RendererOwner;
-typedef RendererOwner::Iterator RendererIter;
-
-typedef OwnerContainer< Camera* > CameraOwner;
-typedef OwnerContainer< PropertyOwner* > CustomObjectOwner;
-
/**
* Structure to contain UpdateManager internal data
*/
{
// Disconnect render tasks from nodes, before destroying the nodes
RenderTaskList::RenderTaskContainer& tasks = taskList.GetTasks();
- for (RenderTaskList::RenderTaskContainer::Iterator iter = tasks.Begin(); iter != tasks.End(); ++iter)
+ for ( auto&& iter : tasks )
{
- (*iter)->SetSourceNode( NULL );
+ iter->SetSourceNode( NULL );
}
// ..repeat for system level RenderTasks
RenderTaskList::RenderTaskContainer& systemLevelTasks = systemLevelTaskList.GetTasks();
- for (RenderTaskList::RenderTaskContainer::Iterator iter = systemLevelTasks.Begin(); iter != systemLevelTasks.End(); ++iter)
+ for ( auto&& iter : systemLevelTasks )
{
- (*iter)->SetSourceNode( NULL );
+ iter->SetSourceNode( NULL );
}
// UpdateManager owns the Nodes. Although Nodes are pool allocated they contain heap allocated parts
delete sceneController;
}
- SceneGraphBuffers sceneGraphBuffers; ///< Used to keep track of which buffers are being written or read
- RenderMessageDispatcher renderMessageDispatcher; ///< Used for passing messages to the render-thread
- NotificationManager& notificationManager; ///< Queues notification messages for the event-thread.
- TransformManager transformManager; ///< Used to update the transformation matrices of the nodes
- CompleteNotificationInterface& animationPlaylist; ///< Holds handles to all the animations
- PropertyNotifier& propertyNotifier; ///< Provides notification to applications when properties are modified.
- ShaderSaver* shaderSaver; ///< Saves shader binaries.
- DiscardQueue& discardQueue; ///< Nodes are added here when disconnected from the scene-graph.
- RenderController& renderController; ///< render controller
- SceneControllerImpl* sceneController; ///< scene controller
- RenderManager& renderManager; ///< This is responsible for rendering the results of each "update"
- RenderQueue& renderQueue; ///< Used to queue messages for the next render
- RenderInstructionContainer& renderInstructions; ///< Used to prepare the render instructions
- RenderTaskProcessor& renderTaskProcessor; ///< Handles RenderTasks and RenderInstrucitons
+ SceneGraphBuffers sceneGraphBuffers; ///< Used to keep track of which buffers are being written or read
+ RenderMessageDispatcher renderMessageDispatcher; ///< Used for passing messages to the render-thread
+ NotificationManager& notificationManager; ///< Queues notification messages for the event-thread.
+ TransformManager transformManager; ///< Used to update the transformation matrices of the nodes
+ CompleteNotificationInterface& animationPlaylist; ///< Holds handles to all the animations
+ PropertyNotifier& propertyNotifier; ///< Provides notification to applications when properties are modified.
+ ShaderSaver* shaderSaver; ///< Saves shader binaries.
+ DiscardQueue& discardQueue; ///< Nodes are added here when disconnected from the scene-graph.
+ RenderController& renderController; ///< render controller
+ SceneControllerImpl* sceneController; ///< scene controller
+ RenderManager& renderManager; ///< This is responsible for rendering the results of each "update"
+ RenderQueue& renderQueue; ///< Used to queue messages for the next render
+ RenderInstructionContainer& renderInstructions; ///< Used to prepare the render instructions
+ RenderTaskProcessor& renderTaskProcessor; ///< Handles RenderTasks and RenderInstrucitons
- Vector4 backgroundColor; ///< The glClear color used at the beginning of each frame.
+ Vector4 backgroundColor; ///< The glClear color used at the beginning of each frame.
- RenderTaskList taskList; ///< The list of scene graph render-tasks
- RenderTaskList systemLevelTaskList; ///< Separate render-tasks for system-level content
+ RenderTaskList taskList; ///< The list of scene graph render-tasks
+ RenderTaskList systemLevelTaskList; ///< Separate render-tasks for system-level content
- Layer* root; ///< The root node (root is a layer)
- Layer* systemLevelRoot; ///< A separate root-node for system-level content
+ Layer* root; ///< The root node (root is a layer)
+ Layer* systemLevelRoot; ///< A separate root-node for system-level content
- Vector<Node*> nodes; ///< A container of all instantiated nodes
+ Vector<Node*> nodes; ///< A container of all instantiated nodes
- SortedLayerPointers sortedLayers; ///< A container of Layer pointers sorted by depth
- SortedLayerPointers systemLevelSortedLayers; ///< A separate container of system-level Layers
+ SortedLayerPointers sortedLayers; ///< A container of Layer pointers sorted by depth
+ SortedLayerPointers systemLevelSortedLayers; ///< A separate container of system-level Layers
- CameraOwner cameras; ///< A container of cameras
- CustomObjectOwner customObjects; ///< A container of owned objects (with custom properties)
+ OwnerContainer< Camera* > cameras; ///< A container of cameras
+ OwnerContainer< PropertyOwner* > customObjects; ///< A container of owned objects (with custom properties)
- AnimationContainer animations; ///< A container of owned animations
- PropertyNotificationContainer propertyNotifications; ///< A container of owner property notifications.
+ AnimationContainer animations; ///< A container of owned animations
+ PropertyNotificationContainer propertyNotifications; ///< A container of owner property notifications.
- RendererOwner renderers; ///< A container of owned renderers
- TextureSetOwner textureSets; ///< A container of owned texture sets
- ShaderOwner shaders; ///< A container of owned shaders
- OwnerPointer<PanGesture> panGestureProcessor; ///< Owned pan gesture processor; it lives for the lifecycle of UpdateManager
+ OwnerContainer< Renderer* > renderers; ///< A container of owned renderers
+ OwnerContainer< TextureSet* > textureSets; ///< A container of owned texture sets
+ OwnerContainer< Shader* > shaders; ///< A container of owned shaders
+ OwnerPointer< PanGesture > panGestureProcessor; ///< Owned pan gesture processor; it lives for the lifecycle of UpdateManager
- MessageQueue messageQueue; ///< The messages queued from the event-thread
- ShaderDataBinaryQueue renderCompiledShaders; ///< Shaders compiled on Render thread are inserted here for update thread to pass on to event thread.
- ShaderDataBinaryQueue updateCompiledShaders; ///< Shaders to be sent from Update to Event
- Mutex compiledShaderMutex; ///< lock to ensure no corruption on the renderCompiledShaders
+ MessageQueue messageQueue; ///< The messages queued from the event-thread
+ std::vector<Internal::ShaderDataPtr> renderCompiledShaders; ///< Shaders compiled on Render thread are inserted here for update thread to pass on to event thread.
+ std::vector<Internal::ShaderDataPtr> updateCompiledShaders; ///< Shaders to be sent from Update to Event
+ Mutex compiledShaderMutex; ///< lock to ensure no corruption on the renderCompiledShaders
- float keepRenderingSeconds; ///< Set via Dali::Stage::KeepRendering
- int nodeDirtyFlags; ///< cumulative node dirty flags from previous frame
- int frameCounter; ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
+ float keepRenderingSeconds; ///< Set via Dali::Stage::KeepRendering
+ int nodeDirtyFlags; ///< cumulative node dirty flags from previous frame
+ int frameCounter; ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
- bool animationFinishedDuringUpdate; ///< Flag whether any animations finished during the Update()
- bool previousUpdateScene; ///< True if the scene was updated in the previous frame (otherwise it was optimized out)
- bool renderTaskWaiting; ///< A REFRESH_ONCE render task is waiting to be rendered
- bool renderersAdded; ///< Flag to keep track when renderers have been added to avoid unnecessary processing
+ bool animationFinishedDuringUpdate; ///< Flag whether any animations finished during the Update()
+ bool previousUpdateScene; ///< True if the scene was updated in the previous frame (otherwise it was optimized out)
+ bool renderTaskWaiting; ///< A REFRESH_ONCE render task is waiting to be rendered
+ bool renderersAdded; ///< Flag to keep track when renderers have been added to avoid unnecessary processing
private:
bool UpdateManager::IsAnimationRunning() const
{
- bool isRunning(false);
- AnimationContainer& animations = mImpl->animations;
-
// Find any animation that isn't stopped or paused
-
- const AnimationIter endIter = animations.End();
- for ( AnimationIter iter = animations.Begin(); !isRunning && iter != endIter; ++iter )
+ for ( auto&& iter : mImpl->animations )
{
- const Animation::State state = (*iter)->GetState();
+ const Animation::State state = iter->GetState();
if (state != Animation::Stopped &&
state != Animation::Paused)
{
- isRunning = true;
+ return true; // stop iteration as soon as first one is found
}
}
- return isRunning;
+ return false;
}
void UpdateManager::AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification )
void UpdateManager::ConstrainCustomObjects( BufferIndex bufferIndex )
{
//Constrain custom objects (in construction order)
- OwnerContainer< PropertyOwner* >& customObjects = mImpl->customObjects;
- const OwnerContainer< PropertyOwner* >::Iterator endIter = customObjects.End();
- for ( OwnerContainer< PropertyOwner* >::Iterator iter = customObjects.Begin(); endIter != iter; ++iter )
+ for ( auto&& object : mImpl->customObjects )
{
- PropertyOwner& object = **iter;
- ConstrainPropertyOwner( object, bufferIndex );
+ ConstrainPropertyOwner( *object, bufferIndex );
}
}
{
// Constrain system-level render-tasks
const RenderTaskList::RenderTaskContainer& systemLevelTasks = mImpl->systemLevelTaskList.GetTasks();
- for ( RenderTaskList::RenderTaskContainer::ConstIterator iter = systemLevelTasks.Begin(); iter != systemLevelTasks.End(); ++iter )
+ for ( auto&& task : systemLevelTasks )
{
- RenderTask& task = **iter;
- ConstrainPropertyOwner( task, bufferIndex );
+ ConstrainPropertyOwner( *task, bufferIndex );
}
// Constrain render-tasks
const RenderTaskList::RenderTaskContainer& tasks = mImpl->taskList.GetTasks();
- for ( RenderTaskList::RenderTaskContainer::ConstIterator iter = tasks.Begin(); iter != tasks.End(); ++iter )
+ for ( auto&& task : tasks )
{
- RenderTask& task = **iter;
- ConstrainPropertyOwner( task, bufferIndex );
+ ConstrainPropertyOwner( *task, bufferIndex );
}
}
void UpdateManager::ConstrainShaders( BufferIndex bufferIndex )
{
// constrain shaders... (in construction order)
- ShaderOwner& shaders = mImpl->shaders;
- for ( ShaderIter iter = shaders.Begin(); iter != shaders.End(); ++iter )
+ for ( auto&& shader : mImpl->shaders )
{
- Shader& shader = **iter;
- ConstrainPropertyOwner( shader, bufferIndex );
+ ConstrainPropertyOwner( *shader, bufferIndex );
}
}
void UpdateManager::ProcessPropertyNotifications( BufferIndex bufferIndex )
{
- PropertyNotificationContainer ¬ifications = mImpl->propertyNotifications;
- PropertyNotificationIter iter = notifications.Begin();
-
- while ( iter != notifications.End() )
+ for( auto&& notification : mImpl->propertyNotifications )
{
- PropertyNotification* notification = *iter;
bool valid = notification->Check( bufferIndex );
if(valid)
{
mImpl->notificationManager.QueueMessage( PropertyChangedMessage( mImpl->propertyNotifier, notification, notification->GetValidity() ) );
}
- ++iter;
}
}
if( mImpl->updateCompiledShaders.size() > 0 )
{
ShaderSaver& factory = *mImpl->shaderSaver;
- ShaderDataBinaryQueue::iterator i = mImpl->updateCompiledShaders.begin();
- ShaderDataBinaryQueue::iterator end = mImpl->updateCompiledShaders.end();
- for( ; i != end; ++i )
+ for( auto&& shader : mImpl->updateCompiledShaders )
{
- mImpl->notificationManager.QueueMessage( ShaderCompiledMessage( factory, *i ) );
+ mImpl->notificationManager.QueueMessage( ShaderCompiledMessage( factory, shader ) );
}
// we don't need them in update anymore
mImpl->updateCompiledShaders.clear();
ProcessPropertyNotifications( bufferIndex );
//Update cameras
- const CameraOwner::Iterator endCameraIterator = mImpl->cameras.End();
- for( CameraOwner::Iterator cameraIterator = mImpl->cameras.Begin(); endCameraIterator != cameraIterator; ++cameraIterator )
+ for( auto&& cameraIterator : mImpl->cameras )
{
- ( *cameraIterator )->Update( bufferIndex );
+ cameraIterator->Update( bufferIndex );
}
//Process the RenderTasks if renderers exist. This creates the instructions for rendering the next frame.
// check the countdown and notify (note, at the moment this is only done for normal tasks, not for systemlevel tasks)
bool doRenderOnceNotify = false;
mImpl->renderTaskWaiting = false;
- const RenderTaskList::RenderTaskContainer& tasks = mImpl->taskList.GetTasks();
- for ( RenderTaskList::RenderTaskContainer::ConstIterator iter = tasks.Begin(), endIter = tasks.End();
- endIter != iter; ++iter )
+ for ( auto&& renderTask : mImpl->taskList.GetTasks() )
{
- RenderTask& renderTask(*(*iter));
-
- renderTask.UpdateState();
+ renderTask->UpdateState();
- if( renderTask.IsWaitingToRender() &&
- renderTask.ReadyToRender( bufferIndex ) /*avoid updating forever when source actor is off-stage*/ )
+ if( renderTask->IsWaitingToRender() &&
+ renderTask->ReadyToRender( bufferIndex ) /*avoid updating forever when source actor is off-stage*/ )
{
mImpl->renderTaskWaiting = true; // keep update/render threads alive
}
- if( renderTask.HasRendered() )
+ if( renderTask->HasRendered() )
{
doRenderOnceNotify = true;
}
{
// note,this vector is already in depth order. It could be used as-is to
// remove sorting in update algorithm. However, it lacks layer boundary markers.
- for( std::vector<NodeDepthPair>::iterator iter = nodeDepths->nodeDepths.begin(),
- end = nodeDepths->nodeDepths.end() ;
- iter != end ; ++iter )
+ for( auto&& iter : nodeDepths->nodeDepths )
{
- iter->node->SetDepthIndex( iter->sortedDepth );
+ iter.node->SetDepthIndex( iter.sortedDepth );
}
}
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 )
{