~ubuntu-branches/ubuntu/wily/psi/wily-proposed

« back to all changes in this revision

Viewing changes to src/tools/trayicon/trayicon_win.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <QBitmap>
28
28
#include <QCursor>
29
29
#include <QLibrary>
30
 
#include <QPainter>
31
30
 
32
31
#include <qt_windows.h>
33
32
 
40
39
static void resolveLibs()
41
40
{
42
41
        QLibrary lib("shell32");
43
 
        lib.setAutoUnload( FALSE );
44
 
        static bool triedResolve = FALSE;
 
42
        lib.setAutoUnload( false );
 
43
        static bool triedResolve = false;
45
44
        if ( !ptrShell_NotifyIcon && !triedResolve ) {
46
 
                triedResolve = TRUE;
 
45
                triedResolve = true;
47
46
                ptrShell_NotifyIcon = (PtrShell_NotifyIcon) lib.resolve( "Shell_NotifyIconW" );
48
47
        }
49
48
}
118
117
                                // Tip is limited to 63 + NULL; lstrcpyn appends a NULL terminator.
119
118
                                QString tip = iconObject->toolTip().left( 63 ) + QChar();
120
119
                                lstrcpynW(tnd.szTip, (TCHAR*)tip.unicode(), QMIN( tip.length()+1, 64 ) );
121
 
                                //              lstrcpynW(tnd.szTip, (TCHAR*)qt_winTchar( tip, FALSE ), QMIN( tip.length()+1, 64 ) );
 
120
                                //              lstrcpynW(tnd.szTip, (TCHAR*)qt_winTchar( tip, false ), QMIN( tip.length()+1, 64 ) );
122
121
                        }
123
122
                }
124
123
                return ptrShell_NotifyIcon(msg, &tnd);
137
136
    bool iconDrawItem(LPDRAWITEMSTRUCT lpdi)
138
137
    {
139
138
                if (!hIcon)
140
 
                        return FALSE;
 
139
                        return false;
141
140
 
142
141
                DrawIconEx(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top, hIcon, 0, 0, 0, NULL, DI_NORMAL );
143
 
                return TRUE;
 
142
                return true;
144
143
    }
145
144
 
146
145
    bool winEvent( MSG *m, long *result )