欢迎来到天天文库
浏览记录
ID:43091535
大小:100.05 KB
页数:3页
时间:2019-09-26
《mtk平台学习心得一_HelloWorld的显示》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、HelloWorld一.HelloWorld的显示1、首先建立新的模块冃录,之后把模块相关文件都放到这个冃录下统一进行管理,新的模块一般放到plutommiMMI下而,这里我们新建一个目录“HelloWorld",然后在模块目录“HelloWorld”下再建三个子目录:“Inc"、“Src"和“Res”,分别用来存放模块的头文件、源文件和资源文件,目录结构如下图所示:2、接着我们在Inc下创建几个头文件:HelloWorldGprot.h,HelloWorldProt.h,HelloWorldTypes.h,HelloWorldDefs.h,再在Src下创建一个源文件:HelloWo
2、rld.c头文件HelloWorldGprot.h的内容人致如下:#ifndef_HELLOWORLD_GPROT_H_#define_HELLOWORLD_GPROT_H_#include''PixtelDataTypes.h'*#include,,HelloWorldTypes.hnexternvoidmmi_HelloWorld_entry(void);/*模块入口,理解成dos程序的main好了*/#endif头文件HelloWorldProt.h的内容的大致如下:#ifndef_HELLOWORLD_PROT_H_#define_HELLOWORLD_PROT_H_#incl
3、ude"HelloWorldGprot.h"externvoidmmi_HelloWorld_entry(void);/*本模块主界面入口例程*/externvoidmmi_HelloWorld_exit(void);/*本模块主界面退出例程*/#endif3、紧接着,我们要修改的相关系统文件,使这个模块成为整个项目的一部分,需要修改的系统文件如下:makeplutommiplutommi.inc文件追加一行''plutommi'mmiHelloWorldInc"makeplutommiplutommi.pth文件追加一行"plutommimmiHelloWor]dS
4、rc”makeplutommiplutommi.lis文件追加一行"plutommimmiHelloWoiidSrcHelloWoi'ld.c''4、再接看,我们需要增加一个开关在plutommiCustomerCustResourcePLUTO_MMIMMI_featuresPLUTO.h这个文件里面追加一行:#define_MMI_HELLOWORLD_ENABLED_,同时在相关源文件里面用:#ifdef_MMI_HELLOWORLD_ENABLED_#endif5、下面讲具体实现的部分修改下文件ttplutommimmimainmenumainmenu
5、srcMainMenu.c,,,
6、丨的goto_main_menu函数,如下所示红色字体部分:voidgoto_main_menu(void){#ifdef_MMI_HELLOWORLD_ENABLED_mmi_HelloWorld_entry();return;#else…〃此处为之前goto_main_menu的代码#endif}再在这个文件的头文件包含代码块(通常是文件的顶部区域)追加这一句:include"HelloWorldGprot.h'1。6、下血是HelloWorld.c的内容:include”stdC.h”#includeMMMI_Features.hn/*编译开关
7、会出现在这个由makeupdate生成的文件里面*/include,,L4Dr.hHinclude"L4Drl.hu#include"AllAppGprot.h"#include"FrameworkStruct.h"#include"GlobalConstants.h'1#include"EventsGprot.h"#include"mmiappfnptrs.h"#include"HistoryGprot.h"#includeMHelloWorldProt.h"include"HelloWorIdTypes.hHincludeMHelloWorldDefs.hu#include"Mai
8、nMenuDef.h"#include"vvgui_categories.h"#include"Unicodexdcl.h"voidmmi_HelloWorld_entry(void);/*模块出口*/voidmmi_HelloWorld_exit(void){#ifdef_MMI_HELLOWORLD_ENABLED_historycurrHistory;S16nHistory=0;currHistory.scmID=MAIN_MENU_SC
此文档下载收益归作者所有