summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2013-09-05 09:12:35 +0000
committerManolo Gouy <Manolo>2013-09-05 09:12:35 +0000
commitbc17e8c6f94be5bd88617dc889dc71307557ba90 (patch)
tree31ddb743fb8095a6ab30c098a5f4629e868315db /src
parentcc68c2e43ce02f1b8196852ad2892b6e284cc08d (diff)
Removed linkage with undocumented function CPSEnableForegroundOperation() used to support
Mac OS 10.2 or below. This made no sense because the Copy/Paste implementation requires Mac OS 10.3. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9964 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index e968cea47..428ef65c2 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1291,10 +1291,11 @@ void fl_open_callback(void (*cb)(const char *)) {
}
@end
-extern "C" {
- OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn, UInt32 _arg2,
- UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+/* Prototype of undocumented function needed to support Mac OS 10.2 or earlier
+ extern "C" {
+ OSErr CPSEnableForegroundOperation(ProcessSerialNumber*, UInt32, UInt32, UInt32, UInt32);
}
+*/
void fl_open_display() {
static char beenHereDoneThat = 0;
@@ -1334,17 +1335,11 @@ void fl_open_display() {
if ( !bundle )
{
- // Earlier versions of this code tried to use weak linking, however it
- // appears that this does not work on 10.2. Since 10.3 and higher provide
- // both TransformProcessType and CPSEnableForegroundOperation, the following
- // conditional code compiled on 10.2 will still work on newer releases...
OSErr err;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
- if (TransformProcessType != NULL) {
- err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication);
- } else
-#endif // MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
- err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
+ err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication); // needs Mac OS 10.3
+ /* support of Mac OS 10.2 or earlier used this undocumented call instead
+ err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
+ */
if (err == noErr) {
SetFrontProcess( &cur_psn );
}
@@ -2693,6 +2688,7 @@ void Fl_X::q_end_image() {
////////////////////////////////////////////////////////////////
// Copy & Paste fltk implementation.
+// Requires Mac OS 10.3 or later
////////////////////////////////////////////////////////////////
static void convert_crlf(char * s, size_t len)