qmake/generators/win32/msvc_objectmodel.h
changeset 0 1918ee327afb
child 3 41300fa6a67c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the qmake application of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef MSVC_OBJECTMODEL_H
       
    43 #define MSVC_OBJECTMODEL_H
       
    44 
       
    45 #include "project.h"
       
    46 #include "xmloutput.h"
       
    47 #include <qatomic.h>
       
    48 #include <qlist.h>
       
    49 #include <qstring.h>
       
    50 #include <qstringlist.h>
       
    51 #include <qmap.h>
       
    52 #include <qdebug.h>
       
    53 
       
    54 QT_BEGIN_NAMESPACE
       
    55 
       
    56 enum DotNET {
       
    57     NETUnknown = 0,
       
    58     NET2002 = 0x70,
       
    59     NET2003 = 0x71,
       
    60     NET2005 = 0x80,
       
    61     NET2008 = 0x90
       
    62 };
       
    63 
       
    64 /*
       
    65     This Object model is of course VERY simplyfied,
       
    66     and does not actually follow the original MSVC
       
    67     object model. However, it fulfilles the basic
       
    68     needs for qmake
       
    69 */
       
    70 
       
    71 /*
       
    72     If a triState value is 'unset' then the
       
    73     corresponding property is not in the output,
       
    74     forcing the tool to utilize default values.
       
    75     False/True values will be in the output...
       
    76 */
       
    77 enum customBuildCheck {
       
    78     none,
       
    79     mocSrc,
       
    80     mocHdr,
       
    81     lexyacc
       
    82 };
       
    83 enum triState {
       
    84     unset = -1,
       
    85     _False = 0,
       
    86     _True = 1
       
    87 };
       
    88 enum addressAwarenessType {
       
    89     addrAwareDefault,
       
    90     addrAwareNoLarge,
       
    91     addrAwareLarge
       
    92 };
       
    93 enum asmListingOption {
       
    94     asmListingNone,
       
    95     asmListingAssemblyOnly,
       
    96     asmListingAsmMachineSrc,
       
    97     asmListingAsmMachine,
       
    98     asmListingAsmSrc
       
    99 };
       
   100 enum basicRuntimeCheckOption {
       
   101     runtimeBasicCheckNone,
       
   102     runtimeCheckStackFrame,
       
   103     runtimeCheckUninitVariables,
       
   104     runtimeBasicCheckAll
       
   105 };
       
   106 enum browseInfoOption {
       
   107     brInfoNone,
       
   108     brAllInfo,
       
   109     brNoLocalSymbols
       
   110 };
       
   111 enum callingConventionOption {
       
   112     callConventionDefault = -1,
       
   113     callConventionCDecl,
       
   114     callConventionFastCall,
       
   115     callConventionStdCall
       
   116 };
       
   117 enum charSet {
       
   118     charSetNotSet,
       
   119     charSetUnicode,
       
   120     charSetMBCS
       
   121 };
       
   122 enum compileAsManagedOptions {
       
   123     managedDefault           = -1, // Was: noAssembly
       
   124     managedAssembly          = 1,
       
   125     managedAssemblyPure      = 2,  // Old was: Assembly
       
   126     managedAssemblySafe      = 3,
       
   127     managedAssemblyOldSyntax = 4
       
   128 };
       
   129 enum CompileAsOptions{
       
   130     compileAsDefault,
       
   131     compileAsC,
       
   132     compileAsCPlusPlus
       
   133 };
       
   134 enum ConfigurationTypes {
       
   135     typeUnknown        = 0,
       
   136     typeApplication    = 1,
       
   137     typeDynamicLibrary = 2,
       
   138     typeStaticLibrary  = 4,
       
   139     typeGeneric        = 10
       
   140 };
       
   141 enum debugOption {
       
   142     debugUnknown = -1,
       
   143     debugDisabled,
       
   144     debugOldStyleInfo,
       
   145     debugLineInfoOnly,
       
   146     debugEnabled,
       
   147     debugEditAndContinue
       
   148 };
       
   149 enum eAppProtectionOption {
       
   150     eAppProtectUnchanged,
       
   151     eAppProtectLow,
       
   152     eAppProtectMedium,
       
   153     eAppProtectHigh
       
   154 };
       
   155 enum enhancedInstructionSetOption {
       
   156     archNotSet = 0,
       
   157     archSSE = 1,
       
   158     archSSE2 = 2
       
   159 };
       
   160 enum exceptionHandling {
       
   161     ehDefault = -1,
       
   162     ehNone    = 0,
       
   163     ehNoSEH   = 1,
       
   164     ehSEH     = 2
       
   165 };
       
   166 enum enumResourceLangID {
       
   167     rcUseDefault                 = 0,
       
   168     rcAfrikaans                  = 1078,
       
   169     rcAlbanian                   = 1052,
       
   170     rcArabicAlgeria              = 5121,
       
   171     rcArabicBahrain              = 15361,
       
   172     rcArabicEgypt                = 3073,
       
   173     rcArabicIraq                 = 2049,
       
   174     rcArabicJordan               = 11265,
       
   175     rcArabicKuwait               = 13313,
       
   176     rcArabicLebanon              = 12289,
       
   177     rcArabicLibya                = 4097,
       
   178     rcArabicMorocco              = 6145,
       
   179     rcArabicOman                 = 8193,
       
   180     rcArabicQatar                = 16385,
       
   181     rcArabicSaudi                = 1025,
       
   182     rcArabicSyria                = 10241,
       
   183     rcArabicTunisia              = 7169,
       
   184     rcArabicUnitedArabEmirates   = 14337,
       
   185     rcArabicYemen                = 9217,
       
   186     rcBasque                     = 1069,
       
   187     rcBulgarian                  = 1026,
       
   188     rcByelorussian               = 1059,
       
   189     rcCatalan                    = 1027,
       
   190     rcChineseHongKong            = 3076,
       
   191     rcChinesePRC                 = 2052,
       
   192     rcChineseSingapore           = 4100,
       
   193     rcChineseTaiwan              = 1028,
       
   194     rcCroatian                   = 1050,
       
   195     rcCzech                      = 1029,
       
   196     rcDanish                     = 1030,
       
   197     rcDutchBelgium               = 2067,
       
   198     rcDutchStandard              = 1043,
       
   199     rcEnglishAustralia           = 3081,
       
   200     rcEnglishBritain             = 2057,
       
   201     rcEnglishCanada              = 4105,
       
   202     RcEnglishCaribbean           = 9225,
       
   203     rcEnglishIreland             = 6153,
       
   204     rcEnglishJamaica             = 8201,
       
   205     rcEnglishNewZealand          = 5129,
       
   206     rcEnglishSouthAfrica         = 7177,
       
   207     rcEnglishUS                  = 1033,
       
   208     rcEstonian                   = 1061,
       
   209     rcFarsi                      = 1065,
       
   210     rcFinnish                    = 1035,
       
   211     rcFrenchBelgium              = 2060,
       
   212     rcFrenchCanada               = 3084,
       
   213     rcFrenchLuxembourg           = 5132,
       
   214     rcFrenchStandard             = 1036,
       
   215     rcFrenchSwitzerland          = 4108,
       
   216     rcGermanAustria              = 3079,
       
   217     rcGermanLichtenstein         = 5127,
       
   218     rcGermanLuxembourg           = 4103,
       
   219     rcGermanStandard             = 1031,
       
   220     rcGermanSwitzerland          = 2055,
       
   221     rcGreek                      = 1032,
       
   222     rcHebrew                     = 1037,
       
   223     rcHungarian                  = 1038,
       
   224     rcIcelandic                  = 1039,
       
   225     rcIndonesian                 = 1057,
       
   226     rcItalianStandard            = 1040,
       
   227     rcItalianSwitzerland         = 2064,
       
   228     rcJapanese                   = 1041,
       
   229     rcKorean                     = 1042,
       
   230     rcKoreanJohab                = 2066,
       
   231     rcLatvian                    = 1062,
       
   232     rcLithuanian                 = 1063,
       
   233     rcNorwegianBokmal            = 1044,
       
   234     rcNorwegianNynorsk           = 2068,
       
   235     rcPolish                     = 1045,
       
   236     rcPortugueseBrazilian        = 1046,
       
   237     rcPortugueseStandard         = 2070,
       
   238     rcRomanian                   = 1048,
       
   239     rcRussian                    = 1049,
       
   240     rcSerbian                    = 2074,
       
   241     rcSlovak                     = 1051,
       
   242     rcSpanishArgentina           = 11274,
       
   243     rcSpanishBolivia             = 16394,
       
   244     rcSpanishChile               = 13322,
       
   245     rcSpanishColombia            = 9226,
       
   246     rcSpanishCostaRica           = 5130,
       
   247     rcSpanishDominicanRepublic   = 7178,
       
   248     rcSpanishEcuador             = 12298,
       
   249     rcSpanishGuatemala           = 4106,
       
   250     rcSpanishMexico              = 2058,
       
   251     rcSpanishModern              = 3082,
       
   252     rcSpanishPanama              = 6154,
       
   253     rcSpanishParaguay            = 15370,
       
   254     rcSpanishPeru                = 10250,
       
   255     rcSpanishTraditional         = 1034,
       
   256     rcSpanishUruguay             = 14346,
       
   257     rcSpanishVenezuela           = 8202,
       
   258     rcSwedish                    = 1053,
       
   259     rcThai                       = 1054,
       
   260     rcTurkish                    = 1055,
       
   261     rcUkrainian                  = 1058,
       
   262     rcUrdu                       = 1056
       
   263 };
       
   264 enum enumSccEvent {
       
   265     eProjectInScc,
       
   266     ePreDirtyNotification
       
   267 };
       
   268 enum favorSizeOrSpeedOption {
       
   269     favorNone,
       
   270     favorSpeed,
       
   271     favorSize
       
   272 };
       
   273 enum floatingPointModel {
       
   274     floatingPointNotSet = -1,
       
   275     floatingPointPrecise,
       
   276     floatingPointStrict,
       
   277     floatingPointFast
       
   278 };
       
   279 enum genProxyLanguage {
       
   280     genProxyNative,
       
   281     genProxyManaged
       
   282 };
       
   283 enum inlineExpansionOption {
       
   284     expandDisable,
       
   285     expandOnlyInline,
       
   286     expandAnySuitable,
       
   287     expandDefault // Not useful number, but stops the output
       
   288 };
       
   289 enum linkIncrementalType {
       
   290     linkIncrementalDefault,
       
   291     linkIncrementalNo,
       
   292     linkIncrementalYes
       
   293 };
       
   294 enum linkProgressOption {
       
   295     linkProgressNotSet,
       
   296     linkProgressAll,
       
   297     linkProgressLibs
       
   298 };
       
   299 enum machineTypeOption {
       
   300     machineNotSet,
       
   301     machineX86
       
   302 };
       
   303 enum midlCharOption {
       
   304     midlCharUnsigned,
       
   305     midlCharSigned,
       
   306     midlCharAscii7
       
   307 };
       
   308 enum midlErrorCheckOption {
       
   309     midlEnableCustom,
       
   310     midlDisableAll,
       
   311     midlEnableAll
       
   312 };
       
   313 enum midlStructMemberAlignOption {
       
   314     midlAlignNotSet,
       
   315     midlAlignSingleByte,
       
   316     midlAlignTwoBytes,
       
   317     midlAlignFourBytes,
       
   318     midlAlignEightBytes,
       
   319     midlAlignSixteenBytes
       
   320 };
       
   321 enum midlTargetEnvironment {
       
   322     midlTargetNotSet,
       
   323     midlTargetWin32,
       
   324     midlTargetWin64
       
   325 };
       
   326 enum midlWarningLevelOption {
       
   327     midlWarningLevel_0,
       
   328     midlWarningLevel_1,
       
   329     midlWarningLevel_2,
       
   330     midlWarningLevel_3,
       
   331     midlWarningLevel_4
       
   332 };
       
   333 enum optFoldingType {
       
   334     optFoldingDefault,
       
   335     optNoFolding,
       
   336     optFolding
       
   337 };
       
   338 enum optimizeOption {
       
   339     optimizeDisabled,
       
   340     optimizeMinSpace,
       
   341     optimizeMaxSpeed,
       
   342     optimizeFull,
       
   343     optimizeCustom,
       
   344     optimizeDefault // Not useful number, but stops the output
       
   345 };
       
   346 enum optRefType {
       
   347     optReferencesDefault,
       
   348     optNoReferences,
       
   349     optReferences
       
   350 };
       
   351 enum optWin98Type {
       
   352     optWin98Default,
       
   353     optWin98No,
       
   354     optWin98Yes
       
   355 };
       
   356 enum optLinkTimeCodeGenType {
       
   357     optLTCGDefault,
       
   358     optLTCGEnabled,
       
   359     optLTCGInstrument,
       
   360     optLTCGOptimize,
       
   361     optLTCGUpdate
       
   362 };
       
   363 enum pchOption {
       
   364     pchNone,
       
   365     pchCreateUsingSpecific,
       
   366     pchGenerateAuto,
       
   367     pchUseUsingSpecific
       
   368 };
       
   369 enum preprocessOption {
       
   370     preprocessUnknown = -1,
       
   371     preprocessNo,
       
   372     preprocessYes,
       
   373     preprocessNoLineNumbers
       
   374 };
       
   375 enum ProcessorOptimizeOption {
       
   376     procOptimizeBlended,                //GB
       
   377     procOptimizePentium,                //G5
       
   378     procOptimizePentiumProAndAbove,     //G6
       
   379     procOptimizePentium4AndAbove        //G7
       
   380 };
       
   381 enum RegisterDeployOption {
       
   382     registerNo = 0,
       
   383     registerYes
       
   384 };
       
   385 enum RemoteDebuggerType {
       
   386     DbgLocal,
       
   387     DbgRemote,
       
   388     DbgRemoteTCPIP
       
   389 };
       
   390 enum runtimeLibraryOption {
       
   391     rtUnknown = -1,
       
   392     rtMultiThreaded,
       
   393     rtMultiThreadedDebug,
       
   394     rtMultiThreadedDLL,
       
   395     rtMultiThreadedDebugDLL,
       
   396     rtSingleThreaded,
       
   397     rtSingleThreadedDebug
       
   398 };
       
   399 enum structMemberAlignOption {
       
   400     alignNotSet,
       
   401     alignSingleByte,
       
   402     alignTwoBytes,
       
   403     alignFourBytes,
       
   404     alignEightBytes,
       
   405     alignSixteenBytes
       
   406 };
       
   407 enum subSystemOption {
       
   408     subSystemNotSet,
       
   409     subSystemConsole,
       
   410     subSystemWindows
       
   411 };
       
   412 enum termSvrAwarenessType {
       
   413     termSvrAwareDefault,
       
   414     termSvrAwareNo,
       
   415     termSvrAwareYes
       
   416 };
       
   417 enum toolSetType {
       
   418     toolSetUtility,
       
   419     toolSetMakefile,
       
   420     toolSetLinker,
       
   421     toolSetLibrarian,
       
   422     toolSetAll
       
   423 };
       
   424 enum TypeOfDebugger {
       
   425     DbgNativeOnly,
       
   426     DbgManagedOnly,
       
   427     DbgMixed,
       
   428     DbgAuto
       
   429 };
       
   430 enum useOfATL {
       
   431     useATLNotSet,
       
   432     useATLStatic,
       
   433     useATLDynamic
       
   434 };
       
   435 enum useOfMfc {
       
   436     useMfcStdWin,
       
   437     useMfcStatic,
       
   438     useMfcDynamic
       
   439 };
       
   440 enum useOfArchitecture {
       
   441     archUnknown = -1,
       
   442     archArmv4,
       
   443     archArmv5,
       
   444     archArmv4T,
       
   445     archArmv5T,
       
   446     archMips1 = 0,
       
   447     archMips2 = 1,
       
   448     archMips3 = 2,
       
   449     archMips4 = 3,
       
   450     archMips5 = 4,
       
   451     archMips16 = 5,
       
   452     archMips32 = 6,
       
   453     archMips64 = 7
       
   454 };
       
   455 enum warningLevelOption {
       
   456     warningLevelUnknown = -1,
       
   457     warningLevel_0,
       
   458     warningLevel_1,
       
   459     warningLevel_2,
       
   460     warningLevel_3,
       
   461     warningLevel_4
       
   462 };
       
   463 
       
   464 
       
   465 class VCToolBase {
       
   466 protected:
       
   467     // Functions
       
   468     VCToolBase(){};
       
   469     virtual ~VCToolBase(){}
       
   470     virtual bool parseOption(const char* option) = 0;
       
   471 public:
       
   472     void parseOptions(QStringList& options) {
       
   473         for (QStringList::ConstIterator it=options.begin(); (it!=options.end()); it++)
       
   474             parseOption((*it).toLatin1());
       
   475     }
       
   476 };
       
   477 
       
   478 class VCConfiguration;
       
   479 class VCProject;
       
   480 
       
   481 class VCCLCompilerTool : public VCToolBase
       
   482 {
       
   483 public:
       
   484     // Functions
       
   485     VCCLCompilerTool();
       
   486     virtual ~VCCLCompilerTool(){}
       
   487     bool parseOption(const char* option);
       
   488 
       
   489     // Variables
       
   490     QStringList             AdditionalIncludeDirectories;
       
   491     QStringList             AdditionalOptions;
       
   492     QStringList             AdditionalUsingDirectories;
       
   493     QString                 AssemblerListingLocation;
       
   494     asmListingOption        AssemblerOutput;
       
   495     basicRuntimeCheckOption BasicRuntimeChecks;
       
   496     browseInfoOption        BrowseInformation;
       
   497     QString                 BrowseInformationFile;
       
   498     triState                BufferSecurityCheck;
       
   499     callingConventionOption CallingConvention;
       
   500     CompileAsOptions        CompileAs;
       
   501     compileAsManagedOptions CompileAsManaged;
       
   502     triState                CompileOnly;
       
   503     debugOption             DebugInformationFormat;
       
   504     triState                DefaultCharIsUnsigned;
       
   505     triState                Detect64BitPortabilityProblems;
       
   506     triState                DisableLanguageExtensions;
       
   507     QStringList             DisableSpecificWarnings;
       
   508     enhancedInstructionSetOption  EnableEnhancedInstructionSet;
       
   509     triState                EnableFiberSafeOptimizations;
       
   510     triState                EnableFunctionLevelLinking;
       
   511     triState                EnableIntrinsicFunctions;
       
   512     exceptionHandling       ExceptionHandling;
       
   513     triState                ExpandAttributedSource;
       
   514     favorSizeOrSpeedOption  FavorSizeOrSpeed;
       
   515     floatingPointModel      FloatingPointModel;
       
   516     triState                FloatingPointExceptions;
       
   517     triState                ForceConformanceInForLoopScope;
       
   518     QStringList             ForcedIncludeFiles;
       
   519     QStringList             ForcedUsingFiles;
       
   520     preprocessOption        GeneratePreprocessedFile;
       
   521     triState                GlobalOptimizations;
       
   522     triState                IgnoreStandardIncludePath;
       
   523     triState                ImproveFloatingPointConsistency;
       
   524     inlineExpansionOption   InlineFunctionExpansion;
       
   525     triState                KeepComments;
       
   526     triState                MinimalRebuild;
       
   527     QString                 ObjectFile;
       
   528     triState                OmitFramePointers;
       
   529     triState                OpenMP;
       
   530     optimizeOption          Optimization;
       
   531     ProcessorOptimizeOption OptimizeForProcessor;
       
   532     triState                OptimizeForWindowsApplication;
       
   533     QString                 OutputFile;
       
   534     QString                 PrecompiledHeaderFile;
       
   535     QString                 PrecompiledHeaderThrough;
       
   536     QStringList             PreprocessorDefinitions;
       
   537     QString                 ProgramDataBaseFileName;
       
   538     runtimeLibraryOption    RuntimeLibrary;
       
   539     triState                RuntimeTypeInfo;
       
   540     triState                ShowIncludes;
       
   541     triState                SmallerTypeCheck;
       
   542     triState                StringPooling;
       
   543     structMemberAlignOption StructMemberAlignment;
       
   544     triState                SuppressStartupBanner;
       
   545     triState                TreatWChar_tAsBuiltInType;
       
   546     triState                TurnOffAssemblyGeneration;
       
   547     triState                UndefineAllPreprocessorDefinitions;
       
   548     QStringList             UndefinePreprocessorDefinitions;
       
   549     pchOption               UsePrecompiledHeader;
       
   550     triState                WarnAsError;
       
   551     warningLevelOption      WarningLevel;
       
   552     triState                WholeProgramOptimization;
       
   553     useOfArchitecture       CompileForArchitecture;
       
   554     triState                InterworkCalls;
       
   555     VCConfiguration*        config;
       
   556 };
       
   557 
       
   558 class VCLinkerTool : public VCToolBase
       
   559 {
       
   560 public:
       
   561     // Functions
       
   562     VCLinkerTool();
       
   563     virtual ~VCLinkerTool(){}
       
   564     bool parseOption(const char* option);
       
   565 
       
   566     // Variables
       
   567     QStringList             AdditionalDependencies;
       
   568     QStringList             AdditionalLibraryDirectories;
       
   569     QStringList             AdditionalOptions;
       
   570     QStringList             AddModuleNamesToAssembly;
       
   571     QString                 BaseAddress;
       
   572     QStringList             DelayLoadDLLs;
       
   573     optFoldingType          EnableCOMDATFolding;
       
   574     QString                 EntryPointSymbol;
       
   575     QStringList             ForceSymbolReferences;
       
   576     QString                 FunctionOrder;
       
   577     triState                GenerateDebugInformation;
       
   578     triState                GenerateMapFile;
       
   579     qlonglong               HeapCommitSize;
       
   580     qlonglong               HeapReserveSize;
       
   581     triState                IgnoreAllDefaultLibraries;
       
   582     QStringList             IgnoreDefaultLibraryNames;
       
   583     triState                IgnoreEmbeddedIDL;
       
   584     triState                IgnoreImportLibrary;
       
   585     QString                 ImportLibrary;
       
   586     addressAwarenessType    LargeAddressAware;
       
   587     triState                LinkDLL;
       
   588     linkIncrementalType     LinkIncremental;
       
   589     optLinkTimeCodeGenType  LinkTimeCodeGeneration;
       
   590     QString                 LinkToManagedResourceFile;
       
   591     triState                MapExports;
       
   592     QString                 MapFileName;
       
   593     triState                MapLines;
       
   594     QString                 MergedIDLBaseFileName;
       
   595     QString                 MergeSections;          // Should be list?
       
   596     QString                 MidlCommandFile;
       
   597     QString                 ModuleDefinitionFile;   // Should be list?
       
   598     optWin98Type            OptimizeForWindows98;
       
   599     optRefType              OptimizeReferences;
       
   600     QString                 OutputFile;
       
   601     QString                 ProgramDatabaseFile;
       
   602     triState                RegisterOutput;
       
   603     triState                ResourceOnlyDLL;
       
   604     triState                SetChecksum;
       
   605     linkProgressOption      ShowProgress;
       
   606     qlonglong               StackCommitSize;
       
   607     qlonglong               StackReserveSize;
       
   608     QString                 StripPrivateSymbols;    // Should be list?
       
   609     subSystemOption         SubSystem;
       
   610     triState                SupportUnloadOfDelayLoadedDLL;
       
   611     triState                SuppressStartupBanner;
       
   612     triState                SwapRunFromCD;
       
   613     triState                SwapRunFromNet;
       
   614     machineTypeOption       TargetMachine;
       
   615     termSvrAwarenessType    TerminalServerAware;
       
   616     triState                TurnOffAssemblyGeneration;
       
   617     QString                 TypeLibraryFile;
       
   618     qlonglong               TypeLibraryResourceID;
       
   619     QString                 Version;
       
   620     VCConfiguration*        config;
       
   621 };
       
   622 
       
   623 class VCMIDLTool : public VCToolBase
       
   624 {
       
   625 public:
       
   626     // Functions
       
   627     VCMIDLTool();
       
   628     virtual ~VCMIDLTool(){}
       
   629     bool parseOption(const char* option);
       
   630 
       
   631     // Variables
       
   632     QStringList             AdditionalIncludeDirectories;
       
   633     QStringList             AdditionalOptions;
       
   634     QStringList             CPreprocessOptions;
       
   635     midlCharOption          DefaultCharType;
       
   636     QString                 DLLDataFileName;    // Should be list?
       
   637     midlErrorCheckOption    EnableErrorChecks;
       
   638     triState                ErrorCheckAllocations;
       
   639     triState                ErrorCheckBounds;
       
   640     triState                ErrorCheckEnumRange;
       
   641     triState                ErrorCheckRefPointers;
       
   642     triState                ErrorCheckStubData;
       
   643     QStringList             FullIncludePath;
       
   644     triState                GenerateStublessProxies;
       
   645     triState                GenerateTypeLibrary;
       
   646     QString                 HeaderFileName;
       
   647     triState                IgnoreStandardIncludePath;
       
   648     QString                 InterfaceIdentifierFileName;
       
   649     triState                MkTypLibCompatible;
       
   650     QString                 OutputDirectory;
       
   651     QStringList             PreprocessorDefinitions;
       
   652     QString                 ProxyFileName;
       
   653     QString                 RedirectOutputAndErrors;
       
   654     midlStructMemberAlignOption StructMemberAlignment;
       
   655     triState                SuppressStartupBanner;
       
   656     midlTargetEnvironment   TargetEnvironment;
       
   657     QString                 TypeLibraryName;
       
   658     QStringList             UndefinePreprocessorDefinitions;
       
   659     triState                ValidateParameters;
       
   660     triState                WarnAsError;
       
   661     midlWarningLevelOption  WarningLevel;
       
   662     VCConfiguration*        config;
       
   663 };
       
   664 
       
   665 class VCLibrarianTool : public VCToolBase
       
   666 {
       
   667 public:
       
   668     // Functions
       
   669     VCLibrarianTool();
       
   670     virtual ~VCLibrarianTool(){}
       
   671     bool parseOption(const char*){ return false; };
       
   672 
       
   673     // Variables
       
   674     QStringList             AdditionalDependencies;
       
   675     QStringList             AdditionalLibraryDirectories;
       
   676     QStringList             AdditionalOptions;
       
   677     QStringList             ExportNamedFunctions;
       
   678     QStringList             ForceSymbolReferences;
       
   679     triState                IgnoreAllDefaultLibraries;
       
   680     QStringList             IgnoreDefaultLibraryNames;
       
   681     QString                 ModuleDefinitionFile;
       
   682     QString                 OutputFile;
       
   683     triState                SuppressStartupBanner;
       
   684 };
       
   685 
       
   686 class VCCustomBuildTool : public VCToolBase
       
   687 {
       
   688 public:
       
   689     // Functions
       
   690     VCCustomBuildTool();
       
   691     virtual ~VCCustomBuildTool(){}
       
   692     bool parseOption(const char*){ return false; };
       
   693 
       
   694     // Variables
       
   695     QStringList             AdditionalDependencies;
       
   696     QStringList             CommandLine;
       
   697     QString                 Description;
       
   698     QStringList             Outputs;
       
   699     QString                 ToolName;
       
   700     QString                 ToolPath;
       
   701 };
       
   702 
       
   703 class VCResourceCompilerTool : public VCToolBase
       
   704 {
       
   705 public:
       
   706     // Functions
       
   707     VCResourceCompilerTool();
       
   708     virtual ~VCResourceCompilerTool(){}
       
   709     bool parseOption(const char*){ return false; };
       
   710 
       
   711     // Variables
       
   712     QStringList             AdditionalIncludeDirectories;
       
   713     QStringList             AdditionalOptions;
       
   714     enumResourceLangID      Culture;
       
   715     QStringList             FullIncludePath;
       
   716     triState                IgnoreStandardIncludePath;
       
   717     QStringList             PreprocessorDefinitions;
       
   718     QString                 ResourceOutputFileName;
       
   719     linkProgressOption      ShowProgress;
       
   720     QString                 ToolPath;
       
   721 };
       
   722 
       
   723 class VCDeploymentTool
       
   724 {
       
   725 public:
       
   726     // Functions
       
   727     VCDeploymentTool();
       
   728     virtual ~VCDeploymentTool() {}
       
   729 
       
   730     // Variables
       
   731     QString                 DeploymentTag;
       
   732     QString                 RemoteDirectory;
       
   733     RegisterDeployOption    RegisterOutput;
       
   734     QString                 AdditionalFiles;
       
   735 };
       
   736 
       
   737 class VCEventTool : public VCToolBase
       
   738 {
       
   739 protected:
       
   740     // Functions
       
   741     VCEventTool() : ExcludedFromBuild(unset){};
       
   742     virtual ~VCEventTool(){}
       
   743     bool parseOption(const char*){ return false; };
       
   744 
       
   745 public:
       
   746     // Variables
       
   747     QString                 CommandLine;
       
   748     QString                 Description;
       
   749     triState                ExcludedFromBuild;
       
   750     QString                 ToolName;
       
   751     QString                 ToolPath;
       
   752 };
       
   753 
       
   754 class VCPostBuildEventTool : public VCEventTool
       
   755 {
       
   756 public:
       
   757     VCPostBuildEventTool();
       
   758     ~VCPostBuildEventTool(){}
       
   759 };
       
   760 
       
   761 class VCPreBuildEventTool : public VCEventTool
       
   762 {
       
   763 public:
       
   764     VCPreBuildEventTool();
       
   765     ~VCPreBuildEventTool(){}
       
   766 };
       
   767 
       
   768 class VCPreLinkEventTool : public VCEventTool
       
   769 {
       
   770 public:
       
   771     VCPreLinkEventTool();
       
   772     ~VCPreLinkEventTool(){}
       
   773 };
       
   774 
       
   775 class VCConfiguration
       
   776 {
       
   777 public:
       
   778     // Functions
       
   779     VCConfiguration();
       
   780     ~VCConfiguration(){}
       
   781 
       
   782     DotNET                  CompilerVersion;
       
   783 
       
   784     // Variables
       
   785     triState                ATLMinimizesCRunTimeLibraryUsage;
       
   786     triState                BuildBrowserInformation;
       
   787     charSet                 CharacterSet;
       
   788     ConfigurationTypes      ConfigurationType;
       
   789     QString                 DeleteExtensionsOnClean;
       
   790     QString                 ImportLibrary;
       
   791     QString                 IntermediateDirectory;
       
   792     QString                 Name;
       
   793     QString                 OutputDirectory;
       
   794     QString                 PrimaryOutput;
       
   795     QString                 ProgramDatabase;
       
   796     triState                RegisterOutput;
       
   797     useOfATL                UseOfATL;
       
   798     useOfMfc                UseOfMfc;
       
   799     triState                WholeProgramOptimization;
       
   800 
       
   801     // XML sub-parts
       
   802     VCCLCompilerTool        compiler;
       
   803     VCLinkerTool            linker;
       
   804     VCLibrarianTool         librarian;
       
   805     VCCustomBuildTool       custom;
       
   806     VCMIDLTool              idl;
       
   807     VCPostBuildEventTool    postBuild;
       
   808     VCPreBuildEventTool     preBuild;
       
   809     VCDeploymentTool        deployment;
       
   810     VCPreLinkEventTool      preLink;
       
   811     VCResourceCompilerTool  resource;
       
   812 };
       
   813 
       
   814 struct VCFilterFile
       
   815 {
       
   816     VCFilterFile()
       
   817     { excludeFromBuild = false; }
       
   818     VCFilterFile(const QString &filename, bool exclude = false )
       
   819     { file = filename; excludeFromBuild = exclude; }
       
   820     VCFilterFile(const QString &filename, const QString &additional, bool exclude = false )
       
   821     { file = filename; excludeFromBuild = exclude; additionalFile = additional; }
       
   822     bool operator==(const VCFilterFile &other){
       
   823         return file == other.file
       
   824                && additionalFile == other.additionalFile
       
   825                && excludeFromBuild == other.excludeFromBuild;
       
   826     }
       
   827 
       
   828     bool                    excludeFromBuild;
       
   829     QString                 file;
       
   830     QString                 additionalFile; // For tools like MOC
       
   831 };
       
   832 
       
   833 #ifndef QT_NO_DEBUG_OUTPUT
       
   834 inline QDebug operator<<(QDebug dbg, const VCFilterFile &p)
       
   835 {
       
   836     dbg.nospace() << "VCFilterFile(file(" << p.file
       
   837                   << ") additionalFile(" << p.additionalFile
       
   838                   << ") excludeFromBuild(" << p.excludeFromBuild << "))" << endl;
       
   839     return dbg.space();
       
   840 }
       
   841 #endif
       
   842 
       
   843 class VcprojGenerator;
       
   844 class VCFilter
       
   845 {
       
   846 public:
       
   847     // Functions
       
   848     VCFilter();
       
   849     ~VCFilter(){};
       
   850 
       
   851     void addFile(const QString& filename);
       
   852     void addFile(const VCFilterFile& fileInfo);
       
   853     void addFiles(const QStringList& fileList);
       
   854     bool addExtraCompiler(const VCFilterFile &info);
       
   855     void modifyPCHstage(QString str);
       
   856     void outputFileConfig(XmlOutput &xml, const QString &filename);
       
   857 
       
   858     // Variables
       
   859     QString                 Name;
       
   860     QString                 Filter;
       
   861     QString                 Guid;
       
   862     triState                ParseFiles;
       
   863     VcprojGenerator*        Project;
       
   864     VCConfiguration*        Config;
       
   865     QList<VCFilterFile>     Files;
       
   866 
       
   867     customBuildCheck	    CustomBuild;
       
   868 
       
   869     bool		    useCustomBuildTool;
       
   870     VCCustomBuildTool       CustomBuildTool;
       
   871 
       
   872     bool                    useCompilerTool;
       
   873     VCCLCompilerTool        CompilerTool;
       
   874 
       
   875 private:
       
   876     friend XmlOutput &operator<<(XmlOutput &xml, VCFilter &tool);
       
   877 };
       
   878 
       
   879 typedef QList<VCFilter> VCFilterList;
       
   880 class VCProjectSingleConfig
       
   881 {
       
   882 public:
       
   883     enum FilterTypes {
       
   884         None,
       
   885         Source,
       
   886         Header,
       
   887         Generated,
       
   888         LexYacc,
       
   889         Translation,
       
   890         Resources,
       
   891         Extras
       
   892     };
       
   893     // Functions
       
   894     VCProjectSingleConfig(){};
       
   895     ~VCProjectSingleConfig(){}
       
   896 
       
   897     // Variables
       
   898     QString                 Name;
       
   899     QString                 Version;
       
   900     QString                 ProjectGUID;
       
   901     QString                 Keyword;
       
   902     QString                 SccProjectName;
       
   903     QString                 SccLocalPath;
       
   904     QString                 PlatformName;
       
   905 
       
   906     // XML sub-parts
       
   907     VCConfiguration         Configuration;
       
   908     VCFilter                RootFiles;
       
   909     VCFilter                SourceFiles;
       
   910     VCFilter                HeaderFiles;
       
   911     VCFilter                GeneratedFiles;
       
   912     VCFilter                LexYaccFiles;
       
   913     VCFilter                TranslationFiles;
       
   914     VCFilter                FormFiles;
       
   915     VCFilter                ResourceFiles;
       
   916     VCFilterList            ExtraCompilersFiles;
       
   917 
       
   918     bool                    flat_files;
       
   919 
       
   920     // Accessor for extracompilers
       
   921     VCFilter               &filterForExtraCompiler(const QString &compilerName);
       
   922 };
       
   923 
       
   924 
       
   925 
       
   926 // Tree & Flat view of files --------------------------------------------------
       
   927 class VCFilter;
       
   928 class Node
       
   929 {
       
   930 public:
       
   931     virtual ~Node() { }
       
   932     void addElement(const VCFilterFile &file) {
       
   933         addElement(file.file, file);
       
   934     }
       
   935     virtual void addElement(const QString &filepath, const VCFilterFile &allInfo) = 0;
       
   936     virtual void removeElements()= 0;
       
   937     virtual void generateXML(XmlOutput &xml, const QString &tagName, VCProject &tool, const QString &filter) = 0;
       
   938     virtual bool hasElements() = 0;
       
   939 };
       
   940 
       
   941 class TreeNode : public Node
       
   942 {
       
   943     typedef QMap<QString, TreeNode*> ChildrenMap;
       
   944     VCFilterFile info;
       
   945     ChildrenMap children;
       
   946 
       
   947 public:
       
   948     virtual ~TreeNode() { removeElements(); }
       
   949 
       
   950     int pathIndex(const QString &filepath) {
       
   951         int Windex = filepath.indexOf("\\");
       
   952         int Uindex = filepath.indexOf("/");
       
   953         if (Windex != -1 && Uindex != -1)
       
   954             return qMin(Windex, Uindex);
       
   955         else if (Windex != -1)
       
   956             return Windex;
       
   957         return Uindex;
       
   958     }
       
   959 
       
   960     void addElement(const QString &filepath, const VCFilterFile &allInfo){
       
   961         QString newNodeName(filepath);
       
   962 
       
   963         int index = pathIndex(filepath);
       
   964         if (index != -1)
       
   965             newNodeName = filepath.left(index);
       
   966 
       
   967         TreeNode *n = children.value(newNodeName);
       
   968         if (!n) {
       
   969             n = new TreeNode;
       
   970             n->info = allInfo;
       
   971             children.insert(newNodeName, n);
       
   972         }
       
   973         if (index != -1)
       
   974             n->addElement(filepath.mid(index+1), allInfo);
       
   975     }
       
   976 
       
   977     void removeElements() {
       
   978         ChildrenMap::ConstIterator it = children.constBegin();
       
   979         ChildrenMap::ConstIterator end = children.constEnd();
       
   980         for( ; it != end; it++) {
       
   981             (*it)->removeElements();
       
   982             delete it.value();
       
   983         }
       
   984         children.clear();
       
   985     }
       
   986 
       
   987     void generateXML(XmlOutput &xml, const QString &tagName, VCProject &tool, const QString &filter);
       
   988     bool hasElements() {
       
   989         return children.size() != 0;
       
   990     }
       
   991 };
       
   992 
       
   993 class FlatNode : public Node
       
   994 {
       
   995     typedef QMap<QString, VCFilterFile> ChildrenMapFlat;
       
   996     ChildrenMapFlat children;
       
   997 
       
   998 public:
       
   999     virtual ~FlatNode() { removeElements(); }
       
  1000 
       
  1001     int pathIndex(const QString &filepath) {
       
  1002         int Windex = filepath.lastIndexOf("\\");
       
  1003         int Uindex = filepath.lastIndexOf("/");
       
  1004         if (Windex != -1 && Uindex != -1)
       
  1005             return qMax(Windex, Uindex);
       
  1006         else if (Windex != -1)
       
  1007             return Windex;
       
  1008         return Uindex;
       
  1009     }
       
  1010 
       
  1011     void addElement(const QString &filepath, const VCFilterFile &allInfo){
       
  1012         QString newKey(filepath);
       
  1013 
       
  1014         int index = pathIndex(filepath);
       
  1015         if (index != -1)
       
  1016             newKey = filepath.mid(index+1);
       
  1017 
       
  1018         // Key designed to sort files with same
       
  1019         // name in different paths correctly
       
  1020         children.insert(newKey + "\0" + allInfo.file, allInfo);
       
  1021     }
       
  1022 
       
  1023     void removeElements() {
       
  1024         children.clear();
       
  1025     }
       
  1026 
       
  1027     void generateXML(XmlOutput &xml, const QString &tagName, VCProject &proj, const QString &filter);
       
  1028     bool hasElements() {
       
  1029         return children.size() != 0;
       
  1030     }
       
  1031 };
       
  1032 // ----------------------------------------------------------------------------
       
  1033 
       
  1034 class VCProject
       
  1035 {
       
  1036 public:
       
  1037     // Variables
       
  1038     QString                 Name;
       
  1039     QString                 Version;
       
  1040     QString                 ProjectGUID;
       
  1041     QString                 Keyword;
       
  1042     QString                 SccProjectName;
       
  1043     QString                 SccLocalPath;
       
  1044     QString                 PlatformName;
       
  1045 
       
  1046     // Single projects
       
  1047     QList<VCProjectSingleConfig>  SingleProjects;
       
  1048 
       
  1049     // List of all extracompilers
       
  1050     QStringList             ExtraCompilers;
       
  1051 
       
  1052     // Functions
       
  1053     void                    outputFilter(XmlOutput &xml,
       
  1054 //                                         VCProjectSingleConfig::FilterTypes type,
       
  1055                                          const QString &filtername);
       
  1056 
       
  1057     void                    outputFileConfigs(XmlOutput &xml,
       
  1058 //                                              VCProjectSingleConfig::FilterTypes type,
       
  1059                                               const VCFilterFile &info,
       
  1060                                               const QString &filtername);
       
  1061 };
       
  1062 
       
  1063 XmlOutput &operator<<(XmlOutput &, const VCCLCompilerTool &);
       
  1064 XmlOutput &operator<<(XmlOutput &, const VCLinkerTool &);
       
  1065 XmlOutput &operator<<(XmlOutput &, const VCMIDLTool &);
       
  1066 XmlOutput &operator<<(XmlOutput &, const VCCustomBuildTool &);
       
  1067 XmlOutput &operator<<(XmlOutput &, const VCLibrarianTool &);
       
  1068 XmlOutput &operator<<(XmlOutput &, const VCResourceCompilerTool &);
       
  1069 XmlOutput &operator<<(XmlOutput &, const VCEventTool &);
       
  1070 XmlOutput &operator<<(XmlOutput &, const VCDeploymentTool &);
       
  1071 XmlOutput &operator<<(XmlOutput &, const VCConfiguration &);
       
  1072 XmlOutput &operator<<(XmlOutput &, VCFilter &);
       
  1073 XmlOutput &operator<<(XmlOutput &, const VCProjectSingleConfig &);
       
  1074 XmlOutput &operator<<(XmlOutput &, VCProject &);
       
  1075 
       
  1076 QT_END_NAMESPACE
       
  1077 
       
  1078 #endif // MSVC_OBJECTMODEL_H