Commit graph

18 commits

Author SHA1 Message Date
Ryan C. Gordon
2c90fe6bf1 Close off warning about setAppleMenu on Mac OS X 10.4 SDK.
Fixes Bugzilla #97.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401596
2006-03-22 22:33:23 +00:00
Sam Lantinga
c21749e945 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401576
2006-03-21 16:04:44 +00:00
Ryan C. Gordon
a499115a04 To: sdl@libsdl.org
From: Christian Walther <cwalther@gmx.ch>
Date: Wed, 28 Dec 2005 12:13:20 +0100
Subject: [SDL] Fix for opening documents on Mac OS X < 10.4

The current code in SDLMain.m that transforms documents opened from the
Finder into command-line arguments (introduced in revision 1.14,
2005-08-11) uses the methods -[NSString lengthOfBytesUsingEncoding:] and
-[NSString getCString:maxLength:encoding:], which are only available in
Mac OS X 10.4.

Compiling this code on 10.3 produces warnings, and running it (i.e.
starting an SDL application by opening a document) leads to weird
behavior which I didn't investigate in detail ("*** -[NSCFString
lengthOfBytesUsingEncoding:]: selector not recognized" is printed to the
console log, and the SDL window never opens).

The attached patch removes the offending calls and uses -[NSString
UTF8String] instead, which is available everywhere. Tested on 10.3.9,
and I see no reason why it shouldn't also work on 10.2 and 10.4.

Two further comments:

* The comment above the -[SDLMain application: openFile:] implementation
says "You need to have a CFBundleDocumentsType section in your
Info.plist to get this message, apparently." This is not the case in my
experience - it worked just fine with a hand-built bare-bones
application consisting only of Test.app/Contents/MacOS/test, without any
Info.plist (although you have to press the option and command keys for
such an application to accept a dragged file).

* I took the liberty of cleaning up another area of SDLMain.m: I changed
"CustomApplicationMain (argc, argv)" to "CustomApplicationMain (int
argc, char **argv)". This avoids the "type of `argv' defaults to `int'"
warnings, and I'm not sure if leaving out the types could cause problems
on platforms where an int and a char** aren't of the same size.

  -Christian

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401214
2006-01-01 23:45:52 +00:00
Ryan C. Gordon
a3e073d82b Apparently MacOS X will sometimes pass command line arguments to a Cocoa
app as an openFile() message, so we have to make sure we were launched from
 the Finder before accepting these as drag'n'drop documents, or they will just
 duplicate what's already in argc/argv.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401126
2005-08-22 14:18:15 +00:00
Ryan C. Gordon
d1c3cb7d61 In MacOSX, when drag'n'dropping a document on an SDL app, or double-clicking a
document associated with the app, the document(s) are passed to SDL_main()
 as if they were command line arguments. Otherwise, the command line is always
 empty and there is no way for the app to recover this information.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401114
2005-08-11 00:56:16 +00:00
Sam Lantinga
93685f61fb *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40959
2004-09-17 13:47:44 +00:00
Sam Lantinga
b88a981cb9 Date: Thu, 2 Sep 2004 19:35:51 +0200
From: Max Horn
Subject: [Patch]: Improved menu code for SDLMain.m

the attached patch improves the menu setup for SDL apps built without a
.nib file. On 10.3, the application menus are empty with the current
SDL CVS version; after this patch, a proper app & window menu, with
"About", "Hide", "Quit", "Minimize" etc. entries are visible, just like
with the .nib enabled applications.

This *should* work on 10.2 and even 10.1, but I can't guarantee it, so
somebody should test there, ideally.

I also changed the way setupWorkingDirectory works by making use of the
Bundle APIs, that results in (IMO) less hackish code.

Finally, I added some "static" keywords to ensure that certain local
functions are not exported (that's just a paranoia change, I guess:
never pollute linker namespaces if you can avoid it).

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40958
2004-09-17 13:28:12 +00:00
Sam Lantinga
b653266009 Tell the dock about command-line launched applications
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40477
2002-08-31 04:01:19 +00:00
Sam Lantinga
aba4b443c9 Date: Sat, 1 Jun 2002 17:56:45 -0500
From: Darrell Walisser <dwaliss1@purdue.edu>
Subject: mac patch

In this patch:

- yuv code
- links to QuickTime
- tabs -> 4 spaces
- mouse events fix
- SDLMain path parsing fix
- BUGS updates
- some miscellaneous docs/comments/code cleanup

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40391
2002-06-01 23:05:05 +00:00
Sam Lantinga
455d014f8a *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40390
2002-06-01 19:54:15 +00:00
Sam Lantinga
f1cd55c173 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40389
2002-06-01 19:51:08 +00:00
Sam Lantinga
e79ad74ac3 *** empty log message ***
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40222
2001-11-02 18:12:52 +00:00
Sam Lantinga
1e5a9f6ffa Oops, back out that SDL_main -> SDLMain conversion
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40195
2001-09-23 21:09:08 +00:00
Sam Lantinga
5fb411a341 Changed SDLMain to SDL_main for MacOS X stuff
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40192
2001-09-23 20:42:00 +00:00
Sam Lantinga
23d3cf9854 Added Max's patches for building MacOS X apps on command line
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40169
2001-09-04 23:18:45 +00:00
Sam Lantinga
75ab0e7ade Date: Tue, 21 Aug 2001 03:50:01 +0200
From: Max Horn <max@quendi.de>
Subject: New patch for OS X

Attached a .patch file for SDL/OSX with some nice bug fixes / enhancments.

* fixes the activation issues, which also caused the window to be
always drawn like an inactive. The close/minimize widgets now are
animated properly, too.

* the menu items are automatically adjusted to use the app name
instead of just "SDL App". I did this so that we really can use one
central SDLMain.nib file, w/o requiring developers to make a copy of
it and adjust it.

* libSDLMain now contains the proper cocoa code, not as before the
carbon code. This means apps no longer have to carry a copy of
SDLMain.m/SDLMain.h

* revamped configure.in to properly build a Cocoa/Quartz SDL lib, not
a Carbon based SDL lib

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40159
2001-08-21 07:19:59 +00:00
Sam Lantinga
254c4d997c * Removed fullscreen menu option from the "Window" menu
* Updated the BUGS file
* Fixed command line parameters when launched from Finder
* Implemented setting the icon window caption
* Implemented frameless style windows
* Added note about SDL_RESIZABLE implementation to SDL_QuartzVideo.m
* Window close requests now go through the event filtering system

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4059
2001-06-11 06:44:43 +00:00
Sam Lantinga
72f7279bf8 Added initial support for Quartz video (thanks Darrell!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4048
2001-06-07 14:28:11 +00:00