Index: svx/source/dialog/optmemory.cxx
===================================================================
RCS file: /cvs/graphics/svx/source/dialog/optmemory.cxx,v
retrieving revision 1.8
diff -u -p -u -r1.8 optmemory.cxx
--- svx/source/dialog/optmemory.cxx	8 Sep 2005 21:47:15 -0000	1.8
+++ svx/source/dialog/optmemory.cxx	11 Nov 2005 16:04:28 -0000
@@ -237,8 +237,7 @@ OfaMemoryOptionsPage::OfaMemoryOptionsPa
 {
 	FreeResource();
 
-    //quick launch only available in Win
-#ifndef WNT
+#if !defined(WNT) && !defined(ENABLE_GTK)
     aQuickLaunchFL.Hide();
     aQuickLaunchCB.Hide();
 #endif

--- /dev/null	2005-11-11 09:08:10.800476000 +0000
+++ sysui/desktop/menus/qstart.desktop	2005-11-11 16:37:17.000000000 +0000
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Terminal=false
+Type=Application
+Categories=Application;Office
+Exec=ooffice -quickstart -nologo -nodefault
+NoDisplay=true
+Name=%PRODUCTNAME Quickstarter
+Comment=Hook for quickstarter startup
Index: sfx2/util/makefile.mk
===================================================================
RCS file: /cvs/framework/sfx2/util/makefile.mk,v
retrieving revision 1.39
diff -u -p -u -r1.39 makefile.mk
--- sfx2/util/makefile.mk	7 Sep 2005 19:33:33 -0000	1.39
+++ sfx2/util/makefile.mk	11 Nov 2005 17:03:08 -0000
@@ -148,6 +148,27 @@ RESLIB1NAME=$(TARGET)
 RESLIB1IMAGES=$(PRJ)$/res
 RESLIB1SRSFILES=$(SFXSRSLIST)
 
+# gtk quick-starter
+.IF "$(GUI)"=="UNX"
+.IF "$(ENABLE_GTK)" != ""
+PKGCONFIG_MODULES=gtk+-2.0
+.INCLUDE: pkg_config.mk
+CFLAGS+=$(PKGCONFIG_CFLAGS)
+
+SHL3TARGET=qstart_gtk$(UPD)$(DLLPOSTFIX)
+SHL3LIBS=$(SLB)$/quickstart.lib
+SHL3DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN)
+# libs for gtk plugin
+SHL3STDLIBS=$(SHL1STDLIBS) $(SFX2LIB) $(EGGTRAYLIB)
+SHL3STDLIBS+=$(PKGCONFIG_LIBS:s/ -lpangoxft-1.0//)
+# hack for faked SO environment
+.IF "$(PKGCONFIG_ROOT)"!=""
+SHL3SONAME+=-z nodefs
+SHL3NOCHECK=TRUE
+.ENDIF          # "$(PKGCONFIG_ROOT)"!=""
+.ENDIF # "$(ENABLE_GTK)" != ""
+.ENDIF # "$(GUI)"=="UNX"
+
 # --- Targets ------------------------------------------------------
 
 

Index: sfx2/source/appl/makefile.mk
===================================================================
RCS file: /cvs/framework/sfx2/source/appl/makefile.mk,v
retrieving revision 1.39
diff -u -p -u -r1.39 makefile.mk
--- sfx2/source/appl/makefile.mk	7 Sep 2005 17:43:35 -0000	1.39
+++ sfx2/source/appl/makefile.mk	11 Nov 2005 17:03:49 -0000
@@ -38,6 +38,7 @@ PRJ=..$/..
 PRJNAME=sfx2
 TARGET=appl
 ENABLE_EXCEPTIONS=TRUE
+LIBTARGET=NO
 
 # --- Settings -----------------------------------------------------
 
@@ -47,10 +48,18 @@ ENABLE_EXCEPTIONS=TRUE
 # w.g. compilerbugs
 .IF "$(GUI)"=="WNT"
 CFLAGS+=-Od
+CFLAGS+=-DENABLE_QUICKSTART_APPLET
 .ENDIF
 
 .IF "$(GUI)"=="UNX"
         CDEFS+=-DDLL_NAME=libsfx$(UPD)$(DLLPOSTFIX)$(DLLPOST)
+.IF "$(ENABLE_GTK)" != ""
+        PKGCONFIG_MODULES=gtk+-2.0
+        .INCLUDE: pkg_config.mk
+        CFLAGS+=$(PKGCONFIG_CFLAGS)
+        CFLAGS+=-DENABLE_QUICKSTART_APPLET
+        CDEFS+=-DPLUGIN_NAME=libqstart_gtk$(UPD)$(DLLPOSTFIX)$(DLLPOST)
+.ENDIF # "$(ENABLE_QUICKSTART_APPLET)"=="TRUE"
 .ELSE
         CDEFS+=-DDLL_NAME=sfx$(UPD)$(DLLPOSTFIX)$(DLLPOST)
 .ENDIF
@@ -65,7 +74,7 @@ SRS2NAME=sfx
 SRC2FILES =  \
 		sfx.src
 
-SLOFILES =  \
+SFX_OBJECTS = \
 	$(SLO)$/app.obj \
 	$(SLO)$/appbas.obj \
 	$(SLO)$/appcfg.obj \
@@ -105,6 +114,21 @@ SLOFILES =  \
     $(SLO)$/fwkhelper.obj \
     $(SLO)$/updatedlg.obj
 
+.IF "$(GUI)"=="UNX"
+QUICKSTART_OBJECTS = \
+	$(SLO)$/shutdowniconunx.obj
+.ENDIF
+
+SLOFILES = $(SFX_OBJECTS) $(QUICKSTART_OBJECTS)
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1OBJFILES= $(SFX_OBJECTS)
+
+.IF "$(GUI)"=="UNX"
+LIB2TARGET= $(SLB)$/quickstart.lib
+LIB2OBJFILES= $(QUICKSTART_OBJECTS)
+.ENDIF
+
+
 EXCEPTIONSFILES=\
 	$(SLO)$/imagemgr.obj		\
 	$(SLO)$/appopen.obj \
Index: scp2/source/ooo/file_library_ooo.scp
===================================================================
RCS file: /cvs/installation/scp2/source/ooo/file_library_ooo.scp,v
retrieving revision 1.156.16.1
diff -u -p -u -r1.156.16.1 file_library_ooo.scp
--- scp2/source/ooo/file_library_ooo.scp	9 Nov 2005 15:29:24 -0000	1.156.16.1
+++ scp2/source/ooo/file_library_ooo.scp	11 Nov 2005 16:49:42 -0000
@@ -417,6 +417,24 @@ End
 
 #endif
 
+#ifdef UNX
+#ifdef ENABLE_GTK
+File gid_File_Lib_Egg_Tray
+ TXT_FILE_BODY;
+ Styles = (PACKED);
+ Dir = gid_Dir_Program;
+ Name = STRING(CONCAT4(libeggtray,OFFICEUPD,DLLPOSTFIX,UNXSUFFIX));
+End
+
+File gid_File_Lib_QStart_Gtk
+    Name = LIBNAME(qstart_gtk);
+    TXT_FILE_BODY;
+    Styles = (PACKED,PATCH);
+    Dir = gid_Dir_Program;
+End
+#endif
+#endif
+
 STD_UNO_LIB_FILE_PATCH( gid_File_Lib_Dba, dba)
 
 STD_UNO_LIB_FILE( gid_File_Lib_Dbacfg, dbacfg)
Index: scp2/source/ooo/file_ooo.scp
===================================================================
RCS file: /cvs/installation/scp2/source/ooo/file_ooo.scp,v
retrieving revision 1.119
diff -u -p -u -r1.119 file_ooo.scp
--- scp2/source/ooo/file_ooo.scp	27 Oct 2005 14:08:26 -0000	1.119
+++ scp2/source/ooo/file_ooo.scp	11 Nov 2005 16:50:31 -0000
@@ -412,6 +412,15 @@ File gid_File_Share_Xdg_Printeradmin
     Name = "printeradmin.desktop";
 End
 
+#ifdef ENABLE_GTK
+File gid_File_Share_Xdg_QStart
+    TXT_FILE_BODY;
+    Dir = gid_Dir_Share_Xdg;
+    Styles = (PACKED,SCPZIP_REPLACE);
+    Name = "qstart.desktop";
+End
+#endif
+
 #endif
 
 File gid_File_Bmp_Installation
Index: config_office/configure.in
===================================================================
RCS file: /cvs/tools/config_office/configure.in,v
retrieving revision 1.139
diff -u -p -u -r1.139 configure.in
--- config_office/configure.in	25 Oct 2005 11:23:57 -0000	1.139
+++ config_office/configure.in	11 Nov 2005 17:12:25 -0000
@@ -3794,6 +3959,7 @@ if test  "$test_gtk" = "yes"; then
         PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-xlib-2.0 >= 2.2)
         GTK_CFLAGS="$GTK_CFLAGS $GDKPIXBUF_CFLAGS"
         GTK_LIBS="$GTK_LIBS $GDKPIXBUF_LIBS"
