[Vm-dev] [commit] r2482 - Make the primVmPath answers Resources
directory behavior controlled by the
commits at squeakvm.org
commits at squeakvm.org
Sun Jul 31 17:12:40 UTC 2011
Author: eliot
Date: 2011-07-31 10:12:40 -0700 (Sun, 31 Jul 2011)
New Revision: 2482
Modified:
branches/Cog/nscogbuild/macbuild/CoreVM.plist
branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk
branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c
branches/Cog/platforms/Mac OS/vm/sqMacMain.c
Log:
Make the primVmPath answers Resources directory behavior controlled by the
<key>SqueakVMPathAnswersResources</key>
preference in the Info.plist file instead of being hard-coded bi #if NewspeakVM.
Fix make clean in the installer to remove any and all .dmg files.
Modified: branches/Cog/nscogbuild/macbuild/CoreVM.plist
===================================================================
--- branches/Cog/nscogbuild/macbuild/CoreVM.plist 2011-07-30 20:48:09 UTC (rev 2481)
+++ branches/Cog/nscogbuild/macbuild/CoreVM.plist 2011-07-31 17:12:40 UTC (rev 2482)
@@ -227,5 +227,7 @@
<true/>
<key>SqueakWindowType</key>
<integer>6</integer>
+ <key>SqueakVMPathAnswersResources</key>
+ <true/>
</dict>
</plist>
Modified: branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk
===================================================================
--- branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk 2011-07-30 20:48:09 UTC (rev 2481)
+++ branches/Cog/nscogbuild/macbuild/installer/installer-Darwin.gmk 2011-07-31 17:12:40 UTC (rev 2482)
@@ -22,4 +22,4 @@
sed $(SED_RULES) < $< > $@
clean::
- -rm -rf $(VM_DMG) $(VM_DMG).sparseimage LayoutDiskImage.applescript *.app
+ -rm -rf *.dmg *.sparseimage LayoutDiskImage.applescript *.app
Modified: branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c 2011-07-30 20:48:09 UTC (rev 2481)
+++ branches/Cog/platforms/Mac OS/vm/sqMacImageIO.c 2011-07-31 17:12:40 UTC (rev 2482)
@@ -24,9 +24,11 @@
/* On Newspeak we want to answer the Resources directory for vmPathGetLength/
* primitiveVMPath/primVMPath since this allows us to put the sources file
- * in the Resources directory.
+ * in the Resources directory. Controlled by the SqueakVMPathAnswersResources
+ * boolean in the Info.plist file.
*/
-#if NewspeakVM
+extern Boolean gSqueakVMPathAnswersResources;
+
static void
getVMResourcesDirectory(char *path)
{
@@ -35,18 +37,16 @@
ux2sqPath(argVec[0], strlen(argVec[0]), path, VMPATH_SIZE,1);
strcpy(strstr(path,"MacOS/"),"Resources/");
}
-#endif /* NewspeakVM */
/*** VM Home Directory Path ***/
int vmPathSize(void) {
char path[VMPATH_SIZE + 1];
-#if NewspeakVM
- getVMResourcesDirectory(path);
-#else
- getVMPathWithEncoding(path,gCurrentVMEncoding);
-#endif
+ if (gSqueakVMPathAnswersResources)
+ getVMResourcesDirectory(path);
+ else
+ getVMPathWithEncoding(path,gCurrentVMEncoding);
return strlen(path);
}
@@ -55,11 +55,10 @@
int count, i;
char path[VMPATH_SIZE + 1];
-#if NewspeakVM
- getVMResourcesDirectory(path);
-#else
- getVMPathWithEncoding(path,gCurrentVMEncoding);
-#endif
+ if (gSqueakVMPathAnswersResources)
+ getVMResourcesDirectory(path);
+ else
+ getVMPathWithEncoding(path,gCurrentVMEncoding);
count = strlen(path);
count = (length < count) ? length : count;
Modified: branches/Cog/platforms/Mac OS/vm/sqMacMain.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacMain.c 2011-07-30 20:48:09 UTC (rev 2481)
+++ branches/Cog/platforms/Mac OS/vm/sqMacMain.c 2011-07-31 17:12:40 UTC (rev 2482)
@@ -113,20 +113,31 @@
extern pthread_cond_t gSleepLockCondition;
OSErr gSqueakFileLastError;
-Boolean gSqueakWindowIsFloating,gSqueakWindowHasTitle=true,gSqueakFloatingWindowGetsFocus=false,gSqueakUIFlushUseHighPercisionClock=false,gSqueakPluginsBuiltInOrLocalOnly=false,gSqueakHeadless=false,gSqueakQuitOnQuitAppleEvent=false,gSqueakExplicitWindowOpenNeeded=false;
-Boolean gSqueakHasQuitWithoutSaving = true;
+Boolean gSqueakWindowIsFloating,gSqueakWindowHasTitle=true,
+ gSqueakHasQuitWithoutSaving = true,
+ gSqueakFloatingWindowGetsFocus=false,
+ gSqueakUIFlushUseHighPercisionClock=false,
+ gSqueakPluginsBuiltInOrLocalOnly=false,
+ gSqueakHeadless=false,
+ gSqueakQuitOnQuitAppleEvent=false,
+ gSqueakExplicitWindowOpenNeeded=false,
+ gSqueakVMPathAnswersResources=false;
long gSqueakMouseMappings[4][4] = {{0},{0}};
long gSqueakBrowserMouseMappings[4][4] = {{0},{0}};
usqInt gMaxHeapSize=512*1024*1024;
UInt32 gSqueakWindowType=zoomDocProc,gSqueakWindowAttributes=0;
-long gSqueakUIFlushPrimaryDeferNMilliseconds=20,gSqueakUIFlushSecondaryCleanupDelayMilliseconds=20,gSqueakUIFlushSecondaryCheckForPossibleNeedEveryNMilliseconds=16,gSqueakDebug=0;
+long gSqueakUIFlushPrimaryDeferNMilliseconds=20,
+ gSqueakUIFlushSecondaryCleanupDelayMilliseconds=20,
+ gSqueakUIFlushSecondaryCheckForPossibleNeedEveryNMilliseconds=16,
+ gSqueakDebug=0;
char gSqueakImageName[PATH_MAX] = "Squeak.image";
char gSqueakUntrustedDirectoryName[PATH_MAX] = "/foobar/tooBar/forSqueak/bogus/";
char gSqueakTrustedDirectoryName[PATH_MAX] = "/foobar/tooBar/forSqueak/bogus/";
CFStringRef gSqueakImageNameStringRef;
int gSqueakBrowserPipes[]= {-1, -1};
-Boolean gSqueakBrowserSubProcess = false,gSqueakBrowserWasHeadlessButMadeFullScreen=false;
-Boolean gSqueakBrowserExitRequested = false;
+Boolean gSqueakBrowserSubProcess = false,
+ gSqueakBrowserWasHeadlessButMadeFullScreen=false,
+ gSqueakBrowserExitRequested = false;
void cocoInterfaceForTilda(CFStringRef aStringRef, char *buffer,int max_size);
/*** Main ***/
@@ -672,13 +683,26 @@
fetchPrefrences() {
CFBundleRef myBundle;
CFDictionaryRef myDictionary;
- CFNumberRef SqueakWindowType,SqueakMaxHeapSizeType,SqueakUIFlushPrimaryDeferNMilliseconds,SqueakUIFlushSecondaryCleanupDelayMilliseconds,SqueakUIFlushSecondaryCheckForPossibleNeedEveryNMilliseconds,SqueakDebug;
- CFBooleanRef SqueakWindowHasTitleType,SqueakFloatingWindowGetsFocusType,SqueakUIFlushUseHighPercisionClock,SqueakPluginsBuiltInOrLocalOnly,SqueakQuitOnQuitAppleEvent,SqueakExplicitWindowOpenNeeded;
+ CFNumberRef SqueakWindowType,
+ SqueakMaxHeapSizeType,
+ SqueakUIFlushPrimaryDeferNMilliseconds,
+ SqueakUIFlushSecondaryCleanupDelayMilliseconds,
+ SqueakUIFlushSecondaryCheckForPossibleNeedEveryNMilliseconds,
+ SqueakDebug;
+ CFBooleanRef SqueakWindowHasTitleType,
+ SqueakFloatingWindowGetsFocusType,
+ SqueakUIFlushUseHighPercisionClock,
+ SqueakPluginsBuiltInOrLocalOnly,
+ SqueakQuitOnQuitAppleEvent,
+ SqueakExplicitWindowOpenNeeded,
+ SqueakVMPathAnswersResources;
CFBooleanRef SqueakHasQuitWithoutSaving;
CFNumberRef SqueakMouseMappings[4][4] = {{0},{0}};
CFNumberRef SqueakBrowserMouseMappings[4][4] = {{0},{0}};
CFDataRef SqueakWindowAttributeType;
- CFStringRef SqueakVMEncodingType, SqueakUnTrustedDirectoryTypeRef, SqueakTrustedDirectoryTypeRef;
+ CFStringRef SqueakVMEncodingType,
+ SqueakUnTrustedDirectoryTypeRef,
+ SqueakTrustedDirectoryTypeRef;
char encoding[256];
long i,j;
@@ -692,6 +716,7 @@
SqueakWindowAttributeType = CFDictionaryGetValue(myDictionary, CFSTR("SqueakWindowAttribute"));
SqueakWindowHasTitleType = CFDictionaryGetValue(myDictionary, CFSTR("SqueakWindowHasTitle"));
SqueakFloatingWindowGetsFocusType = CFDictionaryGetValue(myDictionary, CFSTR("SqueakFloatingWindowGetsFocus"));
+ SqueakVMPathAnswersResources = CFDictionaryGetValue(myDictionary, CFSTR("SqueakVMPathAnswersResources"));
SqueakMaxHeapSizeType = CFDictionaryGetValue(myDictionary, CFSTR("SqueakMaxHeapSize"));
SqueakVMEncodingType = CFDictionaryGetValue(myDictionary, CFSTR("SqueakEncodingType"));
SqueakUnTrustedDirectoryTypeRef = CFDictionaryGetValue(myDictionary, CFSTR("SqueakUnTrustedDirectory"));
@@ -803,6 +828,11 @@
else
gSqueakFloatingWindowGetsFocus = false;
+ if (SqueakVMPathAnswersResources)
+ gSqueakVMPathAnswersResources = CFBooleanGetValue(SqueakVMPathAnswersResources);
+ else
+ gSqueakVMPathAnswersResources = false;
+
if (SqueakWindowHasTitleType)
gSqueakWindowHasTitle = CFBooleanGetValue(SqueakWindowHasTitleType);
else
More information about the Vm-dev
mailing list