Changeset 835 for trunk/src/gui/util/qsystemtrayicon_pm.cpp
- Timestamp:
- Mar 18, 2011, 2:10:26 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/util/qsystemtrayicon_pm.cpp
r659 r835 48 48 #include "qapplication.h" 49 49 #include "qdesktopwidget.h" 50 #include "qlibrary.h" 50 51 #include "qt_os2.h" 51 52 52 #include "xsystray_api.h" 53 // for dynamic linking to xsystray DLL 54 #define xstQuerySysTrayVersion (*_xstQuerySysTrayVersion) 55 #define xstAddSysTrayIcon (*_xstAddSysTrayIcon) 56 #define xstReplaceSysTrayIcon (*_xstReplaceSysTrayIcon) 57 #define xstRemoveSysTrayIcon (*_xstRemoveSysTrayIcon) 58 #define xstSetSysTrayIconToolTip (*_xstSetSysTrayIconToolTip) 59 #define xstQuerySysTrayIconRect (*_xstQuerySysTrayIconRect) 60 #define xstGetSysTrayCreatedMsgId (*_xstGetSysTrayCreatedMsgId) 61 #define xstGetSysTrayMaxTextLen (*_xstGetSysTrayMaxTextLen) 62 63 #include "xsystray.h" 53 64 54 65 QT_BEGIN_NAMESPACE … … 56 67 #define WM_XST_MYNOTIFY (WM_USER + 1000) 57 68 58 static ULONG WM_XST_CREATED = xstGetSysTrayCreatedMsgId();59 static ULONG MaxTextLen = xstGetSysTrayMaxTextLen();69 static ULONG WM_XST_CREATED = 0; 70 static ULONG MaxTextLen = 0; 60 71 61 72 class QSystemTrayIconSys : QWidget … … 307 318 bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys() 308 319 { 320 static bool tried = false; 321 if (!tried) { 322 tried = true; 323 324 // link to the xsystray DLL at runtime 325 QLibrary xsystray(QLatin1String("xsystray")); 326 327 #define R(f) if ((*((void **)&_##f) = xsystray.resolve(#f)) == NULL) return false 328 329 R(xstQuerySysTrayVersion); 330 R(xstAddSysTrayIcon); 331 R(xstReplaceSysTrayIcon); 332 R(xstRemoveSysTrayIcon); 333 R(xstSetSysTrayIconToolTip); 334 R(xstQuerySysTrayIconRect); 335 R(xstGetSysTrayCreatedMsgId); 336 R(xstGetSysTrayMaxTextLen); 337 338 #undef R 339 340 // initialize some constants 341 WM_XST_CREATED = xstGetSysTrayCreatedMsgId(); 342 MaxTextLen = xstGetSysTrayMaxTextLen(); 343 } 344 309 345 return xstQuerySysTrayVersion(0, 0, 0); 310 346 }
Note:
See TracChangeset
for help on using the changeset viewer.