+	BUILD_TYPE="$BUILD_TYPE GTK"
     fi
 
 fi


Index: sfx2/prj/build.lst
===================================================================
RCS file: /cvs/framework/sfx2/prj/build.lst,v
retrieving revision 1.9
diff -u -p -u -r1.9 build.lst
--- sfx2/prj/build.lst	21 Jun 2005 09:45:59 -0000	1.9
+++ sfx2/prj/build.lst	11 Nov 2005 17:15:04 -0000
@@ -1,4 +1,4 @@
-sf      sfx2    :       idl basic xmlscript framework shell setup_native NULL
+sf      sfx2    :       idl basic xmlscript framework shell setup_native GTK:eggtray NULL
 sf	sfx2									usr1	-	all	sf_mkout NULL
 sf	sfx2\inc								get		-	all	sf_inc NULL
 sf	sfx2\prj								get		-	all	sf_prj NULL


Index: sysui/desktop/share/makefile.mk
===================================================================
RCS file: /cvs/gsl/sysui/desktop/share/makefile.mk,v
retrieving revision 1.10
diff -u -p -u -r1.10 makefile.mk
--- sysui/desktop/share/makefile.mk	5 Oct 2005 13:00:54 -0000	1.10
+++ sysui/desktop/share/makefile.mk	11 Nov 2005 22:24:33 -0000
@@ -60,7 +62,7 @@ ULFFILES= \
     launcher_comment.ulf \
     launcher_name.ulf
 
-LAUNCHERLIST = writer calc draw impress math base printeradmin
+LAUNCHERLIST = writer calc draw impress math base printeradmin qstart
 LAUNCHERDEPN = ../menus/{$(LAUNCHERLIST)}.desktop
 
 LAUNCHERFLAGFILE = $(COMMONMISC)/$(TARGET)/xdg.flag



