[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GWorkspace openFile & ImageViewer
From: |
Richard Frith-Macdonald |
Subject: |
Re: GWorkspace openFile & ImageViewer |
Date: |
Wed, 09 Apr 2003 13:48:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030327 Debian/1.3-4 |
Marko Riedel wrote:
I looked at NSWorkspace.m and its use of _launched (dictionary).
1. NSWorkspace invokes _connectApplication in order to open a file.
Yep.
2. It seems it is looking for a named port (application name minus
extension) to talk to the application. Does NSApplication implement
this, i.e. does it listen on this port? What sort of messages
(selectors) can be invoked over this type of connection?
Yes, NSApplication does implement it, and you can send things like
-application:OpenFile:
to it.
3. I guess that the current implementation never establishes a
connection. NSWorkspace then launches the application with the file
as a command line argument (line 442). This explains why it launches
the same application more than once, i.e. one for every file.
That's a good hypothesis ... but it works on my system, so you may have
some system specific trouble.
4. NSWorkspace consults _launched, but the code shows that the
contents of this dictionary do not affect which app
_connectApplication returns.
Yes. The _launched information tells us what apps were launched when,
so if an
app is not responding we can tell if it has hung (was launched a while
ago), or is still in
the process of starting up.
Maybe we should implement listening behavior in NSApplication?
Already there (controlled by the GSServicesManager class).
This
would make _launched superfluous,
Not so ... _launched should have nothing to do with this.
at least where opening files are
concerned. If there is an app at the named port, message it, else
launch it, then message.
That's the way it works now ... launched is there mostly to stop us
launching lots of instances of an app just because it's slow in starting
up and responding to messages.
- GWorkspace openFile & ImageViewer, Marko Riedel, 2003/04/08
- Re: GWorkspace openFile & ImageViewer, Enrico Sersale, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Richard Frith-Macdonald, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Marko Riedel, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Richard Frith-Macdonald, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Enrico Sersale, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Alexander Malmberg, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Enrico Sersale, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Richard Frith-Macdonald, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Alexander Malmberg, 2003/04/09
- Re: GWorkspace openFile & ImageViewer, Matt Rice, 2003/04/10
- Re: GWorkspace openFile & ImageViewer, Marko Riedel, 2003/04/10