
	We do quick-start in ooo-wrapper.in by handling the extra
--session-quickstart argument.

	However; the OO.o internal quickstart code is a mess:

* From the desktop end

	* framework/source/services/desktop.cxx: it seems that
xQuickLauncher isn't => always quitting. Added via
'addTerminateListener'; two listeners:

** QuickLauncher: 'desktop.QuickstartWrapper'.

	The shutdown icon sits in the systray and allows the user to
keep the office instance running for quicker restart. Implemented in:
sfx2/source/appl/shutdownicon.cxx - but that has to be a throw-back,
and doesn't appear to work.


** PipeTerminator: 'OfficeIPCThreadController'

	* desktop/source/app/officeipcthread.cxx: here is where the
action lurks; seems to have no discrimination between a session
shutdown vs. a user terminate. cf.


* Session management:

	* vcl/unx/source/app/sm.cxx (ShutDownHdl): calls 'ShutDown' on
GetSalData()->pFirstFrame_ - if we have one.


* From the 'quickstart' angle

	+ -headless + -invisible seems to work modulo 'exit', we could
do with a hacked version of the 'shutdown icon' thing that works with
session management.

	+ ARGH - so we have to hack the OfficeIPCFooBaa vetoing baz,
we will provide a few really nasty hacks - to make life worthwhile. We
need to connect (somehow) to the SM death signal, and in that case emit
something nasty like shutdownicon.cxx (terminateDesktop).

	+ Ugly ongoing bug - multi-display stuff is uber-broken.

	+ Can we create an 'immortal' first toplevel frame, that
responds to 'Shutdown' from the SM; and disobey's Exit ?

'Exit' ->
	sfx2/source/appl/appserv.cxx: xDesktop->terminate.

'Sm Quit' ->
	SalFrameData::Shutdown ->
		{ return pProc_( pInst_, pFrame_, SALEVENT_SHUTDOWN, 0 ); }

	SALEVENT_CLOSE vs. SALEVENT_SHUTDOWN ...
	-> vcl/source/window/winproc.cxx (ImplWindowFrameProc)
		-> GetpApp->QueryExit -> 
			-> Does a 'Close' on the app
		-> Application::Quit
			Application::PostUserEvent(
				STATIC_LINK( NULL, ImplSVAppData, ImplQuitMsg ) );
			sets:
				ImplGetSVData()->maAppData.mbAppQuit = TRUE;
			-> svapp.cxx: Application::Execute terminates

--

So the current solution that we have is that ShutdownIcon adds itself to the
Desktop::addTerminateListener and then when the application is about to quit,
all the TerminateListeners are queried whether or not it is okay to quit. When
the ShutdownIcon decides to stay back in the background, it sets a veto
variable to true, and when queried by Desktop on quit, vetoes the termination
and stays back in the background. Effectively, the quickstarter is up and
running with:

--- desktop/source/app/cmdlineargs.cxx	2005-09-08 22:35:40.000000000 +0530
+++ desktop/source/app/cmdlineargs.cxx	2005-10-17 16:38:06.000000000 +0530
@@ -350,9 +350,7 @@
 	}
 	else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
 	{
-#ifdef WNT
 		SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
-#endif
 		return sal_True;
 	}
 	else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-terminate_after_init" )) == sal_True )
--- sfx2/source/appl/shutdownicon.cxx	2005-09-07 23:18:37.000000000 +0530
+++ sfx2/source/appl/shutdownicon.cxx	2005-10-17 16:39:46.000000000 +0530
@@ -547,6 +547,10 @@
 				ShutdownIcon::pShutdownIcon = this;
 #ifdef WNT
 				initSystray();
+#else
+				// disable shutdown
+				getInstance()->SetVeto( true );
+				getInstance()->addTerminateListener();
 #endif
 			}
 			catch(const ::com::sun::star::lang::IllegalArgumentException&)




*** Raul's altered files ***

+ eggtray/ - new toplevel etc.
+ scp2/ - install foo ...
+ sfx2/source/appl/
	+ makefile.mk
	+ shutdownicon.hxx
	+ shutdowniconw32.cxx - floated common stuff to .hxx
	+ shutdownicon.cxx - tweaked
	+ shutdowniconunx.cxx
+ vcl/
	+ install prex.h / postx.h ... [ urgh ... ]
	+ also svids.hrc ...

** How does this relate to sysui/source/win32/QuickStart/ ?
    + this code creates 'quickstart.exe'
    + that code itself forks 'soffice.exe -quickstart'
	+ urgh ... [ hmm ... ]