--- /dev/null	2004-08-25 18:34:59.000000000 +0100
+++ sfx2/source/appl/shutdowniconunx.cxx	2006-01-05 16:44:19.819327488 +0000
@@ -0,0 +1,373 @@
+
+#ifdef ENABLE_QUICKSTART_APPLET
+
+#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+#include <svtools/moduleoptions.hxx>
+#endif
+
+#include <svtools/dynamicmenuoptions.hxx>
+
+#include <gtk/gtk.h>
+#include <glib.h>
+#include <eggtray/eggtrayicon.h>
+#include <vos/mutex.hxx>
+
+#ifndef _SV_BITMAPEX_HXX
+#include <vcl/bitmapex.hxx>
+#endif
+#ifndef _SV_BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+#ifndef _SFXAPP_HXX
+#include "app.hxx"
+#endif
+#ifndef _SFX_APP_HRC
+#include "app.hrc"
+#endif
+#ifndef __SHUTDOWNICON_HXX__
+#define USE_APP_SHORTCUTS
+#include "shutdownicon.hxx"
+#endif
+
+// Cut/paste from vcl/inc/svids.hrc
+#define SV_ICON_SMALL_START                 25000
+
+#define SV_ICON_ID_OFFICE                       1
+#define SV_ICON_ID_TEXT                         2
+#define SV_ICON_ID_SPREADSHEET                  4
+#define SV_ICON_ID_DRAWING                      6
+#define SV_ICON_ID_PRESENTATION                 8
+#define SV_ICON_ID_DATABASE                    14
+#define SV_ICON_ID_TEMPLATE                    16
+
+using namespace ::rtl;
+using namespace ::osl;
+
+static ResMgr *pVCLResMgr;
+static EggTrayIcon *pTrayIcon;
+static GtkWidget *pExitMenuItem = NULL;
+static GtkWidget *pOpenMenuItem = NULL;
+static GtkCheckMenuItem *pAutostartMenuItem = NULL;
+
+static void open_url_cb( GtkWidget *pButton, gpointer data )
+{
+	ShutdownIcon::OpenURL( *(OUString *)data,
+						   OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) );
+}
+
+static void open_file_cb( GtkWidget *pButton )
+{
+	if ( !ShutdownIcon::bModalMode )
+		ShutdownIcon::FileOpen();
+}
+
+static void open_template_cb( GtkWidget *pButton )
+{
+	if ( !ShutdownIcon::bModalMode )
+		ShutdownIcon::FromTemplate();
+}
+
+static void prelaunch_toggled_cb( GtkCheckMenuItem *pItem )
+{
+	ShutdownIcon::SetAutostart( 
+		gtk_check_menu_item_get_active( pItem ) );
+}
+
+static void exit_quickstarter_cb( GtkWidget *pButton )
+{
+	egg_tray_icon_cancel_message (pTrayIcon, 1 );
+	ShutdownIcon::getInstance()->terminateDesktop();
+	plugin_shutdown_sys_tray();
+}
+
+static void menu_deactivate_cb( GtkWidget *pMenu )
+{
+	gtk_menu_popdown( GTK_MENU( pMenu ) );
+}
+
+static GdkPixbuf * ResIdToPixbuf( USHORT nResId )
+{
+	ResId aResId( SV_ICON_SMALL_START + nResId, pVCLResMgr );
+	BitmapEx aIcon( aResId );
+	Bitmap pInSalBitmap = aIcon.GetBitmap();
+	AlphaMask pInSalAlpha = aIcon.GetAlpha();
+
+	BitmapReadAccess* pSalBitmap = pInSalBitmap.AcquireReadAccess();
+	BitmapReadAccess* pSalAlpha = pInSalAlpha.AcquireReadAccess();
+
+	g_return_val_if_fail( pSalBitmap != NULL, NULL );
+
+	Size aSize( pSalBitmap->Width(), pSalBitmap->Height() );
+	g_return_val_if_fail( Size( pSalAlpha->Width(), pSalAlpha->Height() ) == aSize, NULL );
+
+	int nX, nY;
+	guchar *pPixbufData = ( guchar * )g_malloc( 4 * aSize.Width() * aSize.Height() );
+	guchar *pDestData = pPixbufData;
+
+	for( nY = 0; nY < pSalBitmap->Height(); nY++ )
+	{
+		for( nX = 0; nX < pSalBitmap->Width(); nX++ )
+		{
+			BitmapColor aPix;
+			aPix = pSalBitmap->GetPixel( nY, nX );
+			pDestData[0] = aPix.GetRed();
+			pDestData[1] = aPix.GetGreen();
+			pDestData[2] = aPix.GetBlue();
+			if (pSalAlpha)
+			{
+				aPix = pSalAlpha->GetPixel( nY, nX );
+				pDestData[3] = 255 - aPix.GetIndex();
+			}
+			else
+				pDestData[3] = 255;
+			pDestData += 4;
+		}
+	}
+
+	pInSalBitmap.ReleaseAccess( pSalBitmap );
+	if( pSalAlpha )
+		pInSalAlpha.ReleaseAccess( pSalAlpha );
+
+	return gdk_pixbuf_new_from_data( pPixbufData,
+		GDK_COLORSPACE_RGB, TRUE, 8,
+		aSize.Width(), aSize.Height(),
+		aSize.Width() * 4,
+		(GdkPixbufDestroyNotify) g_free,
+		NULL );
+}
+
+static void oustring_delete (gpointer data,
+							 GClosure	*closure)
+{
+	OUString *pURL = (OUString *) data;
+	delete pURL;
+}
+
+static void add_item( GtkMenuShell *pMenuShell, const char *pAsciiURL,
+					  OUString *pOverrideLabel,
+					  USHORT nResId, GCallback pFnCallback )
+{
+	OUString *pURL = new OUString (OStringToOUString( pAsciiURL,
+													  RTL_TEXTENCODING_UTF8 ));
+	OString aLabel;
+	if (pOverrideLabel)
+		aLabel = OUStringToOString (*pOverrideLabel, RTL_TEXTENCODING_UTF8);
+	else
+	{
+		ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
+		aLabel = OUStringToOString (pShutdownIcon->GetUrlDescription( *pURL ),
+									RTL_TEXTENCODING_UTF8);
+	}
+
+	GdkPixbuf *pPixbuf= ResIdToPixbuf( nResId );
+	GtkWidget *pImage = gtk_image_new_from_pixbuf( pPixbuf );
+	g_object_unref( G_OBJECT( pPixbuf ) );
+
+	GtkWidget *pMenuItem = gtk_image_menu_item_new_with_label( aLabel );
+	gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage );
+	g_signal_connect_data( pMenuItem, "activate", pFnCallback, pURL, 
+						   oustring_delete, GConnectFlags(0));
+
+	gtk_menu_shell_append( pMenuShell, pMenuItem );
+}
+
+// Unbelievably nasty
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+
+static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL,
+							  OUString *pOverrideLabel,
+							  USHORT nResId, GCallback pFnCallback )
+{
+    SvtDynamicMenuOptions aOpt;
+	Sequence < Sequence < PropertyValue > > aMenu = aOpt.GetMenu( E_NEWMENU );
+	for ( sal_Int32 n=0; n<aMenu.getLength(); n++ )
+    {
+        ::rtl::OUString aURL;
+		::rtl::OUString aDescription;
+		Sequence < PropertyValue >& aEntry = aMenu[n];
+		for ( sal_Int32 m=0; m<aEntry.getLength(); m++ )
+		{
+            if ( aEntry[m].Name.equalsAsciiL( "URL", 3 ) )
+                aEntry[m].Value >>= aURL;
+            if ( aEntry[m].Name.equalsAsciiL( "Title", 5 ) )
+                aEntry[m].Value >>= aDescription;
+		}
+
+		if ( aURL.equalsAscii( BASE_URL ) && aDescription.getLength() )
+		{
+			add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback);
+            break;
+		}
+	}
+}
+
+static void populate_menu( GtkWidget *pMenu )
+{
+	ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
+	GtkMenuShell *pMenuShell = GTK_MENU_SHELL( pMenu );
+	SvtModuleOptions aModuleOptions;
+
+	if ( aModuleOptions.IsWriter() )
+		add_item (pMenuShell, WRITER_URL, NULL,
+				  SV_ICON_ID_TEXT, G_CALLBACK( open_url_cb ));
+
+	if ( aModuleOptions.IsCalc() )
+		add_item (pMenuShell, CALC_URL, NULL,
+				  SV_ICON_ID_SPREADSHEET, G_CALLBACK( open_url_cb ));
+
+	if ( aModuleOptions.IsImpress() )
+		add_item (pMenuShell, IMPRESS_URL, NULL,
+				  SV_ICON_ID_PRESENTATION, G_CALLBACK( open_url_cb ));
+
+	if ( aModuleOptions.IsDraw() )
+		add_item (pMenuShell, DRAW_URL, NULL,
+				  SV_ICON_ID_DRAWING, G_CALLBACK( open_url_cb ));
+
+    if ( aModuleOptions.IsDataBase() )
+		add_ugly_db_item (pMenuShell, BASE_URL, NULL,
+						  SV_ICON_ID_DATABASE, G_CALLBACK( open_url_cb ));
+
+	OUString aULabel = pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE );
+	add_item (pMenuShell, "dummy", &aULabel,
+			  SV_ICON_ID_TEMPLATE, G_CALLBACK( open_template_cb ));
+
+	OString aLabel;
+	GtkWidget *pMenuItem;
+
+	pMenuItem = gtk_separator_menu_item_new();
+	gtk_menu_shell_append( pMenuShell, pMenuItem );
+
+	aLabel = rtl::OUStringToOString (
+			pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ),
+			RTL_TEXTENCODING_UTF8 );
+
+	GtkWidget *pImage;
+	pImage = gtk_image_new_from_stock( GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU );
+	pMenuItem = gtk_image_menu_item_new_with_label( aLabel );
+	gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage );
+	gtk_menu_shell_append( pMenuShell, pMenuItem );
+	g_signal_connect( pMenuItem, "activate", G_CALLBACK( open_file_cb ), NULL );
+	pOpenMenuItem = GTK_WIDGET( pMenuItem );
+
+	pMenuItem = gtk_separator_menu_item_new();
+	gtk_menu_shell_append( pMenuShell, pMenuItem );
+
+	aLabel = rtl::OUStringToOString (
+			pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ),
+			RTL_TEXTENCODING_UTF8 );
+
+	pMenuItem = gtk_check_menu_item_new_with_label( aLabel );
+	pAutostartMenuItem = GTK_CHECK_MENU_ITEM( pMenuItem );
+	gtk_menu_shell_append( pMenuShell, pMenuItem);
+	gtk_check_menu_item_set_active( pAutostartMenuItem,
+									ShutdownIcon::GetAutostart() );
+	g_signal_connect( pMenuItem, "activate", G_CALLBACK( prelaunch_toggled_cb ), NULL );
+
+	pMenuItem = gtk_separator_menu_item_new();
+	gtk_menu_shell_append( pMenuShell, pMenuItem );
+
+	aLabel = rtl::OUStringToOString (
+			pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ),
+			RTL_TEXTENCODING_UTF8 );
+
+	pImage = gtk_image_new_from_stock( GTK_STOCK_QUIT,  GTK_ICON_SIZE_MENU );
+	pMenuItem = gtk_image_menu_item_new_with_label( aLabel );
+	gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM( pMenuItem ), pImage );
+	gtk_menu_shell_append( pMenuShell, pMenuItem );
+	g_signal_connect( pMenuItem, "activate", G_CALLBACK( exit_quickstarter_cb ), NULL );
+	pExitMenuItem = GTK_WIDGET( pMenuItem );
+
+	gtk_widget_show_all( pMenu );
+}
+
+static void refresh_menu( GtkWidget *pMenu )
+{
+	if (!pExitMenuItem)
+		populate_menu( pMenu );
+
+	gtk_check_menu_item_set_active( pAutostartMenuItem,
+									ShutdownIcon::GetAutostart() );
+
+	bool bModal = ShutdownIcon::bModalMode;
+	gtk_widget_set_sensitive( pExitMenuItem, !bModal);
+	gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
+}
+
+static void display_menu_cb( GtkWidget *pButton, GtkWidget *pMenu )
+{
+	refresh_menu( pMenu );
+
+	gtk_menu_popup( GTK_MENU( pMenu ), NULL, NULL,
+					NULL, NULL, 0, gtk_get_current_event_time() );
+}
+
+extern "C" {
+	static gboolean
+	show_at_idle (gpointer pTrayIcon)
+	{
+		::vos::OGuard aGuard( Application::GetSolarMutex() );
+		gtk_widget_show_all( GTK_WIDGET( pTrayIcon ) );
+		return FALSE;
+	}
+}
+
+void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
+{
+	::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+	if( !g_type_from_name( "GdkDisplay" ) )
+		return;
+
+	OString aLabel;
+	ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
+
+	aLabel = rtl::OUStringToOString (
+			pShutdownIcon->GetResString( STR_QUICKSTART_TIP ),
+			RTL_TEXTENCODING_UTF8 );
+
+	pTrayIcon = egg_tray_icon_new( aLabel );
+
+	GtkWidget *pButton = gtk_toggle_button_new();
+	GtkTooltips *pTooltips = gtk_tooltips_new();
+	gtk_tooltips_set_tip( GTK_TOOLTIPS( pTooltips ), pButton, aLabel, NULL );
+
+	GtkWidget *pIconImage = gtk_image_new();
+	gtk_container_add( GTK_CONTAINER( pButton ), pIconImage );
+
+	pVCLResMgr = CREATEVERSIONRESMGR( vcl );
+
+	GdkPixbuf *pPixbuf = ResIdToPixbuf( SV_ICON_ID_OFFICE ); 
+	gtk_image_set_from_pixbuf( GTK_IMAGE( pIconImage ), pPixbuf );
+	g_object_unref( pPixbuf );
+
+	GtkWidget *pMenu = gtk_menu_new();
+	g_signal_connect (pMenu, "deactivate",
+					  G_CALLBACK (menu_deactivate_cb), NULL);
+	g_signal_connect( pButton, "clicked",
+					  G_CALLBACK( display_menu_cb ), pMenu );
+	gtk_container_add( GTK_CONTAINER( pTrayIcon ), pButton );
+
+	// Show at idle to avoid artefacts at startup
+	g_idle_add (show_at_idle, (gpointer) pTrayIcon);
+
+	// disable shutdown
+	pShutdownIcon->SetVeto( true );
+	pShutdownIcon->addTerminateListener();
+}
+
+void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()
+{
+	::vos::OGuard aGuard( Application::GetSolarMutex() );
+	if( !pTrayIcon )
+		return;
+	gtk_widget_destroy( GTK_WIDGET( pTrayIcon ) );
+	pTrayIcon = NULL;
+	pExitMenuItem = NULL;
+	pOpenMenuItem = NULL;
+	pAutostartMenuItem = NULL;
+}
+
+#endif // ENABLE_QUICKSTART_APPLET




