13.07.2015 Views

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

Mali GPU User Interface Engine Application Development Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tutorial on the Lotion <strong>User</strong> <strong>Interface</strong> Classesfps_counter The FpsCounter class is a virtual definition that has a single public virtual methodthat returns the frame rate.radio_buttonThe RadioButton class inherits from Button defines the checked and enabled stateof a radio button widget.sliderThe Slider class defines the virtual interface methods for a slider widget.5.1.2 Overview of initialization in main.cppFigure 5-1 shows the startup and run sequence in main.cpp:Start applicationRead command-line argumentsCreate application and themeLotion::<strong>Application</strong>* app = new Lotion::<strong>Application</strong>();theme = new Lotion::Themes::Minimal();app->setResolution(configResolution);app->setup(theme);Configure input devicesapp->addMultiTouchDevice(Lotion::MultiTouch::createMouseDevice(app->getSystem(), app->getContext()));Instantiate appletsLotion::Applet* lightshow = new Lotion::Applets::Lightshow();Add icons for appletstheme->addAppletIcon(lightshow->getIconThumbDesc(),Lotion::AppletCategoryTechdemos);Add applets to applicationlightshow->create(app, lightshow, theme);theme->addApplet(lightshow, Lotion::AppletCategoryTechdemos);Start the lotion applicationtheme->prepare();app->run();<strong>Application</strong> exitsFigure 5-1 Lotion main.cpp execution flowAfter initializing the application, the code in main.cpp prepares the theme and calls the run()method in the application. Figure 5-2 on page 5-7 shows the run() code within application.cpp:ARM DUI 0527A-02a Copyright © 2010 ARM. All rights reserved. 5-6ID070710Non-Confidential - Draft - Beta

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!