Deleted Move/Copy operators & constructors from Internal::Control
[platform/core/uifw/dali-toolkit.git] / docs / content / programming-guide / programming-languages.md
1 <!--
2 /**-->
3
4 # Programming Languages {#programming-languages}
5
6 DALi applications can be written in several different programming languages.
7
8 ## C++ {#c-plus-plus}
9
10 ~~~{.cpp}
11 Dali::Actor actor = Dali::Actor::New();
12 actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
13 actor.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
14 Dali::Stage::GetCurrent().Add( actor );
15 ...
16 bool OnPressed( Dali::Actor, const TouchEvent& touch )
17 {
18   Dali::Animation anim = Dali::Animation::New( 1.5f );
19   anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 200, -100, 0 ), AlphaFunctions::Bounce );
20   anim.play();
21   return true; // consume the touch event
22 }
23 ...
24 actor.TouchSignal().Connect( &OnPressed );
25 ~~~
26
27 ## JSON {#json-support}
28
29 ~~~{.json}
30 {
31  "animations":
32   {
33     "move":
34     {
35       "duration": 1.5,
36       "properties":
37       [
38         {
39           "actor":"image",
40           "property":"position",
41           "value":[200,-100,0],
42           "alphaFunction": "BOUNCE"
43         }
44       ]
45     }
46   },
47   "stage":
48   [
49     {
50       "name":"image",
51       "type":"Actor",
52       "anchorPoint": "CENTER",
53       "parentOrigin": "CENTER",
54       "signals" :
55       [
56         { "name" : "touch", "action": "play", "animation": "move" }
57       ]
58     }
59   ]
60 }
61 ~~~