Index: sfx2/source/appl/shutdownicon.cxx
===================================================================
RCS file: /cvs/framework/sfx2/source/appl/shutdownicon.cxx,v
retrieving revision 1.46
diff -u -p -u -r1.46 shutdownicon.cxx
--- sfx2/source/appl/shutdownicon.cxx	19 Jun 2006 22:13:01 -0000	1.46
+++ sfx2/source/appl/shutdownicon.cxx	7 Aug 2006 13:29:29 -0000
@@ -102,7 +102,19 @@
 #ifndef _URLOBJ_HXX
 #include <tools/urlobj.hxx>
 #endif
+#ifndef _OSL_SECURITY_HXX_
+#include <osl/security.hxx>
+#endif
+#ifndef _OSL_FILE_HXX_
+#include <osl/file.hxx>
+#endif
+#ifndef _UTL_BOOTSTRAP_HXX
+#include <unotools/bootstrap.hxx>
+#endif
 
+#ifdef UNX // need symlink
+#include <unistd.h>
+#endif
 #include "sfxresid.hxx"
 
 using namespace ::com::sun::star::uno;
@@ -126,9 +138,7 @@ public:
 
 void SAL_CALL SfxNotificationListener_Impl::dispatchFinished( const DispatchResultEvent& ) throw( RuntimeException )
 {
-#ifdef WNT
 	ShutdownIcon::LeaveModalMode();
-#endif
 }
 
 void SAL_CALL SfxNotificationListener_Impl::disposing( const EventObject& ) throw( RuntimeException )
