mirror of https://github.com/axmolengine/axmol.git
parent
2acf23d133
commit
75cfd65f0b
|
@ -0,0 +1,53 @@
|
|||
;
|
||||
; TG3 Makefile Auto Create Script
|
||||
;
|
||||
; 说明:
|
||||
; 1.在等号左边不要有空格
|
||||
; 2.所有的路径请使用"/"来分隔
|
||||
; 3.所有的文件名不可以有空格
|
||||
; 4.只能对当前目录及其子目录下的.c、.cpp生成Makefile
|
||||
;
|
||||
|
||||
;本TMK3文件目录位置到项目根目录之间的转换,不支持多个串,如果有多个,以最后一个为准
|
||||
;即 ./$(TO_PROJECT_ROOT)/ 就是项目的根目录
|
||||
TO_PROJECT_ROOT=../../PRJ_TG3
|
||||
|
||||
;输出目标的名字,不支持多个串,如果有多个,以最后一个为准
|
||||
OUTPUT_FILENAME=libHelloWorld.so
|
||||
|
||||
;包含的其他的TMK3文件,此文件和本文件一起构成MakeFile的内容
|
||||
;此项可以出现在TMK3文件内的任意地方,与已经存在的项依次组合
|
||||
;注意:此项不支持绝对路径,但是可以使用$(TO_PROJECT_ROOT)构成文件名
|
||||
INCLUDE_TMK3=$(TO_PROJECT_ROOT)/MakeInclude/TG3_APP.TMK3 ;TOPS标准应用,包括动态库等
|
||||
|
||||
;预定义串,生成MakeFile的时候直接放在MakeFile的前面
|
||||
;格式:PRE_DEFINE=STRING,生成MakeFile的时候,"PRE_DEFINE="后面的所有非注释非续行字符都会放在MakeFile前面
|
||||
;例如:PRE_DEFINE=AAA=BBB,会放入AAA=BBB到MakeFile中
|
||||
;可以使用多个PRE_DEFINE串,也可以使用PRE_DEFINE1、PRE_DEFINE2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
;PRE_DEFINE=USE_IMAGEKIT=1 ;使用 ImageToolKit 库,此时生成的 Makefile 会自动连接有关的LIB
|
||||
;PRE_DEFINE=USE_ICU=1 ;使用 ICU 库,此时生成的 Makefile 会自动连接有关的LIB
|
||||
;PRE_DEFINE=USE_MTAPI=1 ;使用 MTAPI 库,此时生成的 Makefile 会自动连接有关的LIB
|
||||
|
||||
;C、C++预定义宏,可以使用多个DEFINES串,也可以使用DEFINES1、DEFINES2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
DEFINES=-D_MY_MARCO_ ;这里填入应用的自定义宏。注意:ITOPS自己的所需定义会自动包含,故此这里仅仅包含应用自己特有的定义即可
|
||||
;DEFINES=-D__TG3_PURE_DLL__ ;生成的是纯动态库(意思是:不是TOPS应用,但可以是TCOM组件)
|
||||
;DEFINES=-D__TCOM_SUPPORT__ ;生成的是TCOM组件(注意:TOPS应用也可以同时是TCOM组件)
|
||||
|
||||
;包含路径,可以使用多个INCLUDE_PATH串,也可以使用INCLUDE_PATH1、INCLUDE_PATH2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
INCLUDE_PATH= ;应用额外的包含路径。注意:ITOPS自己的所有路径都会自动包含,故此这里仅仅包含应用自己特有的路径即可
|
||||
|
||||
;连接的库文件,可以使用多个LIBS串,也可以使用LIBS1、LIBS2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
LIBS=-lMyLib ;应用额外的连接库。注意:ITOPS自己的所需库自动包含,而且库包含路径也已经包含,故此这里仅仅包含应用自己特有的库的名字即可
|
||||
|
||||
;强制包含文件的名字,不能使用通配符,一定要使用相对或者绝对路径
|
||||
;极力要求使用相对路径,多个文件之间使用“|”分隔
|
||||
;强制包含文件指的是不在本文件夹及其子文件夹下的.c、.cpp、.o文件
|
||||
;可以使用多个INCLUDEFILE串,也可以使用INCLUDEFILE1、INCLUDEFILE2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
INCLUDEFILE=
|
||||
|
||||
;强制排除文件,不能使用通配符,一定要使用相对路径
|
||||
;多个文件之间使用“|”分隔,路径必须以"./","../"开始
|
||||
;只能对.c、.cpp文件进行排除
|
||||
;如果要排除本目录的文件也要加入"./"
|
||||
;可以使用多个EXCLUDEFILE串,也可以使用EXCLUDEFILE1、EXCLUDEFILE2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
EXCLUDEFILE=
|
|
@ -0,0 +1,333 @@
|
|||
<?xml version="1.0" encoding="gb2312"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="HelloWorld"
|
||||
ProjectGUID="{90D08657-A80A-41CD-8AAC-3A3DC8C33041}"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="../../PRJ_TG3/LIB/Win32Lib"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\Res;..\..\PRJ_TG3\Include;..\..\PRJ_TG3\Include\MTAPI;..\..\PRJ_TG3\Include\ThirdParty;..\..\PRJ_TG3\Include\TCOM;..\..\PRJ_TG3\TG3\Include;..\..\PRJ_TG3\TG3\TG3_Implement;..\..\PRJ_TG3\EOS_SYS;..\..\PRJ_TG3\Common\SoftSupport;..\..\PRJ_TG3\Common\ICU\Include;..\cocos2dx\include;..\cocos2dx;..\..\PRJ_TG3\Include\ThirdParty\gles"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_TRANZDA_VM_;SS_MAKEDLL"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
StructMemberAlignment="3"
|
||||
TreatWChar_tAsBuiltInType="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
ForcedIncludeFiles=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="WS2_32.Lib ..\..\PRJ_TG3\Common\SoftSupport\EosConfig.lib ..\..\PRJ_TG3\Common\SoftSupport\SoftSupport.lib ..\..\PRJ_TG3\Common\SoftSupport\TG3_DLL.lib"
|
||||
OutputFile="$(OutDir)/HelloWorld.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="../../PRJ_TG3/Common/ICU/lib;../../PRJ_TG3/Mtapi/Win32/lib;../../PRJ_TG3/LIB/Win32Lib;../../PRJ_TG3/Common/SoftSupport"
|
||||
GenerateDebugInformation="true"
|
||||
GenerateMapFile="true"
|
||||
MapExports="true"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
ImportLibrary="$(OutDir)/$(TargetName).lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="copy Res\HelloWorld.png D:\Work7\NEWPLUS\TDA_DATA\UserData\"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="../../PRJ_TG3/LIB/Win32Lib"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=".\Res;..\..\PRJ_TG3\Include;..\..\PRJ_TG3\Include\MTAPI;..\..\PRJ_TG3\Include\ThirdParty;..\..\PRJ_TG3\Include\TCOM;..\..\PRJ_TG3\TG3\Include;..\..\PRJ_TG3\TG3\TG3_Implement;..\..\PRJ_TG3\EOS_SYS;..\..\PRJ_TG3\Common\SoftSupport;..\..\PRJ_TG3\Common\ICU\Include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_TRANZDA_VM_;SS_MAKEDLL"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/HelloWorld.dll"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="source"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\HelloWorldEntry.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorldEntry.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="app"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\HelloWorldApp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorldApp.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="forms"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\HelloWorldMainForm.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorldMainForm.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="HelloWorld"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\HelloWorld\HelloSprite.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorld\HelloSprite.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorld\HelloWorld.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorld\HelloWorld.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Res"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Res\HelloWorld_Res.ENU.tr3"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\HelloWorld_Res.ENU.tr3.tts"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\HelloWorld_Res.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\HelloWorld_Res.TR3"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\HelloWorld_Res.TRG"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\helloworld_res_c.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\helloworld_res_def.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Res\helloworld_res_h.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Makefiles"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\HelloWorld.TMK3"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorld_Arm.TMK3"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Makefile"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Makefile.ARM"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Framework"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\NewDeleteOp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TG3AppDllEntry.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\TG3AppDllEntry.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\HelloWorldUnicodeScript.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="..\..\PRJ_TG3\Common\StrConv\TzdStrConv_V1.exe $(InputPath) $(InputDir)$(InputName)_str.h
"
|
||||
AdditionalDependencies="..\..\PRJ_TG3\Common\StrConv\TzdStrConv_V1.exe"
|
||||
Outputs="$(InputDir)$(InputName)_str.h"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\HelloWorldUnicodeScript_str.h"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,20 @@
|
|||
#include "HelloSprite.h"
|
||||
|
||||
HelloSprite::HelloSprite()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HelloSprite::~HelloSprite()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HelloSprite* HelloSprite::CreateWithTexture(CCTexture2D* aTexture)
|
||||
{
|
||||
HelloSprite* pHSprite = new HelloSprite();
|
||||
pHSprite->initWithTexture(aTexture);
|
||||
pHSprite->autorelease();
|
||||
|
||||
return pHSprite;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef _HelloSprite_H_
|
||||
#define _HelloSprite_H_
|
||||
|
||||
#include "CCSprite.h"
|
||||
#include "CCTextureCache.h"
|
||||
|
||||
class HelloSprite : public CCSprite
|
||||
{
|
||||
public:
|
||||
HelloSprite();
|
||||
~HelloSprite();
|
||||
|
||||
public:
|
||||
static HelloSprite* CreateWithTexture(CCTexture2D* aTexture);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,16 @@
|
|||
#include "HelloWorld.h"
|
||||
|
||||
HelloWorld::HelloWorld()
|
||||
{
|
||||
CCTextureCache * pTexCache = CCTextureCache::sharedTextureCache();
|
||||
|
||||
m_pHSprite = HelloSprite::CreateWithTexture(pTexCache->addImage("/NEWPLUS/TDA_DATA/UserData/HelloWorld.png"));
|
||||
m_pHSprite->setPosition(CGPointMake(0.0f, 0.0f));
|
||||
addChild(m_pHSprite);
|
||||
m_pHSprite->retain();
|
||||
}
|
||||
|
||||
HelloWorld::~HelloWorld()
|
||||
{
|
||||
m_pHSprite->release();
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef _HelloWorld_H_
|
||||
#define _HelloWorld_H_
|
||||
|
||||
#include "CCLayer.h"
|
||||
#include "HelloSprite.h"
|
||||
|
||||
class HelloWorld : public CCLayer
|
||||
{
|
||||
public:
|
||||
HelloWorld();
|
||||
~HelloWorld();
|
||||
|
||||
private:
|
||||
HelloSprite * m_pHSprite;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,71 @@
|
|||
// Application application cpp file.
|
||||
|
||||
// Original file name: HelloWorldApp.cpp
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
#include "HelloWorldApp.h"
|
||||
#include "HelloWorldMainForm.h"
|
||||
|
||||
#include "CCDirector.h"
|
||||
#include "CCScene.h"
|
||||
#include "HelloWorld/HelloWorld.h"
|
||||
|
||||
THelloWorldApp::THelloWorldApp()
|
||||
: m_pMainWnd(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
THelloWorldApp::~THelloWorldApp()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Boolean THelloWorldApp::initCocos2d()
|
||||
{
|
||||
CCDirector::getSharedDirector()->setOpenGLView(m_pMainWnd);
|
||||
|
||||
CCScene * pScene = CCScene::node();
|
||||
CCLayer * pLayer = new HelloWorld();
|
||||
pLayer->autorelease();
|
||||
|
||||
pScene->addChild(pLayer);
|
||||
CCDirector::getSharedDirector()->runWithScene(pScene);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Boolean THelloWorldApp::EventHandler(EventType* pEvent)
|
||||
{
|
||||
Boolean bHandled = FALSE;
|
||||
|
||||
switch(pEvent->eType)
|
||||
{
|
||||
case EVENT_AppLoad:
|
||||
{
|
||||
m_pMainWnd = new TMainForm(this);
|
||||
if (m_pMainWnd)
|
||||
{
|
||||
SetActiveWindow(m_pMainWnd);
|
||||
}
|
||||
else
|
||||
{ // 窗口创建失败,退出应用。
|
||||
SendStopEvent();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_AppStopNotify:
|
||||
{
|
||||
|
||||
}
|
||||
bHandled = FALSE;
|
||||
break;
|
||||
}
|
||||
if (FALSE == bHandled)
|
||||
{
|
||||
return CCXApplication::EventHandler(pEvent);
|
||||
}
|
||||
|
||||
return bHandled;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Application application header file.
|
||||
|
||||
// Original file name: HelloWorldApp.h
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
#ifndef __HelloWorld_App_H__
|
||||
#define __HelloWorld_App_H__
|
||||
#include "CCXApplication.h"
|
||||
#include "CCXEGLView.h"
|
||||
|
||||
class THelloWorldApp : public cocos2d::CCXApplication
|
||||
{
|
||||
public:
|
||||
THelloWorldApp();
|
||||
~THelloWorldApp();
|
||||
|
||||
virtual Boolean initCocos2d();
|
||||
|
||||
public:
|
||||
virtual Boolean EventHandler(EventType * pEvent);
|
||||
|
||||
protected:
|
||||
cocos2d::CCXEGLView * m_pMainWnd;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// Application main file.
|
||||
|
||||
// Original file name: HelloWorldEntry.cpp
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
|
||||
#include "HelloWorldEntry.h"
|
||||
#include "HelloWorldApp.h"
|
||||
#include "helloworld_res_c.h"
|
||||
|
||||
const ResourceRegisterEntry ResRegList_HelloWorld[] =
|
||||
{
|
||||
TG_RESOURCE_DEFINE
|
||||
};
|
||||
|
||||
const AppResourceEntry HelloWorldResourceEntry =
|
||||
{
|
||||
(ResourceRegisterEntry*)ResRegList_HelloWorld, // res list in this app
|
||||
sizeof(ResRegList_HelloWorld) / sizeof(ResourceRegisterEntry), //number of item in res
|
||||
};
|
||||
|
||||
Int32 TG3AppMain(const TUChar * pAppID, UInt32 nCmd, void * pCmdParam)
|
||||
{
|
||||
switch(nCmd)
|
||||
{
|
||||
case 0: // Ö÷Èë¿Ú
|
||||
{
|
||||
// UIÓ¦ÓóÌÐòÀý×Ó£º
|
||||
THelloWorldApp * pApp= new THelloWorldApp();
|
||||
pApp->WM_SetResourceEntry(&HelloWorldResourceEntry);
|
||||
pApp->Run();
|
||||
|
||||
delete pApp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// Application main header file.
|
||||
|
||||
// Original file name: HelloWorldEntry.h
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
|
||||
#ifndef __HelloWorld_Main_H__
|
||||
#define __HelloWorld_Main_H__
|
||||
#include "TG3.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
// Application main form file.
|
||||
|
||||
// Original file name: HelloWorldMainForm.cpp
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
|
||||
#include "HelloWorldMainForm.h"
|
||||
#include "helloworld_res_def.h"
|
||||
|
||||
#include "TG3.h"
|
||||
#include "ssMsgQueue.h"
|
||||
#include "touch_dispatcher/CCTouchDelegateProtocol.h"
|
||||
#include "CCDirector.h"
|
||||
|
||||
TMainForm::TMainForm(TApplication * pApp)
|
||||
: CCXEGLView(pApp)
|
||||
{
|
||||
Create(HELLOW_ID_Form1002);
|
||||
}
|
||||
|
||||
TMainForm::~TMainForm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Boolean TMainForm::EventHandler(TApplication * pApp, EventType * pEvent)
|
||||
{
|
||||
Boolean bHandled = FALSE;
|
||||
|
||||
switch(pEvent->eType)
|
||||
{
|
||||
case EVENT_WinInit:
|
||||
{
|
||||
bHandled = TRUE;
|
||||
}
|
||||
break;
|
||||
case EVENT_CtrlSelect:
|
||||
{
|
||||
//switch(pEvent->sParam1)
|
||||
//{
|
||||
//case RES_SYSTEM_WINDOW_TITLE_BUTTON_ID:
|
||||
// bHandled = TRUE;
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
break;
|
||||
case EVENT_WinClose:
|
||||
{
|
||||
// Stop the application since the main form has been closed
|
||||
pApp->SendStopEvent();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (FALSE == bHandled)
|
||||
{
|
||||
return CCXEGLView::EventHandler(pApp,pEvent);
|
||||
}
|
||||
return bHandled;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
// Application main form file.
|
||||
|
||||
// Original file name: HelloWorldMainForm.h
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
|
||||
#ifndef __HelloWorld_MainForm_H__
|
||||
#define __HelloWorld_MainForm_H__
|
||||
#include "CCXEGLView.h"
|
||||
|
||||
class TMainForm : public cocos2d::CCXEGLView
|
||||
{
|
||||
public:
|
||||
|
||||
TMainForm(TApplication * pApp);
|
||||
|
||||
~TMainForm(void);
|
||||
|
||||
public:
|
||||
virtual Boolean EventHandler(TApplication * pApp, EventType * pEvent);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
// Unicode string resource scrip file,DOT NOT include it.
|
||||
|
||||
// Original file name: HelloWorldUnicodeScript.h
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
|
||||
#define TZD_CONV(x, y)
|
||||
TZD_CONV(AppName_HelloWorld, "HelloWorld")
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __HELLOWORLDUNICODESCRIPT_STR_H__
|
||||
#define __HELLOWORLDUNICODESCRIPT_STR_H__
|
||||
|
||||
|
||||
#define AppName_HelloWorld__N \
|
||||
"H\x00\x65\x00l\x00l\x00o\x00W\x00o\x00r\x00l\x00\x64\x00"
|
||||
#define AppName_HelloWorld__C \
|
||||
AppName_HelloWorld__N"\x00\x00"
|
||||
#define AppName_HelloWorld \
|
||||
((const unsigned short *)(AppName_HelloWorld__C))
|
||||
#define AppName_HelloWorld__N16 \
|
||||
0x0048,0x0065,0x006c,0x006c,0x006f,0x0057,0x006f,0x0072,0x006c,0x0064
|
||||
#define AppName_HelloWorld_16 \
|
||||
{AppName_HelloWorld__N16,0x0000}
|
||||
// Ôʼ´®ÐÅÏ¢£º
|
||||
// HelloWorld
|
||||
|
||||
|
||||
#endif //__HELLOWORLDUNICODESCRIPT_STR_H__
|
|
@ -0,0 +1,53 @@
|
|||
;
|
||||
; TG3 Makefile Auto Create Script
|
||||
;
|
||||
; 说明:
|
||||
; 1.在等号左边不要有空格
|
||||
; 2.所有的路径请使用"/"来分隔
|
||||
; 3.所有的文件名不可以有空格
|
||||
; 4.只能对当前目录及其子目录下的.c、.cpp生成Makefile
|
||||
;
|
||||
|
||||
;本TMK3文件目录位置到项目根目录之间的转换,不支持多个串,如果有多个,以最后一个为准
|
||||
;即 ./$(TO_PROJECT_ROOT)/ 就是项目的根目录
|
||||
TO_PROJECT_ROOT=../../PRJ_TG3
|
||||
|
||||
;输出目标的名字,不支持多个串,如果有多个,以最后一个为准
|
||||
OUTPUT_FILENAME=libHelloWorld.so
|
||||
|
||||
;包含的其他的TMK3文件,此文件和本文件一起构成MakeFile的内容
|
||||
;此项可以出现在TMK3文件内的任意地方,与已经存在的项依次组合
|
||||
;注意:此项不支持绝对路径,但是可以使用$(TO_PROJECT_ROOT)构成文件名
|
||||
INCLUDE_TMK3=$(TO_PROJECT_ROOT)/MakeInclude/TG3_APP_Arm.TMK3 ;TOPS标准应用,包括动态库等
|
||||
|
||||
;预定义串,生成MakeFile的时候直接放在MakeFile的前面
|
||||
;格式:PRE_DEFINE=STRING,生成MakeFile的时候,"PRE_DEFINE="后面的所有非注释非续行字符都会放在MakeFile前面
|
||||
;例如:PRE_DEFINE=AAA=BBB,会放入AAA=BBB到MakeFile中
|
||||
;可以使用多个PRE_DEFINE串,也可以使用PRE_DEFINE1、PRE_DEFINE2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
;PRE_DEFINE=USE_IMAGEKIT=1 ;使用 ImageToolKit 库,此时生成的 Makefile 会自动连接有关的LIB
|
||||
;PRE_DEFINE=USE_ICU=1 ;使用 ICU 库,此时生成的 Makefile 会自动连接有关的LIB
|
||||
;PRE_DEFINE=USE_MTAPI=1 ;使用 MTAPI 库,此时生成的 Makefile 会自动连接有关的LIB
|
||||
|
||||
;C、C++预定义宏,可以使用多个DEFINES串,也可以使用DEFINES1、DEFINES2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
DEFINES=-D_MY_MARCO_ ;这里填入应用的自定义宏。注意:ITOPS自己的所需定义会自动包含,故此这里仅仅包含应用自己特有的定义即可
|
||||
;DEFINES=-D__TG3_PURE_DLL__ ;生成的是纯动态库(意思是:不是TOPS应用,但可以是TCOM组件)
|
||||
;DEFINES=-D__TCOM_SUPPORT__ ;生成的是TCOM组件(注意:TOPS应用也可以同时是TCOM组件)
|
||||
|
||||
;包含路径,可以使用多个INCLUDE_PATH串,也可以使用INCLUDE_PATH1、INCLUDE_PATH2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
INCLUDE_PATH= ;应用额外的包含路径。注意:ITOPS自己的所有路径都会自动包含,故此这里仅仅包含应用自己特有的路径即可
|
||||
|
||||
;连接的库文件,可以使用多个LIBS串,也可以使用LIBS1、LIBS2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
LIBS=-lMyLib ;应用额外的连接库。注意:ITOPS自己的所需库自动包含,而且库包含路径也已经包含,故此这里仅仅包含应用自己特有的库的名字即可
|
||||
|
||||
;强制包含文件的名字,不能使用通配符,一定要使用相对或者绝对路径
|
||||
;极力要求使用相对路径,多个文件之间使用“|”分隔
|
||||
;强制包含文件指的是不在本文件夹及其子文件夹下的.c、.cpp、.o文件
|
||||
;可以使用多个INCLUDEFILE串,也可以使用INCLUDEFILE1、INCLUDEFILE2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
INCLUDEFILE=
|
||||
|
||||
;强制排除文件,不能使用通配符,一定要使用相对路径
|
||||
;多个文件之间使用“|”分隔,路径必须以"./","../"开始
|
||||
;只能对.c、.cpp文件进行排除
|
||||
;如果要排除本目录的文件也要加入"./"
|
||||
;可以使用多个EXCLUDEFILE串,也可以使用EXCLUDEFILE1、EXCLUDEFILE2等方式,MakeFile中依据出现顺序(不是数字大小)排列
|
||||
EXCLUDEFILE=
|
|
@ -0,0 +1 @@
|
|||
this file need to run .tmk3 file to rebuild.
|
|
@ -0,0 +1 @@
|
|||
this file need to run .tmk3 file to rebuild.
|
|
@ -0,0 +1,82 @@
|
|||
|
||||
/*!
|
||||
* @file NewDeleteOp.cpp
|
||||
* @author 全智达
|
||||
* @brief
|
||||
*
|
||||
* @section Copyright
|
||||
* =======================================================================<br>
|
||||
* <br>
|
||||
* Copyright (c) 2005-2010 Tranzda Technologies Co.,Ltd. <br>
|
||||
* 深圳市全智达科技有限公司 版权所有2005-2010<br>
|
||||
* <br>
|
||||
* PROPRIETARY RIGHTS of Tranzda Technologies Co.,Ltd. are involved in <br>
|
||||
* the subject matter of this material. All manufacturing, reproduction, <br>
|
||||
* use, and sales rights pertaining to this subject matter are governed <br>
|
||||
* by the license agreement. The recipient of this software implicitly <br>
|
||||
* accepts the terms of the license. <br>
|
||||
* 本软件文档资料是深圳市全智达科技有限公司的合法资产,任何人士阅读和使<br>
|
||||
* 用本资料必须获得相应的书面授权,承担保密责任和接受相应的法律约束。<br>
|
||||
* <br>
|
||||
* 公司网址:<a href="http://www.tranzda.com"> http://www.tranzda.com </a> <br>
|
||||
* 公司邮箱:<a mailto="support@tranzda.com">support@tranzda.com</a> <br>
|
||||
* =======================================================================<br>
|
||||
*/
|
||||
|
||||
#include "ssTypes.h"
|
||||
#include "TG3_Type.h"
|
||||
#include "TG3_Memory.h"
|
||||
|
||||
#ifdef new
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
#ifdef delete
|
||||
#undef delete
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
void * __cdecl operator new(unsigned int size)
|
||||
{
|
||||
return TMalloc(size);
|
||||
}
|
||||
|
||||
void * __cdecl operator new[](unsigned int size)
|
||||
{
|
||||
return TMalloc(size);
|
||||
}
|
||||
|
||||
void * __cdecl operator new(unsigned int size, const unsigned short * fileName, int lineNo)
|
||||
{
|
||||
return TMallocEx(size, fileName, lineNo);
|
||||
}
|
||||
|
||||
void * __cdecl operator new[](unsigned int size, const unsigned short * fileName, int lineNo)
|
||||
{
|
||||
return TMallocEx(size, fileName, lineNo);
|
||||
}
|
||||
|
||||
void __cdecl operator delete(void *p)
|
||||
{
|
||||
TFree(p);
|
||||
}
|
||||
|
||||
void __cdecl operator delete[](void *p)
|
||||
{
|
||||
TFree(p);
|
||||
}
|
||||
|
||||
void __cdecl operator delete(void *p, const unsigned short * fileName, int lineNo)
|
||||
{
|
||||
TFreeEx(p, fileName, lineNo);
|
||||
}
|
||||
|
||||
void __cdecl operator delete[](void *p, const unsigned short * fileName, int lineNo)
|
||||
{
|
||||
TFreeEx(p, fileName, lineNo);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
// Original file name: HelloWorld_Res.ENU.tr3
|
||||
// Generated by TOPS Builder 1.2.3.229 Date:2010-8-4
|
||||
|
||||
|
||||
//$VERSION 60003
|
||||
//$SETTINGS
|
||||
//$Begin
|
||||
//$VCPRJFILE=$002E$002E$005C$0048$0065$006C$006C$006F$0057$006F$0072$006C$0064$002E$0076$0063$0070$0072$006F$006A
|
||||
//$SCR_WIDTH=320
|
||||
//$SCR_HEIGHT=480
|
||||
//$End
|
||||
LANGUAGE = 1033
|
||||
// ImageLists
|
||||
|
||||
// TComObject
|
||||
|
||||
// Forms
|
||||
|
||||
FORM ID Form1002 AT(0,0,320,480)
|
||||
FRAME
|
||||
NOSAVEBEHIND
|
||||
BIClose
|
||||
VISIBLED
|
||||
ENABLED
|
||||
CHARSET 0
|
||||
UseSYSDefColor
|
||||
TRANSPARENT
|
||||
BACKCOLOR $0003
|
||||
FORECOLOR $0002
|
||||
FOCUSBACKCOLOR $0006
|
||||
FOCUSFORECOLOR $0007
|
||||
SELECTEDFORECOLOR $0005
|
||||
SELECTEDBACKCOLOR $0004
|
||||
BEGIN
|
||||
END
|
||||
|
||||
// Menus Ö÷²Ëµ¥
|
||||
|
||||
// Alerts ¾¯¸æÏûÏ¢
|
||||
|
||||
// Strings
|
||||
|
||||
// Fonts
|
||||
|
||||
// Bitmaps
|
||||
|
||||
IMAGEFOLDER ID ResFolder1001 FOLDERNAME $0052$006F$006F$0074$0028$0041$006C$006C$0029
|
||||
// Îļþ¼Ð: Root(All)
|
||||
BEGIN
|
||||
END
|
||||
// Application
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
// Tranzda Translation File.
|
||||
// TOPS Builder use infomation contained by this file to
|
||||
// update the controls' trnaslation status.
|
||||
|
||||
// Original file name: HelloWorld_Res.ENU.tr3.tts
|
||||
// Generated by TOPS Builder 1.2.3.229 Date:2010-8-4
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
// Original file name: HelloWorld_Res.TR3
|
||||
// Generated by TOPS Builder 1.2.3.229 Date:2010-8-4
|
||||
|
||||
|
||||
#include "HelloWorld_Res.h"
|
||||
|
||||
//$VERSION 60003
|
||||
//$SETTINGS
|
||||
//$Begin
|
||||
//$VCPRJFILE=$002E$002E$005C$0048$0065$006C$006C$006F$0057$006F$0072$006C$0064$002E$0076$0063$0070$0072$006F$006A
|
||||
//$SCR_WIDTH=320
|
||||
//$SCR_HEIGHT=480
|
||||
//$End
|
||||
LANGUAGE = 2052
|
||||
// ImageLists
|
||||
|
||||
// TComObject
|
||||
|
||||
// Forms
|
||||
|
||||
FORM ID Form1002 AT(0,0,320,480)
|
||||
FRAME
|
||||
NOSAVEBEHIND
|
||||
FullScreen
|
||||
VISIBLED
|
||||
ENABLED
|
||||
CHARSET 0
|
||||
UseSYSDefColor
|
||||
TRANSPARENT
|
||||
BACKCOLOR $0003
|
||||
FORECOLOR $0002
|
||||
FOCUSBACKCOLOR $0006
|
||||
FOCUSFORECOLOR $0007
|
||||
SELECTEDFORECOLOR $0005
|
||||
SELECTEDBACKCOLOR $0004
|
||||
BEGIN
|
||||
END
|
||||
|
||||
// Menus Ö÷²Ëµ¥
|
||||
|
||||
// Alerts ¾¯¸æÏûÏ¢
|
||||
|
||||
// Strings
|
||||
|
||||
// Fonts
|
||||
|
||||
// Bitmaps
|
||||
|
||||
IMAGEFOLDER ID ResFolder1001 FOLDERNAME $0052$006F$006F$0074$0028$0041$006C$006C$0029
|
||||
// Îļþ¼Ð: Root(All)
|
||||
BEGIN
|
||||
END
|
||||
// Application
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// Application resource group file.
|
||||
|
||||
// Original file name: HelloWorld_Res.TRG
|
||||
// Generated by TOPS Builder:Project wizard,Date:2010-8-3
|
||||
|
||||
|
||||
|
||||
VERSION 60001
|
||||
PROJECT
|
||||
Begin
|
||||
IsLangBase
|
||||
FileName = ".\HelloWorld_Res.TR3"
|
||||
End
|
||||
|
||||
PROJECT
|
||||
Begin
|
||||
FileName = ".\HelloWorld_Res.ENU.tr3"
|
||||
End
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
// Original file name: HelloWorld_Res.h
|
||||
// Generated by TOPS Builder 1.2.3.229 Date:2010-8-4
|
||||
|
||||
#define ResFolder1001 1001
|
||||
#define Form1002 1002
|
|
@ -0,0 +1,223 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// HelloWorld_Res_c.h
|
||||
// 资源编译器转换文件数据定义文件
|
||||
//
|
||||
//
|
||||
// Copyright (C) Tranzda CORPORATION
|
||||
//
|
||||
//---┤编译器信息├---
|
||||
// 编译器名称: TR3C.exe
|
||||
// 编译器版本: TG3 资源编译器 版本V1.5 Build 87
|
||||
//
|
||||
//---┤注意├---
|
||||
// 警告:未经允许,任何人不准擅自修改此文件!!!否则后果自负!
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#include "helloworld_res_h.h" //类型定义头文件
|
||||
#ifndef WIN32
|
||||
//#pragma diag_remark 1296
|
||||
#endif
|
||||
#if 10<RES_VERSION
|
||||
#error Resource file version too low!Must be compiled with higher version TR3C.
|
||||
#endif
|
||||
|
||||
|
||||
/************************************************************
|
||||
* Language:CHS
|
||||
*************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
* ID为HELLOW_ID_Form1002窗体的数据
|
||||
------------------------------------------------------------*/
|
||||
|
||||
|
||||
const ResWindowType HELLOW_Form1002 =
|
||||
{
|
||||
{//资源公共头部定义
|
||||
HELLOW_ID_Form1002,//资源ID
|
||||
RES_CLASS_FORM,//资源类型为FORM(窗体)类型
|
||||
sizeof(ResWindowType),//资源大小
|
||||
-1,//父资源ID(窗体没有故为-1)
|
||||
0,//Tag
|
||||
0//StyleOption
|
||||
},//资源公共头部定义结束
|
||||
{//ControlAttrType属性
|
||||
0,//Enabled,(nouse here)
|
||||
0,//Visibled,(nouse here)
|
||||
0,//Ctl3D,,(nouse here)
|
||||
0,//TabStop,(nouse here)
|
||||
0,//ReadOnly,(nouse here)
|
||||
0,//ImeEnable,(nouse here)
|
||||
0,//WordWrap,(nouse here)
|
||||
0,//TopLeftIsLock,(nouse here)
|
||||
0,//Check,(nouse here)
|
||||
0,//MultiLine,(nouse here)
|
||||
0,//AutoSize,(nouse here)
|
||||
0,//Modal,
|
||||
0,//Numeric ,Field Use
|
||||
0,//AutoShift,Field Use
|
||||
0,//DynamicSize,Field Use
|
||||
0,//UnderLine,Field Use
|
||||
0,//BIClose
|
||||
0,//HasStatusBar
|
||||
0,//BIAction
|
||||
0,//BIMaximize
|
||||
0,//ForceShowTitle
|
||||
0,//Graphical,(nouse here)
|
||||
0,//sbmHasVertical,垂直滚动条
|
||||
0,//sbmHasHorizontal,水平滚动条
|
||||
0,//sbmAuto,滚动条自动出现
|
||||
0,//hasImage
|
||||
0,//hasCheckBox
|
||||
1,//UseSYSDefColor
|
||||
0,//Smooth
|
||||
0,//ShowText
|
||||
1,//TransParent
|
||||
0//OwnerDraw
|
||||
},
|
||||
{//PanelAttr
|
||||
2,//HScrollMode,0-auto,1-enable,2-disable
|
||||
0,//VScrollMode,0-auto,1-enable,2-disable
|
||||
},
|
||||
0X3, // BackColor
|
||||
0X2, // ForeColor
|
||||
{{0, 0}, {320, 480}}, // RectangleType windowBounds
|
||||
0, // 控件个数
|
||||
{//ResWindowExAttrType
|
||||
0,//closeBtnStyle
|
||||
0,//actionBtnStyle
|
||||
0,//hasSystemStatusBar
|
||||
1,//fullScreen
|
||||
},
|
||||
NULL, // 标题(当前窗体没有标题,故为空!)
|
||||
NULL, // 关闭按钮文字(当前为空!)
|
||||
NULL, // action button text = null
|
||||
0, //CharSet
|
||||
stdFont,//Font
|
||||
-1, //MainMenuID(-1为没有主菜单)
|
||||
TG3_WINDOW_MOVIE_MODE_DEFAULT , // 启动动画模式
|
||||
TG3_WINDOW_MOVIE_MODE_DEFAULT , // 关闭动画模式
|
||||
NULL, // 指向控件列表(没有控件,所以为空!)
|
||||
0, // 旋转参考表子项个数
|
||||
NULL // 界面旋转参考表(空)
|
||||
};//窗体HELLOW_Form1002资源数据常量结束
|
||||
const ResourceLangRegisterEntry HELLOW_CHS_Resource[] =
|
||||
{
|
||||
{kWindowRscType,HELLOW_ID_Form1002,(void*)&HELLOW_Form1002,sizeof(HELLOW_Form1002)}
|
||||
};
|
||||
|
||||
const ResourceLangRegisterEntry2 HELLOW_CHS_ResourceEntry =
|
||||
{
|
||||
tgresource_tag,
|
||||
10,//res version
|
||||
0,//subVersionValue
|
||||
0,//reserved1
|
||||
0,//reserved2
|
||||
HELLOW_CHS_Resource
|
||||
};
|
||||
|
||||
|
||||
/************************************************************
|
||||
* Language:ENU
|
||||
*************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
* ID为HELLOW_ID_Form1002窗体的数据
|
||||
------------------------------------------------------------*/
|
||||
|
||||
|
||||
const ResWindowType HELLOW_ENU_Form1002 =
|
||||
{
|
||||
{//资源公共头部定义
|
||||
HELLOW_ID_Form1002,//资源ID
|
||||
RES_CLASS_FORM,//资源类型为FORM(窗体)类型
|
||||
sizeof(ResWindowType),//资源大小
|
||||
-1,//父资源ID(窗体没有故为-1)
|
||||
0,//Tag
|
||||
0//StyleOption
|
||||
},//资源公共头部定义结束
|
||||
{//ControlAttrType属性
|
||||
0,//Enabled,(nouse here)
|
||||
0,//Visibled,(nouse here)
|
||||
0,//Ctl3D,,(nouse here)
|
||||
0,//TabStop,(nouse here)
|
||||
0,//ReadOnly,(nouse here)
|
||||
0,//ImeEnable,(nouse here)
|
||||
0,//WordWrap,(nouse here)
|
||||
0,//TopLeftIsLock,(nouse here)
|
||||
0,//Check,(nouse here)
|
||||
0,//MultiLine,(nouse here)
|
||||
0,//AutoSize,(nouse here)
|
||||
0,//Modal,
|
||||
0,//Numeric ,Field Use
|
||||
0,//AutoShift,Field Use
|
||||
0,//DynamicSize,Field Use
|
||||
0,//UnderLine,Field Use
|
||||
1,//BIClose
|
||||
0,//HasStatusBar
|
||||
0,//BIAction
|
||||
0,//BIMaximize
|
||||
0,//ForceShowTitle
|
||||
0,//Graphical,(nouse here)
|
||||
0,//sbmHasVertical,垂直滚动条
|
||||
0,//sbmHasHorizontal,水平滚动条
|
||||
0,//sbmAuto,滚动条自动出现
|
||||
0,//hasImage
|
||||
0,//hasCheckBox
|
||||
1,//UseSYSDefColor
|
||||
0,//Smooth
|
||||
0,//ShowText
|
||||
1,//TransParent
|
||||
0//OwnerDraw
|
||||
},
|
||||
{//PanelAttr
|
||||
2,//HScrollMode,0-auto,1-enable,2-disable
|
||||
0,//VScrollMode,0-auto,1-enable,2-disable
|
||||
},
|
||||
0X3, // BackColor
|
||||
0X2, // ForeColor
|
||||
{{0, 0}, {320, 480}}, // RectangleType windowBounds
|
||||
0, // 控件个数
|
||||
{//ResWindowExAttrType
|
||||
0,//closeBtnStyle
|
||||
0,//actionBtnStyle
|
||||
0,//hasSystemStatusBar
|
||||
0,//fullScreen
|
||||
},
|
||||
NULL, // 标题(当前窗体没有标题,故为空!)
|
||||
NULL, // 关闭按钮文字(当前为空!)
|
||||
NULL, // action button text = null
|
||||
0, //CharSet
|
||||
stdFont,//Font
|
||||
-1, //MainMenuID(-1为没有主菜单)
|
||||
TG3_WINDOW_MOVIE_MODE_DEFAULT , // 启动动画模式
|
||||
TG3_WINDOW_MOVIE_MODE_DEFAULT , // 关闭动画模式
|
||||
NULL, // 指向控件列表(没有控件,所以为空!)
|
||||
0, // 旋转参考表子项个数
|
||||
NULL // 界面旋转参考表(空)
|
||||
};//窗体HELLOW_ENU_Form1002资源数据常量结束
|
||||
const ResourceLangRegisterEntry HELLOW_ENU_Resource[] =
|
||||
{
|
||||
{kWindowRscType,HELLOW_ID_Form1002,(void*)&HELLOW_ENU_Form1002,sizeof(HELLOW_ENU_Form1002)}
|
||||
};
|
||||
|
||||
const ResourceLangRegisterEntry2 HELLOW_ENU_ResourceEntry =
|
||||
{
|
||||
tgresource_tag,
|
||||
10,//res version
|
||||
0,//subVersionValue
|
||||
0,//reserved1
|
||||
0,//reserved2
|
||||
HELLOW_ENU_Resource
|
||||
};
|
||||
|
||||
//资源定义
|
||||
#define TG_RESOURCE_DEFINE \
|
||||
{SYS_LANGUAGE_CHS,sizeof( HELLOW_CHS_Resource )/ sizeof(ResourceLangRegisterEntry), &HELLOW_CHS_ResourceEntry}, \
|
||||
{SYS_LANGUAGE_ENU,sizeof( HELLOW_ENU_Resource )/ sizeof(ResourceLangRegisterEntry), &HELLOW_ENU_ResourceEntry},
|
|
@ -0,0 +1,20 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// HelloWorld_Res_def.h
|
||||
// 资源编译器转换文件ID宏声明文件
|
||||
//
|
||||
//
|
||||
// Copyright (C) Tranzda CORPORATION
|
||||
//
|
||||
//---┤编译器信息├---
|
||||
// 编译器名称: TR3C.exe
|
||||
// 编译器版本: TG3 资源编译器 版本V1.5 Build 87
|
||||
//
|
||||
//---┤注意├---
|
||||
// 警告:未经允许,任何人不准擅自修改此文件!!!否则后果自负!
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef __HELLOWORLD_RES_DEF_H__
|
||||
#define __HELLOWORLD_RES_DEF_H__
|
||||
|
||||
#define HELLOW_ID_Form1002 1073742826
|
||||
#endif
|
|
@ -0,0 +1,23 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// HelloWorld_Res_h.h
|
||||
// 资源编译器转换文件数据结构声明文件
|
||||
//
|
||||
//
|
||||
// Copyright (C) Tranzda CORPORATION
|
||||
//
|
||||
//---┤编译器信息├---
|
||||
// 编译器名称: TR3C.exe
|
||||
// 编译器版本: TG3 资源编译器 版本V1.5 Build 87
|
||||
//
|
||||
//---┤注意├---
|
||||
// 警告:未经允许,任何人不准擅自修改此文件!!!否则后果自负!
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef __HELLOWORLD_RES_H_H__
|
||||
#define __HELLOWORLD_RES_H_H__
|
||||
|
||||
#include "ResTypes.h"
|
||||
|
||||
#include "helloworld_res_def.h"
|
||||
|
||||
#endif
|
|
@ -0,0 +1,231 @@
|
|||
|
||||
#include "ssGlobal.h"
|
||||
#include "ssTsd.h"
|
||||
#include "TG3_Type.h"
|
||||
#include <stdio.h>
|
||||
#include "TCOM.h"
|
||||
#include "ssAppMgr.h"
|
||||
#include "TG3AppDllEntry.h"
|
||||
|
||||
#ifdef __TCOM_SUPPORT__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//实现TCOM所需要的DLL函数
|
||||
|
||||
//DLL提供的获取指定CLSID的指定接口
|
||||
SS_EXPORT HRESULT TDllGetClassObject(TREFCLSID rclsid, TREFIID riid, LPVOID * ppv);
|
||||
|
||||
//DLL提供的查询DLL能否被Unload
|
||||
SS_EXPORT HRESULT TDllCanUnloadNow(void);
|
||||
|
||||
//DLL提供的把DLL的TCOM信息加入到注册表
|
||||
SS_EXPORT HRESULT TDllRegisterServer(void);
|
||||
|
||||
//DLL提供的把DLL的TCOM信息从注册表中删除
|
||||
SS_EXPORT HRESULT TDllUnregisterServer(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
//TCOM实现中需要用到的函数和数据
|
||||
|
||||
//实例对象被引用的次数
|
||||
static Int32 __TCOM_ClsidInstanceRefCount;
|
||||
|
||||
//ClassFactory被Locked的次数
|
||||
static Int32 __TCOM_CalssFactoryLockedCount;
|
||||
|
||||
//做必要的初始化
|
||||
static Int32 __TCOM_Init()
|
||||
{
|
||||
__TCOM_ClsidInstanceRefCount = 0;
|
||||
__TCOM_CalssFactoryLockedCount = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//做必要的清除工作
|
||||
static Int32 __TCOM_DeInit()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//DLL全局使用:增加对象实例被引用次数
|
||||
Int32 TCOM_AddClsidInstanceRefCount()
|
||||
{
|
||||
__TCOM_ClsidInstanceRefCount++;
|
||||
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
|
||||
SS_printf("[TCOM_SYSTEM] TCOM_AddClsidInstanceRefCount: address: %p, value: %d.\n",
|
||||
&__TCOM_ClsidInstanceRefCount, __TCOM_ClsidInstanceRefCount);
|
||||
#endif
|
||||
if(__TCOM_ClsidInstanceRefCount <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return __TCOM_ClsidInstanceRefCount;
|
||||
}
|
||||
|
||||
//DLL全局使用:减少对象实例被引用次数
|
||||
Int32 TCOM_DecClsidInstanceRefCount()
|
||||
{
|
||||
__TCOM_ClsidInstanceRefCount--;
|
||||
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
|
||||
SS_printf("[TCOM_SYSTEM] TCOM_DecClsidInstanceRefCount: address: %p, value: %d.\n",
|
||||
&__TCOM_ClsidInstanceRefCount, __TCOM_ClsidInstanceRefCount);
|
||||
#endif
|
||||
if(__TCOM_ClsidInstanceRefCount <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return __TCOM_ClsidInstanceRefCount;
|
||||
}
|
||||
|
||||
//DLL全局使用:增加ClassFactory被Locked的次数
|
||||
Int32 TCOM_AddCalssFactoryLockedCount()
|
||||
{
|
||||
__TCOM_CalssFactoryLockedCount++;
|
||||
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
|
||||
SS_printf("[TCOM_SYSTEM] TCOM_AddCalssFactoryLockedCount: address: %p, value: %d.\n",
|
||||
&__TCOM_CalssFactoryLockedCount, __TCOM_CalssFactoryLockedCount);
|
||||
#endif
|
||||
if(__TCOM_CalssFactoryLockedCount <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return __TCOM_CalssFactoryLockedCount;
|
||||
}
|
||||
|
||||
//DLL全局使用:减少ClassFactory被Locked的次数
|
||||
Int32 TCOM_DecCalssFactoryLockedCount()
|
||||
{
|
||||
__TCOM_CalssFactoryLockedCount--;
|
||||
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
|
||||
SS_printf("[TCOM_SYSTEM] TCOM_DecCalssFactoryLockedCount: address: %p, value: %d.\n",
|
||||
&__TCOM_CalssFactoryLockedCount, __TCOM_CalssFactoryLockedCount);
|
||||
#endif
|
||||
if(__TCOM_CalssFactoryLockedCount <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return __TCOM_CalssFactoryLockedCount;
|
||||
}
|
||||
|
||||
//实现TCOM所需要的DLL函数
|
||||
|
||||
//DLL提供的获取指定CLSID的指定接口
|
||||
SS_EXPORT HRESULT TDllGetClassObject(TREFCLSID rclsid, TREFIID riid, LPVOID * ppv)
|
||||
{
|
||||
return TCOM_Srv_GetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
//DLL提供的查询DLL能否被Unload
|
||||
SS_EXPORT HRESULT TDllCanUnloadNow(void)
|
||||
{
|
||||
#ifdef __TCOM_OUTPUT_DEBUG_INFO__
|
||||
SS_printf("[TCOM_SYSTEM] TDllCanUnloadNow: address1: %p, address2: %p, value1: %d, value2: %d.\n",
|
||||
&__TCOM_ClsidInstanceRefCount, &__TCOM_CalssFactoryLockedCount, __TCOM_ClsidInstanceRefCount,
|
||||
__TCOM_CalssFactoryLockedCount);
|
||||
#endif
|
||||
if((__TCOM_ClsidInstanceRefCount <= 0) && (__TCOM_CalssFactoryLockedCount <= 0))
|
||||
return TCOM_S_TRUE;
|
||||
return TCOM_S_FALSE;
|
||||
}
|
||||
|
||||
//DLL提供的把DLL的TCOM信息加入到注册表
|
||||
SS_EXPORT HRESULT TDllRegisterServer(void)
|
||||
{
|
||||
return TCOM_Srv_RegisterServer();
|
||||
}
|
||||
|
||||
//DLL提供的把DLL的TCOM信息从注册表中删除
|
||||
SS_EXPORT HRESULT TDllUnregisterServer(void)
|
||||
{
|
||||
return TCOM_Srv_UnregisterServer();
|
||||
}
|
||||
|
||||
#endif //__TCOM_SUPPORT__
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifndef SS_MAKEDLL
|
||||
#error Error!!! SS_MAKEDLL Must defined!
|
||||
#endif
|
||||
|
||||
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
//进程加载动态库进行的操作
|
||||
#ifdef __TCOM_SUPPORT__
|
||||
__TCOM_Init();
|
||||
#endif
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
//线程加载动态库进行的操作
|
||||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
//线程卸载动态库进行的操作
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
//进程卸载动态库进行的操作
|
||||
#ifdef __TCOM_SUPPORT__
|
||||
__TCOM_DeInit();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#else //linux
|
||||
|
||||
#ifndef SS_SHARED
|
||||
#error Error!!! SS_SHARED Must defined!
|
||||
#endif
|
||||
|
||||
void __attribute((constructor)) TG3_Dll_Attach()
|
||||
{
|
||||
//进程加载动态库进行的操作
|
||||
#ifdef __TCOM_SUPPORT__
|
||||
__TCOM_Init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void __attribute((destructor)) TG3_Dll_Detach()
|
||||
{
|
||||
//进程卸载动态库进行的操作
|
||||
#ifdef __TCOM_SUPPORT__
|
||||
__TCOM_DeInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//如果不是作为TG3的动态库应用,请在VC项目中和TMK3文件中定义 __TG3_PURE_DLL__ 宏
|
||||
#ifndef __TG3_PURE_DLL__
|
||||
|
||||
//动态库应用使用的统一导出名字的入口函数
|
||||
SS_EXPORT Int32 TDllTG3AppMain(const TUChar * pAppID, UInt32 nCmd, void * pCmdParam)
|
||||
{
|
||||
Int32 retValue;
|
||||
|
||||
//初始化TCOM
|
||||
TCoInitialize(NULL);
|
||||
|
||||
retValue = TG3AppMain(pAppID, nCmd, pCmdParam);
|
||||
|
||||
//释放TCOM
|
||||
TCoUninitialize();
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
#ifndef __TG3_APP_DLL_ENTRY_H__
|
||||
#define __TG3_APP_DLL_ENTRY_H__
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This file need C++ support
|
||||
#endif
|
||||
|
||||
#if TG3_APP_ENTRY_MINIMUM_VERSION > 200
|
||||
#error Please replace TG3AppDllEntry.h and TG3AppDllEntry.cpp to newest version!
|
||||
#endif
|
||||
|
||||
#ifdef __TCOM_SUPPORT__
|
||||
|
||||
#include "TCOM.h"
|
||||
|
||||
//提供给DLL实现者调用的函数,用于在全局记录实例和ClassFactory被引用的次数,
|
||||
//这两个计数影响DLL是否可能被从内存中卸载,请大家在实例中内部实现计数的同时更新全局计数,
|
||||
//否则DLL很有可能会在实例还存在的时候被系统自动强制卸载
|
||||
|
||||
//DLL全局使用:增加对象实例被引用次数
|
||||
Int32 TCOM_AddClsidInstanceRefCount();
|
||||
|
||||
//DLL全局使用:减少对象实例被引用次数
|
||||
Int32 TCOM_DecClsidInstanceRefCount();
|
||||
|
||||
//DLL全局使用:增加ClassFactory被Locked的次数
|
||||
Int32 TCOM_AddCalssFactoryLockedCount();
|
||||
|
||||
//DLL全局使用:减少ClassFactory被Locked的次数
|
||||
Int32 TCOM_DecCalssFactoryLockedCount();
|
||||
|
||||
|
||||
//应用DLL在支持TCOM的时候提供给导出函数使用的函数
|
||||
|
||||
//应用根据给出的CLSID和ClassFactory接口IID返回ClassFactory的接口
|
||||
//返回值:参考TCOM_S_系列宏定义
|
||||
HRESULT TCOM_Srv_GetClassObject(TREFCLSID rclsid, TREFIID riid, LPVOID * ppv);
|
||||
|
||||
//应用提供的把TCOM信息加入到注册表
|
||||
//返回值:参考TCOM_S_系列宏定义
|
||||
HRESULT TCOM_Srv_RegisterServer(void);
|
||||
|
||||
//应用提供的把TCOM信息从注册表中删除
|
||||
//返回值:参考TCOM_S_系列宏定义
|
||||
HRESULT TCOM_Srv_UnregisterServer(void);
|
||||
|
||||
#endif //__TCOM_SUPPORT__
|
||||
|
||||
#endif //__TG3_APP_DLL_ENTRY_H__
|
||||
|
||||
|
||||
|
|
@ -13,6 +13,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_sprite", "test_sprite\
|
|||
{6AC43F51-A036-4653-B910-BDDC346D15E7} = {6AC43F51-A036-4653-B910-BDDC346D15E7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\HelloWorld.vcproj", "{90D08657-A80A-41CD-8AAC-3A3DC8C33041}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6AC43F51-A036-4653-B910-BDDC346D15E7} = {6AC43F51-A036-4653-B910-BDDC346D15E7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
|
@ -31,6 +36,10 @@ Global
|
|||
{E67615DB-B3DF-4AC5-B3CF-C1E8EAE99626}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E67615DB-B3DF-4AC5-B3CF-C1E8EAE99626}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E67615DB-B3DF-4AC5-B3CF-C1E8EAE99626}.Release|Win32.Build.0 = Release|Win32
|
||||
{90D08657-A80A-41CD-8AAC-3A3DC8C33041}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{90D08657-A80A-41CD-8AAC-3A3DC8C33041}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{90D08657-A80A-41CD-8AAC-3A3DC8C33041}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{90D08657-A80A-41CD-8AAC-3A3DC8C33041}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
Loading…
Reference in New Issue