Le 31 juil. 07 à 23:10, Yen-Ju Chen a écrit :

> On 7/31/07, Andreas Höschler <[EMAIL PROTECTED]> wrote:
>>
>> - connectToWorkspaceApplicationLaunch: (BOOL) launchFlag
>> {
>>    NSString * appName = nil;
>>
>> #if 0
>>    /* It does not make sense to check for default workspace
>>       because even if there is one, we still use etoile_system to log
>> out.
>>       And in order to avoid GWorkspace from launching automatically,
>>       we may set GSWorkspaceApplication to a non-existing  
>> application.
>>       If that is the case, it will break logout. */
>>    appName = [[NSUserDefaults standardUserDefaults] objectForKey:
>> @"GSWorkspaceApplication"];
>> #endif
>>    if (appName == nil)
>>      {
>>        // NOTE: appName is defined as SCSystemNamespace in  
>> EtoileSystem.h
>>        appName = @"/etoilesystem"; // @"EtoileWorkspaceServer";
>>      }
>>
>>    return [self connectToApplication: appName launch: launchFlag];
>> }
>>
>> I don't understand why this is commented out?

In Étoilé, File Manager (aka Workspace/Finder) doesn't handle session  
operations, this means GSWorkspaceApplication default has no use  
unless you decide not to run etoile_system.

>> I did
>>
>>         defaults write NSGlobalDomain GSWorkspaceApplication  
>> Finder.app
>>
>> and implemented
>>
>> - (void)logOut
>> {
>>         NSLog(@"logOut");
>> }
>>
>> in the application delegate of Finder.app. I am not yet sure what
>> exactly this method will have to do to kill the session (A pkill on
>> Azalea??). What I know is that I have no file /etoilesystem on my  
>> box!?

/etoilesystem is the name which is used to identify/register the  
session manager in DO server.

>> Where should that come from? How is logout supposed to work?

MenuServer retrieves a DO proxy for "/etoilesystem" name. In fact,  
any applications can retrieve this proxy like this:
sessionProxy = [NSConnection  
rootProxyForConnectionWithRegisteredName: @"/etoilesystem" host: nil];

This proxy must reply to:
- (oneway void) logOut;
- (oneway void) powerOff: (BOOL)reboot;
- (oneway void) suspend;

By default this proxy is an instance of SCSystem located inside  
etoile_system. It's advised to always used etoile_system otherwise  
you are going to lost all session management stuff which is difficult  
to implement because GNUstep doesn't provide a ready-to-use mechanism  
and API.
One of the tricky part is explained in Bundles/EtoileBehavior which  
is an AppKit user bundle implementing a protocol to negociate log out  
between applications and etoile_system.

etoile_system is made of two main classes:
- SCSystem main class which takes care of managed processes (by  
'managed' I mean background or daemonized processes which are listed  
in SystemTaskList.plist)
- ApplicationManager helper class which tracks AppKit-based processes  
launched by the user

ApplicationManager is the class which negociates Log Out operations  
with each application through SCSession protocol as described in  
NSApplication+Etoile.m of EtoileBehavior. A short overview can be  
read here: <http://www.etoile-project.org/etoile/blog/2006/12/if-you- 
want-just-log-out.html>

Now if you want to use your own File Manager, you just need to  
replace OuterSpace by your Finder in SystemTaskList.plist (located in  
Services/Private/System and installed in Library/Etoile), that's it.  
Session management will still work.

Excerpt of SystemTaskList.plist:

        /etoilesystem/application/outerspace =
        {
                LaunchPath = "OuterSpace"; <-- Replace OuterSpace by the name 
of  
your own file manager
                Arguments = ();
                UserName = "";
                LaunchPriority = 40;
                OnStart = <*BY>;
                OnDemand = <*BN>;
                Persistent = <*BN>;
                Hidden = <*BY>;
        };

This part '/etoilesystem/application/outerspace' doesn't really  
matter for now, it's just a key to identify the process inside  
etoile_system. In future, this is going to represent a CoreObject  
path similar to /proc on Linux.
All the keys following LaunchPath are documented in EtoileSystem.h,  
all these keys allows to specify in which fashion etoile_system must  
manage this process. etoile_system in addition to be a session  
managener is also a dameonizer similar to Mac OS X launchd.

>  The way Etoile does is that in the xsession,
>   it launches etoile_system after login.
>   Then etoile_system will read SystemTaskList.plist and lauches  
> applications
>   one-by-one, including window manager (Azalea).
>   So the right way to log out is to stop etoile_system, not window  
> manager,
>   and I believe it is what the menu server does.

The menu server requests various operations (like reboot, log out,  
suspend etc.) to etoile_system. etoile_system asks running  
applications if necessary and tries to achieve the operation. When  
etoile_system cannot succeed it replies with an error to the menu  
server or any other applications that sent the request.

>   If you launch window manager in your xsession instead of  
> etoile_system,
>   then you have to logout by killing the window manager
>   and the logout in menu server will not work.
>
>   Now, the logout in menu server specifically call -logOut: for
> workspace manager.
>   In this case, etoile_system will be the workspace manager
>   because GSworkspace.app has no -logOut:.
>   Therefore, it is commented out so that it will not use GWorkspace,
>   which is the default workspace manager for GNUstep.
>   The '/etoile_system' is the name to represent etoile_system.
>   If you have your own workspace manager (Finder),
>   you can replace that with 'Finder', I believe.
>   So I believe the missing point for your Finder is that
>   you need to change '/etoile_system' to your 'Finder'
>   if you plan not to use etoile_system for logOut.

This is correct but the important point is etoile_system should be  
used, it has been specially thought to allow File Manager replacement  
without having to reimplement complicated session management stuff.

Cheers,
Quentin.


_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à