@@ -138,64 +148,85 @@ void SAL_CALL SfxNotificationListener_Im
 SFX_IMPL_XSERVICEINFO( ShutdownIcon, "com.sun.star.office.Quickstart", "com.sun.star.comp.desktop.QuickstartWrapper" )	\
 SFX_IMPL_ONEINSTANCEFACTORY( ShutdownIcon );
 
+bool ShutdownIcon::bModalMode = false;
 ShutdownIcon* ShutdownIcon::pShutdownIcon = 0;
 
-ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
-	ShutdownIconServiceBase( m_aMutex ),
-	m_bVeto ( false ),
-	m_pResMgr( 0 ),
-	m_xServiceManager( aSMgr )
-{
+// To remove conditionals
+extern "C" {
+	static void disabled_initSystray()
+	{
+		// disable shutdown
+		ShutdownIcon::getInstance()->SetVeto( true );
+		ShutdownIcon::getInstance()->addTerminateListener();
+	}
+	static void disabled_deInitSystray() { }
 }
+#define DOSTRING( x )			   			#x
+#define STRING( x )				   			DOSTRING( x )
 
-ShutdownIcon::~ShutdownIcon()
+void ShutdownIcon::initSystray()
 {
-#ifdef WNT
-    deInitSystray();
-#endif
+#ifdef ENABLE_QUICKSTART_APPLET
+	if (!m_pInitSystray)
+	{
+#  ifdef WIN32
+		m_pInitSystray = win32_init_sys_tray;
+		m_pDeInitSystray = win32_shutdown_sys_tray;
+#  else // UNX
+		m_pPlugin = new osl::Module();
+		if ( m_pPlugin->load( OUString (RTL_CONSTASCII_USTRINGPARAM( STRING( PLUGIN_NAME ) ) ) ) )
+		{
+			m_pInitSystray = (void (*)()) m_pPlugin->getSymbol(
+					OUString( RTL_CONSTASCII_USTRINGPARAM( "plugin_init_sys_tray" ) ) );
+			m_pDeInitSystray = (void (*)()) m_pPlugin->getSymbol(
+					OUString( RTL_CONSTASCII_USTRINGPARAM( "plugin_shutdown_sys_tray" ) ) );
+			OSL_ASSERT (m_pInitSystray && m_pDeInitSystray);
+		}
+		else
+		{
+			delete m_pPlugin;
+			m_pPlugin = 0;
+		}
+#  endif // UNX
+	}
+#endif // ENABLE_QUICKSTART_APPLET
+	if (!m_pInitSystray ||
+		!m_pDeInitSystray)
+	{
+		m_pInitSystray = disabled_initSystray;
+		m_pDeInitSystray = disabled_deInitSystray;
+	}
+	m_pInitSystray();
 }
 
-// ---------------------------------------------------------------------------
-
-void ShutdownIcon::SetAutostart( bool bActivate )
+void ShutdownIcon::deInitSystray()
 {
-#ifdef WNT
-    OUString aShortcutName( RTL_CONSTASCII_USTRINGPARAM( "StarOffice 6.0" ) );
-	ResMgr* pMgr = SfxResId::GetResMgr();
-    if( pMgr )
-    {
-        ::vos::OGuard aGuard( Application::GetSolarMutex() );
-        UniString aRes( SfxResId( STR_QUICKSTART_LNKNAME ) );
-        aShortcutName = OUString( aRes );
-    }
+    if (m_pDeInitSystray)
+	m_pDeInitSystray();
 
-    aShortcutName += OUString( RTL_CONSTASCII_USTRINGPARAM( ".lnk" ) );
-
-    SetAutostartW32( aShortcutName, bActivate );
-#else
-    (void)bActivate; // unused variable
-#endif
+	m_pInitSystray = 0;
+	m_pDeInitSystray = 0;
+	if (m_pPlugin)
+		delete m_pPlugin;
+	m_pPlugin = 0;
 }
 
-bool ShutdownIcon::GetAutostart( )
-{
-#ifdef WNT
-    OUString aShortcutName( RTL_CONSTASCII_USTRINGPARAM( "StarOffice 6.0" ) );
-	ResMgr* pMgr = SfxResId::GetResMgr();
-    if( pMgr )
-    {
-        ::vos::OGuard aGuard( Application::GetSolarMutex() );
-        UniString aRes( SfxResId( STR_QUICKSTART_LNKNAME ) );
-        aShortcutName = OUString( aRes );
-    }
-    aShortcutName += OUString( RTL_CONSTASCII_USTRINGPARAM( ".lnk" ) );
 
-    return GetAutostartW32( aShortcutName );
-#else
-    return false;
-#endif
+ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
+	ShutdownIconServiceBase( m_aMutex ),
+	m_bVeto ( false ),
+	m_pResMgr( 0 ),
+	m_xServiceManager( aSMgr ),
+	m_pInitSystray( 0 ),
+	m_pDeInitSystray( 0 ),
+	m_pPlugin( 0 )
+{
 }
 
+ShutdownIcon::~ShutdownIcon()
+{
+	deInitSystray();
+}
 
 // ---------------------------------------------------------------------------
 
@@ -233,9 +264,7 @@ void ShutdownIcon::FileOpen()
     if ( getInstance() && getInstance()->m_xDesktop.is() )
     {
         ::vos::OGuard aGuard( Application::GetSolarMutex() );
-#ifdef WNT
 		EnterModalMode();
-#endif
 		// use ctor for filling up filters automatically! #89169#
 		FileDialogHelper dlg( WB_OPEN | SFXWB_MULTISELECTION, String() );
         if ( ERRCODE_NONE == dlg.Execute() )
@@ -359,9 +388,7 @@ void ShutdownIcon::FileOpen()
 			{
 			}
 		}
-#ifdef WNT
 		LeaveModalMode();
-#endif
     }
 }
 
