⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symbian.cf

📁 linux下的一款播放器
💻 CF
📖 第 1 页 / 共 2 页
字号:
# -*- python -*-## ***** BEGIN LICENSE BLOCK *****# Source last modified: $Id: symbian.cf,v 1.41 2004/12/08 22:37:16 pankajgupta Exp $# # Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.# # The contents of this file, and the files included with this file,# are subject to the current version of the RealNetworks Public# Source License (the "RPSL") available at# http://www.helixcommunity.org/content/rpsl unless you have licensed# the file under the current version of the RealNetworks Community# Source License (the "RCSL") available at# http://www.helixcommunity.org/content/rcsl, in which case the RCSL# will apply. You may also obtain the license terms directly from# RealNetworks.  You may not use this file except in compliance with# the RPSL or, if you have a valid RCSL with RealNetworks applicable# to this file, the RCSL.  Please see the applicable RPSL or RCSL for# the rights, obligations and limitations governing use of the# contents of the file.# # Alternatively, the contents of this file may be used under the# terms of the GNU General Public License Version 2 or later (the# "GPL") in which case the provisions of the GPL are applicable# instead of those above. If you wish to allow use of your version of# this file only under the terms of the GPL, and not to allow others# to use your version of this file under the terms of either the RPSL# or RCSL, indicate your decision by deleting the provisions above# and replace them with the notice and other provisions required by# the GPL. If you do not delete the provisions above, a recipient may# use your version of this file under the terms of any one of the# RPSL, the RCSL or the GPL.# # This file is part of the Helix DNA Technology. RealNetworks is the# developer of the Original Code and owns the copyrights in the# portions it created.# # This file, and the files included with this file, is distributed# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET# ENJOYMENT OR NON-INFRINGEMENT.# # Technology Compatibility Kit Test Suite(s) Location:#    http://www.helixcommunity.org/content/tck# # Contributor(s):# # ***** END LICENSE BLOCK *****#"""Generic symbian .cf file. Common stuff to all symbian platforms."""import shell## Symbian PCF file listplatform.pcf_prefix_list = ['symbian']## Symbina specific defines.project.AddDefines( '__SYMBIAN32__',                    '_UNICODE',                    '__AVKON_ELAF__',                    '_SYMBIAN',                    '__DLL__',                    'HELIX_CONFIG_FIXEDPOINT',                    'HELIX_CONFIG_NOSTATICS',                    'HELIX_CONFIG_COMPACT_COM_MACROS',                    'HELIX_CONFIG_STDIO',                    'HELIX_CONFIG_LITEPREFS_SLUGGISH_OUT',                    '_LITTLE_ENDIAN'                    )## enable this for checking to ensure that only COM objects## are using the HX_ADDREF and HX_RELEASE COM macros# project.AddDefines('HELIX_CONFIG_TYPE_CHECK_COM_MACROS')## we don't want the normal windows defines.project.RemoveDefines('_WIN32', '_M_IX86', '_WINDOWS')platform.rm.cmd = 'rm -rf'platform.rm.args['default'] = ''platform.rm.make_var = 'RM'platform.rmdir.cmd = 'rm -rf'platform.rmdir.args['default'] = ''platform.rmdir.make_var = 'RM_DIR'platform.path_sep = '\\'platform.parent_dir = '..'platform.current_dir = '.'platform.line_cont = '\\'platform.make_source = '$<'platform.make_target = '$@'platform.make_depend = ':'platform.var_begin = '$('platform.var_end = ')'platform.type = 'symbian'platform.sys_lib_arg = ''platform.inc_subdir = "symbian"platform.include_arg = '/I'platform.define_arg = '/D'platform.object_suffix = 'obj'platform.shared_object_suffix = 'obj'platform.copy.cmd = 'copy'platform.copy.make_var = 'CP'## suffexes for target typesplatform.exe_suffix          = 'exe'platform.library_suffix      = 'lib'platform.dll_suffix          = 'dll'platform.resource_dll_suffix = 'xrs'platform.make.cmd = 'nmake'platform.make.make_var = 'MAKE'platform.make.args['default'] = '/nologo'# Turn on the ordinal build option since# that is the only way Symbian exports symbolsproject.AddBuildOption("ordinal")if project.BuildOption('static'):    project.output_dir = '%ss' % (project.output_dir)## common defines for release and debug.if project.BuildOption("debug"):    project.AddDefines("_DEBUG", "DEBUG", "HELIX_FEATURE_DPRINTF")if project.BuildOption("release"):    project.AddDefines("NDEBUG")# This is needed so we can include our "hlxclib/HEADER.h" wrapper files# instead of directly including system <HEADER.h> files.if not project.BuildOption('no_common_runtime'):    project.AddModuleIncludes('common/runtime/pub')# All DLL stubs access the global manager now so# we always need common/system/pub in the include list# and common/system[syslib] in the library list.# The global manager code uses HX_ASSERT() so we need# common/dbgtool[debuglib] and common/runtime[runtlib] as wellproject.AddModuleIncludes('common/system/pub')project.AddModuleLibraries("common/system[syslib]",                           "common/dbgtool[debuglib]",                           "common/runtime[runtlib]")## Define some symbian utilities...class SymbianUtils:    def __init__(self):        self.rss_files = []        self.rss_includes = []        self.uid1 = 0        self.uid2 = 0        self.uid3 = 0        self.priority = 0   # Normal priority        self.cap = 0        self.flags = 0    def write_uid_file(self):        # first uid (what kind of binary image)        KDynamicLibraryUid  = 0x10000079        KExecutableImageUid = 0x1000007a        # second uid (what kind of dll or exe)        KUidApp             = 0x100039ce        KUidRecognizer      = 0x10003a19        # third uid = implementation uid        #        # for symbian, target_type is 'exe' for .app and .mdl and .mmf (misleading)        #        imageType = "unknown"        if( project.target_type == "dll" ):            imageType = "dll"        elif ( project.target_type == "exe" ):            if (project.BuildOption('make-app') or project.BuildOption('make-mdl') or project.BuildOption('make-mmf')):                imageType = "dll"            else:                imageType = "exe"        if( self.uid1 == 0 ):            # set to default value for target type            if (imageType == "exe"):                self.uid1 = KExecutableImageUid            elif (imageType == "dll"):                self.uid1 = KDynamicLibraryUid                        if( self.uid2 == 0 ):            # set to default value for specific type of target            if (project.BuildOption('make-app')):                # app                self.uid2 = KUidApp            elif (project.BuildOption('make-mdl')):                # recognizer                self.uid2 = KUidRecognizer        uidpath = '%s.uid.cpp' %( project.target_name)        fil = open(uidpath, 'w')        fil.write('//Umake generated UID file.\n')        fil.write('#include <E32STD.H>\n')        if(project.IsDefined('_SYMBIAN_81_')):                fil.write('#include <E32CONST.H>\n')        fil.write('#pragma data_seg(".E32_UID")\n')        if(not project.IsDefined('_SYMBIAN_81_')):                tmp = '__WINS_UID(0x%x, 0x%x, 0x%x)\n' % (self.uid1,                                            self.uid2,                                            self.uid3)        else:                tmp = '__EMULATOR_IMAGE_HEADER(0x%x, 0x%x, 0x%x, %s, 0x%x, 0x%x)\n' % (self.uid1,                                            self.uid2, self.uid3,                                            'EPriorityLow', self.cap, self.flags)        fil.write(tmp)        fil.write('#pragma data_seg()\n')        fil.close()        project.AddSources(uidpath)    def SetUIDs(self, uid1, uid2, uid3 ):        self.uid1 = uid1        self.uid2 = uid2        self.uid3 = uid3    def AddResourceFiles(self, *args):        for x in args:            self.rss_files.append(x)    def AddResourceIncludes(self, *args):        for x in args:            self.rss_includes.append(x)    def UseARMICompiler(self):        if 'symbian-thumb' in sysinfo.family_list:            cxx.cmd = cc.cmd = platform.armi_cxx_cmd            cxx.args['default'] = cc.args['default'] = platform.armi_cxx_args            project.AddDefines('__MARM_ARMI__')            project.RemoveDefines('__MARM_THUMB__')    def UseARMCCompiler(self):        if 'symbian-thumb' in sysinfo.family_list:            cc.cmd = cxx.cmd = platform.armi_cc_cmd            cc.args['default'] = cxx.args['default'] = platform.armi_cc_args            project.AddDefines('__MARM_ARMI__')            project.RemoveDefines('__MARM_THUMB__')    def compile_resource(self, rss_name):        # Generate resource file        if (not os.path.exists(project.output_dir)):            os.mkdir(project.output_dir)        baseName = re.match("(.+)\.rss", rss_name).group(1)        arg_list = []        arg_list.append("-v -u -t\".\"")        arg_list.append("-I \"%s\"" % os.path.join(GetSDKPath('SYMBIANSDK'), 'EPOC32\include'))        for incFile in self.rss_includes:            arg_list.append('-I "%s"' % incFile)                arg_list.append("-h\"%s.rsg\"" % baseName)        arg_list.append("-o\"%s.rsc\"" % os.path.join(project.output_dir,                                                      os.path.basename(baseName)))        arg_list.append("%s.rss" % (baseName))        cmd = "perl -S epocrc.pl %s" % (string.join(arg_list))        (status, output) = shell.run(cmd)        print output        if status:            raise "*** resource generation failed (%s) ***" % status    def compile_resources(self):        for x in self.rss_files:            self.compile_resource(x)    def generate_ordinal_info(self):        # Add info for the symbol to ordinal function.        # It should always have ordinal 1 assigned to it        info = [(1, "GetSymbolOrdinal")]        # Assign ordinals to the exported functions        ordinal = 2        for func in project.exported_func:            info.append((ordinal, func))            ordinal = ordinal + 1        return info    def create_mbm_file(self, mbmpath, headerpath, options, imagelist):        sep = " %s" % options        cmd = "bmconv /h%s %s %s%s" % (headerpath, mbmpath, options, string.join(imagelist, sep))        (status, output) = shell.run(cmd)        print output        if status:            raise "*** mbm generation failed (%s) ***" % status    def generate_ordinal_file(self, ordinalInfo):        ordFileName = "%s_ordinal.dat" % project.target_name        ordFile = open(ordFileName, 'w')        for x in ordinalInfo :            ordFile.write("%d %s\n" % (x[0], x[1]))        ordFile.close()    def generate_dll_stub_code(self, ordinalInfo):        stubSourceName = "%s_dll_stub.c" % project.target_name        # find ordinal 1's function name        for x in ordinalInfo:            if (x[0] == 1):                symbol2OrdinalFunc = x[1]                break        dllStub = open(stubSourceName, "w")        dllStub.write("#include <e32std.h>\n")        dllStub.write("#include <string.h>\n")        if(not project.IsDefined('HELIX_CONFIG_MICROCORE_DLL_STUB')):                dllStub.write("#include \"hxglobalmgr.h\"\n")                dllStub.write("\n")        dllStub.write("GLDEF_C TInt E32Dll(TDllReason reason)\n")        dllStub.write("{\n")        if(not project.IsDefined('HELIX_CONFIG_MICROCORE_DLL_STUB')):                dllStub.write("    if (reason == EDllProcessDetach)\n")                dllStub.write("    {\n")                dllStub.write("        HXGlobalManager* pGM = HXGlobalManager::Instance();\n")                dllStub.write("        if (pGM)\n")                dllStub.write("        {\n")                dllStub.write("            pGM->Shutdown();\n")                dllStub.write("        }\n")                dllStub.write("    }\n")        dllStub.write("    return(KErrNone);\n")        dllStub.write("}\n")        dllStub.write("\n")        dllStub.write("struct SymbolEntry {\n")        dllStub.write("    const char* m_pSymbolName;\n")        dllStub.write("    int m_ordinal;\n")        dllStub.write("};\n")        dllStub.write("\n")        dllStub.write("static const struct SymbolEntry z_symbolTable[] = {\n")        dllStub.write("    {\"%s\", %d}" % (ordinalInfo[0][1], ordinalInfo[0][0]))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -