|
From: Brenda L. <asp...@us...> - 2003-05-13 22:42:33
|
Update of /cvsroot/squeak/squeak/platforms/unix/vm-display-Quartz
In directory sc8-pr-cvs1:/tmp/cvs-serv27896
Added Files:
CPS.h Info.plist.in Makefile.in Makefile.inc PkgInfo Squeak.h
Squeak.m SqueakView.h SqueakView.m SqueakWindow.h
SqueakWindow.m acinclude.m4 mkinfo sqUnixQuartz.m
sqUnixQuartzGL.h
Log Message:
Ian Piumarta's release 3.5-1devel
--- NEW FILE: CPS.h ---
// CPS.h -- generously provided by Bob Ippolito (bo...@re...)
#pragma once
#include <Carbon/Carbon.h>
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
};
typedef struct CPSProcessSerNum CPSProcessSerNum;
enum
{
kCPSNoProcess = 0,
kCPSSystemProcess = 1,
kCPSCurrentProcess = 2
};
enum
{
bfCPSIntraProcessSwitch = 1,
bfCPSDeathBySignal = 2
};
typedef UInt16 CPSEventFlags;
enum
{
kCPSBlueApp = 0,
kCPSBlueBox = 1,
kCPSCarbonApp = 2,
kCPSYellowApp = 3,
kCPSUnknownApp = 4
};
typedef UInt32 CPSAppFlavour;
enum
{
kCPSBGOnlyAttr = 1024,
kCPSUIElementAttr = 65536,
kCPSHiddenAttr = 131072,
kCPSNoConnectAttr = 262144,
kCPSFullScreenAttr = 524288,
kCPSClassicReqAttr = 1048576,
kCPSNativeReqAttr = 2097152
};
typedef UInt32 CPSProcAttributes;
struct CPSProcessInfoRec
{
CPSProcessSerNum Parent;
UInt64 LaunchDate;
CPSAppFlavour Flavour;
CPSProcAttributes Attributes;
UInt32 ExecFileType;
UInt32 ExecFileCreator;
UInt32 UnixPID;
};
typedef struct CPSProcessInfoRec CPSProcessInfoRec;
enum
{
kCPSNotifyChildDeath = 1,
kCPSNotifyNewFront = 2,
kCPSNotifyAppBirth = 4,
kCPSNotifyAppDeath = 8,
kCPSNotifyLaunch = 9,
kCPSNotifyServiceReq = 16,
kCPSNotifyAppHidden = 32,
kCPSNotifyAppRevealed = 64,
kCPSNotifyFGEnabled = 128,
kCPSNotifyLaunchStart = 256,
kCPSNotifyAppReady = 512,
kCPSNotifyLaunchFail = 1024,
kCPSNotifyAppDeathExt = 2048,
kCPSNotifyLostKeyFocus = 4096
};
typedef UInt32 CPSNotificationCodes;
enum
{
bfCPSLaunchInhibitDaemon = 128,
bfCPSLaunchDontSwitch = 512,
bfCPSLaunchNoProcAttr = 2048,
bfCPSLaunchAsync = 65536,
bfCPSLaunchStartClassic = 131072,
bfCPSLaunchInClassic = 262144,
bfCPSLaunchInstance = 524288,
bfCPSLaunchAndHide = 1048576,
bfCPSLaunchAndHideOthers = 2097152
};
typedef UInt32 CPSLaunchOptions;
typedef UInt8 *CPSLaunchRefcon;
typedef UInt8 *CPSLaunchData;
enum
{
bfCPSExtLaunchWithData = 2,
bfCPSExtLaunchByParent = 4,
bfCPSExtLaunchAsUidGid = 8
};
typedef UInt32 CPSLaunchPBFields;
struct CPSLaunchPB
{
CPSLaunchPBFields Contents;
CPSLaunchData pData;
UInt32 DataLen;
UInt32 DataTag;
UInt32 RefCon;
CPSProcessSerNum Parent;
UInt32 ChildUID;
UInt32 ChildGID;
};
typedef struct CPSLaunchPB CPSLaunchPB;
enum
{
bfCPSKillHard = 1,
bfCPSKillAllClassicApps = 2
};
typedef UInt32 CPSKillOptions;
enum
{
kCPSLaunchService = 0,
kCPSKillService = 1,
kCPSHideService = 2,
kCPSShowService = 3,
kCPSPrivService = 4,
kCPSExtDeathNoteService = 5
};
typedef UInt32 CPSServiceReqType;
struct CPSLaunchRequest
{
CPSProcessSerNum TargetPSN;
CPSLaunchOptions Options;
CPSProcAttributes ProcAttributes;
UInt8 *pUTF8TargetPath;
UInt32 PathLen;
};
typedef struct CPSLaunchRequest CPSLaunchRequest;
struct CPSKillRequest
{
CPSProcessSerNum TargetPSN;
CPSKillOptions Options;
};
typedef struct CPSKillRequest CPSKillRequest;
struct CPSHideRequest
{
CPSProcessSerNum TargetPSN;
};
typedef struct CPSHideRequest CPSHideRequest;
struct CPSShowRequest
{
CPSProcessSerNum TargetPSN;
};
typedef struct CPSShowRequest CPSShowRequest;
struct CPSExtDeathNotice
{
CPSProcessSerNum DeadPSN;
UInt32 Flags;
UInt8 *pUTF8AppPath;
UInt32 PathLen;
};
typedef struct CPSExtDeathNotice CPSExtDeathNotice;
union CPSRequestDetails
{
CPSLaunchRequest LaunchReq;
CPSKillRequest KillReq;
CPSHideRequest HideReq;
CPSShowRequest ShowReq;
CPSExtDeathNotice DeathNotice;
};
typedef union CPSRequestDetails CPSRequestDetails;
struct CPSServiceRequest
{
CPSServiceReqType Type;
SInt32 ID;
CPSRequestDetails Details;
};
typedef struct CPSServiceRequest CPSServiceRequest;
enum
{
kCPSProcessInterruptKey = 0,
kCPSAppSwitchFwdKey = 1,
kCPSAppSwitchBackKey = 2,
kCPSSessionInterruptKey = 3,
kCPSScreenSaverKey = 4,
kCPSDiskEjectKey = 5,
kCPSSpecialKeyCount = 6
};
typedef SInt32 CPSSpecialKeyID;
extern Boolean CPSEqualProcess( CPSProcessSerNum *psn1, CPSProcessSerNum *psn2);
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSGetFrontProcess( CPSProcessSerNum *psn);
extern OSErr CPSGetNextProcess( CPSProcessSerNum *psn);
extern OSErr CPSGetNextToFrontProcess( CPSProcessSerNum *psn);
extern OSErr CPSGetProcessInfo( CPSProcessSerNum *psn, CPSProcessInfoRec *info, char *path, int maxPathLen, int *len, char *name, int maxNameLen);
extern OSErr CPSPostHideMostReq( CPSProcessSerNum *psn);
extern OSErr CPSPostHideReq( CPSProcessSerNum *psn);
extern OSErr CPSPostKillRequest( CPSProcessSerNum *psn, CPSKillOptions options);
extern OSErr CPSPostShowAllReq( CPSProcessSerNum *psn);
extern OSErr CPSPostShowReq( CPSProcessSerNum *psn);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
extern OSErr CPSReleaseKeyFocus( CPSProcessSerNum *psn);
extern OSErr CPSStealKeyFocus( CPSProcessSerNum *psn);
extern OSErr CPSSetProcessName ( CPSProcessSerNum *psn, char *processname);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef __cplusplus
}
#endif
--- NEW FILE: Info.plist.in ---
<!-- Info.plist -- bundle info file for Unix Squeak on Mac OS X -*- html -*- -->
<!-- (based on John McIntosh's Info.plist for Carbonised MacSqueak) -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC
"-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key> <string>English</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleExecutable</key> <string>squeak</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleSignature</key> <string>FAST</string>
<key>CFBundleName</key> <string>Squeak</string>
<key>CFBundleVersion</key> <string>@BNDL_VERSION@</string>
<key>CFBundleShortVersionString</key> <string>Squeak @BNDL_VERSION@</string>
<key>CFBundleGetInfoString</key> <string>Squeak @BNDL_VERSION@ http://www.squeak.org </string>
<key>CFBundleIdentifier</key> <string>org.squeak.Squeak</string>
<key>CFBundleIconFile</key> <string>Squeak.icns</string>
<key>CFBundleHelpBookFolder</key> <string>SqueakHelp</string>
<key>CFBundleHelpBookName</key> <string>Squeak Help</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key> <array><string>image</string></array>
<key>CFBundleTypeIconFile</key> <string>SqueakImage.icns</string>
<key>CFBundleTypeName</key> <string>Squeak Image File</string>
<key>CFBundleTypeOSTypes</key> <array><string>STim</string></array>
<key>CFBundleTypeRole</key> <string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key> <array><string>changes</string></array>
<key>CFBundleTypeIconFile</key> <string>SqueakChanges.icns</string>
<key>CFBundleTypeName</key> <string>Squeak Changes File</string>
<key>CFBundleTypeOSTypes</key> <array><string>STch</string></array>
<key>CFBundleTypeRole</key> <string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key> <array><string>sobj</string></array>
<key>CFBundleTypeIconFile</key> <string>SqueakScript.icns</string>
<key>CFBundleTypeName</key> <string>Squeak Script File</string>
<key>CFBundleTypeOSTypes</key> <array><string>SOBJ</string></array>
<key>CFBundleTypeRole</key> <string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key> <array><string>bundle</string></array>
<key>CFBundleTypeIconFile</key> <string>SqueakPlugin.icns</string>
<key>CFBundleTypeName</key> <string>Squeak Plugin</string>
<key>CFBundleTypeOSTypes</key> <array><string>BNDL</string></array>
<key>CFBundleTypeRole</key> <string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>JPEG</string>
<key>CFBundleTypeOSTypes</key> <array><string>JPEG</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>TEXT</string>
<key>CFBundleTypeOSTypes</key> <array><string>TEXT</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>ttro</string>
<key>CFBundleTypeOSTypes</key> <array><string>ttro</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string></dict>
<dict>
<key>CFBundleTypeName</key> <string>HTML</string>
<key>CFBundleTypeOSTypes</key> <array><string>HTML</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string></dict>
<dict>
<key>CFBundleTypeName</key> <string>RTF</string>
<key>CFBundleTypeOSTypes</key> <array><string>RTF</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string></dict>
<dict>
<key>CFBundleTypeName</key> <string>TIFF</string>
<key>CFBundleTypeOSTypes</key> <array><string>TIFF</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>PICT</string>
<key>CFBundleTypeOSTypes</key> <array><string>PICT</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>URL </string>
<key>CFBundleTypeOSTypes</key> <array><string>URL</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>ZIP </string>
<key>CFBundleTypeOSTypes</key> <array><string>ZIP</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>zip </string>
<key>CFBundleTypeOSTypes</key> <array><string>zip</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>BINA</string>
<key>CFBundleTypeOSTypes</key> <array><string>BINA</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>GIFf</string>
<key>CFBundleTypeOSTypes</key> <array><string>GIFf</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>PNGf</string>
<key>CFBundleTypeOSTypes</key> <array><string>PNGf</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MP3 </string>
<key>CFBundleTypeOSTypes</key> <array><string>MP3</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MP3!</string>
<key>CFBundleTypeOSTypes</key> <array><string>MP3!</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MP3U</string>
<key>CFBundleTypeOSTypes</key> <array><string>MP3U</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MPEG</string>
<key>CFBundleTypeOSTypes</key> <array><string>MPEG</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>mp3!</string>
<key>CFBundleTypeOSTypes</key> <array><string>mp3!</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MPG2</string>
<key>CFBundleTypeOSTypes</key> <array><string>MPG2</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MPG3</string>
<key>CFBundleTypeOSTypes</key> <array><string>MPG3</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>MPG </string>
<key>CFBundleTypeOSTypes</key> <array><string>MPG</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>Mp3</string>
<key>CFBundleTypeOSTypes</key> <array><string>mp3</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>M3U</string>
<key>CFBundleTypeOSTypes</key> <array><string>M3U</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>SRCS</string>
<key>CFBundleTypeOSTypes</key> <array><string>SRCS</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>Chng</string>
<key>CFBundleTypeOSTypes</key> <array><string>Chng</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeName</key> <string>HPS5</string>
<key>CFBundleTypeOSTypes</key> <array><string>HPS5</string></array>
<key>CFBundleTypeRole</key> <string>Viewer</string>
</dict>
</array>
</dict>
</plist>
--- NEW FILE: Makefile.in ---
# Makefile for Quartz Window System support -*- makefile -*-
#
# Copyright (C) 1996-2002 Ian Piumarta and other authors/contributors
# as listed elsewhere in this file.
# All rights reserved.
#
# You are NOT ALLOWED to distribute modified versions of this file
# under its original name. If you want to modify it and then make
# your modifications available publicly, rename the file first.
#
# This file is part of Unix Squeak.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# You may use and/or distribute this file ONLY as part of Squeak, under
# the terms of the Squeak License as described in `LICENSE' in the base of
# this distribution, subject to the following additional restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software. If you use this software
# in a product, an acknowledgment to the original author(s) (and any
# other contributors mentioned herein) in the product documentation
# would be appreciated but is not required.
#
# 2. You must not distribute (or make publicly available by any
# means) a modified copy of this file unless you first rename it.
#
# 3. This notice must not be removed or altered in any source distribution.
#
# Using (or modifying this file for use) in any context other than Squeak
# changes these copyright conditions. Read the file `COPYING' in the
# directory `platforms/unix/doc' before proceeding with any such use.
#
# Author: ian...@in...
#
# Last edited: 2003-02-23 18:09:56 by piumarta on emilia.inria.fr
[make_cfg]
[make_plg]
TARGET= vm-display-Quartz$a
OBJS= sqUnixQuartz$o
XINCLUDES= [includes] \
-I$(topdir)/platforms/Cross/plugins/B3DAcceleratorPlugin \
-I$(topdir)/platforms/unix/plugins/B3DAcceleratorPlugin
#XCFLAGS= -framework Cocoa -framework OpenGL
PLIBS= -Wl,-framework -Wl,Cocoa \
-Wl,-framework -Wl,OpenGL
$(TARGET) : $(OBJS) Makefile
$(LINK) $(TARGET) $(OBJS) $(PLIBS)
$(RANLIB) $(TARGET)
[make_targets]
DEPS= $(OBJS:$o=.d)
include $(DEPS)
%.d : $(topdir)/platforms/unix/vm-display-Quartz/%.m
$(SHELL) -ec '$(CC) -MM $(CFLAGS) $(INCLUDES) $(XINCLUDES) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
%.d : $(topdir)/platforms/unix/vm-display-Quartz/%.c
$(SHELL) -ec '$(CC) -MM $(CFLAGS) $(INCLUDES) $(XINCLUDES) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
.force :
--- NEW FILE: Makefile.inc ---
XCPPFLAGS= -I$(topdir)/platforms/Cross/plugins/B3DAcceleratorPlugin \
-I$(topdir)/platforms/unix/plugins/B3DAcceleratorPlugin \
-framework Cocoa -framework OpenGL
PLIBS= -Wl,-framework -Wl,Cocoa \
-Wl,-framework -Wl,OpenGL
--- NEW FILE: PkgInfo ---
APPLFAST
--- NEW FILE: Squeak.h ---
// -*- ObjC -*-
@interface Squeak : NSApplication
- (void) applicationDidFinishLaunching: (NSNotification *)note;
- (void) applicationDidChangeScreenParameters: (NSNotification *)note;
- (void) unhideAllApplications: (id)sender;
- (BOOL) windowShouldClose: (id)sender;
- (void) maybeTerminate: (id)sender;
- (void) terminate: (id)sender;
- (void) performEnableKeys: (id)sender;
- (void) performDisableKeys: (id)sender;
@end
--- NEW FILE: Squeak.m ---
#import <Cocoa/Cocoa.h>
@implementation Squeak
+ (void) initialize
{
NSMutableDictionary *dict;
NSUserDefaults *defaults;
defaults= [NSUserDefaults standardUserDefaults];
dict= [NSMutableDictionary dictionary];
[dict setObject: @"YES" forKey: @"AppleDockIconEnabled"];
[defaults registerDefaults: dict];
}
static char *documentName= 0;
-(BOOL) application: (NSApplication *) theApplication
openFile: (NSString *) filename
{
if (fromFinder)
documentName= strdup([filename cString]);
return YES;
}
-(void) applicationDidFinishLaunching: (NSNotification *)note
{
int fds[2];
// this saves an awful lot of tedious mutex contention (and besides
// is essentially free, since there's no way to avoid writing a
// socket to inform aio of the availability of the event)
#if 0
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) != 0)
{
perror("socketpair");
exit(1);
}
osXfd= fds[0];
stXfd= fds[1];
#else
if (pipe(fds))
{
perror("pipe");
exit(1);
}
stXfd= fds[0];
osXfd= fds[1];
#endif
aioEnable(stXfd, 0, 0);
aioHandle(stXfd, evtHandler, AIO_RX);
#if (!USE_SPINLOCK)
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
# ifndef NDEBUG
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
# endif
if (pthread_mutex_init(&displayMx, &attr))
{
perror("pthread_mutex_init");
exit(1);
}
pthread_mutexattr_destroy(&attr);
}
#endif
if (fromFinder)
{
char *ptr= 0;
strncpy(resourcePath, argVec[0], sizeof(resourcePath)); // .app/Contents/MacOS/squeak
if ((ptr= strrchr(resourcePath, '/')))
{
*ptr= '\0'; // .app/Contents/MacOS
if ((ptr= strrchr(resourcePath, '/')))
{
*ptr= '\0'; // .app/Contents
strcpy(ptr, "/Resources/"); // .app/Contents/Resources/
}
else
resourcePath[0]= '\0';
}
else
resourcePath[0]= '\0';
}
imgInit();
// vmPath has been set to the realpath() of the VM, which might be
// bogus (since the more cultivated OS X user will make it a symlink
// to /usr/local/bin/squeak). put it back where it should be. note
// that we would also like to pick up the sources file from
// resourcePath/SqueakV*.sources, but I guess the stupid image is
// going to look for it in the vmPath. ho hum.
{
char *ptr;
assert(strlen(argVec[0]) < MAXPATHLEN);
strcpy(vmPath, argVec[0]);
if ((ptr= strrchr(vmPath, '/')))
ptr[1]= '\0';
}
setUpDisplay();
printf("fullScreenFlag %d\n", getFullScreenFlag());
setUpWindow(fullscreen= getFullScreenFlag());
[NSThread
detachNewThreadSelector: @selector(interpret:)
toTarget: self
withObject: nil];
}
- (void) interpret: (id)context
{
[[NSAutoreleasePool alloc] init]; // running in new thread
interpret();
(void)recordMouseEvent;
(void)recordKeyboardEvent;
(void)recordDragEvent;
}
- (void) applicationDidChangeScreenParameters: (NSNotification *)note
{
//xxx this one might be tricky in the absence of appWillChangeScreenParams:
fprintf(stderr, "\nDISPLAY PARAMETERS CHANGED\n\n");
// lock(display);
pixWidth= pixHeight= pixDepth= 0;
setUpDisplay();
//setUpWindow(getFullScreenFlag());
updatePix();
// unlock(display);
//setUpMenus();
fullDisplayUpdate();
}
- (void) unhideAllApplications: (id)sender
{
[super unhideAllApplications: sender];
[win orderFront: self]; // so that unhinding once more will reveal the Sq window
}
- (BOOL) windowShouldClose: (id)sender
{
return NO;
}
- (void) terminate: (id)sender
{
[super terminate: sender];
exit(0);
}
- (void) maybeTerminate: (id)sender
{
switch (NSRunAlertPanel(@"Really quit?",
@"All changes since your last save will be lost.\n\nIf you want to save your changes, press `Cancel' and then choose `save and quit' from the background menu in the Squeak window.",
@"Quit",
@"Cancel",
nil))
{
case NSAlertDefaultReturn: [self terminate: self];
}
}
- (void) performAbout: (id)sender
{
extern char *getVersionInfo(int verbose);
char *info= getVersionInfo(1);
NSPanel *panel= NSGetInformationalAlertPanel(@"About Squeak",
@"%s",
@"Dismiss",
nil,
nil,
info);
NSRect frame= [panel frame];
frame.size.width *= 1.5;
[panel setFrame: frame display: NO];
[NSApp runModalForWindow: panel];
[panel close];
free(info);
}
//xxx why does rebuilding the menu lose boldface on the Apple menu item???
- (void) performEnableKeys: (id)sender { cmdKeys= 1; setUpMenus(); }
- (void) performDisableKeys: (id)sender { cmdKeys= 0; setUpMenus(); }
- (void) windowWillMove: (NSNotification *)note
{
//xxx FIXME SOON: there are other ways to enter this (and ways other than
// noteEvent to escape from it)
inModalLoop= 1;
}
- (NSSize) windowWillResize: (NSWindow *)sender toSize: (NSSize)size
{
return glActive ? [sender frame].size : size;
}
- (void) windowDidResize: (NSNotification *)note
{
reframeRenderers();
}
-(void) sendEvent: (NSEvent *)event
{
int type= [event type];
NSPoint loc= [event locationInWindow];
NSWindow *evtWin= [event window];
#if 0
NSPoint loc= (fullscreen
? [NSEvent mouseLocation] //xxx should use deltas
: [event locationInWindow]);
#endif
if (evtWin && ((NSWindow *)win != [event window]))
{
[super sendEvent: event];
return;
}
switch (type)
{
# define down buttonState |= qz2sqButton([event buttonNumber])
# define move
# define up buttonState &= ~qz2sqButton([event buttonNumber])
# define recordEvent(delta) \
if (fullscreen || NSPointInRect(loc, [view frame])) \
{ \
noteMousePoint(loc); \
delta; \
modifierState= qz2sqModifiers([event modifierFlags]); \
noteMouseEvent(); \
} \
else \
[super sendEvent: event] // don't track outside window
case NSLeftMouseDown: case NSOtherMouseDown: case NSRightMouseDown:
if ((!active) || NSPointInRect(loc, resizeRect))
[super sendEvent: event]; // first click, or start resize
else
recordEvent(down);
break;
case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged:
if (!(buttonState & qz2sqButton([event buttonNumber])))
{
[super sendEvent: event]; // already tracking window move
break;
}
// fall through...
case NSMouseMoved:
recordEvent(move);
break;
case NSLeftMouseUp: case NSOtherMouseUp: case NSRightMouseUp:
recordEvent(up);
break;
# undef recordEvent
# undef down
# undef move
# undef up
case NSKeyDown:
{
int keyCode;
modifierState= qz2sqModifiers([event modifierFlags]);
keyCode= [view composeKeyDown: event]; //qz2sqKey(event);
if (keyCode >= 0)
{
if (cmdKeys)
{
if ((modifierState == CommandKeyBit) || (modifierState == CommandKeyBit + ShiftKeyBit))
switch (keyCode)
{
case '?': [NSApp showHelp: self]; keyCode= -1; break;
case 'h': [NSApp hide: self]; keyCode= -1; break;
case 'k': [NSApp performDisableKeys: self]; keyCode= -1; break;
case 'm': [win performMiniaturize: self]; keyCode= -1; break;
case 'q': [NSApp maybeTerminate: self]; keyCode= -1; break;
}
else if (modifierState == CommandKeyBit + OptionKeyBit)
switch (keyCode)
{
case 'h': [NSApp hideOtherApplications: self]; keyCode= -1; break;
}
}
if (keyCode >= 0)
{
if (![event isARepeat])
noteKeyboardEvent(keyCode, EventKeyDown, modifierState);
noteKeyboardEvent(keyCode, EventKeyChar, modifierState);
recordKeystroke(keyCode); /* DEPRECATED */
}
else // key up not interesting
[view composeKeyUp: event];
}
}
break;
case NSKeyUp:
{
int keyCode;
modifierState= qz2sqModifiers([event modifierFlags]);
keyCode= [view composeKeyUp: event]; //qz2sqKey(event);
if (keyCode >= 0)
{
noteKeyboardEvent(keyCode, EventKeyUp, modifierState);
//accentMap= 0;
}
}
break;
case NSScrollWheel:
{
int keyCode= ([event deltaY] >= 0.0) ? 30 : 31;
noteKeyboardEvent(keyCode, EventKeyDown, modifierState);
noteKeyboardEvent(keyCode, EventKeyChar, modifierState);
noteKeyboardEvent(keyCode, EventKeyUp, modifierState);
}
break;
case NSAppKitDefined:
switch ([event subtype])
{
case NSApplicationActivatedEventType:
active= 1;
break;
case NSApplicationDeactivatedEventType:
active= 0;
break;
// case NSScreenChangedEventType: //xxx this means the window
// changed to a different physical screen, which is useless
// info (we'd far rather be informed that the current screen's
// depth has changed)
}
//dprintf(("AppKitDefinedEvent subtype %d\n", [event subtype]));
[super sendEvent: event];
break;
// case NSFlagsChanged:
// case NSApplicationDefined: break;
// case NSPeriodic: break;
// case NSCursorUpdate: break;
default: // almost always NSSystemDefined
//dprintf(("Event type %d subtype %d\n", [event type], [event subtype]));
[super sendEvent: event];
}
}
@end // Squeak
--- NEW FILE: SqueakView.h ---
// -*- ObjC -*-
// Why QDView? Well...
//
// 1) we can trivially obtain a raw pointer to its backing store, so
// 2) no need to putz around with the lockFocus/DataProvider/ImageRep crap; plus
// 3) its buffer's coordinate system is already the right way up for Squeak, so
// 4) we avoid potential recopy (just to have CG recopy again); besides
// 5) QDFlushBuffer is _blindingly_ fast (even compared to drawing directly on
// the framebuffer [go measure it if you don't believe me]); but most importantly
// 6) the QD API is completely free of ObjC and attendant inefficiencies.
@interface SqueakView : NSQuickDrawView <NSTextInput>
- (BOOL) acceptsFirstResponder;
- (BOOL) becomeFirstResponder;
- (BOOL) isOpaque;
- (BOOL) isFlipped;
- (id) initWithFrame: (NSRect)frame;
- (void) setFrame: (NSRect)rect;
- (void) drawRect: (NSRect)rect;
- (void) viewWillStartLiveResize;
- (void) viewDidEndLiveResize;
- (int) draggingEntered: (id<NSDraggingInfo>)sender;
- (int) draggingUpdated: (id<NSDraggingInfo>)sender;
- (void) draggingExited: (id<NSDraggingInfo>)sender;
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender;
- (int) composeKeyDown: (NSEvent *)event;
- (int) composeKeyUp: (NSEvent *)event;
@end
--- NEW FILE: SqueakView.m ---
@implementation SqueakView
- (BOOL) isOpaque { return YES; }
- (BOOL) isFlipped { return YES; }
- (BOOL) acceptsFirstResponder { return YES; }
- (BOOL) becomeFirstResponder { return YES; }
- (BOOL) resignFirstResponder { return NO; }
- (void) renewGState
{
printf("\nRENEW GSTATE\n\n");
[super renewGState];
}
static NSRange inputMark;
static NSRange inputSelection;
static int inputCharCode;
- (id) initWithFrame: (NSRect)frame
{
id result= [super initWithFrame: frame];
if (self == result)
[self registerForDraggedTypes:
[NSArray arrayWithObjects:
NSFilenamesPboardType, nil]];
inputCharCode= -1;
inputMark= NSMakeRange(NSNotFound, 0);
inputSelection= NSMakeRange(0, 0);
return result;
}
- (void) setFrame: (NSRect)rect
{
lock(display);
[super setFrame: rect];
if ([self inLiveResize])
{
# if (RESIZE_IN_TITLE)
display_winSetName(shortImageName);
# endif
}
else
if ([self qdPort])
updatePix();
unlock(display);
}
- (void) drawRect: (NSRect)rect // view already has focus
{
printf("drawRect:\n");
if ([self inLiveResize])
{
[[NSColor whiteColor] set];
NSRectFill(rect);
drawImage([[NSGraphicsContext currentContext] graphicsPort], 0);
}
else
{
if (!pixBase)
{
printf("drawRect: calling updatePix\n");
assert([self qdPort]);
updatePix();
}
fullDisplayUpdate();
}
}
- (void) viewWillStartLiveResize
{
captureImage(1);
[win setShowsResizeIndicator: YES];
#if (RESIZE_IN_TITLE)
showExtent= 1;
display_winSetName(shortImageName);
#endif
pixWidth= 0;
pixHeight= 0;
}
- (void) viewDidEndLiveResize
{
releaseImage(1);
[win setShowsResizeIndicator: NO];
#if (RESIZE_IN_TITLE)
showExtent= 0;
display_winSetName(shortImageName);
#endif
updatePix();
fullDisplayUpdate(); // gets rid of the resize icon if window didn't resize
}
- (int) draggingEntered: (id<NSDraggingInfo>)info
{
if ((dragCount == 0) // cannot drag again until previous drag completes
&& ([info draggingSourceOperationMask] & NSDragOperationCopy))
{
int count= [[[info draggingPasteboard]
propertyListForType: NSFilenamesPboardType] count];
noteMousePoint([info draggingLocation]);
noteDragEvent(DragEnter, dragCount= count);
return NSDragOperationCopy;
}
return NSDragOperationNone;
}
- (int) draggingUpdated: (id<NSDraggingInfo>)info
{
noteMousePoint([info draggingLocation]);
noteDragEvent(DragMove, dragCount);
return NSDragOperationCopy;
}
- (void) draggingExited: (id<NSDraggingInfo>)info
{
noteMousePoint([info draggingLocation]);
noteDragEvent(DragLeave, dragCount);
dragCount= 0;
}
- (BOOL) performDragOperation: (id<NSDraggingInfo>)info
{
NSPasteboard *pboard= [info draggingPasteboard];
noteMousePoint([info draggingLocation]);
if ([[pboard types] containsObject: NSFilenamesPboardType])
{
NSArray *files= [pboard propertyListForType: NSFilenamesPboardType];
int i;
if (uxDropFileCount)
{
assert(uxDropFileNames);
for (i= 0; i < uxDropFileCount; ++i)
free(uxDropFileNames[i]);
free(uxDropFileNames);
uxDropFileNames= 0;
}
if (( (!(uxDropFileCount= [files count])))
|| (!(uxDropFileNames= (char **)malloc(uxDropFileCount * sizeof(char *)))))
{
uxDropFileCount= 0;
return NO;
}
for (i= 0; i < uxDropFileCount; ++i)
uxDropFileNames[i]= strdup([[files objectAtIndex: i] cString]);
}
noteDragEvent(DragDrop, uxDropFileCount);
dragCount= 0;
return YES; // under some duress, I might add (see sqUxDragDrop.c)
}
enum { KeyMapSize= 32 };
typedef struct
{
int keyCode;
int keyChar;
} KeyMapping;
static KeyMapping keyMap[KeyMapSize];
static int keyMapSize= 0;
static int inputCharCode= -1;
static int addToKeyMap(int keyCode, int keyChar)
{
if (keyMapSize > KeyMapSize) { fprintf(stderr, "keymap overflow\n"); return -1; }
keyMap[keyMapSize++]= (KeyMapping){ keyCode, keyChar };
return keyChar;
}
static int indexInKeyMap(int keyCode)
{
int i;
for (i= 0; i < keyMapSize; ++i)
if (keyMap[i].keyCode == keyCode)
return i;
return -1;
}
static int findInKeyMap(int keyCode)
{
int idx= indexInKeyMap(keyCode);
return (idx >= 0) ? keyMap[idx].keyChar : -1;
}
static int removeFromKeyMap(int keyCode)
{
int idx= indexInKeyMap(keyCode);
int keyChar= -1;
if (idx < 0) { fprintf(stderr, "keymap underflow\n"); return -1; }
keyChar= keyMap[idx].keyChar;
for (; idx < keyMapSize - 1; ++idx)
keyMap[idx]= keyMap[idx + 1];
--keyMapSize;
return keyChar;
}
// the following (to @end) must be installed in the first responder
- (int) composeKeyDown: (NSEvent *)event
{
int keyCode= [event keyCode];
inputCharCode= -1;
if (modifierState & CommandKeyBit)
inputCharCode= qz2sqKey(event);
else
{
if ([event isARepeat])
{
int keyChar= findInKeyMap(keyCode);
//printf("%d REP keyCode %x -> keyChar %x\n", keyMapSize, keyCode, keyChar);
return keyChar;
}
else
{
[self interpretKeyEvents: [NSArray arrayWithObject: event]];
if (inputCharCode < 0)
inputCharCode= qz2sqKey(event);
}
}
if (inputCharCode >= 0)
{
//printf("%d ADD keyCode %x -> keyChar %x\n", keyMapSize, keyCode, inputCharCode);
addToKeyMap(keyCode, inputCharCode);
}
return inputCharCode;
}
- (int) composeKeyUp: (NSEvent *)event
{
int keyCode= [event keyCode];
int keyChar= removeFromKeyMap(keyCode);
//printf("%d DEL keyCode %x -> charCode %x\n", keyMapSize, keyCode, keyChar);
return keyChar;
}
- (void) insertText: (NSString *)text
{
//printf("insertText\n");
inputMark= NSMakeRange(NSNotFound, 0);
inputSelection= NSMakeRange(0, 0);
if ([text length])
{
UInt8 buf[4];
CFIndex nUsed;
if (CFStringGetBytes((CFStringRef)text, CFRangeMake(0, CFStringGetLength((CFStringRef)text)),
kCFStringEncodingMacRoman, 0, FALSE,
buf, sizeof(buf), &nUsed))
inputCharCode= buf[0];
}
}
// ParagraphEditor's map looks like this:
//
// 0 noop cursorHome noop noop cursorEnd noop noop noop
// 8 backspace noop noop cursorPageUp cursorPageDown crWithIndent noop noop
// 16 noop noop noop noop noop noop noop noop
// 24 noop noop noop offerMenuFromEsc cursorLeft cursorRight cursorUp cursorDown
// 127 forwardDelete
- (void) doCommandBySelector: (SEL)aSelector
{
// why doesn't @selector() reduce to a constant??
# define encode(c, s) if (aSelector == @selector(s)) inputCharCode= c
// my (subjective) approximation of usage frequency...
encode( 8, deleteBackward:);
else encode( 13, insertNewline:);
else encode( 9, insertTab:);
else encode( 28, moveLeft:);
else encode( 29, moveRight:);
else encode( 30, moveUp:);
else encode( 31, moveDown:);
else encode( 11, pageUp:);
else encode( 12, pageDown:);
else encode( 1, moveToBeginningOfDocument:);
else encode( 4, moveToEndOfDocument:);
else encode(127, deleteForward:);
else encode( 27, _cancelKey:);
else
printf("doCommandBySelector: %s\n", sel_getName(aSelector));
# undef encode
}
- (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange
{
inputMark= NSMakeRange(0, 1);
inputSelection= NSMakeRange(NSNotFound, 0);
}
- (void) unmarkText { inputMark= NSMakeRange(NSNotFound, 0); }
- (BOOL) hasMarkedText { return inputMark.location != NSNotFound; }
- (long) conversationIdentifier { return (long)self; }
- (NSAttributedString *) attributedSubstringFromRange: (NSRange)theRange { return nil; }
- (NSRange) markedRange { return inputMark; }
- (NSRange) selectedRange { return inputSelection; }
- (NSRect) firstRectForCharacterRange: (NSRange)theRange { return NSMakeRect(0,0, 0,0); }
- (unsigned int) characterIndexForPoint: (NSPoint)thePoint { return 0; }
- (NSArray *) validAttributesForMarkedText { return nil; }
@end
--- NEW FILE: SqueakWindow.h ---
// -*- ObjC -*-
@interface SqueakWindow : NSWindow
{
NSImage *icon;
}
- (BOOL) isOpaque;
- (BOOL) canBecomeKeyWindow;
- (void) setIcon;
- (void) performMiniaturize: (id)sender;
- (void) miniaturize: (id)sender;
@end
--- NEW FILE: SqueakWindow.m ---
@implementation SqueakWindow
- (BOOL) isOpaque { return YES; }
- (BOOL) canBecomeKeyWindow { return YES; }
- (void) setIcon
{
/////////////xxxxxxxxxxxxxxxxxxxxxxxxxx REMOVE
icon= [[NSImage alloc] initWithContentsOfFile: @"transp.icns"];
if (icon)
[NSApp setApplicationIconImage: icon];
}
- (NSImage *) dockImage
{
NSBitmapImageRep *rep= [NSBitmapImageRep alloc];
if ([rep initWithFocusedViewRect: topRect])
{
NSImage *image= [[NSImage alloc] init];
[image addRepresentation: rep];
if (icon)
{
[image lockFocus];
[icon drawInRect: NSMakeRect(0, 0, [image size].width, [image size].height)
fromRect: NSMakeRect(0, 0, [icon size].width, [icon size].height)
operation: NSCompositeSourceOver
fraction: 1.0];
[image unlockFocus];
}
return image;
}
return nil;
}
- (void) performMiniaturize: (id)sender
{
if (!glActive)
[super performMiniaturize: sender];
}
- (void) miniaturize: (id)sender
{
NSImage *image= [self dockImage];
if (image)
[self setMiniwindowImage: image];
[image release];
[super miniaturize: sender];
}
@end
--- NEW FILE: acinclude.m4 ---
# -*- sh -*-
AC_ARG_WITH(quartz,
[ --without-quartz disable MacOSX Window System support [default=enabled]],
[have_quartz="$withval"],
[have_quartz="yes"])
case $host_os in
darwin*) ;;
*) have_quartz="no";;
esac
if test "$have_quartz" = "yes"; then
AC_DEFINE(USE_QUARTZ, [1])
if test "$have_gl" = ""; then have_gl="no"; fi
AC_CHECK_HEADERS(OpenGL/gl.h, [
have_gl=yes
AC_DEFINE(USE_QUARTZ_CGL, [1])
])
else
AC_PLUGIN_DISABLE
fi
--- NEW FILE: mkinfo ---
#!/bin/sh
IN=$1; shift
OUT=$1; shift
BNDL_VERSION="$@"
sed "s%\@BNDL_VERSION@%${BNDL_VERSION}%g" < ${IN} > ${OUT}
--- NEW FILE: sqUnixQuartz.m ---
/* sqUnixQuartz.m -- display via native windows on Mac OS X -*- ObjC -*-
*
* Author: Ian Piumarta <ian...@in...>
*
* Copyright (C) 1996-2002 Ian Piumarta and other authors/contributors
* as listed elsewhere in this file.
* All rights reserved.
*
* You are NOT ALLOWED to distribute modified versions of this file
* under its original name. If you want to modify it and then make
* your modifications available publicly, rename the file first.
*
* This file is part of Unix Squeak.
*
* This file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You may use and/or distribute this file ONLY as part of Squeak, under
[...2703 lines suppressed...]
assert(r->context);
frame.origin.y= [topView bounds].size.height - frame.size.height - frame.origin.y;
fprintf(stderr, "view setFrame: %d %d %d %d\n",
(int)frame.origin.x, (int)frame.origin.y, (int)frame.size.width, (int)frame.size.height);
[renderView(r) setFrame: frame];
}
SqDisplayDefine(Quartz);
#include "SqModule.h"
static void *display_makeInterface(void)
{
return &display_Quartz_itf;
}
SqModuleDefine(display, Quartz);
--- NEW FILE: sqUnixQuartzGL.h ---
#if (DEBUG)
static long getFormatAttribute(NSOpenGLPixelFormat *fmt,
NSOpenGLPixelFormatAttribute attr)
{
long val;
[fmt getValues: &val forAttribute: attr forVirtualScreen: 0];
return val;
}
void printFormatInfo(NSOpenGLPixelFormat *fmt)
{
printf("GL pixel format:\n");
// valued
printf(" RendererID 0x%lx\n", getFormatAttribute(fmt, NSOpenGLPFARendererID ));
printf(" AuxBuffers %ld\n", getFormatAttribute(fmt, NSOpenGLPFAAuxBuffers ));
printf(" ColorSize %ld\n", getFormatAttribute(fmt, NSOpenGLPFAColorSize ));
printf(" AlphaSize %ld\n", getFormatAttribute(fmt, NSOpenGLPFAAlphaSize ));
printf(" DepthSize %ld\n", getFormatAttribute(fmt, NSOpenGLPFADepthSize ));
printf(" StencilSize %ld\n", getFormatAttribute(fmt, NSOpenGLPFAStencilSize));
printf(" AccumSize %ld\n", getFormatAttribute(fmt, NSOpenGLPFAAccumSize ));
printf(" ScreenMask %ld\n", getFormatAttribute(fmt, NSOpenGLPFAScreenMask ));
// bool
printf(" AllRenderers %ld\n", getFormatAttribute(fmt, NSOpenGLPFAAllRenderers ));
printf(" Stereo %ld\n", getFormatAttribute(fmt, NSOpenGLPFAStereo ));
printf(" MinimumPolicy %ld\n", getFormatAttribute(fmt, NSOpenGLPFAMinimumPolicy ));
printf(" MaximumPolicy %ld\n", getFormatAttribute(fmt, NSOpenGLPFAMaximumPolicy ));
printf(" OffScreen %ld\n", getFormatAttribute(fmt, NSOpenGLPFAOffScreen ));
printf(" FullScreen %ld\n", getFormatAttribute(fmt, NSOpenGLPFAFullScreen ));
printf(" SingleRenderer %ld\n", getFormatAttribute(fmt, NSOpenGLPFASingleRenderer));
printf(" NoRecovery %ld\n", getFormatAttribute(fmt, NSOpenGLPFANoRecovery ));
printf(" Accelerated %ld\n", getFormatAttribute(fmt, NSOpenGLPFAAccelerated ));
printf(" ClosestPolicy %ld\n", getFormatAttribute(fmt, NSOpenGLPFAClosestPolicy ));
printf(" Robust %ld\n", getFormatAttribute(fmt, NSOpenGLPFARobust ));
printf(" BackingStore %ld\n", getFormatAttribute(fmt, NSOpenGLPFABackingStore ));
printf(" Window %ld\n", getFormatAttribute(fmt, NSOpenGLPFAWindow ));
printf(" MultiScreen %ld\n", getFormatAttribute(fmt, NSOpenGLPFAMultiScreen ));
printf(" Compliant %ld\n", getFormatAttribute(fmt, NSOpenGLPFACompliant ));
}
static long getCtxParam(NSOpenGLContext *ctx, NSOpenGLContextParameter param)
{
long val;
[ctx getValues: &val forParameter: param];
return val;
}
void printContextInfo(NSOpenGLContext *ctx)
{
long vals[4];
printf("GL Context Parameters:\n");
[ctx getValues: vals forParameter: NSOpenGLCPSwapRectangle];
printf(" SwapRectangle %ld,%ld %ldx%ld\n", vals[0], vals[1], vals[2], vals[3]);
printf(" SwapRectangleEnable %ld\n", getCtxParam(ctx, NSOpenGLCPSwapRectangleEnable));
printf(" RasterizationEnable %ld\n", getCtxParam(ctx, NSOpenGLCPRasterizationEnable));
printf(" SwapInterval %ld\n", getCtxParam(ctx, NSOpenGLCPSwapInterval));
printf(" SurfaceOrder %ld\n", getCtxParam(ctx, NSOpenGLCPSurfaceOrder));
printf(" SurfaceOpacity %ld\n", getCtxParam(ctx, NSOpenGLCPSurfaceOpacity));
printf(" StateValidation %ld\n", getCtxParam(ctx, NSOpenGLCPStateValidation));
}
#else /* !DEBUG */
# define printFormatInfo(fmt)
# define printContextInfo(ctx)
#endif
|