@@ -397,9 +424,7 @@ void ShutdownIcon::FromTemplate()
             Reference< ::com::sun::star::frame::XNotifyingDispatch > xNotifyer( xDisp, UNO_QUERY );
             if ( xNotifyer.is() )
 			{
-#ifdef WNT
 				EnterModalMode();
-#endif
                 xNotifyer->dispatchWithNotification( aTargetURL, aArgs, new SfxNotificationListener_Impl() );
 			}
             else
@@ -555,10 +580,9 @@ void SAL_CALL ShutdownIcon::initialize( 
 				if ( !m_xDesktop.is() )
 					return;
 
+				/* Create a sub-classed instance - foo */
 				ShutdownIcon::pShutdownIcon = this;
-#ifdef WNT
 				initSystray();
-#endif
 			}
 			catch(const ::com::sun::star::lang::IllegalArgumentException&)
 			{
@@ -576,3 +600,141 @@ void SAL_CALL ShutdownIcon::initialize( 
     }
 
 }
+
+// -------------------------------
+
+void ShutdownIcon::EnterModalMode()
+{
+	bModalMode = TRUE;
+}
+
+// -------------------------------
+
+void ShutdownIcon::LeaveModalMode()
+{
+	bModalMode = FALSE;
+}
+
+#ifdef WNT
+// defined in shutdowniconw32.cxx
+#else
+bool ShutdownIcon::IsQuickstarterInstalled()
+{
+#ifndef ENABLE_QUICKSTART_APPLET
+	return false;
+#endif // !ENABLE_QUICKSTART_APPLET
+#ifdef UNX
+	return true;
+#endif // UNX
+}
+#endif // !WNT
+
+// ---------------------------------------------------------------------------
+
+#if defined (ENABLE_QUICKSTART_APPLET) && defined (UNX)
+static OUString getDotAutostart( bool bCreate = false )
+{
+	OUString aShortcut;
+	const char *pConfigHome;
+	if( (pConfigHome = getenv("XDG_CONFIG_HOME") ) )
+		aShortcut = OStringToOUString( OString( pConfigHome ), RTL_TEXTENCODING_UTF8 );
+	else
+	{
+		OUString aHomeURL;
+		osl::Security().getHomeDir( aHomeURL );
+		::osl::File::getSystemPathFromFileURL( aHomeURL, aShortcut );
+		aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/.config" ) );
+	}
+	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/autostart" ) );
+	if (bCreate)
+	{
+		OUString aShortcutUrl;
+		osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
+		osl::Directory::createPath( aShortcutUrl );
+	}
+	return aShortcut;
+}
+#endif
+
+rtl::OUString ShutdownIcon::getShortcutName()
+{
+#ifndef ENABLE_QUICKSTART_APPLET
+	return OUString();
+#else
+
+    OUString aShortcutName( RTL_CONSTASCII_USTRINGPARAM( "StarOffice 6.0" ) );
+	ResMgr* pMgr = SfxResId::GetResMgr();
+    if( pMgr )
+    {
+        ::vos::OGuard aGuard( Application::GetSolarMutex() );
+        UniString aRes( SfxResId( STR_QUICKSTART_LNKNAME ) );
+        aShortcutName = OUString( aRes );
+    }
+#ifdef WNT
+    aShortcutName += OUString( RTL_CONSTASCII_USTRINGPARAM( ".lnk" ) );
+
+	OUString aShortcut(GetAutostartFolderNameW32());
+	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
+	aShortcut += aShortcutName;
+#else // UNX
+	OUString aShortcut = getDotAutostart();
+	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "/ooqstart.desktop" ) );
+#endif // UNX
+	return aShortcut;
+#endif // ENABLE_QUICKSTART_APPLET
+}
+
+bool ShutdownIcon::GetAutostart( )
+{
+	bool bRet = false;
+#ifdef ENABLE_QUICKSTART_APPLET
+	OUString aShortcut( getShortcutName() );
+	OUString aShortcutUrl;
+	osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
+	osl::File f( aShortcutUrl );
+	osl::File::RC error = f.open( OpenFlag_Read );
+	if( error == osl::File::E_None )
+	{
+		f.close();
+		bRet = true;
+	}
+#endif // ENABLE_QUICKSTART_APPLET
+    return bRet;
+}
+
+void ShutdownIcon::SetAutostart( bool bActivate )
+{
+#ifdef ENABLE_QUICKSTART_APPLET
+	OUString aShortcut( getShortcutName() );
+
+    if( bActivate && IsQuickstarterInstalled() )
+    {
+#ifdef WNT
+		EnableAutostartW32( aShortcut );
+#else // UNX
+		getDotAutostart( true );
+
+		OUString aPath;
+		::utl::Bootstrap::locateBaseInstallation(aPath);
+
+		OUString aDesktopFile;
+		::osl::File::getSystemPathFromFileURL( aPath, aDesktopFile );
+		aDesktopFile += OUString( RTL_CONSTASCII_USTRINGPARAM( "/share/xdg/qstart.desktop" ) );
+
+		OString aDesktopFileUnx = OUStringToOString( aDesktopFile,
+													 osl_getThreadTextEncoding() );
+		OString aShortcutUnx = OUStringToOString( aShortcut,
+												  osl_getThreadTextEncoding() );
+		symlink( aDesktopFileUnx, aShortcutUnx );
+#endif // UNX
+    }
+    else
+    {
+        OUString aShortcutUrl;
+        ::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
+        ::osl::File::remove( aShortcutUrl );
+    }
+#else
+    (void)bActivate; // unused variable
+#endif // ENABLE_QUICKSTART_APPLET
+}
Index: sfx2/source/appl/shutdownicon.hxx
===================================================================
RCS file: /cvs/framework/sfx2/source/appl/shutdownicon.hxx,v
retrieving revision 1.18
diff -u -p -u -r1.18 shutdownicon.hxx
--- sfx2/source/appl/shutdownicon.hxx	30 Mar 2005 08:41:34 -0000	1.18
+++ sfx2/source/appl/shutdownicon.hxx	7 Aug 2006 13:29:29 -0000
@@ -35,12 +35,18 @@
 #ifndef _OSL_MUTEX_HXX_
 #include <osl/mutex.hxx>
 #endif
+#ifndef _OSL_MODULE_HXX_
+#include <osl/module.hxx>
+#endif
 #ifndef _SFX_SFXUNO_HXX
 #include <sfxuno.hxx>
 #endif
 #ifndef _CPPUHELPER_COMPBASE3_HXX_
 #include <cppuhelper/compbase3.hxx>
 #endif
