On 2007-01-25 03:06:09 +0200 Adrian Robert [EMAIL PROTECTED] wrote:
Hello,
Someone was asking me about whether Emacs.app supports the - GSFilePath
option which GWorkspace uses to tell applications to open files. I thought
that there were already two ways to do this in OpenStep / Cocoa: -NSOpen
option, and NSApplication- application:openFIle: method via DO or
notifications. Is this correct or is the GNUstep-specific -GSFilePath
really needed?
thanks,
Adrian
If the application is running GWorkspace uses -application:openFIle:, if not it
launches it with -GSFilePath and the path of the file to open as arguments.
In NSWorkspace.m I read:
* pIf the Info-gnustep.plist of an application says that it
* can open files with a particular extension, then when NSWorkspace
* is asked to open such a file it will attempt to send an
* -application:openFile: message to the application (which must be
* handled by the applications delegate). If the application is not
* running, NSWorkspace will instead attempt to launch the application
* passing the filename to open after a '-GSFilePath' flag
* in the command line arguments. For a GNUstep application, the
* application will recognize this and invoke the -application:openFile:
* method passing it the file name.
* /p
and, in NSApplication.m, we find:
/*
*Now check to see if we were launched with arguments asking to
*open a file. We permit some variations on the default name.
*/
if ((filePath = [defs stringForKey: @GSFilePath]) != nil
|| (filePath = [defs stringForKey: @NSOpen]) != nil)
{
[_listener application: self openFile: filePath];
}
...
That is, NSApplication treats GSFilePath and NSOpen as the same thing and,
if Emacs.app implements -application:openFIle: in its delegate, this is the method that will be
called.
___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev