Line
Link Here
|
0 |
-- sfx2/source/appl/shutdownicon.cxx |
0 |
++ sfx2/source/appl/shutdownicon.cxx |
Lines 69-74
Link Here
|
69 |
#include <unistd.h> |
69 |
#include <unistd.h> |
70 |
#include <errno.h> |
70 |
#include <errno.h> |
71 |
#endif |
71 |
#endif |
|
|
72 |
#include <vcl/timer.hxx> |
72 |
|
73 |
|
73 |
#include "sfxresid.hxx" |
74 |
#include "sfxresid.hxx" |
74 |
|
75 |
|
Lines 186-191
Link Here
|
186 |
return true; |
187 |
return true; |
187 |
} |
188 |
} |
188 |
|
189 |
|
|
|
190 |
class IdleUnloader : Timer |
191 |
{ |
192 |
::osl::Module *m_pModule; |
193 |
public: |
194 |
IdleUnloader (::osl::Module **pModule) : |
195 |
m_pModule (*pModule) |
196 |
{ |
197 |
*pModule = NULL; |
198 |
Start(); |
199 |
} |
200 |
virtual void Timeout() |
201 |
{ |
202 |
delete m_pModule; |
203 |
delete this; |
204 |
} |
205 |
}; |
206 |
|
189 |
void ShutdownIcon::initSystray() |
207 |
void ShutdownIcon::initSystray() |
190 |
{ |
208 |
{ |
191 |
if (m_bInitialized) |
209 |
if (m_bInitialized) |
Lines 201-215
Link Here
|
201 |
{ |
221 |
{ |
202 |
if (!m_bInitialized) |
222 |
if (!m_bInitialized) |
203 |
return; |
223 |
return; |
|
|
224 |
|
204 |
if (m_pDeInitSystray) |
225 |
if (m_pDeInitSystray) |
205 |
m_pDeInitSystray(); |
226 |
m_pDeInitSystray(); |
206 |
|
227 |
|
207 |
m_bVeto = false; |
228 |
m_bVeto = false; |
208 |
m_pInitSystray = 0; |
229 |
m_pInitSystray = 0; |
209 |
m_pDeInitSystray = 0; |
230 |
m_pDeInitSystray = 0; |
210 |
if (m_pPlugin) |
231 |
new IdleUnloader (&m_pPlugin); |
211 |
delete m_pPlugin; |
232 |
|
212 |
m_pPlugin = 0; |
|
|
213 |
delete m_pFileDlg; |
233 |
delete m_pFileDlg; |
214 |
m_pFileDlg = NULL; |
234 |
m_pFileDlg = NULL; |
215 |
m_bInitialized = false; |
235 |
m_bInitialized = false; |
Lines 228-233
Link Here
|
228 |
ShutdownIcon::~ShutdownIcon() |
249 |
ShutdownIcon::~ShutdownIcon() |
229 |
{ |
250 |
{ |
230 |
deInitSystray(); |
251 |
deInitSystray(); |
|
|
252 |
new IdleUnloader (&m_pPlugin); |
231 |
} |
253 |
} |
232 |
|
254 |
|
233 |
// --------------------------------------------------------------------------- |
255 |
// --------------------------------------------------------------------------- |
Lines 853-861
Link Here
|
853 |
::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl ); |
884 |
::osl::File::getFileURLFromSystemPath( aShortcut, aShortcutUrl ); |
854 |
::osl::File::remove( aShortcutUrl ); |
885 |
::osl::File::remove( aShortcutUrl ); |
855 |
#ifdef UNX |
886 |
#ifdef UNX |
856 |
ShutdownIcon *pIcon = getInstance(); |
887 |
if (pShutdownIcon) |
857 |
if( pIcon ) |
888 |
{ |
858 |
pIcon->deInitSystray(); |
889 |
ShutdownIcon *pIcon = getInstance(); |
|
|
890 |
pIcon->deInitSystray(); |
891 |
} |
859 |
#endif |
892 |
#endif |
860 |
} |
893 |
} |
861 |
#elif defined OS2 |
894 |
#elif defined OS2 |
862 |
-- libegg/source/eggtrayicon.c |
895 |
++ libegg/source/eggtrayicon.c |
Lines 76-81
Link Here
|
76 |
static void egg_tray_icon_manager_window_destroyed (EggTrayIcon *icon); |
76 |
static void egg_tray_icon_manager_window_destroyed (EggTrayIcon *icon); |
77 |
#endif |
77 |
#endif |
78 |
|
78 |
|
|
|
79 |
/* |
80 |
* This is made somewhat more 'interesting' by the facts that: |
81 |
* a) GTypePlugin is a foul & tangled mess |
82 |
* b) We may have been unloaded, and left an invalid |
83 |
* EggTrayIcon class lying around in the GType database, |
84 |
* we could use GTypePlugin to fix this, but see a) - |
85 |
* this is far easier and simpler. |
86 |
*/ |
79 |
GType |
87 |
GType |
80 |
egg_tray_icon_get_type (void) |
88 |
egg_tray_icon_get_type (void) |
81 |
{ |
89 |
{ |
Lines 88-105
Link Here
|
88 |
sizeof (EggTrayIconClass), |
96 |
sizeof (EggTrayIconClass), |
89 |
(GBaseInitFunc) NULL, |
97 |
(GBaseInitFunc) NULL, |
90 |
(GBaseFinalizeFunc) NULL, |
98 |
(GBaseFinalizeFunc) NULL, |
91 |
(GClassInitFunc) egg_tray_icon_class_init, |
99 |
(GClassInitFunc) NULL, /* class_init */ |
92 |
NULL, /* class_finalize */ |
100 |
NULL, /* class_finalize */ |
93 |
NULL, /* class_data */ |
101 |
NULL, /* class_data */ |
94 |
sizeof (EggTrayIcon), |
102 |
sizeof (EggTrayIcon), |
95 |
0, /* n_preallocs */ |
103 |
0, /* n_preallocs */ |
96 |
(GInstanceInitFunc) egg_tray_icon_init, |
104 |
(GInstanceInitFunc) NULL, /* instance_init */ |
97 |
NULL |
105 |
NULL |
98 |
}; |
106 |
}; |
99 |
|
107 |
|
100 |
our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0); |
108 |
our_type = g_type_from_name ("EggTrayIcon"); |
|
|
109 |
if (!our_type) |
110 |
our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0); |
101 |
} |
111 |
} |
102 |
|
112 |
|
|
|
113 |
/* always overwrite the function pointers */ |
114 |
egg_tray_icon_class_init (g_type_class_ref (our_type)); |
115 |
|
103 |
return our_type; |
116 |
return our_type; |
104 |
} |
117 |
} |
105 |
|
118 |
|
Lines 128-149
Link Here
|
128 |
|
141 |
|
129 |
container_class->add = egg_tray_icon_add; |
142 |
container_class->add = egg_tray_icon_add; |
130 |
|
143 |
|
131 |
g_object_class_install_property (gobject_class, |
144 |
if (!g_object_class_find_property (gobject_class, "orientation")) |
132 |
PROP_ORIENTATION, |
145 |
g_object_class_install_property (gobject_class, |
133 |
g_param_spec_enum ("orientation", |
146 |
PROP_ORIENTATION, |
134 |
_("Orientation"), |
147 |
g_param_spec_enum ("orientation", |
135 |
_("The orientation of the tray."), |
148 |
"Orientation", |
136 |
GTK_TYPE_ORIENTATION, |
149 |
"The orientation of the tray.", |
137 |
GTK_ORIENTATION_HORIZONTAL, |
150 |
GTK_TYPE_ORIENTATION, |
138 |
G_PARAM_READABLE)); |
151 |
GTK_ORIENTATION_HORIZONTAL, |
139 |
|
152 |
G_PARAM_READABLE)); |
140 |
#if defined (GDK_WINDOWING_X11) |
|
|
141 |
/* Nothing */ |
142 |
#elif defined (GDK_WINDOWING_WIN32) |
143 |
g_warning ("Port eggtrayicon to Win32"); |
144 |
#else |
145 |
g_warning ("Port eggtrayicon to this GTK+ backend"); |
146 |
#endif |
147 |
} |
153 |
} |
148 |
|
154 |
|
149 |
static void |
155 |
static void |
Lines 471-477
Link Here
|
471 |
EggTrayIcon* |
477 |
EggTrayIcon* |
472 |
egg_tray_icon_new (const gchar *name) |
478 |
egg_tray_icon_new (const gchar *name) |
473 |
{ |
479 |
{ |
474 |
return g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL); |
480 |
EggTrayIcon *icon = g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL); |
|
|
481 |
egg_tray_icon_init (icon); |
482 |
return icon; |
475 |
} |
483 |
} |
476 |
|
484 |
|
477 |
guint |
485 |
guint |