+#ifndef INCLUDED_SFX2_DLLAPI_H
+#include <sfx2/dllapi.h>
+#endif
 
 class ResMgr;
 
@@ -49,7 +55,17 @@ typedef ::cppu::WeakComponentImplHelper3
 	::com::sun::star::frame::XTerminateListener,
 	::com::sun::star::lang::XServiceInfo > ShutdownIconServiceBase;
 
-class ShutdownIcon :	public ShutdownIconServiceBase
+#if defined(USE_APP_SHORTCUTS)
+#define WRITER_URL      "private:factory/swriter"
+#define CALC_URL        "private:factory/scalc"
+#define IMPRESS_URL     "private:factory/simpress"
+#define IMPRESS_WIZARD_URL     "private:factory/simpress?slot=10425"
+#define DRAW_URL        "private:factory/sdraw"
+#define MATH_URL        "private:factory/smath"
+#define BASE_URL        "private:factory/sdatabase?Interactive"
+#endif
+
+class SFX2_DLLPUBLIC ShutdownIcon :	public ShutdownIconServiceBase
 {
 		::osl::Mutex	m_aMutex;
         bool            m_bVeto;
@@ -58,16 +74,18 @@ class ShutdownIcon :	public ShutdownIcon
 
         static ShutdownIcon *pShutdownIcon; // one instance
 
-#ifdef WNT
-        void initSystray();
-        void deInitSystray();
-        static void SetAutostartW32( const ::rtl::OUString& aShortcutName, bool bActivate );
-        static bool GetAutostartW32( const ::rtl::OUString& aShortcutName );
+		void (*m_pInitSystray)   ();
+		void (*m_pDeInitSystray) ();
+		::osl::Module  *m_pPlugin;
+
+		void initSystray();
+		void deInitSystray();
+
 		static void EnterModalMode();
 		static void LeaveModalMode();
+		static rtl::OUString getShortcutName();
 
 		friend class SfxNotificationListener_Impl;
-#endif
 
 	public:
 		ShutdownIcon( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > aSMgr );
@@ -88,6 +106,7 @@ class ShutdownIcon :	public ShutdownIcon
 
         static void SetAutostart( bool bActivate );
         static bool GetAutostart();
+		static bool bModalMode;
 
 		static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >
 					GetWrapperFactory( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSMgr );
@@ -99,9 +118,7 @@ class ShutdownIcon :	public ShutdownIcon
         void SetVeto( bool bVeto )  { m_bVeto = bVeto;}
         bool GetVeto()              { return m_bVeto; }
 
-#ifdef WNT
         static bool IsQuickstarterInstalled();
-#endif
 
 		// Component Helper - force override
 		virtual void SAL_CALL disposing();
@@ -121,6 +138,22 @@ class ShutdownIcon :	public ShutdownIcon
 			throw( ::com::sun::star::uno::Exception );
 
 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop > m_xDesktop;
+
+#ifdef WNT
+		static void EnableAutostartW32( const rtl::OUString &aShortcutName ); 
+		static rtl::OUString GetAutostartFolderNameW32();
+#endif
 };
 
+extern "C" {
+#  ifdef WNT
+	// builtin win32 systray
+	void win32_init_sys_tray();
+	void win32_shutdown_sys_tray();
+#  endif
+	// external plugin systray impl.
+	void plugin_init_sys_tray();
+	void plugin_shutdown_sys_tray();
+}
+
 #endif
Index: sfx2/source/appl/shutdowniconw32.cxx
===================================================================
RCS file: /cvs/framework/sfx2/source/appl/shutdowniconw32.cxx,v
retrieving revision 1.36
diff -u -p -u -r1.36 shutdowniconw32.cxx
--- sfx2/source/appl/shutdowniconw32.cxx	29 Mar 2006 08:42:50 -0000	1.36
+++ sfx2/source/appl/shutdowniconw32.cxx	7 Aug 2006 13:29:29 -0000
@@ -55,7 +55,6 @@
 #include <stdio.h>
 #include <io.h>
 #include <osl/thread.h>
-#include <osl/file.hxx>
 #include <setup_native/qswin32.h>
 
 #ifndef _COMPHELPER_PROCESSFACTORY_HXX_
@@ -102,16 +101,6 @@ using namespace ::osl;
 #define IDM_UNINSTALL               11
 
 
-#if defined(USE_APP_SHORTCUTS)
-#define WRITER_URL      "private:factory/swriter"
-#define CALC_URL        "private:factory/scalc"
-#define IMPRESS_URL     "private:factory/simpress"
-#define IMPRESS_WIZARD_URL     "private:factory/simpress?slot=6686"
-#define DRAW_URL        "private:factory/sdraw"
-#define MATH_URL        "private:factory/smath"
-#define BASE_URL        "private:factory/sdatabase?Interactive"
-#endif
-
 #define ICON_SO_DEFAULT 				1
 #define ICON_TEXT_DOCUMENT				2
 #define ICON_TEXT_TEMPLATE				3
@@ -137,7 +126,6 @@ using namespace ::osl;
 
 static HWND  aListenerWindow = NULL;
 static HWND  aExecuterWindow = NULL;
-static BOOL	 bModalMode = FALSE;
 static HMENU popupMenu = NULL;
 
 static void OnMeasureItem(HWND hwnd, LPMEASUREITEMSTRUCT lpmis);
