ApplicationDefinition.st
branchjv
changeset 18042 2aa6ef1820fe
parent 18040 a11a12546f23
parent 14979 e517ad4c5b23
child 18043 03660093fe98
equal deleted inserted replaced
18041:d17dbf11e306 18042:2aa6ef1820fe
   157 
   157 
   158 forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition
   158 forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition
   159     super forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition.
   159     super forEachMethodsCodeToCompileDo:aTwoArgBlock ignoreOldDefinition:ignoreOldDefinition.
   160 
   160 
   161     #(
   161     #(
   162         (applicationIconFileName applicationIconFileName_code)
   162         (applicationIconFileName applicationIconFileName_code 'description - project information')
   163         (subProjects subProjects_code 'description')
   163         (subProjects subProjects_code 'description')
   164         (productInstallDirBaseName productInstallDirBaseName_code 'description - project information')
   164         (productInstallDirBaseName productInstallDirBaseName_code 'description - project information')
   165         (startupClassName startupClassName_code 'description - startup')
   165         (startupClassName startupClassName_code 'description - startup')
   166         (startupSelector startupSelector_code 'description - startup')
   166         (startupSelector startupSelector_code 'description - startup')
   167     ) triplesDo:[:selector :codeMethodSelector :category|
   167     ) triplesDo:[:selector :codeMethodSelector :category|
   404      stx_projects_smalltalk applicationName     
   404      stx_projects_smalltalk applicationName     
   405     "
   405     "
   406 
   406 
   407     "Created: / 08-08-2006 / 20:25:39 / fm"
   407     "Created: / 08-08-2006 / 20:25:39 / fm"
   408     "Modified: / 30-08-2006 / 19:29:25 / cg"
   408     "Modified: / 30-08-2006 / 19:29:25 / cg"
   409 !
       
   410 
       
   411 applicationNameConsole
       
   412     ^ self applicationName, '.com'
       
   413 !
       
   414 
       
   415 applicationNameFromPackage
       
   416     "answer the name of the application.
       
   417      This is also the name of the generated .exe file.
       
   418 
       
   419      Subclasses may redefine this"
       
   420 
       
   421     |m path|
       
   422 
       
   423     m := self moduleDirectory.
       
   424     path := m subStrings:$/.
       
   425     path last = 'application' ifTrue:[
       
   426         path size > 1 ifTrue:[
       
   427             path := path copyWithoutLast:1.
       
   428         ].
       
   429     ].
       
   430     ^ path last
       
   431 
       
   432     "
       
   433      bosch_dapasx_application applicationName     
       
   434      stx_projects_smalltalk applicationName     
       
   435      alspa_batch_application applicationName    
       
   436     "
       
   437 
       
   438     "Created: / 08-08-2006 / 20:25:39 / fm"
       
   439     "Modified: / 05-09-2012 / 10:08:44 / cg"
       
   440 !
       
   441 
       
   442 applicationNameNoConsole
       
   443     ^ self applicationName , '.exe'
       
   444 !
       
   445 
       
   446 applicationPackage
       
   447 
       
   448     ^self module, ':', self applicationNameFromPackage
       
   449 
       
   450     "
       
   451      bosch_dapasx_application applicationPackage     
       
   452      stx_projects_smalltalk applicationPackage     
       
   453      alspa_batch_application applicationPackage            
       
   454     "
       
   455 
       
   456     "Created: / 08-08-2006 / 20:25:39 / fm"
       
   457     "Modified: / 30-08-2006 / 19:29:25 / cg"
       
   458 !
       
   459 
       
   460 applicationType 
       
   461 
       
   462     ^self isGUIApplication
       
   463         ifTrue:['GUI_APPLICATION']
       
   464         ifFalse:['NON_GUI_APPLICATION']
       
   465 !
       
   466 
       
   467 commonFilesToInstall
       
   468     "files installed for applications.
       
   469      Do not redefine - see additionalFilesToInstall for a redefinable variant of this"
       
   470 
       
   471     ^ #(
       
   472         '"*.dll"'
       
   473         '"symbols.stc"'
       
   474         '"*.stx"'
       
   475         '"*.rc"'
       
   476         '/r /x CVS /x ".*" resources'
       
   477     )
       
   478 
       
   479     "Created: / 01-03-2007 / 20:05:40 / cg"
       
   480 !
   409 !
   481 
   410 
   482 documentExtensions
   411 documentExtensions
   483     "list extensions which should be registered with the application.
   412     "list extensions which should be registered with the application.
   484      Results in the application to be started when double-clicking on such a file (win32)"
   413      Results in the application to be started when double-clicking on such a file (win32)"
   570 !
   499 !
   571 
   500 
   572 makeConsoleApplication
   501 makeConsoleApplication
   573     "Used with WIN32 only (i.e. affects bc.mak).
   502     "Used with WIN32 only (i.e. affects bc.mak).
   574      Return true, if this should be built as a console application.
   503      Return true, if this should be built as a console application.
   575      Redefine to return true, if you want one always 8i.e. to generate both)."
   504      Redefine to return true, if you want one always i.e. to generate both)."
   576 
   505 
   577     ^ self isConsoleApplication
   506     ^ self isConsoleApplication
   578 !
   507 !
   579 
   508 
   580 makeNonConsoleApplication
   509 makeNonConsoleApplication
   623     ^ #start
   552     ^ #start
   624 
   553 
   625     "Modified: / 17-08-2006 / 20:01:00 / cg"
   554     "Modified: / 17-08-2006 / 20:01:00 / cg"
   626 ! !
   555 ! !
   627 
   556 
       
   557 !ApplicationDefinition class methodsFor:'description - private'!
       
   558 
       
   559 applicationNameConsole
       
   560     ^ self applicationName, '.com'
       
   561 !
       
   562 
       
   563 applicationNameFromPackage
       
   564     "answer the name of the application.
       
   565      This is also the name of the generated .exe file.
       
   566 
       
   567      Subclasses may redefine this"
       
   568 
       
   569     |m path|
       
   570 
       
   571     m := self moduleDirectory.
       
   572     path := m subStrings:$/.
       
   573     path last = 'application' ifTrue:[
       
   574         path size > 1 ifTrue:[
       
   575             path := path copyWithoutLast:1.
       
   576         ].
       
   577     ].
       
   578     ^ path last
       
   579 
       
   580     "
       
   581      bosch_dapasx_application applicationName     
       
   582      stx_projects_smalltalk applicationName     
       
   583      alspa_batch_application applicationName    
       
   584     "
       
   585 
       
   586     "Created: / 08-08-2006 / 20:25:39 / fm"
       
   587     "Modified: / 05-09-2012 / 10:08:44 / cg"
       
   588 !
       
   589 
       
   590 applicationNameNoConsole
       
   591     ^ self applicationName , '.exe'
       
   592 !
       
   593 
       
   594 applicationPackage
       
   595 
       
   596     ^self module, ':', self applicationNameFromPackage
       
   597 
       
   598     "
       
   599      bosch_dapasx_application applicationPackage     
       
   600      stx_projects_smalltalk applicationPackage     
       
   601      alspa_batch_application applicationPackage            
       
   602     "
       
   603 
       
   604     "Created: / 08-08-2006 / 20:25:39 / fm"
       
   605     "Modified: / 30-08-2006 / 19:29:25 / cg"
       
   606 !
       
   607 
       
   608 commonFilesToInstall
       
   609     "files installed for applications - used only for NSIS installuer under WIN3.
       
   610      Do not redefine - see additionalFilesToInstall for a redefinable variant of this"
       
   611 
       
   612     ^ #(
       
   613         '"*.dll"'
       
   614         '"symbols.stc"'
       
   615         '"*.stx"'
       
   616         '"*.rc"'
       
   617         '/r /x CVS /x ".*" resources'
       
   618     )
       
   619 
       
   620     "Created: / 01-03-2007 / 20:05:40 / cg"
       
   621 !
       
   622 
       
   623 docDirPath_unix
       
   624     "path relative to my dir to the documentation - or nil"
       
   625 
       
   626     ^ self docDirPath replaceAll:$\ with:$/.
       
   627 !
       
   628 
       
   629 docDirPath_win32
       
   630     "path relative to my dir to the documentation - or nil"
       
   631 
       
   632     ^ self docDirPath replaceAll:$/ with:$\.
       
   633 ! !
       
   634 
   628 !ApplicationDefinition class methodsFor:'description - project information'!
   635 !ApplicationDefinition class methodsFor:'description - project information'!
       
   636 
       
   637 applicationType 
       
   638 
       
   639     ^self isGUIApplication
       
   640         ifTrue:['GUI_APPLICATION']
       
   641         ifFalse:['NON_GUI_APPLICATION']
       
   642 !
   629 
   643 
   630 description
   644 description
   631     "Returns a description string which will appear in nt.def / bc.def"
   645     "Returns a description string which will appear in nt.def / bc.def"
   632 
   646 
   633     self module = 'stx' ifTrue:[
   647     self module = 'stx' ifTrue:[
   644     "path relative to my dir to the documentation - or empty."
   658     "path relative to my dir to the documentation - or empty."
   645 
   659 
   646     ^ ''
   660     ^ ''
   647 
   661 
   648     "Created: / 20-09-2006 / 17:58:40 / cg"
   662     "Created: / 20-09-2006 / 17:58:40 / cg"
   649 !
       
   650 
       
   651 docDirPath_unix
       
   652     "path relative to my dir to the documentation - or nil"
       
   653 
       
   654     ^ self docDirPath replaceAll:$\ with:$/.
       
   655 !
       
   656 
       
   657 docDirPath_win32
       
   658     "path relative to my dir to the documentation - or nil"
       
   659 
       
   660     ^ self docDirPath replaceAll:$/ with:$\.
       
   661 !
   663 !
   662 
   664 
   663 hasLicenceToAcceptDuringInstallation
   665 hasLicenceToAcceptDuringInstallation
   664     ^ false
   666     ^ false
   665 
   667 
  2861     "Created: / 15-10-2006 / 12:51:00 / cg"
  2863     "Created: / 15-10-2006 / 12:51:00 / cg"
  2862 ! !
  2864 ! !
  2863 
  2865 
  2864 !ApplicationDefinition class methodsFor:'queries'!
  2866 !ApplicationDefinition class methodsFor:'queries'!
  2865 
  2867 
  2866 canHaveExtensions
       
  2867     "return true, if this class allows extensions from other packages.
       
  2868      Private classes, namespaces and projectDefinitions dont allow this"
       
  2869 
       
  2870     ^ self == ApplicationDefinition
       
  2871 
       
  2872     "
       
  2873      Smalltalk allClasses select:[:each | each canHaveExtensions not]
       
  2874     "
       
  2875 
       
  2876     "Created: / 30-08-2006 / 15:29:49 / cg"
       
  2877 !
       
  2878 
       
  2879 projectType
  2868 projectType
  2880     ^ self isGUIApplication
  2869     ^ self isGUIApplication
  2881         ifTrue:[ GUIApplicationType  ]
  2870         ifTrue:[ GUIApplicationType  ]
  2882         ifFalse:[ NonGUIApplicationType ]
  2871         ifFalse:[ NonGUIApplicationType ]
  2883 !
  2872 !
  2934 isAbstract
  2923 isAbstract
  2935     ^ self == ApplicationDefinition
  2924     ^ self == ApplicationDefinition
  2936 !
  2925 !
  2937 
  2926 
  2938 isApplicationDefinition
  2927 isApplicationDefinition
  2939     ^ self ~~ ApplicationDefinition
  2928     ^ self isAbstract not
  2940 
  2929 
  2941     "Created: / 23-08-2006 / 15:17:38 / cg"
  2930     "Created: / 23-08-2006 / 15:17:38 / cg"
  2942 !
       
  2943 
       
  2944 isProjectDefinition
       
  2945     ^ self ~~ ApplicationDefinition "/ skip myself - I am abstract
       
  2946 
       
  2947     "Created: / 17-08-2006 / 14:11:56 / cg"
       
  2948     "Modified: / 08-02-2011 / 10:03:34 / cg"
       
  2949 ! !
  2931 ! !
  2950 
  2932 
  2951 !ApplicationDefinition class methodsFor:'documentation'!
  2933 !ApplicationDefinition class methodsFor:'documentation'!
  2952 
  2934 
  2953 version
  2935 version
  2954     ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.228 2013-03-26 11:35:24 stefan Exp $'
  2936     ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.230 2013-03-27 12:18:03 stefan Exp $'
  2955 !
  2937 !
  2956 
  2938 
  2957 version_CVS
  2939 version_CVS
  2958     ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.228 2013-03-26 11:35:24 stefan Exp $'
  2940     ^ '$Header: /cvs/stx/stx/libbasic/ApplicationDefinition.st,v 1.230 2013-03-27 12:18:03 stefan Exp $'
  2959 !
  2941 !
  2960 
  2942 
  2961 version_SVN
  2943 version_SVN
  2962     ^ '§ Id: ApplicationDefinition.st 10645 2011-06-09 15:28:45Z vranyj1  §'
  2944     ^ '§ Id: ApplicationDefinition.st 10645 2011-06-09 15:28:45Z vranyj1  §'
  2963 ! !
  2945 ! !