1 /*! \page dali-application DALi Application
3 <h2 class="pg">Creating an Application</h2>
5 The Adaptor framework provides provides a Dali::Application class which initialises and sets up DALi appropriately so that the application writer does not have to.
6 This provides many platform related services.
8 Several signals can be connected to so that the application writer is informed when certain platform related activities occur.
9 It also ensures that, upon system events, DALi is called in a thread-safe manner.
11 The following example shows how to create a Dali::Application instance and connect to its initialise signal (which is where a Dali::Actor hierarchy should be created).
14 void CreateProgram(Application& app)
16 // Create DALi components...
17 Dali::Actor actor = Actor::New();
21 int main (int argc, char **argv)
23 Dali::Application app = Application::New(&argc, &argv);
24 app.InitSignal().Connect(&CreateProgram);
29 Please see the Dali::Application class for other signals to which the application can connect.
31 <h2 class="pg">Window</h2>
32 DALi provides a Window class to manage drawing to a default surface. It is also responsible for drawing the Indicator bar if required. The Application class automatically creates a Window which the application author can access after the SignalInit has fired.
35 void CreateProgram(Application& app)
37 app.GetWindow().ShowIndicator(Dali::Window::VISIBLE);
40 int main (int argc, char **argv)
42 Dali::Application app = Application::New(&argc, &argv);
43 app.InitSignal().Connect(&CreateProgram);
48 <h2 class="pg">Timers</h2>
50 Timers are also provided by the Adaptor Framework so that the application writer can execute a portion of their code periodically or just once, after a delay. The example below shows how a Dali::Timer can be created and used:
56 return true; // Timer continues, i.e. this function will be called again after the specified time has elapsed.
62 Dali::Timer timer = Dali::Timer::New(2000); // 2 second timeout
63 timer.TickSignal().Connect(&Tick);