CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/demo-theme.json.in ${LOCAL_STYLE_DIR}/demo-theme.json )
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/contact-cards-example-theme.json.in ${LOCAL_STYLE_DIR}/contact-cards-example-theme.json )
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/progress-bar-example-theme.json.in ${LOCAL_STYLE_DIR}/progress-bar-example-theme.json )
+CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/simple-example-theme.json.in ${LOCAL_STYLE_DIR}/simple-example-theme.json )
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-one.json.in ${LOCAL_STYLE_DIR}/style-example-theme-one.json )
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-two.json.in ${LOCAL_STYLE_DIR}/style-example-theme-two.json )
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-three.json.in ${LOCAL_STYLE_DIR}/style-example-theme-three.json )
<ui-application appid="cube-transition-effect.example" exec="/usr/apps/com.samsung.dali-demo/bin/cube-transition-effect.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Cube transition effect</label>
</ui-application>
+ <ui-application appid="simple-visuals-control.example" exec="/usr/apps/com.samsung.dali-demo/bin/simple-visuals-control.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+ <label>Simple Control</label>
+ </ui-application>
<ui-application appid="dissolve-effect.example" exec="/usr/apps/com.samsung.dali-demo/bin/dissolve-effect.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Dissolve effect</label>
</ui-application>
demo.AddExample(Example("popup.example", DALI_DEMO_STR_TITLE_POPUP));
demo.AddExample(Example("primitive-shapes.example", DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES));
demo.AddExample(Example("progress-bar.example", DALI_DEMO_STR_TITLE_PROGRESS_BAR));
+ demo.AddExample(Example("rendering-line.example", DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE));
+ demo.AddExample(Example("rendering-triangle.example", DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE));
+ demo.AddExample(Example("rendering-cube.example", DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE));
+ demo.AddExample(Example("rendering-textured-cube.example", DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE));
demo.AddExample(Example("scroll-view.example", DALI_DEMO_STR_TITLE_SCROLL_VIEW));
demo.AddExample(Example("size-negotiation.example", DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE));
demo.AddExample(Example("styling.example", DALI_DEMO_STR_TITLE_STYLING));
demo.AddExample(Example("text-label-multi-language.example", DALI_DEMO_STR_TITLE_TEXT_LABEL_MULTI_LANGUAGE));
demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT));
demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING));
- demo.AddExample(Example("textured-mesh.example", DALI_DEMO_STR_TITLE_TEXTURED_MESH));
+ demo.AddExample(Example("texturedss-mesh.example", DALI_DEMO_STR_TITLE_TEXTURED_MESH));
demo.AddExample(Example("tilt.example", DALI_DEMO_STR_TITLE_TILT_SENSOR));
demo.AddExample(Example("tooltip.example", DALI_DEMO_STR_TITLE_TOOLTIP));
demo.AddExample(Example("transitions.example", DALI_DEMO_STR_TITLE_VISUAL_TRANSITIONS));
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace
+{
+
+/*
+ * Vertex shader
+ */
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+attribute mediump vec3 aPosition;\n // DALi shader builtin
+attribute mediump vec3 aColor;\n // DALi shader builtin
+uniform mediump mat4 uMvpMatrix;\n // DALi shader builtin
+uniform mediump vec3 uSize;\n // DALi shader builtin
+\n
+varying mediump vec4 vColor;\n
+\n
+void main()\n
+{\n
+ mediump vec4 vertexPosition = vec4(aPosition, 1.0);\n
+ vertexPosition.xyz *= uSize;\n
+ vColor = vec4( aColor, 1.0 );\n
+ gl_Position = uMvpMatrix * vertexPosition;\n
+}\n
+);
+
+/*
+ * Fragment shader
+ */
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+varying mediump vec4 vColor;\n
+\n
+void main()\n
+{\n
+ gl_FragColor = vColor;\n
+}\n
+);
+
+}
+
+// This example shows how to create a cube with colors on each side
+//
+class DrawCubeController : public ConnectionTracker
+{
+public:
+
+ DrawCubeController( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &DrawCubeController::Create );
+ }
+
+ ~DrawCubeController()
+ {
+ // Nothing to do here;
+ }
+
+ // The Init signal is received once (only) during the Application lifetime
+ void Create( Application& application )
+ {
+ // Get a handle to the stage
+ Stage stage = Stage::GetCurrent();
+ stage.SetBackgroundColor( Color::WHITE );
+
+ // Step 1. Create shader
+ CreateCubeShader();
+
+ // Step 2. Prepare geometry
+ CreateCubeGeometry();
+
+ // Step 3. Create a renderer
+ CreateRenderer();
+
+ // Step 4. Create an Actor
+ CreateActor();
+
+ // Step 5. Play animation to rotate the cube
+ PlayAnimation();
+
+ // Respond to a click anywhere on the stage
+ stage.GetRootLayer().TouchSignal().Connect( this, &DrawCubeController::OnTouch );
+ }
+
+ bool OnTouch( Actor actor, const TouchData& touch )
+ {
+ // quit the application
+ mApplication.Quit();
+ return true;
+ }
+
+ /**
+ * This function creates a cube geometry including texture coordinates.
+ * Also it demonstrates using the indexed draw feature by setting an index array.
+ */
+ void CreateCubeGeometry()
+ {
+ struct Vertex
+ {
+ Vector3 aPosition;
+ Vector3 aColor;
+ };
+
+ const Vector3 COLOR0( 1.0f, 1.0f, 0.0f );
+ const Vector3 COLOR1( 0.0f, 1.0f, 1.0f );
+ const Vector3 COLOR2( 1.0f, 0.0f, 1.0f );
+ const Vector3 COLOR3( 0.0f, 1.0f, 0.0f );
+ const Vector3 COLOR4( 0.0f, 0.0f, 1.0f );
+ const Vector3 COLOR5( 1.0f, 0.0f, 0.0f );
+
+ Vertex vertices[] = {
+ { Vector3( 1.0f,-1.0f,-1.0f ), COLOR5 },
+ { Vector3( -1.0f, 1.0f,-1.0f ), COLOR5 },
+ { Vector3( 1.0f, 1.0f,-1.0f ), COLOR5 },
+ { Vector3( -1.0f, 1.0f, 1.0f ), COLOR3 },
+ { Vector3( 1.0f,-1.0f, 1.0f ), COLOR3 },
+ { Vector3( 1.0f, 1.0f, 1.0f ), COLOR3 },
+ { Vector3( 1.0f, 1.0f, 1.0f ), COLOR4 },
+ { Vector3( 1.0f,-1.0f,-1.0f ), COLOR4 },
+ { Vector3( 1.0f, 1.0f,-1.0f ), COLOR4 },
+ { Vector3( 1.0f,-1.0f, 1.0f ), COLOR1 },
+ { Vector3( -1.0f,-1.0f,-1.0f ), COLOR1 },
+ { Vector3( 1.0f,-1.0f,-1.0f ), COLOR1 },
+ { Vector3( -1.0f,-1.0f,-1.0f ), COLOR0 },
+ { Vector3( -1.0f, 1.0f, 1.0f ), COLOR0 },
+ { Vector3( -1.0f, 1.0f,-1.0f ), COLOR0 },
+ { Vector3( 1.0f, 1.0f,-1.0f ), COLOR2 },
+ { Vector3( -1.0f, 1.0f, 1.0f ), COLOR2 },
+ { Vector3( 1.0f, 1.0f, 1.0f ), COLOR2 },
+ { Vector3( 1.0f,-1.0f,-1.0f ), COLOR5 },
+ { Vector3( -1.0f,-1.0f,-1.0f ), COLOR5 },
+ { Vector3( -1.0f, 1.0f,-1.0f ), COLOR5 },
+ { Vector3( -1.0f, 1.0f, 1.0f ), COLOR3 },
+ { Vector3( -1.0f,-1.0f, 1.0f ), COLOR3 },
+ { Vector3( 1.0f,-1.0f, 1.0f ), COLOR3 },
+ { Vector3( 1.0f, 1.0f, 1.0f ), COLOR4 },
+ { Vector3( 1.0f,-1.0f, 1.0f ), COLOR4 },
+ { Vector3( 1.0f,-1.0f,-1.0f ), COLOR4 },
+ { Vector3( 1.0f,-1.0f, 1.0f ), COLOR1 },
+ { Vector3( -1.0f,-1.0f, 1.0f ), COLOR1 },
+ { Vector3( -1.0f,-1.0f,-1.0f ), COLOR1 },
+ { Vector3( -1.0f,-1.0f,-1.0f ), COLOR0 },
+ { Vector3( -1.0f,-1.0f, 1.0f ), COLOR0 },
+ { Vector3( -1.0f, 1.0f, 1.0f ), COLOR0 },
+ { Vector3( 1.0f, 1.0f,-1.0f ), COLOR2 },
+ { Vector3( -1.0f, 1.0f,-1.0f ), COLOR2 },
+ { Vector3( -1.0f, 1.0f, 1.0f ), COLOR2 },
+ };
+
+ PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map()
+ .Add( "aPosition", Property::VECTOR3 )
+ .Add( "aColor", Property::VECTOR3 ) );
+ vertexBuffer.SetData( vertices, sizeof(vertices) / sizeof(Vertex) );
+
+ // create indices
+ const unsigned short INDEX_CUBE[] = {
+ 2, 1, 0,
+ 5, 4, 3,
+ 8, 7, 6,
+ 11, 10, 9,
+ 14, 13, 12,
+ 17, 16, 15,
+ 20, 19, 18,
+ 23, 22, 21,
+ 26, 25, 24,
+ 29, 28, 27,
+ 32, 31, 30,
+ 35, 34, 33
+ };
+ mGeometry = Geometry::New();
+ mGeometry.AddVertexBuffer( vertexBuffer );
+ mGeometry.SetIndexBuffer( INDEX_CUBE,
+ sizeof(INDEX_CUBE)/sizeof(INDEX_CUBE[0])
+ );
+ mGeometry.SetType( Geometry::TRIANGLES );
+ }
+
+ /**
+ * Creates a shader using inlined variable VERTEX_SHADER and FRAGMENT_SHADER
+ *
+ * Shaders are very basic and all they do is transforming vertices and interpolating
+ * input per-vertex color.
+ */
+ void CreateCubeShader()
+ {
+ mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+ }
+
+ /**
+ * Function creates renderer. It turns on depth test and depth write.
+ */
+ void CreateRenderer()
+ {
+ mRenderer = Renderer::New( mGeometry, mShader );
+
+ // Face culling is enabled to hide the backwards facing sides of the cube
+ // This is sufficient to render a single object; for more complex scenes depth-testing might be required
+ mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
+ }
+
+ /**
+ * Creates new actor and attaches renderer.
+ */
+ void CreateActor()
+ {
+ Stage stage = Stage::GetCurrent();
+
+ float quarterStageWidth = stage.GetSize().x * 0.25f;
+ mActor = Actor::New();
+ mActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
+ mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) );
+ mActor.AddRenderer( mRenderer );
+ stage.Add( mActor );
+ }
+
+ /**
+ * Plays animation
+ */
+ void PlayAnimation()
+ {
+ mAnimation = Animation::New( 5.0f );
+ mAnimation.SetLooping( true );
+ mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::ZAXIS ) );
+ mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::YAXIS ) );
+ mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::XAXIS ) );
+ mAnimation.Play();
+ }
+
+private:
+ Application& mApplication;
+
+ Renderer mRenderer;
+ Shader mShader;
+ Geometry mGeometry;
+ Actor mActor;
+ Animation mAnimation;
+};
+
+void RunTest( Application& application )
+{
+ DrawCubeController test( application );
+
+ application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv );
+
+ RunTest( application );
+
+ return 0;
+}
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace
+{
+
+/*
+ * Vertex shader
+ */
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+attribute mediump vec2 aPosition;\n // DALi shader builtin
+uniform mediump mat4 uMvpMatrix;\n // DALi shader builtin
+uniform mediump vec3 uSize;\n // DALi shader builtin
+\n
+void main()\n
+{\n
+ mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+ vertexPosition.xyz *= uSize;\n
+ gl_Position = uMvpMatrix * vertexPosition;\n
+}\n
+);
+
+/*
+ * Fragment shader
+ */
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+uniform mediump vec4 uColor;\n
+\n
+void main()\n
+{\n
+ gl_FragColor = uColor;\n
+}\n
+);
+
+}
+
+// This example shows how to draw a line in actor's color
+//
+class DrawLineController : public ConnectionTracker
+{
+public:
+
+ DrawLineController( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &DrawLineController::Create );
+ }
+
+ ~DrawLineController()
+ {
+ // Nothing to do here;
+ }
+
+ // The Init signal is received once (only) during the Application lifetime
+ void Create( Application& application )
+ {
+ // Get a handle to the stage
+ Stage stage = Stage::GetCurrent();
+ stage.SetBackgroundColor( Color::WHITE );
+
+ // Step 1. Create shader
+ CreateLineShader();
+
+ // Step 2. Prepare geometry
+ CreateLineGeometry();
+
+ // Step 3. Create a renderer
+ CreateRenderer();
+
+ // Step 4. Create an Actor
+ CreateActor();
+
+ // Respond to a click anywhere on the stage
+ stage.GetRootLayer().TouchSignal().Connect( this, &DrawLineController::OnTouch );
+ }
+
+ bool OnTouch( Actor actor, const TouchData& touch )
+ {
+ // quit the application
+ mApplication.Quit();
+ return true;
+ }
+
+ /**
+ * This function creates a line geometry made of two vertices in order
+ * to draw a diagonal line.
+ */
+ void CreateLineGeometry()
+ {
+ Vector2 vertices[] = {
+ Vector2( -1.0f, -1.0f ),
+ Vector2( 1.0f, 1.0f )
+ };
+
+ PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map()
+ .Add( "aPosition", Property::VECTOR2 ) );
+ vertexBuffer.SetData( vertices, sizeof(vertices) / sizeof(Vector2) );
+
+ mGeometry = Geometry::New();
+ mGeometry.AddVertexBuffer( vertexBuffer );
+ mGeometry.SetType( Geometry::LINES );
+ }
+
+ /**
+ * Creates a shader using inlined variable VERTEX_SHADER and FRAGMENT_SHADER
+ *
+ * Shaders are very basic and all they do is transforming vertices and applying actor's colour.
+ */
+ void CreateLineShader()
+ {
+ mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+ }
+
+ /**
+ * Function creates renderer.
+ */
+ void CreateRenderer()
+ {
+ mRenderer = Renderer::New( mGeometry, mShader );
+ }
+
+ /**
+ * Creates new actor and attaches renderer.
+ */
+ void CreateActor()
+ {
+ Stage stage = Stage::GetCurrent();
+ Size size = stage.GetSize() * 0.25f;
+ mActor = Actor::New();
+ mActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
+ mActor.SetColor( Color::BLACK );
+ mActor.SetSize( Vector3( size.x, size.x, size.x ) );
+ mActor.AddRenderer( mRenderer );
+ stage.Add( mActor );
+ }
+
+private:
+ Application& mApplication;
+
+ Renderer mRenderer;
+ Shader mShader;
+ Geometry mGeometry;
+ Actor mActor;
+};
+
+void RunTest( Application& application )
+{
+ DrawLineController test( application );
+
+ application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv );
+
+ RunTest( application );
+
+ return 0;
+}
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace
+{
+
+/*
+ * Vertex shader
+ */
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+attribute mediump vec3 aPosition;\n // DALi shader builtin
+attribute mediump vec2 aTexCoord;\n // DALi shader builtin
+uniform mediump mat4 uMvpMatrix;\n // DALi shader builtin
+uniform mediump vec3 uSize;\n // DALi shader builtin
+\n
+varying mediump vec2 vTexCoord;\n
+void main()\n
+{\n
+ mediump vec4 vertexPosition = vec4(aPosition, 1.0);\n
+ vertexPosition.xyz *= uSize;\n
+ vTexCoord = aTexCoord;\n
+ gl_Position = uMvpMatrix * vertexPosition;\n
+}\n
+);
+
+/*
+ * Fragment shader
+ */
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+uniform sampler2D uTexture;\n
+\n
+varying mediump vec2 vTexCoord;\n
+void main()\n
+{\n
+ mediump vec4 texColor = texture2D( uTexture, vTexCoord );\n
+ gl_FragColor = texColor;\n
+}\n
+);
+
+const char* TEXTURE_URL = DEMO_IMAGE_DIR "wood.png";
+
+}
+
+// This example shows how to create textured cube
+//
+class TexturedCubeController : public ConnectionTracker
+{
+public:
+
+ TexturedCubeController( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &TexturedCubeController::Create );
+ }
+
+ ~TexturedCubeController()
+ {
+ // Nothing to do here;
+ }
+
+ // The Init signal is received once (only) during the Application lifetime
+ void Create( Application& application )
+ {
+ // Get a handle to the stage
+ Stage stage = Stage::GetCurrent();
+ stage.SetBackgroundColor( Color::WHITE );
+
+ // Step 1. Create shader
+ CreateCubeShader();
+
+ // Step 2. Load a texture
+ CreateTexture();
+
+ // Step 3. Prepare geometry
+ CreateCubeGeometry();
+
+ // Step 4. Create a renderer
+ CreateRenderer();
+
+ // Step 5. Create an Actor
+ CreateActor();
+
+ // Step 6. Play animation to rotate the cube
+ PlayAnimation();
+
+ // Respond to a click anywhere on the stage
+ stage.GetRootLayer().TouchSignal().Connect( this, &TexturedCubeController::OnTouch );
+ }
+
+ bool OnTouch( Actor actor, const TouchData& touch )
+ {
+ // quit the application
+ mApplication.Quit();
+ return true;
+ }
+
+ /**
+ * @brief CreateCubeGeometry
+ * This function creates a cube geometry including texture coordinates.
+ * Also it demonstrates using the indexed draw feature by setting an index array.
+ */
+ void CreateCubeGeometry()
+ {
+ struct Vertex
+ {
+ Vector3 aPosition;
+ Vector2 aTexCoord;
+ };
+
+ Vertex vertices[] = {
+ { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 0.0, 1.0 ) },
+ { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 0.0, 1.0 ) },
+ { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 0.0, 1.0 ) },
+ { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 0.0, 1.0 ) },
+ { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 0.0, 1.0 ) },
+ { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 0.0, 1.0 ) },
+ { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 1.0, 0.0 ) },
+ { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) },
+ { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) },
+ { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) },
+ { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) },
+ { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
+ { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 1.0, 1.0 ) },
+ { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 1.0, 0.0 ) },
+ { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
+ };
+
+ PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map()
+ .Add( "aPosition", Property::VECTOR3 )
+ .Add( "aTexCoord", Property::VECTOR2 ) );
+ vertexBuffer.SetData( vertices, sizeof(vertices) / sizeof(Vertex) );
+
+ // create indices
+ const unsigned short INDEX_CUBE[] = {
+ 2, 1, 0,
+ 5, 4, 3,
+ 8, 7, 6,
+ 11, 10, 9,
+ 14, 13, 12,
+ 17, 16, 15,
+ 20, 19, 18,
+ 23, 22, 21,
+ 26, 25, 24,
+ 29, 28, 27,
+ 32, 31, 30,
+ 35, 34, 33
+ };
+ mGeometry = Geometry::New();
+ mGeometry.AddVertexBuffer( vertexBuffer );
+ mGeometry.SetIndexBuffer( INDEX_CUBE,
+ sizeof(INDEX_CUBE)/sizeof(INDEX_CUBE[0]) );
+ mGeometry.SetType( Geometry::TRIANGLES );
+ }
+
+ /**
+ * Creates a shader using inlined variable VERTEX_SHADER and FRAGMENT_SHADER
+ *
+ * Shaders are very basic and all they do is transforming vertices and sampling
+ * a texture.
+ */
+ void CreateCubeShader()
+ {
+ mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+ }
+
+ /**
+ * This function loads a pixel data from a file. In order to load it we use SyncImageLoader utility.
+ * If loading succeeds returned PixelData object can be used to create a texture.
+ * Texture must be uploaded. In the end the texture must be set on the TextureSet object.
+ */
+ void CreateTexture()
+ {
+ // Load image from file
+ PixelData pixels = SyncImageLoader::Load( TEXTURE_URL );
+
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight() );
+ texture.Upload( pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight() );
+
+ // create TextureSet
+ mTextureSet = TextureSet::New();
+ mTextureSet.SetTexture( 0, texture );
+ }
+
+ /**
+ * Function creates renderer. It turns on depth test and depth write.
+ */
+ void CreateRenderer()
+ {
+ mRenderer = Renderer::New( mGeometry, mShader );
+ mRenderer.SetTextures( mTextureSet );
+
+ // Face culling is enabled to hide the backwards facing sides of the cube
+ // This is sufficient to render a single object; for more complex scenes depth-testing might be required
+ mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
+ }
+
+ /**
+ * Creates new actor and attaches renderer.
+ */
+ void CreateActor()
+ {
+ Stage stage = Stage::GetCurrent();
+
+ float quarterStageWidth = stage.GetSize().x * 0.25f;
+ mActor = Actor::New();
+ mActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
+ mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) );
+ mActor.AddRenderer( mRenderer );
+ stage.Add( mActor );
+ }
+
+ /**
+ * Plays animation
+ */
+ void PlayAnimation()
+ {
+ mAnimation = Animation::New( 5.0f );
+ mAnimation.SetLooping( true );
+ mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::ZAXIS ) );
+ mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::YAXIS ) );
+ mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::XAXIS ) );
+ mAnimation.Play();
+ }
+
+private:
+ Application& mApplication;
+
+ Renderer mRenderer;
+ Shader mShader;
+ Geometry mGeometry;
+ TextureSet mTextureSet;
+ Actor mActor;
+ Animation mAnimation;
+};
+
+void RunTest( Application& application )
+{
+ TexturedCubeController test( application );
+
+ application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv );
+
+ RunTest( application );
+
+ return 0;
+}
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+namespace
+{
+
+/*
+ * Vertex shader
+ */
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+attribute mediump vec2 aPosition;\n // DALi shader builtin
+uniform mediump mat4 uMvpMatrix;\n // DALi shader builtin
+uniform mediump vec3 uSize;\n // DALi shader builtin
+\n
+void main()\n
+{\n
+ mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+ vertexPosition.xyz *= uSize;\n
+ gl_Position = uMvpMatrix * vertexPosition;\n
+}\n
+);
+
+/*
+ * Fragment shader
+ */
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+uniform mediump vec4 uColor;\n
+\n
+void main()\n
+{\n
+ gl_FragColor = uColor;\n
+}\n
+);
+
+}
+
+// This example shows how to draw a triangle in actor's color
+//
+class DrawTriangleController : public ConnectionTracker
+{
+public:
+
+ DrawTriangleController( Application& application )
+ : mApplication( application )
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &DrawTriangleController::Create );
+ }
+
+ ~DrawTriangleController()
+ {
+ // Nothing to do here;
+ }
+
+ // The Init signal is received once (only) during the Application lifetime
+ void Create( Application& application )
+ {
+ // Get a handle to the stage
+ Stage stage = Stage::GetCurrent();
+ stage.SetBackgroundColor( Color::WHITE );
+
+ // Step 1. Create shader
+ CreateTriangleShader();
+
+ // Step 2. Prepare geometry
+ CreateTriangleGeometry();
+
+ // Step 3. Create a renderer
+ CreateRenderer();
+
+ // Step 4. Create an Actor
+ CreateActor();
+
+ // Respond to a click anywhere on the stage
+ stage.GetRootLayer().TouchSignal().Connect( this, &DrawTriangleController::OnTouch );
+ }
+
+ bool OnTouch( Actor actor, const TouchData& touch )
+ {
+ // quit the application
+ mApplication.Quit();
+ return true;
+ }
+
+ /**
+ * This function creates a triangle geometry made of three vertices in order
+ * to draw a coloured triangle.
+ */
+ void CreateTriangleGeometry()
+ {
+ Vector2 vertices[] = {
+ Vector2( -1.0f, -1.0f ),
+ Vector2( 1.0f, 1.0f ),
+ Vector2( -1.0f, 1.0f )
+ };
+
+ PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map()
+ .Add( "aPosition", Property::VECTOR2 ) );
+ vertexBuffer.SetData( vertices, sizeof(vertices) / sizeof(Vector2) );
+
+ mGeometry = Geometry::New();
+ mGeometry.AddVertexBuffer( vertexBuffer );
+ mGeometry.SetType( Geometry::TRIANGLES );
+ }
+
+ /**
+ * Creates a shader using inlined variable VERTEX_SHADER and FRAGMENT_SHADER
+ *
+ * Shaders are very basic and all they do is transforming vertices and applying actor's colour.
+ */
+ void CreateTriangleShader()
+ {
+ mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+ }
+
+ /**
+ * Function creates renderer.
+ */
+ void CreateRenderer()
+ {
+ mRenderer = Renderer::New( mGeometry, mShader );
+ }
+
+ /**
+ * Creates new actor and attaches renderer.
+ */
+ void CreateActor()
+ {
+ Stage stage = Stage::GetCurrent();
+ Size size = stage.GetSize() * 0.25f;
+ mActor = Actor::New();
+ mActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
+ mActor.SetColor( Color::RED );
+ mActor.SetSize( Vector3( size.x, size.x, size.x ) );
+ mActor.AddRenderer( mRenderer );
+ stage.Add( mActor );
+ }
+
+private:
+ Application& mApplication;
+
+ Renderer mRenderer;
+ Shader mShader;
+ Geometry mGeometry;
+ Actor mActor;
+};
+
+void RunTest( Application& application )
+{
+ DrawTriangleController test( application );
+
+ application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int DALI_EXPORT_API main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv );
+
+ RunTest( application );
+
+ return 0;
+}
--- /dev/null
+/*
+ * 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.
+ */
+
+// CLASS HEADER
+
+#include "my-control-impl.h"
+
+// EXTERNAL INCLUDES
+
+#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/enum-helper.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace Demo
+{
+namespace Internal
+{
+
+namespace
+{
+
+
+Dali::BaseHandle Create()
+{
+ return Demo::MyControl::New();
+}
+
+// Required code for Property set up.
+
+DALI_TYPE_REGISTRATION_BEGIN( MyControl, Dali::Toolkit::Control, Create );
+
+DALI_PROPERTY_REGISTRATION( Demo, MyControl, "iconVisual", MAP, ICON_VISUAL )
+
+DALI_TYPE_REGISTRATION_END();
+
+// Add an enum to string conversion entry for the control's visuals. In this case just the icon visual.
+// Enables Setting of the property using enums or strings.
+DALI_ENUM_TO_STRING_TABLE_BEGIN( VISUAL_PROPERTIES )
+{ "iconVisual", Demo::MyControl::Property::ICON_VISUAL },
+DALI_ENUM_TO_STRING_TABLE_END( VISUAL_PROPERTIES )
+
+
+} // anonymous namespace
+
+
+Internal::MyControl::MyControl()
+: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) )
+{
+}
+
+Demo::MyControl Internal::MyControl::New()
+{
+ IntrusivePtr<Internal::MyControl> impl = new Internal::MyControl();
+ Demo::MyControl handle = Demo::MyControl( *impl );
+ impl->Initialize();
+ return handle;
+}
+
+void MyControl::OnInitialize()
+{
+ Dali::Actor self = Self();
+ self.SetKeyboardFocusable( true );
+}
+
+void MyControl::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
+{
+ Demo::MyControl myControl = Demo::MyControl::DownCast( Dali::BaseHandle( object ) );
+
+ if( myControl )
+ {
+ MyControl& impl = GetImpl( myControl );
+ switch ( index )
+ {
+ case Demo::MyControl::Property::ICON_VISUAL:
+ {
+ Toolkit::Visual::Base iconVisual;
+ Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+ Property::Map *map = value.GetMap();
+ if( map && !map->Empty() )
+ {
+ iconVisual = visualFactory.CreateVisual( *map );
+ }
+
+ if ( iconVisual )
+ {
+ impl.RegisterVisual( index, iconVisual );
+ }
+ break;
+ }
+ }
+ }
+}
+
+Property::Value MyControl::GetProperty( BaseObject* object, Property::Index propertyIndex )
+{
+ Property::Value value;
+
+ Demo::MyControl myControl = Demo::MyControl::DownCast( Dali::BaseHandle( object ) );
+
+ if ( myControl )
+ {
+ switch ( propertyIndex )
+ {
+ case Demo::MyControl::Property::ICON_VISUAL:
+ {
+ Property::Map map;
+ Toolkit::Visual::Base visual = GetImpl( myControl ).GetVisual( propertyIndex );
+ if ( visual )
+ {
+ visual.CreatePropertyMap( map ); // Creates a Property map containing the Visual that ICON_VISUAL currently is. Can change if state changes.
+ value = map;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ return value;
+}
+
+} // Internal
+} // Demo
--- /dev/null
+#ifndef DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H
+#define DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_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.
+ */
+
+// CLASS HEADER
+#include "my-control.h"
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
+
+namespace Demo
+{
+
+namespace Internal // To use TypeRegistry, handle and body classes need the same name
+{
+
+/**
+ * @brief A Simple Control to show use of visuals with a style sheet and changing visuals with a state change
+ */
+
+class MyControl : public Dali::Toolkit::Internal::Control
+{
+public:
+ /**
+ * @brief Instantiate a new ContentView object
+ */
+ static Demo::MyControl New();
+
+ /**
+ * @brief Default constructor
+ */
+ MyControl();
+
+public: // Properties
+ /**
+ * @brief Called when a property of an object of this type is set.
+ *
+ * @param[in] object The object whose property is set.
+ * @param[in] index The property index.
+ * @param[in] value The new property value.
+ */
+ static void SetProperty( Dali::BaseObject* object, Dali::Property::Index index, const Dali::Property::Value& value );
+
+ /**
+ * @brief Called to retrieve a property of an object of this type.
+ *
+ * @param[in] object The object whose property is to be retrieved.
+ * @param[in] index The property index.
+ * @return The current value of the property.
+ */
+ static Dali::Property::Value GetProperty( Dali::BaseObject* object, Dali::Property::Index propertyIndex );
+
+private: // From Control
+ /**
+ * @copydoc Toolkit::Control::OnInitialize()
+ */
+ virtual void OnInitialize();
+
+private:
+ /**
+ * undefined constructor and operator=
+ */
+ MyControl( const MyControl& );
+ MyControl& operator=( const MyControl& );
+
+private:
+};
+
+} // Internal
+
+inline Internal::MyControl& GetImpl( Demo::MyControl& handle )
+{
+ DALI_ASSERT_ALWAYS( handle );
+ Dali::RefObject& object = handle.GetImplementation();
+ return static_cast<Internal::MyControl&>(object);
+}
+
+inline const Internal::MyControl& GetImpl( const Demo::MyControl& handle )
+{
+ DALI_ASSERT_ALWAYS( handle );
+ const Dali::RefObject& object = handle.GetImplementation();
+ return static_cast<const Internal::MyControl&>(object);
+}
+
+} // Demo
+
+#endif // DALI_DEMO_INTERNAL_MY_CONTROL_IMPL_H
--- /dev/null
+/*
+ * 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.
+ */
+
+// CLASS HEADER
+#include "my-control.h"
+
+// INTERNAL INCLUDES
+#include "my-control-impl.h"
+
+namespace Demo
+{
+
+MyControl::MyControl()
+{
+}
+
+MyControl::MyControl( const MyControl& control )
+: Control( control )
+{
+}
+
+MyControl& MyControl::operator= ( const MyControl& rhs )
+{
+ if( &rhs != this )
+ {
+ Control::operator=( rhs );
+ }
+ return *this;
+}
+
+MyControl::~MyControl()
+{
+}
+
+MyControl MyControl::New()
+{
+ MyControl control = Internal::MyControl::New();
+ return control;
+}
+
+MyControl MyControl::DownCast( BaseHandle handle )
+{
+ return Control::DownCast< MyControl, Internal::MyControl > ( handle );
+}
+
+MyControl::MyControl( Internal::MyControl& implementation )
+: Control( implementation )
+{
+}
+
+MyControl::MyControl( Dali::Internal::CustomActor* internal )
+: Control( internal )
+{
+ VerifyCustomActorPointer< Internal::MyControl >( internal ) ;
+}
+
+
+} //namespace Demo
--- /dev/null
+#ifndef DALI_DEMO_MY_CONTROL_H
+#define DALI_DEMO_MY_CONTROL_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.
+ */
+
+#include <dali-toolkit/dali-toolkit.h>
+#include <string>
+
+namespace Demo
+{
+
+namespace Internal
+{
+class MyControl;
+}
+
+/**
+ * @brief MyControl is an example control,
+ *
+ * @details It's purpose is to show how to create a simple control to work with the style sheet and state changes.
+ * States changes includes Normal, Focused and Disabled, this example uses the style sheet to set visuals for Normal and Focused states.
+ * When the Focus manager changes the control to be focused the visual displayed is changed and vice versa.
+ *
+ * The visual has the property name ICON_VISUAL with the style sheet string equivalent of "iconVisual"
+ *
+ */
+
+class MyControl : public Dali::Toolkit::Control
+{
+public:
+
+ /**
+ * The start and end property ranges for this Control
+ * My control can use properties from Toolkit::Control as it is derived from it. As control is derived from Actor, MyControl can also use Dali::Actor Properties.
+ *
+ * To ensure that the Property indexes from MyControl do not shadow any from Control we start it's index from the end of Toolkit::Control's indexes.
+ *
+ * Toolkit::Control would have done the same with Actor.
+ *
+ * The end index for this control is set to the start index + 1000 hence MyControl can have 1000 property indexes.
+ *
+ * PROPERTY_END_INDEX for MyControl is public, if another control is derived from it then if can specify MyControl::PROPERTY_END_INDEX+1 to start it's
+ * indexing after MyControls last index.
+ */
+ enum PropertyRange
+ {
+ PROPERTY_START_INDEX = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
+ PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000,
+ ANIMATABLE_PROPERTY_START_INDEX = Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
+ ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX+1000
+ };
+
+ struct Property
+ {
+ enum
+ {
+ /**
+ * @brief name "iconVisual", type string if it is a url, map otherwise
+ * @details Sets the icon visual to be displayed by the control
+ */
+ ICON_VISUAL = PROPERTY_START_INDEX
+ };
+ };
+
+public: // Construction / destruction
+
+ /**
+ * @brief Create an uninitialized handle
+ */
+ MyControl();
+
+ /**
+ * @brief Create a new MyControl
+ */
+ static MyControl New();
+
+ /**
+ * @brief Destructor. This is non-virtual since derived Handle types must not contain data or virtual methods
+ */
+ ~MyControl();
+
+ /**
+ * @brief Copy Constructor
+ *
+ * @param[in] shadowButton the handle of the control to copy
+ */
+ MyControl( const MyControl& shadowButton );
+
+ /**
+ * @brief Assignment Operator
+ *
+ * @param[in] shadowButton the source of the assignment
+ */
+ MyControl& operator=( const MyControl& shadowButton );
+
+ /**
+ * @brief Downcast
+ *
+ * @param[in] shadowButton the handle of control to downcast to MyControl
+ */
+ static MyControl DownCast( BaseHandle handle );
+
+
+public: // // Not intended for application developers
+
+ /// @cond internal
+ /**
+ * @brief Create a handle from an implementation
+ */
+ MyControl( Internal::MyControl& implementation );
+
+ /**
+ * @brief Allow the creation of an ShadowButton handle from an internal CustomActor pointer
+ */
+ MyControl( Dali::Internal::CustomActor* internal );
+ /// @endcond
+};
+
+} // namespace Demo
+
+#endif // DALI_DEMO_MY_CONTROL_H
--- /dev/null
+/*
+ * 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.
+ */
+
+// CLASS HEADER
+#include "my-control.h"
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <cstdio>
+#include <sstream>
+
+// INTERNAL INCLUDES
+#include "simple-visuals-application.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+}
+
+namespace Demo
+{
+
+const char* ICON_IMAGE( DEMO_IMAGE_DIR "application-icon-13.png" );
+
+SimpleVisualsApplication::SimpleVisualsApplication( Application& application )
+: mApplication( application ),
+ mMyControl()
+{
+ application.InitSignal().Connect( this, &SimpleVisualsApplication::Create );
+}
+
+Dali::Actor SimpleVisualsApplication::OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction )
+{
+ Actor nextFocusActor = proposed;
+
+ if( !current && !proposed )
+ {
+ // Set the initial focus to the first tile in the current page should be focused.
+ nextFocusActor = mMyControl;
+ }
+ else
+ {
+ if ( current == mMyControl )
+ {
+ nextFocusActor = mMyControl2;
+ }
+ else
+ {
+ nextFocusActor = mMyControl;
+ }
+ }
+
+ return nextFocusActor;
+}
+
+
+void SimpleVisualsApplication::OnKeyEvent( const KeyEvent& keyEvent )
+{
+ static int keyPressed = 0;
+
+ if( keyEvent.state == KeyEvent::Down)
+ {
+ if( keyPressed == 0 ) // Is this the first down event?
+ {
+ printf("Key pressed: %s %d\n", keyEvent.keyPressedName.c_str(), keyEvent.keyCode );
+
+ if( IsKey( keyEvent, DALI_KEY_ESCAPE) || IsKey( keyEvent, DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ else if( keyEvent.keyPressedName.compare("Return") == 0 )
+ {
+ }
+ }
+ keyPressed = 1;
+ }
+ else if( keyEvent.state == KeyEvent::Up )
+ {
+ keyPressed = 0;
+ }
+}
+
+void SimpleVisualsApplication::Create( Application& application )
+{
+ Stage stage = Stage::GetCurrent();
+ stage.SetBackgroundColor( Vector4( 0.1f, 0.1f, 0.1f, 1.0f ) );
+
+ // Connect to key events so can quit application
+ stage.KeyEventSignal().Connect(this, &SimpleVisualsApplication::OnKeyEvent);
+
+ // Hide the indicator bar
+ application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
+
+ // Create a table view to parent the 2 MyControls
+ TableView contentLayout = TableView::New( 2, 2 );
+ contentLayout.SetName("ContentLayout");
+ contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ contentLayout.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
+ contentLayout.SetSizeModeFactor( Vector3( 1.0f, .5f, 1.0f ) );
+ contentLayout.SetAnchorPoint( AnchorPoint::CENTER );
+ contentLayout.SetParentOrigin( ParentOrigin::CENTER );
+ contentLayout.SetCellPadding( Vector2( 50.0f, 15.0f ) );
+ contentLayout.SetBackgroundColor( Vector4(0.949, 0.949, 0.949, 1.0) );
+
+ // Listen to focus change so can see Visual change from NORMAL to FOCUSED state
+ KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &SimpleVisualsApplication::OnKeyboardPreFocusChange );
+
+ stage.Add( contentLayout );
+
+ // Create 2 MyControls and add to table view.
+ mMyControl = MyControl::New();
+ mMyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mMyControl.SetParentOrigin(ParentOrigin::TOP_LEFT);
+
+ mMyControl2 = MyControl::New();
+ mMyControl2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mMyControl2.SetParentOrigin(ParentOrigin::CENTER);
+
+ contentLayout.AddChild( mMyControl2, TableView::CellPosition(0, 0) );
+ contentLayout.AddChild( mMyControl, TableView::CellPosition(0, 1) );
+}
+
+} // namespace Demo
--- /dev/null
+#ifndef DALI_DEMO_SIMPLE_VISUALS_APPLICATION_H
+#define DALI_DEMO_SIMPLE_VISUALS_APPLICATION_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
+#include <dali-toolkit/dali-toolkit.h>
+#include <cstdio>
+#include <sstream>
+
+// INTERNAL INCLUDES
+#include "my-control.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace Demo
+{
+
+/**
+ * @brief An application that uses the my-control to display 2 icons, if focus is allowed ( by using a keyboard or remote ) then the icons will change
+ * depending on which one is focused.
+ *
+ * Inherits from connection tracker to manage connection and disconnection of signals, In this case PreFocusChangeSignal
+ */
+class SimpleVisualsApplication : public ConnectionTracker
+{
+
+public:
+
+ /**
+ * @brief Constructor.
+ *
+ * @param[in] application A reference to the Application class.
+ */
+ SimpleVisualsApplication( Application& application );
+
+
+private:
+ /**
+ * @brief Listen to Focus change signal
+ * @param[in] current Current focused Actor
+ * @param[in] proposed New actor that is requesting to be focused
+ * @param[in] direction The direction of the focus event from current actor
+ */
+ Dali::Actor OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction );
+
+ /**
+ * @brief Derived from control, enables capture of key presses
+ *
+ * @param[in] event In incoming key event
+ */
+ void OnKeyEvent( const KeyEvent& event );
+
+ /**
+ * @brief Called to initialise the application content
+ *
+ * @param[in] application A reference to the Application class.
+ */
+ void Create( Application& application );
+
+
+private:
+
+ Application& mApplication; // Handle to the application that is created and passed in.
+
+ MyControl mMyControl; // Handle to first instance of MyControl
+ MyControl mMyControl2; // Handle to second instance of MyControl
+
+};
+
+} // Namespace Demo
+
+
+#endif // DALI_DEMO_SIMPLE_VISUALS_APPLICATION_H
--- /dev/null
+/*
+ * 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.
+ */
+
+/**
+ * @file transition-example.cpp
+ * @brief Example of a control built with visuals
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/dali.h>
+
+// INTERNAL INCLUDES
+#include "simple-visuals-application.h"
+
+namespace
+{
+// Style sheet to be used by this application
+const char* SIMPLE_DEMO_THEME( DEMO_STYLE_DIR "simple-example-theme.json" );
+}
+
+/// Entry point for applications
+int DALI_EXPORT_API main( int argc, char** argv )
+{
+ Application application = Application::New( &argc, &argv, SIMPLE_DEMO_THEME ); // Use the above defined style sheet for this application.
+ Demo::SimpleVisualsApplication simpleVisualsApplication( application );
+ application.MainLoop();
+ return 0;
+}
const float BORDER_WIDTH = 4.0f;
- const Vector3 POPUP_SIZE_FACTOR_TO_PARENT = Vector3( 0.0, 0.25, 0.0 );
+ const Vector3 POPUP_SIZE_FACTOR_TO_PARENT = Vector3( 0.8, 0.25, 0.0 );
} // unnamed namespace
button.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, FOLDER_ICON_IMAGE );
button.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, FOLDER_OPEN_ICON_IMAGE );
button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- ImageDimensions imageSize = ResourceImage::GetImageSize( FOLDER_ICON_IMAGE );
- button.SetSize( imageSize.GetWidth(), imageSize.GetHeight() );
-
return button;
}
// Launch a pop-up containing TextField
mField = CreateTextField( stageSize, mButtonLabel );
- mPopup = CreatePopup( stageSize.width * 0.8f );
+ mPopup = CreatePopup();
mPopup.Add( mField );
mPopup.OutsideTouchedSignal().Connect( this, &TextFieldExample::OnPopupOutsideTouched );
stage.Add( mPopup );
return field;
}
- Popup CreatePopup( float width )
+ Popup CreatePopup()
{
Popup popup = Popup::New();
popup.SetParentOrigin( ParentOrigin::CENTER );
popup.SetAnchorPoint( AnchorPoint::CENTER );
- popup.SetSize( width, 0.0f );
- popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
+ popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT );
popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched );
mTitle(),
mBeatControl(),
mActionButtons(),
+ mVisualIndex( Property::INVALID_INDEX ),
mActionIndex( Property::INVALID_INDEX )
{
application.InitSignal().Connect( this, &TransitionApplication::Create );
Name: com.samsung.dali-demo
Summary: The OpenGLES Canvas Core Demo
-Version: 1.2.28
+Version: 1.2.29
Release: 1
Group: System/Libraries
License: Apache-2.0
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP খেলা"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "ৰেণ্ডাৰিং গাঁথনি"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "ৰেণ্ডাৰিং ঘনক"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "ৰেণ্ডাৰিং ত্ৰিকোণমিতি"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "ৰেণ্ডাৰিং শাৰী"
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP Spiel"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "Texturierter Würfel"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "Würfel zeichnen"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "Dreieck zeichnen"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "Zeichnen"
msgid "DALI_DEMO_STR_TITLE_RENDERER_STENCIL"
msgstr "Renderer Stencil"
+msgid "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL"
+msgstr "Simple Visuals Control"
+
msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI"
msgstr "Script-based UI"
msgid "DALI_DEMO_STR_TITLE_VISUAL_TRANSITIONS"
msgstr "Visual Transitions"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "Textured cube"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "Draw cube"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "Draw triangle"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "Draw line"
msgid "DALI_DEMO_STR_TITLE_RENDERER_STENCIL"
msgstr "Renderer Stencil"
+msgid "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL"
+msgstr "Simple Visuals Control"
+
msgid "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI"
msgstr "Script-based UI"
msgid "DALI_DEMO_STR_TITLE_VISUAL_TRANSITIONS"
msgstr "Visual Transitions"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "Textured cube"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "Draw cube"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "Draw triangle"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "Draw line"
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "Juego FPP"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "Cubo con textura"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "Dibujar cubo"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "Dibujar triángulo"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "Dibujar linea"
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP peli"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "kuvioitu kuutio"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "piirtää kuutio"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "Piirrä kolmio"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "Draw linja"
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP Game"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "질감 입방체"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "큐브 그리기"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "삼각형 그리기"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "선 그리기"
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP Game"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "ടെക്സ്ചർ ക്യൂബ്"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "ക്യൂബ് വരയ്ക്കുക"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "ത്രികോണം വരയ്ക്കുക"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "സമനില ലൈൻ"
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP گیم"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "بویک ٹوانب "
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "ارڈ بویک "
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "ارڈ ثلثم "
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "انچنیھک ریکل "
msgid "DALI_DEMO_STR_TITLE_FPP_GAME"
msgstr "FPP游戏"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE"
+msgstr "纹理的多维数据集"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE"
+msgstr "绘制多维数据集"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE"
+msgstr "绘制三角形"
+
+msgid "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE"
+msgstr "画线"
demo-theme.json
contact-cards-example-theme.json
progress-bar-example-theme.json
+simple-example-theme.json
style-example-theme-three.json
style-example-theme-two.json
style-example-theme-one.json
"units": "USER_SPACE",
"stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
}
+ },
+//
+// Simple Visuals Application Style section
+//
+ "MyControl":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
+ }
+ }
+ },
+ "FOCUSED":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
+ }
+ }
+ }
+ }
}
}
}
--- /dev/null
+/*
+ * Copyright (c) 2000-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.
+ *
+ */
+
+{
+ "styles":
+ {
+ //
+ // Simple Visuals Application styling
+ //
+ "MyControl":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
+ }
+ }
+ },
+ "FOCUSED":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-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.
+ *
+ */
+
+{
+ "styles":
+ {
+ //
+ // Simple Visuals Application styling
+ //
+ "MyControl":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
+ }
+ }
+ },
+ "FOCUSED":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
+ }
+ }
+ }
+ }
+ }
+ }
+}
#define DALI_DEMO_STR_TITLE_POPUP dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_POPUP")
#define DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES")
#define DALI_DEMO_STR_TITLE_PROGRESS_BAR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_PROGRESS_BAR")
+#define DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE")
+#define DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE")
+#define DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE")
+#define DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE")
#define DALI_DEMO_STR_TITLE_REFRACTION dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_REFRACTION")
#define DALI_DEMO_STR_TITLE_RENDERER_STENCIL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERER_STENCIL")
+#define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS")
#define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI")
#define DALI_DEMO_STR_TITLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCROLL_VIEW")
#define DALI_DEMO_STR_TITLE_SPARKLE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SPARKLE")
#define DALI_DEMO_STR_TITLE_POPUP "Popup"
#define DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES "Primitive Shapes"
#define DALI_DEMO_STR_TITLE_PROGRESS_BAR "Progress Bar"
+#define DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE "Draw Line"
+#define DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE "Draw Triangle"
+#define DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE "Draw Cube"
+#define DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE "Textured Cube"
#define DALI_DEMO_STR_TITLE_REFRACTION "Refract Effect"
#define DALI_DEMO_STR_TITLE_RENDERER_STENCIL "Renderer Stencils"
+#define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL "Simple Visuals Control"
#define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI"
#define DALI_DEMO_STR_TITLE_SCROLL_VIEW "Scroll View"
#define DALI_DEMO_STR_TITLE_SPARKLE "Sparkle"