Changeset 273 for trunk


Ignore:
Timestamp:
Nov 2, 2009, 3:10:29 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

3rdparty: os2/xsystray: Use custom shared memory pool for structures posted by the server to the client windows. Process mouse/wheel and context menu messages in the icon area and post them to the respective client windows. Use smaller spacing between icons (one pad unit instead of two).

Location:
trunk/src/3rdparty/os2/xsystray
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/3rdparty/os2/xsystray/xsystray.c

    r270 r273  
    111111 */
    112112
    113 typedef struct _ICONDATA
     113typedef struct
    114114{
    115115    HWND        hwnd;
    116116                // associated window
    117     ULONG       ulId;
     117    UId;
    118118                // icon ID
    119119    HPOINTER    hIcon;
     
    123123    PSZ         pszToolTip;
    124124                // icon tooltip (NULL if none)
     125
     126
     127
    125128
    126129} ICONDATA, *PICONDATA;
     
    147150    size_t      cIconsMax;
    148151                // maximum number of icons pIcons can fit
     152
     153
    149154
    150155} SYSTRAYDATA, *PSYSTRAYDATA;
     
    154159        // space for the newly added icon
    155160
    156 static ULONG QWL_USER_SERVER_DATA = 0;
    157              // offset to the PXCENTERWIDGET pointer in the widget data array
     161#define SERVER_MEMORYPOOL_SIZE 65536
     162        // taking NOTIFYDATA size into account (<=32 B), this is enough for at
     163        // least 2048 simultaneous notification messages, which (even taking
     164        // slowly responsing clients into account) sounds sane since in most
     165        // cases the structure is freed once it reaches the target event queue
     166        // and before a message created as a copy of it is sent to the target
     167        // window procedure
    158168
    159169#define TID_CHECKALIVE          1
     
    161171#define TID_CHECKALIVE_TIMEOUT  2000 // ms
    162172         // how often to perform alive checks
     173
     174
     175
     176
     177
     178
     179
     180
    163181
    164182static
     
    299317{
    300318    pData->hwnd = NULLHANDLE;
    301     pData->ulId = 0;
     319    pData->uId = 0;
    302320    if (pData->hIcon != NULLHANDLE)
    303321    {
     
    323341PICONDATA FindIconData(PSYSTRAYDATA pSysTrayData,
    324342                       HWND hwnd,       // in: associated window handle
    325                        ULONG ulId,      // in: icon ID
     343                       U     // in: icon ID
    326344                       size_t *pIdx)    // out: index of the icon in the icon array
    327345                                        // (optional, may be NULL)
     
    331349    {
    332350        if (pSysTrayData->pIcons[i].hwnd == hwnd &&
    333             pSysTrayData->pIcons[i].ulId == ulId)
     351            pSysTrayData->pIcons[i].uId)
    334352        {
    335353            if (pIdx)
     
    342360        *pIdx = i;
    343361    return NULL;
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
     417
     418
     419
     420
     421
     422
     423
     424
     425
     426
     427
     428
     429
     430
     431
     432
     433
     434
     435
     436
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
     447
     448
     449
     450
     451
     452
     453
     454
     455
     456
     457
     458
     459
     460
     461
     462
     463
     464
     465
     466
     467
     468
     469
     470
     471
     472
     473
     474
     475
     476
     477
     478
     479
     480
    344481}
    345482
     
    404541            {
    405542                PSIZEL pszl = (PSIZEL)mp2;
    406                 LONG pad2 = pSysTrayData->lIconPad * 2;
    407                 pszl->cx = (pSysTrayData->lIconWidth + pad2) * pSysTrayData->cIcons; // desired width
    408                 pszl->cy = pSysTrayData->lIconHeight + pad2; // desired minimum height
     543                LONG pad = pSysTrayData->lIconPad;
     544                size_t cnt = pSysTrayData->cIcons;
     545                // desired width
     546                if (cnt)
     547                    pszl->cx = pad + (pSysTrayData->lIconWidth + pad) * cnt;
     548                else
     549                    pszl->cx = 0;
     550                // desired minimum height
     551                pszl->cy = pSysTrayData->lIconHeight + pad * 2;
    409552                brc = TRUE;
    410553            }
     
    421564 *      implementation for WM_PAINT in fnwpXSysTray.
    422565 *
    423  *      This really does nothing, except painting a
    424  *      3D rectangle and printing a question mark.
     566 *      Draws all the icons. If the widget's center is located to the left from
     567 *      the XCenter's center, icons go left to right. Otherwise, they go right
     568 *      to left.
     569 */
     570/*
     571        +---------------------------+  p = lIconPad
     572        |     p                     |  w = lIconWidth
     573        |   +-------+   +-------+   |  h = lIconHeight
     574        | p |   w   | p |   w   | p |
     575        |   |      h|   |      h|   |
     576        |   |       |   |       |   |  If "Frame around statics" is on in XCenter
     577        |   +-------+   +-------+   |  properties, then a 1 px 3D frame is drawn
     578        |     p                     |  within the pad area. So, lIconPad must
     579        +---------------------------+  be at least 2 px.
    425580 */
    426581
     
    438593        RECTL   rcl;
    439594        BOOL    bLeftToRight;
    440         LONG    x, y, lTotalWidth;
     595        LONG    x, y, l;
    441596        size_t  i;
    442597
     
    481636        // always center the icon vertically (we may be given more height than
    482637        // we requested)
    483         y = (swp.cy - pSysTrayData->lIconWidth) / 2;
     638        y = (swp.cy - pSysTrayData->lIcon) / 2;
    484639
    485640        if (bLeftToRight)
     
    488643            x = swp.cx - pSysTrayData->lIconPad - pSysTrayData->lIconWidth;
    489644
    490         lTotalWidth = pSysTrayData->lIconWidth + pSysTrayData->lIconPad * 2;
     645        l;
    491646
    492647        // where to start from?
    493648        if (bLeftToRight)
    494649        {
    495             i = rclPaint.xLeft / lTotalWidth;
    496             x = pSysTrayData->lIconPad + i * lTotalWidth;
     650            i = rclPaint.xLeft / l;
     651            x = pSysTrayData->lIconPad + i * l;
    497652        }
    498653        else
    499654        {
    500             i = (swp.cx - rclPaint.xRight) / lTotalWidth;
    501             x = swp.cx - (i + 1) * lTotalWidth + pSysTrayData->lIconPad;
     655            i = (swp.cx - rclPaint.xRight) / lIconStep;
     656            x = swp.cx - (i + 1) * lIconStep;
     657            // negate the step, for convenience
     658            lIconStep = -lIconStep;
    502659        }
    503660
    504661        // draw as many icons as we can / need
    505         for (i = 0; i < pSysTrayData->cIcons; ++i)
     662        for (; i < pSysTrayData->cIcons; ++i)
    506663        {
    507664            if (x >= rclPaint.xRight)
     
    509666
    510667            DrawPointer(hps, x, y, pSysTrayData->pIcons[i].hIcon, DP_MINI);
    511             if (bLeftToRight)
    512                 x += lTotalWidth;
    513             else
    514                 x -= lTotalWidth;
     668            x += lIconStep;
    515669        }
    516670
    517671        WinEndPaint(hps);
    518672    }
     673
     674
     675
     676
     677
     678
     679
     680
     681
     682
     683
     684
     685
     686
     687
     688
     689
     690
     691
     692
     693
     694
     695
     696
     697
     698
     699
     700
     701
     702
     703
     704
     705
     706
     707
     708
     709
     710
     711
     712
     713
     714
     715
     716
     717
     718
     719
     720
     721
     722
     723
     724
     725
     726
     727
     728
     729
     730
     731
     732
     733
     734
     735
     736
     737
     738
     739
     740
     741
     742
     743
     744
     745
     746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
     786
     787
     788
     789
     790
     791
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
     802
     803
     804
     805
     806
     807
     808
     809
     810
    519811}
    520812
     
    562854
    563855            PSYSTRAYDATA pSysTrayData = NULL;
     856
    564857
    565858            WinSetWindowPtr(hwnd, QWL_USER, mp1);
     
    575868
    576869            // initialize the SYSTRAYDATA structure
     870
    577871            pSysTrayData->lIconWidth = WinQuerySysValue(HWND_DESKTOP, SV_CXICON) / 2;
    578872            pSysTrayData->lIconHeight = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) / 2;
     
    583877            if (pSysTrayData->pIcons == NULL)
    584878            {
    585                 free(pSysTrayData);
     879                (pSysTrayData);
    586880                return (MRESULT)TRUE;
    587881            }
    588882            pSysTrayData->cIcons = 0;
     883
     884
     885
     886
     887
     888
     889
     890
     891
     892
     893
     894
     895
     896
     897
     898
     899
     900
     901
     902
     903
     904
     905
     906
     907
     908
    589909
    590910            // create the "server" window (note that we pass the XCENTERWIDGET
     
    598918            if (pSysTrayData->hwndServer == NULLHANDLE)
    599919            {
    600                 free(pSysTrayData->pIcons);
    601                 free(pSysTrayData);
     920                FreeSysTrayData(pSysTrayData);
    602921                return (MRESULT)TRUE;
    603922            }
     
    606925
    607926            // inform all interested parties that we are fired up
    608             // (NOTE: keep in sync with xstGetSysTrayCreatedMsgId())
    609             WinBroadcastMsg(HWND_DESKTOP,
    610                             WinAddAtom(WinQuerySystemAtomTable(),
    611                                        "ExtendedSysTray.WM_XST_CREATED"),
    612                             NULL, NULL,
    613                             BMSG_POST);
     927            WinBroadcastMsg(HWND_DESKTOP, WM_XST_CREATED,
     928                            NULL, NULL, BMSG_POST);
    614929
    615930            return FALSE; // confirm success
     
    628943
    629944            PSYSTRAYDATA pSysTrayData = (PSYSTRAYDATA)pWidget->pUser;
    630             size_t i;
    631 
    632             // destroy the server
    633             WinDestroyWindow(pSysTrayData->hwndServer);
    634             pSysTrayData->hwndServer = NULLHANDLE;
    635 
    636             // free all system tray data
    637             for (i = 0; i < pSysTrayData->cIcons; ++i)
    638                 FreeIconData(&pSysTrayData->pIcons[i]);
    639             pSysTrayData->cIcons = 0;
    640             free(pSysTrayData->pIcons);
    641             pSysTrayData->pIcons = NULL;
    642 
    643             // make sure we remove the check alive timer
    644             WgtXSysTrayUpdateAfterIconAddRemove(pWidget);
    645 
    646             free(pSysTrayData);
     945
     946            // stop the check alive timer
     947            WinStopTimer(pWidget->habWidget, pSysTrayData->hwndServer,
     948                         TID_CHECKALIVE);
     949
     950            FreeSysTrayData(pSysTrayData);
    647951            pWidget->pUser = NULL;
    648952
     
    680984        break; */
    681985
     986
     987
     988
     989
     990
     991
     992
     993
     994
     995
     996
     997
     998
     999
     1000
     1001
     1002
     1003
     1004
     1005
     1006
     1007
     1008
     1009
     1010
     1011
     1012
     1013
     1014
    6821015        default:
    6831016            break;
     
    7131046    }
    7141047
    715     if (pSysTrayData->pIcons != NULL)
    716     {
    717         // ask XCenter to take our new size into account (this will also
    718         // invalidate us). If pIcons is NULL it means that we are in WM_DESTROY,
    719         // in which case XCenter will do everything for us
    720         WinPostMsg(pWidget->pGlobals->hwndClient,
    721                    XCM_REFORMAT,
    722                    (MPARAM)XFMF_GETWIDGETSIZES,
    723                    0);
    724     }
     1048    // ask XCenter to take our new size into account (this will also
     1049    // invalidate us)
     1050    WinPostMsg(pWidget->pGlobals->hwndClient,
     1051               XCM_REFORMAT,
     1052               (MPARAM)XFMF_GETWIDGETSIZES,
     1053               0);
    7251054}
    7261055
     
    7671096            LOGF(("SYSTRAYCMD_ADDICON\n"));
    7681097            LOGF((" hwnd  %x\n", pCtlData->hwndSender));
    769             LOGF((" ulId  %ld\n", pCtlData->u.icon.ulId));
     1098            LOGF((" uId));
    7701099            LOGF((" hIcon %x\n", pCtlData->u.icon.hIcon));
    7711100
     
    7851114
    7861115            pData = FindIconData(pSysTrayData, pCtlData->hwndSender,
    787                                  pCtlData->u.icon.ulId, &i);
     1116                                 pCtlData->u.icon.uId, &i);
    7881117            if (pData)
    7891118            {
     
    8251154
    8261155                pData = &pSysTrayData->pIcons[i];
     1156
     1157
    8271158                pData->hwnd = pCtlData->hwndSender;
    828                 pData->ulId = pCtlData->u.icon.ulId;
     1159                pData->uId;
    8291160                pData->hIcon = hIcon;
    8301161                pData->ulMsgId = pCtlData->u.icon.ulMsgId;
     
    8441175            LOGF(("SYSTRAYCMD_REMOVEICON\n"));
    8451176            LOGF((" hwnd  %x\n", pCtlData->hwndSender));
    846             LOGF((" ulId  %ld\n", pCtlData->u.icon.ulId));
     1177            LOGF((" uId));
    8471178
    8481179            pCtlData->bAcknowledged = TRUE;
    8491180
    8501181            pData = FindIconData(pSysTrayData, pCtlData->hwndSender,
    851                                  pCtlData->u.icon.ulId, &i);
     1182                                 pCtlData->u.icon.uId, &i);
    8521183            if (pData)
    8531184            {
     
    8931224{
    8941225    PSYSTRAYDATA pSysTrayData = (PSYSTRAYDATA)pWidget->pUser;
     1226
     1227
     1228
    8951229
    8961230    if (usTimerId == TID_CHECKALIVE)
     
    9041238            if (!WinIsWindow(pWidget->habWidget, pSysTrayData->pIcons[i].hwnd))
    9051239            {
     1240
     1241
    9061242                LOGF(("Removing icon of dead window!\n"));
    907                 LOGF((" hwnd  %x\n", pSysTrayData->pIcons[i].hwnd));
    908                 LOGF((" ulId  %ld\n", pSysTrayData->pIcons[i].ulId));
    909                 LOGF((" hIcon %x\n", pSysTrayData->pIcons[i].hIcon));
     1243                LOGF((" hwnd  %x\n", pData->hwnd));
     1244                LOGF((" usId  %ld\n", pData->usId));
     1245                LOGF((" hIcon %x\n", pData->hIcon));
     1246
     1247                // free memory blocks from the pool allocated for this client
     1248                ulMemPoolMax = pMemPoolHdr->ulBeyond;
     1249                if (ulMemPoolMax > pMemPoolHdr->ulNeedsCommit)
     1250                    ulMemPoolMax = pMemPoolHdr->ulNeedsCommit;
     1251                ulMemPoolMax -= sizeof(MEMPOOLBLK);
     1252
     1253                pMemPoolBlk = pMemPoolHdr->aBlocks;
     1254                while ((ULONG)pMemPoolBlk <= ulMemPoolMax)
     1255                {
     1256                    if (pMemPoolBlk->hwnd == pData->hwnd)
     1257                    {
     1258                        LOGF((" freeing memory block %p\n", pMemPoolBlk));
     1259                        __atomic_cmpxchg32((uint32_t *)&pMemPoolBlk->hwnd,
     1260                                           NULLHANDLE, hwnd);
     1261                    }
     1262                    ++pMemPoolBlk;
     1263                }
    9101264
    9111265                bAnyDead = TRUE;
    912                 FreeIconData(&pSysTrayData->pIcons[i]);
    913                 // hwnd is NULLHANDLE here
     1266                FreeIconData();
     1267                // hwnd is NULLHANDLE here
    9141268            }
    9151269        }
     
    11281482        }
    11291483
     1484
     1485
     1486
     1487
     1488
     1489
     1490
    11301491        // no error:
    11311492        // return widget classes array
  • trunk/src/3rdparty/os2/xsystray/xsystray.h

    r272 r273  
    1717#define XSYSTRAY_HEADER_INCLUDED
    1818
     19
     20
     21
     22
    1923#define XSYSTRAY_VERSION_MAJOR 0
    2024#define XSYSTRAY_VERSION_MINOR 1
     
    2630#define INTCLASS_WIDGET_XSYSTRAY        "ExtendedSysTray"
    2731#define HUMANSTR_WIDGET_XSYSTRAY        "Extended system tray"
     32
     33
     34
    2835
    2936#define WM_XST_CONTROL  (WM_USER + 0)
     
    3845    SYSTRAYCMD_HIDEBALLOON,
    3946} SYSTRAYCMD;
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
    4058
    4159typedef struct
     
    5876        struct
    5977        {
    60             ULONG       ulId;
     78            UId;
    6179            HPOINTER    hIcon;
    6280            ULONG       ulMsgId;
     
    6684        struct
    6785        {
    68             ULONG   ulId;
     86            UId;
    6987            CHAR    szText[512];
    7088        } tooltip;
     
    7795} SYSTRAYCTLDATA, *PSYSTRAYCTLDATA;
    7896
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
    79188#endif // XSYSTRAY_HEADER_INCLUDED
    80189
  • trunk/src/3rdparty/os2/xsystray/xsystray_api.c

    r272 r273  
    2828#include <sys/builtin.h>        // atomics
    2929
    30 static HWND G_hwndSysTray = NULLHANDLE;
    31             // window handle of the system tray server
    32 
    33 static PVOID G_pvMemoryPool = NULL;
    34              // memory pool for SYSTRAYCTLDATA structs used by WM_XST_CONTROL
    35              // messages. Note that once allocated, this memory is never freed:
    36              // it is intentional since the memory is assumed to be always in
    37              // need and that the system will free it when the application
    38              // terminates
    39 
    40 #define MEMORYPOOL_SIZE 65536
    41         // taking SYSTRAYCTLDATA size into account, this is enough for at least
    42         // 64 threads sending WM_XST_CONTROL simultaneously, which sounds sane
     30static
     31volatile HWND G_hwndSysTray = NULLHANDLE;
     32              // window handle of the system tray server
     33
     34static
     35volatile PVOID G_pvMemoryPool = NULL;
     36               // shared memory pool for SYSTRAYCTLDATA structs used by
     37               // WM_XST_CONTROL messages. Note that once allocated, this memory
     38               // is never freed: it is intentional since the memory is assumed
     39               // to be always in need and that the system will free it when the
     40               // application terminates
     41
     42#define CLIENT_MEMORYPOOL_SIZE 65536
     43        // taking SYSTRAYCTLDATA size into account (<=1024 B), this is enough
     44        // for at least 64 threads sending WM_XST_CONTROL simultaneously, which
     45        // sounds sane
    4346
    4447// @todo to be on the safe side with casting in __atomic_cmpxchg32() we need
     
    116119}
    117120
    118 // This function allocates a SYSTRAYCTLDATA struct in the pool of shared memory.
    119 // If there is no free space in the pool, it returns NULL. The allocated memory
    120 // must be freed by FreeSysTrayCtlDataPtr() when not needed.
     121/*
     122 *@@ AllocSysTrayCtlDataPtr:
     123 *      Allocates a SYSTRAYCTLDATA struct in the pool of shared memory.
     124 *
     125 *      If there is no free space in the pool, it returns NULL. The allocated
     126 *      memory must be freed by FreeSysTrayCtlDataPtr() when not needed.
     127 */
     128
    121129static PSYSTRAYCTLDATA AllocSysTrayCtlDataPtr()
    122130{
     
    128136    {
    129137        // Note: we don't PAG_COMMIT, DosSubAllocMem will do so when needed
    130         arc = DosAllocSharedMem((PVOID)&pvPool, NULL, MEMORYPOOL_SIZE,
     138        arc = DosAllocSharedMem((PVOID)&pvPool, NULL, MEMORYPOOL_SIZE,
    131139                                PAG_READ | PAG_WRITE | OBJ_GIVEABLE);
    132140        if (arc == NO_ERROR)
    133141            arc = DosSubSetMem(pvPool,
    134142                               DOSSUB_INIT | DOSSUB_SPARSE_OBJ,
    135                                MEMORYPOOL_SIZE);
     143                               MEMORYPOOL_SIZE);
    136144        if (!__atomic_cmpxchg32((uint32_t *)&G_pvMemoryPool,
    137145                                (uint32_t)pvPool, (uint32_t)NULL))
     
    149157    }
    150158
    151     arc = DosSubAllocMem(G_pvMemoryPool, (PVOID)&pData, sizeof(SYSTRAYCTLDATA));
     159    arc = DosSubAllocMem(G_pvMemoryPool, (PVOID)&pData, sizeof());
    152160    if (arc != NO_ERROR)
    153161        return NULL;
     
    158166static VOID FreeSysTrayCtlDataPtr(PSYSTRAYCTLDATA pData)
    159167{
    160     DosSubFreeMem(G_pvMemoryPool, pData, sizeof(SYSTRAYCTLDATA));
     168    DosSubFreeMem(G_pvMemoryPool, pData, sizeof());
    161169}
    162170
     
    220228 *
    221229 *          param1
    222  *              USHORT  usID        icon ID
    223  *              USHORT  usCode      notify code, one of XST_IN_ constants
     230 *              USHORT  usID        icon ID
     231 *              USHORT  us    notify code, one of XST_IN_ constants
    224232 *
    225233 *          param2
    226  *              PVOID   pData       notify code specific data (see below)
     234 *              PVOID   pData       notify code specific data (see below)
    227235 *
    228236 *      The following notify codes are currently recognized:
     
    232240 *              messages are recognized. param2 is a pointer to the XSTMOUSEMSG
    233241 *              structure containing full mouse message details.
     242
     243
     244
     245
     246
     247
     248
     249
    234250 */
    235251
    236252BOOL xstAddSysTrayIcon(HWND hwnd,       // in: window handle associated with the icon
    237                        ULONG ulId,      // in: icon ID to add
     253                       U     // in: icon ID to add
    238254                       HPOINTER hIcon,  // in: icon handle
    239255                       ULONG ulMsgId,   // in: message ID for notifications
     
    252268        pData->ulCommand = SYSTRAYCMD_ADDICON;
    253269        pData->hwndSender = hwnd;
    254         pData->u.icon.ulId = ulId;
     270        pData->u.icon.uId;
    255271        pData->u.icon.hIcon = hIcon;
    256272        pData->u.icon.ulMsgId = ulMsgId;
     
    278294
    279295BOOL xstRemoveSysTrayIcon(HWND hwnd,    // in: window handle associated with the icon
    280                           ULONG ulId)   // in: icon ID to remove
     296                          U  // in: icon ID to remove
    281297{
    282298    BOOL brc;
     
    287303    pData->ulCommand = SYSTRAYCMD_REMOVEICON;
    288304    pData->hwndSender = hwnd;
    289     pData->u.icon.ulId = ulId;
     305    pData->u.icon.uId;
    290306
    291307    brc = SendSysTrayCtlMsg(pData);
     
    314330
    315331BOOL xstSetSysTrayIconToolTip(HWND hwnd,    // in: window handle associated with the icon
    316                               ULONG ulId,   // in: icon ID to set the tooltip for
     332                              U  // in: icon ID to set the tooltip for
    317333                              PSZ pszText)  // in: tooltip text
    318334{
     
    324340    pData->ulCommand = SYSTRAYCMD_SETTOOLTIP;
    325341    pData->hwndSender = hwnd;
    326     pData->u.tooltip.ulId = ulId;
     342    pData->u.tooltip.uId;
    327343
    328344    if (pszText == NULL)
     
    343359}
    344360
    345 BOOL xstShowSysTrayIconBalloon(HWND hwnd, ULONG ulId, PSZ pszTitle, PSZ pszText,
     361BOOL xstShowSysTrayIconBalloon(HWND hwnd, UId, PSZ pszTitle, PSZ pszText,
    346362                               ULONG ulFlags, ULONG ulTimeout)
    347363{
     
    350366}
    351367
    352 BOOL xstHideSysTrayIconBalloon(HWND hwnd, ULONG ulId)
     368BOOL xstHideSysTrayIconBalloon(HWND hwnd, UId)
    353369{
    354370    // @todo implement
     
    364380 *      Returns TRUE on success and FALSE otherwise.
    365381 */
    366 BOOL xstQuerySysTrayIconRect(HWND hwnd, ULONG ulId, PRECTL prclRect)
     382BOOL xstQuerySysTrayIconRect(HWND hwnd, UId, PRECTL prclRect)
    367383{
    368384    // @todo implement
     
    384400ULONG xstGetSysTrayCreatedMsgId()
    385401{
    386     // NOTE: keep in sync with fnwpXSysTray()::WM_CREATED
    387 
    388402    static ULONG WM_XST_CREATED = 0;
    389403    if (WM_XST_CREATED == 0)
    390404        WM_XST_CREATED = WinAddAtom(WinQuerySystemAtomTable(),
    391                                     "ExtendedSysTray.WM_XST_CREATED");
     405                                    );
    392406    return WM_XST_CREATED;
    393407}
  • trunk/src/3rdparty/os2/xsystray/xsystray_api.h

    r256 r273  
    2424// tray (refer to xstAddSysTrayIcon() for details)
    2525#define XST_IN_MOUSE    0x0001
     26
     27
    2628
    2729// structure for XST_IN_MOUSE
     
    2931{
    3032    ULONG  ulMouseMsg;
     33
    3134    POINTS ptsPointerPos;
     35
    3236    USHORT fsHitTestRes;
     37
    3338    USHORT fsFlags;
     39
    3440
    3541} XSTMOUSEMSG, *PXSTMOUSEMSG;
    3642
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
    3765BOOL xstQuerySysTrayVersion(PULONG pulMajor, PULONG pulMinor, PULONG pulRevision);
    38 BOOL xstAddSysTrayIcon(HWND hwnd, ULONG ulId, HPOINTER hIcon, ULONG ulMsgId,
     66BOOL xstAddSysTrayIcon(HWND hwnd, UId, HPOINTER hIcon, ULONG ulMsgId,
    3967                       ULONG ulFlags);
    40 BOOL xstRemoveSysTrayIcon(HWND hwnd, ULONG ulId);
    41 BOOL xstSetSysTrayIconToolTip(HWND hwnd, ULONG ulId, PSZ pszText);
    42 BOOL xstShowSysTrayIconBalloon(HWND hwnd, ULONG ulId, PSZ pszTitle, PSZ pszText,
     68BOOL xstRemoveSysTrayIcon(HWND hwnd, UId);
     69BOOL xstSetSysTrayIconToolTip(HWND hwnd, UId, PSZ pszText);
     70BOOL xstShowSysTrayIconBalloon(HWND hwnd, UId, PSZ pszTitle, PSZ pszText,
    4371                               ULONG ulFlags, ULONG ulTimeout);
    44 BOOL xstHideSysTrayIconBalloon(HWND hwnd, ULONG ulId);
     72BOOL xstHideSysTrayIconBalloon(HWND hwnd, UId);
    4573
    46 BOOL xstQuerySysTrayIconRect(HWND hwnd, ULONG ulId, PRECTL prclRect);
     74BOOL xstQuerySysTrayIconRect(HWND hwnd, UId, PRECTL prclRect);
    4775
    4876ULONG xstGetSysTrayCreatedMsgId();
Note: See TracChangeset for help on using the changeset viewer.