Venus provides several important features for programming:
C++ and OO development environment
Venus object model
Fancy UI engine
High priority rendering task:VRT
Make file
• MMI_BASE = VENUS_MMI
• MMI_VERSION = COSMOS_MMI
• VENUS_MMI = VENUS_LEVEL1
Libraries:
Package:
cosmos_app.lib :UCM, Call-log, SMS, SIM, Idle, …
cosmos_media_app.lib: Image viewer, camera, video player, audio
cosmos_inet_app.lib: MMS, Browser, Provisioning, EMail,
cosmos_conn_app.lib: DA, BT, Download Agent, …
------------------------------------------------------------------------
Platform
venusmmi.lib: UIcore, MMI core, XML …
--------------------------------------------------------------------------
Common
mmi_framework.lib: Framework, language, font, middleware, … (w/o WGUI, Categor
mmi_service.lib: Services
gdi.lib: graphic device related function
--------------------------------------------------------------------------
Common:
1.Content of original venusmmi\service
2.Common parts of application or CUI
Cosmos:
FTO specific AP/CUI
1.Each application has its own folder
2.Each CUI can has its own folder
3.To reduce directory depth, APP and CUI are put at same level
4.If a CUI is strong y related to application, it can just put to application.
Pltuo_variation
1.Old (10A) content of venusmmi/app
2.Old (10A) content of venusmmi/pluto_adaptor
Framework and Service were put under pluto folder initially. Can be referenced by Venus platform
Step by step to Write a Venus app:
Step 1: Add Venus app resource
1) App registeration
In Vapp _package_res.h
We use macro VFX_APP_RES_DECLARE to register a unique app id:
VFX_APP_RES_DECLARE(APP_MY_FIRST_APP,50,”MyFirstApp\\res\\”)
The macro VFX_APP_RES_DECLARE requires 3 parameters:APP id,resource count,resource location
2) Create “MyFirstApp” file folder below mcu\venusmmi\app\Cosmos\
/* In app res file */
#include "mmi_features.h"
#include "custresdef.h"
<?xml version="1.0" encoding="UTF-8"?>
<APP id="VAPP_ALARM" package_name="native.mtk.alarm"
name="VAPP_STR_ALARM“
img="VAPP_IMG_ALARM" launch="vapp_alarm_launch“ type="venus">
<MEMORY heap="500*1024" />
<IMAGE
id="VAPP_IMG_ALARM">RES_IMG_ROOT"\\\\Mainmenu_Icon\\\\Alarm.png"</IMAGE>
<STRING id="VAPP_STR_ALARM_NO_ALARMS">"No alarms"</STRING>
<RECIEVER id="EVT_ID_SRV_REMINDER_PWRRESET_REQ"
proc="vapp_alarm_evt_handlr"/>
<CACHEDATA type="byte" id="NVRAM_ALARM_SETTINGS_SNOOZE">
<DEFAULT_VALUE> [0x00] </DEFAULT_VALUE>
<DESCRIPTION>Alarm setting snooze list</DESCRIPTION>
</CACHEDATA>
Step 2: Define application’s entry point
1) In vapp_my_first_app_launch,we call VfxAppLauncher::launch() to launch this app:
2) Vapp_my_first_app.h Define the app class: VappMyFirstAppinherit from VfxApp
3) Vapp_my_first_app.cpp
- We override onRun() function to run the app,
- We create instance of VappMyFirstScreen(will be defined later) :
Step 3: Define MainScreen and Page
1) Vapp_my_first_app.h
2) Vapp_my_first_app.cpp
- In VappMyFirstScreen::on1stReady(),we create our page instance called
VappMyFirstPage(will be defined later) and push this new page into main screen
3) Vapp_my_first_app.h
- Define my first page class called: VappMyFirstPage inherit from VfxPage or VcpTabCtrlPage
oid VappTestPage::onInit()
{
// we create contents of test page in its onInit() function
…
// screen_bg is a child of this page
VFX_OBJ_CREATE(page_bg,VfxFrame,this);
// audio_widget is a child of this page
VFX_OBJ_CREATE(audio_widget,VcpAudioWidget,this);
// widget_bg is a child of audio widget
VFX_OBJ_CREATE(widget_bg,VfxFrame, audio_widget);
// play_button is a child of audio widget
// play_button is a child of audio widget
VFX_OBJ_CREATE(play_button,VcpButton, audio_widget);
// button_bg is a child of button component
VFX_OBJ_CREATE(button_bg,VfxFrame, play_button);
// button_text is a child of button component
VFX_OBJ_CREATE(button_text,VfxTextFrame, play_button);
// page_text is a child of this page
VFX_OBJ_CREATE(page_text,VfxTextFrame,this);
…
}
Example: Signal & Slot
class VfxTestObj : public VfxObject
{
public:
VfxSignal0 m_eventArg0;
VfxSignal1 <VfxFloat> m_eventArg1;
VfxSignal2 <VfxFloat, VfxFloat> m_eventArg2;
//...
protected:
virtual void onInit();
};
…
void VfxOtherTest::onInit()
{
VfxTestObj * test_obj;
VFX_OBJ_CREATE(test_obj,VfxTestObj,this);
test_obj->m_eventArg0.connect(this,&VfxOtherTest::onTestArg_a);
test_obj->m_eventArg1.connect(this, &VfxOtherTest::onTestArg_b);
test_obj->m_eventArg1.connect(this,&VfxOtherTest::onTestArg_c);
test_obj->testEvent();
Example: Signal & Slot
void VfxTestObj::testEvent()
{
//...
m_eventArg0.emit( ); // onTestArg1_a will be called
m_eventArg1.emit(1.2); // onTestArg1_b will be called
m_eventarg2.emit(2.7, 3.5); // onTestArg1_c will be called
}
void VfxOtherTest::onTestArg1_a( )
{
… // You can add your handling function when m_eventArg0 emited
}
void VfxOtherTest ::onTestArg1_b(VFxFloat arg1)
{
… // You can add your handling function when m_eventArg0 emited
}
void VfxOtherTest ::onTestArg1_c(VFxFloat arg1,vfxFloat arg2)
{
… // You can add your handling function when m_eventArg0 emited
}
Step 4: Create your frame or control on page Dual with pen/key event Display more fancy effects