Commit db0f431ef91de874927ac9b8ea93d93c2a6601d6
[dali_1.2.52] Merge branch 'devel/master'
Change-Id: Ic32572c24b43cd11e4a52d62e0886962a0987e91
Showing
7 changed files
with
253 additions
and
4 deletions
com.samsung.dali-demo.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <manifest xmlns="http://tizen.org/ns/packages" package="com.samsung.dali-demo" version="0.0.1" api-version="2.4" install-location="internal-only"> |
| 3 | 3 | <!-- NOTE THAT ALL LEADING WHITESPACE IN THIS FILE MUST BE TABS, NOT SPACES. APPS WITH LEADING SPACES WILL SILENTLY FAIL TO RUN ON A TARGET DEVICE. --> |
| 4 | - | |
| 5 | 4 | <label>Dali Demo</label> |
| 6 | 5 | <author email="jonghyun.ho@samsung.com" href="www.samsung.com">Jonghyun Ho</author> |
| 7 | 6 | <description>DALi demo Application</description> |
| ... | ... | @@ -203,6 +202,9 @@ |
| 203 | 202 | <ui-application appid="focus-integration.example" exec="/usr/apps/com.samsung.dali-demo/bin/focus-integration.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 204 | 203 | <label>Focus Integration</label> |
| 205 | 204 | </ui-application> |
| 205 | + <ui-application appid="remote-image-loading.example" exec="/usr/apps/com.samsung.dali-demo/bin/remote-image-loading.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> | |
| 206 | + <label>Remote Image</label> | |
| 207 | + </ui-application> | |
| 206 | 208 | <ui-application appid="rendering-cube.example" exec="/usr/apps/com.samsung.dali-demo/bin/rendering-cube.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 207 | 209 | <label>Rendering Cube</label> |
| 208 | 210 | </ui-application> |
| ... | ... | @@ -233,4 +235,17 @@ |
| 233 | 235 | <ui-application appid="text-overlap.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-overlap.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 234 | 236 | <label>Text Overlap</label> |
| 235 | 237 | </ui-application> |
| 238 | + <privileges> | |
| 239 | + <privilege>http://tizen.org/privilege/mediastorage</privilege> | |
| 240 | + <privilege>http://tizen.org/privilege/externalstorage</privilege> | |
| 241 | + <privilege>http://tizen.org/privilege/externalstorage.appdata</privilege> | |
| 242 | + <privilege>http://tizen.org/privilege/unlimitedstorage</privilege> | |
| 243 | + <privilege>http://tizen.org/privilege/filesystem.write</privilege> | |
| 244 | + <privilege>http://tizen.org/privilege/filesystem.read</privilege> | |
| 245 | + <privilege>http://tizen.org/privilege/download</privilege> | |
| 246 | + <privilege>http://tizen.org/privilege/internet</privilege> | |
| 247 | + <privilege>http://tizen.org/privilege/network.get</privilege> | |
| 248 | + <privilege>http://tizen.org/privilege/network.profile</privilege> | |
| 249 | + <privilege>http://tizen.org/privilege/network.set</privilege> | |
| 250 | + </privileges> | |
| 236 | 251 | </manifest> | ... | ... |
examples-reel/dali-examples-reel.cpp
| ... | ... | @@ -82,6 +82,7 @@ int DALI_EXPORT_API main(int argc, char **argv) |
| 82 | 82 | demo.AddExample(Example("text-label-emojis.example", DALI_DEMO_STR_TITLE_EMOJI_TEXT)); |
| 83 | 83 | demo.AddExample(Example("text-overlap.example", DALI_DEMO_STR_TITLE_TEXT_OVERLAP)); |
| 84 | 84 | demo.AddExample(Example("text-scrolling.example", DALI_DEMO_STR_TITLE_TEXT_SCROLLING)); |
| 85 | + demo.AddExample(Example("remote-image-loading.example", DALI_DEMO_STR_TITLE_REMOTE_IMAGE)); | |
| 85 | 86 | demo.AddExample(Example("textured-mesh.example", DALI_DEMO_STR_TITLE_TEXTURED_MESH)); |
| 86 | 87 | demo.AddExample(Example("tilt.example", DALI_DEMO_STR_TITLE_TILT_SENSOR)); |
| 87 | 88 | demo.AddExample(Example("tooltip.example", DALI_DEMO_STR_TITLE_TOOLTIP)); | ... | ... |
examples/remote-image-loading/remote-image-loading-example.cpp
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2016 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | + | |
| 19 | +#include <shared/utility.h> | |
| 20 | +#include <stdlib.h> | |
| 21 | +#include <iostream> | |
| 22 | +#include <dali/dali.h> | |
| 23 | +#include <dali-toolkit/dali-toolkit.h> | |
| 24 | +#include <dali/devel-api/actors/actor-devel.h> | |
| 25 | + | |
| 26 | + | |
| 27 | +using namespace Dali; | |
| 28 | +using namespace Dali::Toolkit; | |
| 29 | + | |
| 30 | +// This example shows the load-time image scaling and filtering features. | |
| 31 | +// | |
| 32 | +class MyTester : public ConnectionTracker | |
| 33 | +{ | |
| 34 | +public: | |
| 35 | + MyTester(Application &application) : mApplication(application) | |
| 36 | + { | |
| 37 | + // Connect to the Application's Init signal | |
| 38 | + mApplication.InitSignal().Connect(this, &MyTester::Create); | |
| 39 | + } | |
| 40 | + | |
| 41 | + ~MyTester() | |
| 42 | + { | |
| 43 | + // Nothing to do here; | |
| 44 | + } | |
| 45 | + | |
| 46 | + void ConnectEventSignal(Control control) | |
| 47 | + { | |
| 48 | + control.TouchSignal().Connect(this, &MyTester::OnControlTouch); | |
| 49 | + | |
| 50 | + control.SetKeyboardFocusable(true); | |
| 51 | + control.KeyEventSignal().Connect(this, &MyTester::OnControlKeyEvent); | |
| 52 | + control.KeyInputFocusGainedSignal().Connect(this, &MyTester::OnFocusSet); | |
| 53 | + control.KeyInputFocusLostSignal().Connect(this, &MyTester::OnFocusUnSet); | |
| 54 | + } | |
| 55 | + | |
| 56 | + // The Init signal is received once (only) during the Application lifetime | |
| 57 | + void Create(Application &application) | |
| 58 | + { | |
| 59 | + stage = Stage::GetCurrent(); | |
| 60 | + stage.SetBackgroundColor(Color::BLACK); | |
| 61 | + stage.KeyEventSignal().Connect(this, &MyTester::OnKey); | |
| 62 | + stage.TouchSignal().Connect(this, &MyTester::OnTouch); | |
| 63 | + | |
| 64 | + TextLabel rubric = TextLabel::New( "You will need a working internet connection to see the images below"); | |
| 65 | + rubric.SetProperty( TextLabel::Property::MULTI_LINE, true ); | |
| 66 | + rubric.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE ); | |
| 67 | + rubric.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 68 | + rubric.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); | |
| 69 | + rubric.SetParentOrigin( ParentOrigin::TOP_CENTER ); | |
| 70 | + rubric.SetAnchorPoint( ParentOrigin::TOP_CENTER ); | |
| 71 | + stage.Add( rubric ); | |
| 72 | + | |
| 73 | + mImageView1 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/293/259/19/520_000000000000293259191500x1500_72dpi_RGB_q70.jpg"); | |
| 74 | + | |
| 75 | + mImageView1.SetName("mImageView1"); | |
| 76 | + mImageView1.SetParentOrigin(ParentOrigin::TOP_LEFT); | |
| 77 | + mImageView1.SetAnchorPoint(AnchorPoint::TOP_CENTER); | |
| 78 | + mImageView1.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); | |
| 79 | + mImageView1.SetPosition(0, 100); | |
| 80 | + mImageView1.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); | |
| 81 | + stage.Add(mImageView1); | |
| 82 | + | |
| 83 | + mImageView2 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/212/651/88/520_000000000000212651881500x1500_72dpi_RGB_q70.jpg"); | |
| 84 | + mImageView2.SetName("mImageView2"); | |
| 85 | + mImageView2.SetParentOrigin(ParentOrigin::TOP_LEFT); | |
| 86 | + mImageView2.SetAnchorPoint(AnchorPoint::TOP_CENTER); | |
| 87 | + mImageView2.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); | |
| 88 | + mImageView2.SetPosition(400, 100); | |
| 89 | + mImageView2.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); | |
| 90 | + stage.Add(mImageView2); | |
| 91 | + | |
| 92 | + mImageView3 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/212/353/21/520_000000000000212353211500x1500_72dpi_RGB_q70.jpg"); | |
| 93 | + mImageView3.SetName("mImageView3"); | |
| 94 | + mImageView3.SetParentOrigin(ParentOrigin::TOP_LEFT); | |
| 95 | + mImageView3.SetAnchorPoint(AnchorPoint::TOP_CENTER); | |
| 96 | + mImageView3.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); | |
| 97 | + mImageView3.SetPosition(0, 400); | |
| 98 | + mImageView3.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); | |
| 99 | + stage.Add(mImageView3); | |
| 100 | + | |
| 101 | + mImageView4 = Toolkit::ImageView::New("http://d2k43l0oslhof9.cloudfront.net/platform/image/contents/vc/20/01/58/20170629100630071189_0bf6b911-a847-cba4-e518-be40fe2f579420170629192203240.jpg"); | |
| 102 | + mImageView4.SetName("mImageView4"); | |
| 103 | + mImageView4.SetParentOrigin(ParentOrigin::TOP_LEFT); | |
| 104 | + mImageView4.SetAnchorPoint(AnchorPoint::TOP_CENTER); | |
| 105 | + mImageView4.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); | |
| 106 | + mImageView4.SetPosition(400, 400); | |
| 107 | + mImageView4.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); | |
| 108 | + stage.Add(mImageView4); | |
| 109 | + | |
| 110 | + mImageView5 = Toolkit::ImageView::New("http://static.midomi.com/h/images/w/weather_sunny.png"); | |
| 111 | + mImageView5.SetName("mImageView5"); | |
| 112 | + mImageView4.SetParentOrigin(ParentOrigin::TOP_LEFT); | |
| 113 | + mImageView5.SetAnchorPoint(AnchorPoint::TOP_CENTER); | |
| 114 | + mImageView5.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false); | |
| 115 | + mImageView5.SetPosition(800, 100); | |
| 116 | + mImageView5.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f)); | |
| 117 | + stage.Add(mImageView5); | |
| 118 | + | |
| 119 | + // Tie-in input event handlers: | |
| 120 | + stage.KeyEventSignal().Connect( this, &MyTester::OnKeyEvent ); | |
| 121 | + } | |
| 122 | + | |
| 123 | + void OnAnimationEnd(Animation &source) | |
| 124 | + { | |
| 125 | + std::cout<<"OnAnimationEnd" << std::endl; | |
| 126 | + } | |
| 127 | + | |
| 128 | + void OnKeyEvent(const KeyEvent& event) | |
| 129 | + { | |
| 130 | + if( event.state == KeyEvent::Down ) | |
| 131 | + { | |
| 132 | + if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | |
| 133 | + { | |
| 134 | + mApplication.Quit(); | |
| 135 | + } | |
| 136 | + } | |
| 137 | + } | |
| 138 | + | |
| 139 | + void OnKey(const KeyEvent &event) | |
| 140 | + { | |
| 141 | + if (event.state == KeyEvent::Down) | |
| 142 | + { | |
| 143 | + std::cout<<"Stage key : " << event.keyCode << std::endl; | |
| 144 | + } | |
| 145 | + } | |
| 146 | + | |
| 147 | + void OnTouch(const TouchData &touch) | |
| 148 | + { | |
| 149 | + if (touch.GetState(0) == PointState::DOWN) | |
| 150 | + { | |
| 151 | + std::cout<<"Stage touch" << std::endl; | |
| 152 | + } | |
| 153 | + } | |
| 154 | + | |
| 155 | + bool OnControlKeyEvent(Toolkit::Control control, const KeyEvent &event) | |
| 156 | + { | |
| 157 | + if (event.state == KeyEvent::Down) | |
| 158 | + { | |
| 159 | + std::cout<<"Control down key : " << control.GetName() << ", keyCode : " << event.keyCode << std::endl; | |
| 160 | + } | |
| 161 | + else | |
| 162 | + { | |
| 163 | + std::cout<<"Control up key : " << control.GetName() << ", keyCode : " << event.keyCode << std::endl; | |
| 164 | + } | |
| 165 | + return false; | |
| 166 | + } | |
| 167 | + | |
| 168 | + bool OnControlTouch(Actor actor, const TouchData &touch) | |
| 169 | + { | |
| 170 | + if (touch.GetState(0) == PointState::DOWN) | |
| 171 | + { | |
| 172 | + | |
| 173 | + std::cout<<"Control touch " << actor.GetName() << ", parent " << actor.GetParent().GetName() << std::endl; | |
| 174 | + } | |
| 175 | + | |
| 176 | + return false; | |
| 177 | + } | |
| 178 | + | |
| 179 | + void OnFocusSet(Control control) | |
| 180 | + { | |
| 181 | + std::cout<<"OnFocusSet " << control.GetName() << std::endl; | |
| 182 | + } | |
| 183 | + | |
| 184 | + void OnFocusUnSet(Control control) | |
| 185 | + { | |
| 186 | + std::cout<<"OnFocusUnSet " << control.GetName() << std::endl; | |
| 187 | + } | |
| 188 | + | |
| 189 | +private: | |
| 190 | + Stage stage; | |
| 191 | + Application &mApplication; | |
| 192 | + | |
| 193 | + Control mControl1; | |
| 194 | + Control mControl2; | |
| 195 | + ImageView mImageView1; | |
| 196 | + ImageView mImageView2; | |
| 197 | + ImageView mImageView3; | |
| 198 | + ImageView mImageView4; | |
| 199 | + ImageView mImageView5; | |
| 200 | + | |
| 201 | + TextLabel mTextLabel1; | |
| 202 | + TextLabel mTextLabel2; | |
| 203 | + TextField mTextField; | |
| 204 | + TextEditor mTextEditor; | |
| 205 | + | |
| 206 | + Animation mAnimation; | |
| 207 | + Timer mTimer; | |
| 208 | + | |
| 209 | +}; | |
| 210 | + | |
| 211 | +void RunTest(Application &application) | |
| 212 | +{ | |
| 213 | + MyTester test(application); | |
| 214 | + application.MainLoop(); | |
| 215 | +} | |
| 216 | + | |
| 217 | +// Entry point for Linux & Tizen applications | |
| 218 | +int DALI_EXPORT_API main(int argc, char **argv) | |
| 219 | +{ | |
| 220 | + | |
| 221 | + Application application = Application::New(&argc, &argv, ""); | |
| 222 | + RunTest(application); | |
| 223 | + | |
| 224 | + return 0; | |
| 225 | +} | ... | ... |
packaging/com.samsung.dali-demo.spec
resources/po/en_GB.po
| ... | ... | @@ -169,6 +169,9 @@ msgstr "FPP Game" |
| 169 | 169 | msgid "DALI_DEMO_STR_TITLE_VISUAL_TRANSITIONS" |
| 170 | 170 | msgstr "Visual Transitions" |
| 171 | 171 | |
| 172 | +msgid "DALI_DEMO_STR_TITLE_REMOTE_IMAGE" | |
| 173 | +msgstr "Remote Image" | |
| 174 | + | |
| 172 | 175 | msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE" |
| 173 | 176 | msgstr "Textured cube" |
| 174 | 177 | ... | ... |
resources/po/en_US.po
| ... | ... | @@ -169,6 +169,9 @@ msgstr "FPP Game" |
| 169 | 169 | msgid "DALI_DEMO_STR_TITLE_VISUAL_TRANSITIONS" |
| 170 | 170 | msgstr "Visual Transitions" |
| 171 | 171 | |
| 172 | +msgid "DALI_DEMO_STR_TITLE_REMOTE_IMAGE" | |
| 173 | +msgstr "Remote Image" | |
| 174 | + | |
| 172 | 175 | msgid "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE" |
| 173 | 176 | msgstr "Textured cube" |
| 174 | 177 | ... | ... |
shared/dali-demo-strings.h
| ... | ... | @@ -73,13 +73,14 @@ extern "C" |
| 73 | 73 | #define DALI_DEMO_STR_TITLE_PIVOT dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_PIVOT") |
| 74 | 74 | #define DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES") |
| 75 | 75 | #define DALI_DEMO_STR_TITLE_PROGRESS_BAR dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_PROGRESS_BAR") |
| 76 | +#define DALI_DEMO_STR_TITLE_REFRACTION dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_REFRACTION") | |
| 77 | +#define DALI_DEMO_STR_TITLE_REMOTE_IMAGE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_REMOTE_IMAGE") | |
| 76 | 78 | #define DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE") |
| 77 | 79 | #define DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE") |
| 78 | 80 | #define DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE") |
| 79 | 81 | #define DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE") |
| 80 | 82 | #define DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS") |
| 81 | 83 | #define DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING") |
| 82 | -#define DALI_DEMO_STR_TITLE_REFRACTION dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_REFRACTION") | |
| 83 | 84 | #define DALI_DEMO_STR_TITLE_RENDERER_STENCIL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERER_STENCIL") |
| 84 | 85 | #define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS") |
| 85 | 86 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI") |
| ... | ... | @@ -141,13 +142,14 @@ extern "C" |
| 141 | 142 | #define DALI_DEMO_STR_TITLE_PIVOT "Pivot" |
| 142 | 143 | #define DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES "Primitive Shapes" |
| 143 | 144 | #define DALI_DEMO_STR_TITLE_PROGRESS_BAR "Progress Bar" |
| 145 | +#define DALI_DEMO_STR_TITLE_REFRACTION "Refract Effect" | |
| 146 | +#define DALI_DEMO_STR_TITLE_REMOTE_IMAGE "Remote Image" | |
| 144 | 147 | #define DALI_DEMO_STR_TITLE_RENDERING_DRAW_LINE "Draw Line" |
| 145 | 148 | #define DALI_DEMO_STR_TITLE_RENDERING_DRAW_TRIANGLE "Draw Triangle" |
| 146 | 149 | #define DALI_DEMO_STR_TITLE_RENDERING_DRAW_CUBE "Draw Cube" |
| 147 | 150 | #define DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE "Textured Cube" |
| 148 | 151 | #define DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING "Ray Marching" |
| 149 | 152 | #define DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS "Radial Progress" |
| 150 | -#define DALI_DEMO_STR_TITLE_REFRACTION "Refract Effect" | |
| 151 | 153 | #define DALI_DEMO_STR_TITLE_RENDERER_STENCIL "Renderer Stencils" |
| 152 | 154 | #define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL "Simple Visuals Control" |
| 153 | 155 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI" | ... | ... |