office.quickstart hits:
 RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance com.sun.star.office.Quickstart" ); framework/desktop/source/app/app.cxx, line 1800
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ), framework/desktop/source/app/app.cxx, line 1809
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" )), framework/desktop/source/app/app.cxx, line 2338
OUString::createFromAscii( "com.sun.star.office.Quickstart" )),UNO_QUERY ); framework/desktop/source/migration/wizard.cxx, line 534
OUString::createFromAscii( "com.sun.star.office.Quickstart" )),UNO_QUERY ); framework/framework/source/services/license.cxx, line 400
msgbox (&quot;Office must be restarted before your changes will take effect.&quot;+ chr$(10)+&quot;Also close the Office QuickStarter (Windows and Linux)&quot;, 48, &quot;Assign Script (Java) To Menu&quot; ) framework/scripting/workben/bindings/ScriptBinding.xba, line 804
xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.office.Quickstart") ); framework/sfx2/source/appl/appuno.cxx, line 2175
SFX_IMPL_XSERVICEINFO( ShutdownIcon, "com.sun.star.office.Quickstart", "com.sun.star.comp.desktop.QuickstartWrapper" ) \ framework/sfx2/source/appl/shutdownicon.cxx, line 138
OUString::createFromAscii("com.sun.star.office.Quickstart")), UNO_QUERY); graphics/svx/source/dialog/optgdlg.cxx, line 1400
RegistryItem gid_Regitem_Software_OpenOffice_Quickstarterinstalled installation/scp2/source/quickstart/registryitem_quickstart.scp, line 38
setup2 source\ui\pages\preadygo.src 0 fixedtext RESID_PAGE_PAGEREADYGO FT_PATCH3 190 pt-BR Antes de esta correÃ§Ã£o para o StarOffice 6.0 ser instalada, cÃ³pias de todos os arquivos a serem alterados serÃ£o salvas do diretÃ³rio "Backup_PP1".\n\nNota: Para remover esta correÃ§Ã£o futuramente, vocÃª deve copiar o conteÃºdo do diretÃ³rio "Backup_PP1" de volta para o diretÃ³rio de instalaÃ§Ã£o do StarOffice. Certifique-se de que o StarOffice e o StarOffice QuickStarter nÃ£o estejam sendo executados.\n\nClique em "%1" para iniciar a instalaÃ§Ã£o da correÃ§Ã£o. 20040507 14:24:47 installation/setup2/source/ui/pages/localize.sdf, line 9345
setup2 source\ui\pages\preadygo.src 0 fixedtext RESID_PAGE_PAGEREADYGO FT_PATCH3 190 sk SkÃ´r ako bude nainÅ¡talovanÃ¡ tÃ¡to zÃ¡plata pre StarOffice 6.0, skopÃ­rujÃº sa vÅ¡etky sÃºbory ktorÃ© budÃº zmenenÃ© poÄas inÅ¡talÃ¡cie zÃ¡platy do adresÃ¡ra 'Backup_PP1'.\n\nPoznÃ¡mka: Na odstrÃ¡nenie tejto zÃ¡platy musÃ­te manuÃ¡lne prekopÃ­rovaÅ¥ obsah adresÃ¡ra 'Backup_PP1' do adresÃ¡ra kde mÃ¡te nainÅ¡talovanÃ½ StarOffice. PoÄas tejto odinÅ¡talaÄnej procedÃºry nesmÃº byÅ¥ spustenÃ© programy StarOffice a StarOffice Quickstarter. StlaÄte '%1' pre zaÄatie inÅ¡talÃ¡cie zÃ¡platy. 20040507 14:24:47 installation/setup2/source/ui/pages/localize.sdf, line 9347


* Split sfx2/source/appl/appuno.cxx
    + bin quickstart wrapper service.

* sfx2/source/appl/appcfg.cxx:
    + requires an UNO interface
	+ launch it - check foo ...
    + do we have an existing interface ?

    + It's really a 'PropertyBag' interface
	+ 'IsInstalled' ?
	+ 'AutoStart' - yes/no...


* Design:
    + requires turn on / off ability
    + do-we-have-this-functionality feature ?
	+ activation fails to signal that ?
	+ 'IsInstalled' ?
    + IsInstalled
	- always true for UNX ...
	    #ifdef ENABLE_GTK
	    return true
	    #endif
	+ different for win32 ...

    + AutoStart - yes/no (?)
	+ whether we should start it when we run OO.o ?
	+ ie. is the .desktop file installed (win32)

    + Why does app always activate the service ?
	+ 'createinstancewitharguments'
	    + arg is a bool - 'isquickstart'

    + How to register the service ?
	+ conditional build of the component ?
	+ ...foo...

    + OR - a sub-component ?
	+ a simple shlib that we load ...
	+ virtualise all the funky bits :-)
		+ get tml to test the Win32 piece ...

    + win32:
        + the ::initSystray piece ...
	  ::deInitSystray ...
	  ::isQuickStarterInstalled()
		+ push up to shutdownicon.cxx
	  ::set/getAutoStart ...
		+ push up to shutdownicon.cxx

	+ do we in fact neeed a sub-class ?
	    + leave the same ? init/de-init foo ...
	    + just load a shlib for gtk+ ?

	+ bModalMode - make it a static member
	  of the class (just ignored by gtk+) ...

+ Dialog in svx/source/dialog/optmemory.src


Issues:
    + [ string is butt ugly
	'Load OO.o on system startup' ]
    + fix the icon load foo - we should use svx surely ?

    + following bugs:
	+ use (new) xdg autostart spec.
	+ fix crash-on-'exit quickstarter'

    + don't use gtk+ stock item for 'Open'
	+ use the builtin one ...