@@ -398,10 +386,10 @@ LRESULT CALLBACK listenerWndProc( HWND h
                     // update status before showing menu, could have been changed from option page
                     CheckMenuItem( popupMenu, IDM_INSTALL, MF_BYCOMMAND| (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) );
 
-					EnableMenuItem( popupMenu, IDM_EXIT, MF_BYCOMMAND | (bModalMode ? MF_GRAYED : MF_ENABLED) );
+					EnableMenuItem( popupMenu, IDM_EXIT, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
 #if defined(USE_APP_SHORTCUTS)
-					EnableMenuItem( popupMenu, IDM_OPEN, MF_BYCOMMAND | (bModalMode ? MF_GRAYED : MF_ENABLED) );
-					EnableMenuItem( popupMenu, IDM_TEMPLATE, MF_BYCOMMAND | (bModalMode ? MF_GRAYED : MF_ENABLED) );
+					EnableMenuItem( popupMenu, IDM_OPEN, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
+					EnableMenuItem( popupMenu, IDM_TEMPLATE, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
 #endif
                     int m = TrackPopupMenuEx( popupMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_RIGHTBUTTON,
                                               pt.x, pt.y, hWnd, NULL );
@@ -496,7 +484,7 @@ LRESULT CALLBACK executerWndProc( HWND h
             {
 #if defined(USE_APP_SHORTCUTS)
                 case IDM_OPEN:
-					if ( !bModalMode && checkOEM() )
+					if ( !ShutdownIcon::bModalMode && checkOEM() )
 						ShutdownIcon::FileOpen();
                 break;
                 case IDM_WRITER:
@@ -520,7 +508,7 @@ LRESULT CALLBACK executerWndProc( HWND h
                     ShutdownIcon::OpenURL( OUString( RTL_CONSTASCII_USTRINGPARAM( BASE_URL ) ), OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ) );
                 break;
                 case IDM_TEMPLATE:
-					if ( !bModalMode && checkOEM())
+					if ( !ShutdownIcon::bModalMode && checkOEM())
 						ShutdownIcon::FromTemplate();
                 break;
 #endif
@@ -530,7 +518,7 @@ LRESULT CALLBACK executerWndProc( HWND h
                 case IDM_EXIT:
                     // remove listener and
                     //  terminate office if running in background
-					if ( !bModalMode )
+					if ( !ShutdownIcon::bModalMode )
 						ShutdownIcon::terminateDesktop();
                     break;
             }
@@ -574,9 +562,9 @@ DWORD WINAPI SystrayThread( LPVOID lpPar
 
 // -------------------------------
 
-void ShutdownIcon::initSystray()
+void win32_init_sys_tray()
 {
-	if ( IsQuickstarterInstalled() )
+	if ( ShutdownIcon::IsQuickstarterInstalled() )
 	{
 		WNDCLASSEXA listenerClass;
 		listenerClass.cbSize		= sizeof(WNDCLASSEX);
@@ -625,15 +613,15 @@ void ShutdownIcon::initSystray()
 			);
 
 		DWORD	dwThreadId;
-		HANDLE	hThread = CreateThread( NULL, 0, SystrayThread, this, 0, &dwThreadId );
+		HANDLE	hThread = CreateThread( NULL, 0, SystrayThread, NULL, 0, &dwThreadId );
 	}
 }
 
 // -------------------------------
 
-void ShutdownIcon::deInitSystray()
+void win32_shutdown_sys_tray()
 {
-	if ( IsQuickstarterInstalled() )
+	if ( ShutdownIcon::IsQuickstarterInstalled() )
 	{
 		if( IsWindow( aListenerWindow ) )
 		{
@@ -648,19 +636,6 @@ void ShutdownIcon::deInitSystray()
 }
 
 
-// -------------------------------
-
-void ShutdownIcon::EnterModalMode()
-{
-	bModalMode = TRUE;
-}
-
-// -------------------------------
-
-void ShutdownIcon::LeaveModalMode()
-{
-	bModalMode = FALSE;
-}
 
 // -------------------------------
 
@@ -808,7 +783,7 @@ static OUString _SHGetSpecialFolder( int
 	return aFolder;
 }
 
-static OUString SHGetAutostartFolderName()
+OUString ShutdownIcon::GetAutostartFolderNameW32()
 {
 	return _SHGetSpecialFolder(CSIDL_STARTUP);
 }
@@ -915,68 +890,35 @@ bool ShutdownIcon::IsQuickstarterInstall
 	return FileExistsW( quickstartExe.getStr() );
 }
 
-void ShutdownIcon::SetAutostartW32( const OUString& aShortcutName, bool bActivate )
+void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut )
 {
-    OUString aShortcut(SHGetAutostartFolderName());
-    aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
-    aShortcut += aShortcutName;
-
-    if( bActivate && IsQuickstarterInstalled() )
-    {
-        wchar_t aPath[_MAX_PATH];
-        if( isNT() )
-        {
-            GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
-        }
-        else
-        {
-            char szPathA[_MAX_PATH];
-            int len = GetModuleFileNameA( NULL, szPathA, _MAX_PATH-1);
-
-		    // calc the string wcstr len
-		    int nNeededWStrBuffSize = MultiByteToWideChar( CP_ACP, 0, szPathA, -1, NULL, 0 );
-
-		    // copy the string if necessary
-		    if ( nNeededWStrBuffSize > 0 )
-			    MultiByteToWideChar( CP_ACP, 0, szPathA, -1, aPath, nNeededWStrBuffSize );
-	    }
+	wchar_t aPath[_MAX_PATH];
+	if( isNT() )
+		GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
+	else
+	{
+		char szPathA[_MAX_PATH];
+		int len = GetModuleFileNameA( NULL, szPathA, _MAX_PATH-1);
 
-        OUString aOfficepath( aPath );
-        int i = aOfficepath.lastIndexOf((sal_Char) '\\');
-        if( i != -1 )
-            aOfficepath = aOfficepath.copy(0, i);
+		// calc the string wcstr len
+		int nNeededWStrBuffSize = MultiByteToWideChar( CP_ACP, 0, szPathA, -1, NULL, 0 );
 
-        OUString quickstartExe(aOfficepath);
-        quickstartExe += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\quickstart.exe" ) );
+		// copy the string if necessary
+		if ( nNeededWStrBuffSize > 0 )
+			MultiByteToWideChar( CP_ACP, 0, szPathA, -1, aPath, nNeededWStrBuffSize );
+	}
 
-        CreateShortcut( quickstartExe, aOfficepath, aShortcut, OUString(), OUString() );
-    }
-    else
-    {
-        OUString aShortcutUrl;
-        ::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
-        ::osl::File::remove( aShortcutUrl );
-    }
+	OUString aOfficepath( aPath );
+	int i = aOfficepath.lastIndexOf((sal_Char) '\\');
+	if( i != -1 )
+		aOfficepath = aOfficepath.copy(0, i);
+
+	OUString quickstartExe(aOfficepath);
+	quickstartExe += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\quickstart.exe" ) );
+		
+	CreateShortcut( quickstartExe, aOfficepath, aShortcut, OUString(), OUString() );
 }
 
-bool ShutdownIcon::GetAutostartW32( const OUString& aShortcutName )
-{
-	OUString aShortcut(SHGetAutostartFolderName());
-	aShortcut += OUString( RTL_CONSTASCII_USTRINGPARAM( "\\" ) );
-	aShortcut += aShortcutName;
-
-	OUString aShortcutUrl;
-	File::getFileURLFromSystemPath( aShortcut, aShortcutUrl );
-	File f( aShortcutUrl );
-	File::RC error = f.open( OpenFlag_Read );
-	if( error == File::E_None )
-	{
-		f.close();
-		return true;
-	}
-	else
-		return false;
-}
 #endif // WNT
 
 
