mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
Resource file fixes - and added resource file generation for ActiveX plugin
This commit is contained in:
parent
a565600ea0
commit
9126fad01b
@ -1434,6 +1434,66 @@ static int check_panda_version = panda_version_$VERSION1_$VERSION2_$VERSION3;
|
|||||||
# endif
|
# endif
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
P3DACTIVEX_RC="""#include "resource.h"
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#include "afxres.h"
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
1 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\\0"
|
||||||
|
END
|
||||||
|
2 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"#include ""afxres.h""\\r\\n"
|
||||||
|
"\\0"
|
||||||
|
END
|
||||||
|
3 TEXTINCLUDE
|
||||||
|
BEGIN
|
||||||
|
"1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
|
||||||
|
"\\0"
|
||||||
|
END
|
||||||
|
#endif
|
||||||
|
%s
|
||||||
|
IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
|
||||||
|
IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
|
||||||
|
STYLE DS_SETFONT | WS_CHILD
|
||||||
|
FONT 8, "MS Sans Serif"
|
||||||
|
BEGIN
|
||||||
|
LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
|
||||||
|
IDC_STATIC,7,25,229,16
|
||||||
|
END
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
GUIDELINES DESIGNINFO
|
||||||
|
BEGIN
|
||||||
|
IDD_PROPPAGE_P3DACTIVEX, DIALOG
|
||||||
|
BEGIN
|
||||||
|
LEFTMARGIN, 7
|
||||||
|
RIGHTMARGIN, 243
|
||||||
|
TOPMARGIN, 7
|
||||||
|
BOTTOMMARGIN, 55
|
||||||
|
END
|
||||||
|
END
|
||||||
|
#endif
|
||||||
|
STRINGTABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_P3DACTIVEX "P3DActiveX Control"
|
||||||
|
IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
|
||||||
|
END
|
||||||
|
STRINGTABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_P3DACTIVEX_PPG_CAPTION "General"
|
||||||
|
END
|
||||||
|
#endif
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
1 TYPELIB "P3DActiveX.tlb"
|
||||||
|
#endif"""
|
||||||
|
|
||||||
def CreatePandaVersionFiles():
|
def CreatePandaVersionFiles():
|
||||||
version1=int(VERSION.split(".")[0])
|
version1=int(VERSION.split(".")[0])
|
||||||
version2=int(VERSION.split(".")[1])
|
version2=int(VERSION.split(".")[1])
|
||||||
@ -1478,6 +1538,16 @@ def CreatePandaVersionFiles():
|
|||||||
ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
|
ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
|
||||||
ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
|
ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
|
||||||
|
|
||||||
|
if RUNTIME:
|
||||||
|
p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
|
||||||
|
"version" : VERSION,
|
||||||
|
"description" : "Runs 3-D games and interactive applets",
|
||||||
|
"filename" : "p3dactivex.ocx",
|
||||||
|
"mimetype" : "application/x-panda3d",
|
||||||
|
"extension" : "p3d",
|
||||||
|
"filedesc" : "Panda3D applet"}
|
||||||
|
ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
|
||||||
|
|
||||||
CreatePandaVersionFiles()
|
CreatePandaVersionFiles()
|
||||||
|
|
||||||
##########################################################################################
|
##########################################################################################
|
||||||
|
@ -1600,15 +1600,11 @@ def ParsePluginVersion(fn):
|
|||||||
#
|
#
|
||||||
##########################################################################################
|
##########################################################################################
|
||||||
|
|
||||||
RESOURCE_FILE_TEMPLATE = """#define APSTUDIO_READONLY_SYMBOLS
|
RESOURCE_FILE_TEMPLATE = """VS_VERSION_INFO VERSIONINFO
|
||||||
#include "winresrc.h"
|
|
||||||
#undef APSTUDIO_READONLY_SYMBOLS
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION %(commaversion)s
|
FILEVERSION %(commaversion)s
|
||||||
PRODUCTVERSION %(commaversion)s
|
PRODUCTVERSION %(commaversion)s
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS $(debugflag)s
|
FILEFLAGS %(debugflag)s
|
||||||
FILEOS 0x40004L
|
FILEOS 0x40004L
|
||||||
FILETYPE 0x2L
|
FILETYPE 0x2L
|
||||||
FILESUBTYPE 0x0L
|
FILESUBTYPE 0x0L
|
||||||
@ -1617,14 +1613,15 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904e4"
|
BLOCK "040904e4"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "FileDescription", "%(description)s\0"
|
VALUE "FileDescription", "%(description)s\\0"
|
||||||
VALUE "FileVersion", "%(dotversion)s"
|
VALUE "FileVersion", "%(dotversion)s"
|
||||||
VALUE "LegalTrademarks", "\0"
|
VALUE "LegalTrademarks", "\\0"
|
||||||
VALUE "MIMEType", "%(mimetype)s\0"
|
VALUE "MIMEType", "%(mimetype)s\\0"
|
||||||
VALUE "FileExtents", "%(extension)s\0"
|
VALUE "FileExtents", "%(extension)s\\0"
|
||||||
VALUE "FileOpenName", "%(filedesc)s\0"
|
VALUE "FileOpenName", "%(filedesc)s\\0"
|
||||||
VALUE "OriginalFilename", "%(filename)s\0"
|
VALUE "OLESelfRegister", "\\0"
|
||||||
VALUE "ProductName", "%(name)s %(version)s\0"
|
VALUE "OriginalFilename", "%(filename)s\\0"
|
||||||
|
VALUE "ProductName", "%(name)s %(version)s\\0"
|
||||||
VALUE "ProductVersion", "%(dotversion)s"
|
VALUE "ProductVersion", "%(dotversion)s"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
@ -1635,7 +1632,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def GenerateResourceFile(basename, **kwargs):
|
def GenerateResourceFile(**kwargs):
|
||||||
if "debugflag" not in kwargs:
|
if "debugflag" not in kwargs:
|
||||||
if GetOptimize() <= 2:
|
if GetOptimize() <= 2:
|
||||||
kwargs["debugflag"] = "0x1L"
|
kwargs["debugflag"] = "0x1L"
|
||||||
@ -1647,15 +1644,24 @@ def GenerateResourceFile(basename, **kwargs):
|
|||||||
if "commaversion" not in kwargs:
|
if "commaversion" not in kwargs:
|
||||||
kwargs["commaversion"] = kwargs["dotversion"].replace(".", ",")
|
kwargs["commaversion"] = kwargs["dotversion"].replace(".", ",")
|
||||||
|
|
||||||
rcdata = RESOURCE_FILE_TEMPLATE % kwargs
|
rcdata = ""
|
||||||
|
if not "noinclude" in kwargs:
|
||||||
|
rcdata += "#define APSTUDIO_READONLY_SYMBOLS\n"
|
||||||
|
rcdata += "#include \"winresrc.h\"\n"
|
||||||
|
rcdata += "#undef APSTUDIO_READONLY_SYMBOLS\n"
|
||||||
|
rcdata += RESOURCE_FILE_TEMPLATE % kwargs
|
||||||
|
|
||||||
if "icon" in kwargs:
|
if "icon" in kwargs:
|
||||||
rcdata += "\nICON_FILE ICON \"%s\"\n" % kwargs["icon"]
|
rcdata += "\nICON_FILE ICON \"%s\"\n" % kwargs["icon"]
|
||||||
|
|
||||||
|
return rcdata
|
||||||
|
|
||||||
|
|
||||||
|
def WriteResourceFile(basename, **kwargs):
|
||||||
if not basename.endswith(".rc"):
|
if not basename.endswith(".rc"):
|
||||||
basename += ".rc"
|
basename += ".rc"
|
||||||
basename = GetOutputDir() + "/include/" + basename
|
basename = GetOutputDir() + "/include/" + basename
|
||||||
ConditionalWriteFile(basename, rcdata)
|
ConditionalWriteFile(basename, GenerateResourceFile(**kwargs))
|
||||||
return basename
|
return basename
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
@ -1833,7 +1839,7 @@ def TargetAdd(target, dummy=0, opts=0, input=0, dep=0, ipath=0, winrc=0):
|
|||||||
fulldep = FindLocation(x, ipath)
|
fulldep = FindLocation(x, ipath)
|
||||||
t.deps[fulldep] = 1
|
t.deps[fulldep] = 1
|
||||||
if (winrc != 0 and sys.platform.startswith("win")):
|
if (winrc != 0 and sys.platform.startswith("win")):
|
||||||
t.deps[GenerateResourceFile(target.split("/")[-1].split(".")[0], **winrc)] = 1
|
TargetAdd(target, input=WriteResourceFile(target.split("/")[-1].split(".")[0], **winrc))
|
||||||
if (target.endswith(".in")):
|
if (target.endswith(".in")):
|
||||||
t.deps[FindLocation("interrogate.exe",[])] = 1
|
t.deps[FindLocation("interrogate.exe",[])] = 1
|
||||||
t.deps[FindLocation("dtool_have_python.dat",[])] = 1
|
t.deps[FindLocation("dtool_have_python.dat",[])] = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user