Ignore:
Timestamp:
Jan 8, 2011, 1:51:04 PM (15 years ago)
Author:
dmik
Message:

os2wrap2.h: Added BM_, LM_ and MM_ constants. Fixed incorrect redefinition of special Dos.../Win... macros with the os2_ prefix (we don't use this prefix for these APIs as they are unlikely to clash with Win APIs).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/os2wrap2.h

    r21547 r21548  
    15601560#define ATOM os2_ATOM
    15611561#define os2_MAKEINTATOM (x)             ((PCH) os2_MAKEULONG  (x, 0xffff))
     1562#define os2_BM_CLICK 0x0120
     1563#define os2_BM_QUERYCHECKINDEX 0x0121
     1564#define os2_BM_QUERYHILITE 0x0122
     1565#define os2_BM_SETHILITE 0x0123
     1566#define os2_BM_QUERYCHECK 0x0124
     1567#define os2_BM_SETCHECK 0x0125
     1568#define os2_BM_SETDEFAULT 0x0126
    15621569#define _BTNCDATA os2__BTNCDATA
    15631570#define BTNCDATA os2_BTNCDATA
     
    16481655#define MB2INFO os2_MB2INFO
    16491656#define PMB2INFO os2_PMB2INFO
    1650 #define os2_WinCheckButton (hwndDlg,id,usCheckState) \
    1651     ((os2_ULONG)WinSendDlgItemMsg (hwndDlg, id, BM_SETCHECK, \
    1652                                os2_MPFROMSHORT (usCheckState), (os2_MPARAM)NULL))
    1653 #define os2_WinIsControlEnabled (hwndDlg,id) \
    1654     ((os2_BOOL)WinIsWindowEnabled (WinWindowFromID (hwndDlg, id)))
    1655 #define os2_WinQueryButtonCheckstate (hwndDlg,id) \
    1656     ((os2_ULONG)WinSendDlgItemMsg (hwndDlg, id, BM_QUERYCHECK, \
    1657                                (os2_MPARAM)NULL, (os2_MPARAM)NULL))
    16581657#define _DLGTITEM os2__DLGTITEM
    16591658#define DLGTITEM os2_DLGTITEM
     
    17321731#define os2_CHARMSG (pmsg)              ((os2_PCHRMSG)((os2_PBYTE)pmsg + sizeof (os2_ULONG)))
    17331732#define os2_MOUSEMSG (pmsg)             ((os2_PMSEMSG)((os2_PBYTE)pmsg + sizeof (os2_ULONG)))
     1733#define os2_LM_QUERYITEMCOUNT 0x0160
     1734#define os2_LM_INSERTITEM 0x0161
     1735#define os2_LM_SETTOPINDEX 0x0162
     1736#define os2_LM_DELETEITEM 0x0163
     1737#define os2_LM_SELECTITEM 0x0164
     1738#define os2_LM_QUERYSELECTION 0x0165
     1739#define os2_LM_SETITEMTEXT 0x0166
     1740#define os2_LM_QUERYITEMTEXTLENGTH 0x0167
     1741#define os2_LM_QUERYITEMTEXT 0x0168
     1742#define os2_LM_SETITEMHANDLE 0x0169
     1743#define os2_LM_QUERYITEMHANDLE 0x016a
     1744#define os2_LM_SEARCHSTRING 0x016b
     1745#define os2_LM_SETITEMHEIGHT 0x016c
     1746#define os2_LM_QUERYTOPINDEX 0x016d
     1747#define os2_LM_DELETEALL 0x016e
     1748#define os2_LM_INSERTMULTITEMS 0x016f
     1749#define os2_LM_SETITEMWIDTH 0x0660 /* ? */
    17341750#define _LBOXINFO os2__LBOXINFO
    17351751#define LBOXINFO os2_LBOXINFO
    17361752#define PLBOXINFO os2_PLBOXINFO
    1737 #define os2_WinDeleteLboxItem (hwndLbox,index) \
    1738     ((os2_LONG)WinSendMsg (hwndLbox, LM_DELETEITEM, os2_MPFROMLONG (index), \
    1739                        (os2_MPARAM)NULL))
    1740 #define os2_WinInsertLboxItem (hwndLbox,index,psz) \
    1741     ((os2_LONG)WinSendMsg (hwndLbox, LM_INSERTITEM, os2_MPFROMLONG(index), \
    1742                        os2_MPFROMP (psz)))
    1743 #define os2_WinQueryLboxCount (hwndLbox) \
    1744     ((os2_LONG)WinSendMsg (hwndLbox, LM_QUERYITEMCOUNT, (os2_MPARAM)NULL, \
    1745                        (os2_MPARAM)NULL))
    1746 #define os2_WinQueryLboxItemText (hwndLbox,index,psz,cchMax) \
    1747     ((os2_LONG)WinSendMsg (hwndLbox, LM_QUERYITEMTEXT, \
    1748                        os2_MPFROM2SHORT((index), (cchMax)), os2_MPFROMP (psz)))
    1749 #define os2_WinQueryLboxItemTextLength (hwndLbox,index) \
    1750     ((os2_SHORT)WinSendMsg (hwndLbox, LM_QUERYITEMTEXTLENGTH, \
    1751                         os2_MPFROMSHORT (index), (os2_MPARAM)NULL))
    1752 #define os2_WinQueryLboxSelectedItem (hwndLbox) \
    1753     ((os2_LONG)WinSendMsg (hwndLbox, LM_QUERYSELECTION, os2_MPFROMLONG (LIT_FIRST), \
    1754                        (os2_MPARAM)NULL))
    1755 #define os2_WinSetLboxItemText (hwndLbox,index,psz) \
    1756     ((os2_BOOL)WinSendMsg (hwndLbox, LM_SETITEMTEXT, \
    1757                        os2_MPFROMLONG (index), os2_MPFROMP (psz)))
    17581753#define os2_MIA_NODISMISS 0x0020
    17591754#define os2_MIA_FRAMED 0x1000
     
    17611756#define os2_MIA_DISABLED 0x4000
    17621757#define os2_MIA_HILITED 0x8000
     1758#define os2_MM_INSERTITEM 0x0180
     1759#define os2_MM_DELETEITEM 0x0181
     1760#define os2_MM_QUERYITEM 0x0182
     1761#define os2_MM_SETITEM 0x0183
     1762#define os2_MM_QUERYITEMCOUNT 0x0184
     1763#define os2_MM_STARTMENUMODE 0x0185
     1764#define os2_MM_ENDMENUMODE 0x0186
     1765#define os2_MM_REMOVEITEM 0x0188
     1766#define os2_MM_SELECTITEM 0x0189
     1767#define os2_MM_QUERYSELITEMID 0x018a
     1768#define os2_MM_QUERYITEMTEXT 0x018b
     1769#define os2_MM_QUERYITEMTEXTLENGTH 0x018c
     1770#define os2_MM_SETITEMHANDLE 0x018d
     1771#define os2_MM_SETITEMTEXT 0x018e
     1772#define os2_MM_ITEMPOSITIONFROMID 0x018f
     1773#define os2_MM_ITEMIDFROMPOSITION 0x0190
     1774#define os2_MM_QUERYITEMATTR 0x0191
     1775#define os2_MM_SETITEMATTR 0x0192
     1776#define os2_MM_ISITEMVALID 0x0193
     1777#define os2_MM_QUERYITEMRECT 0x0194
     1778#define os2_MM_QUERYDEFAULTITEMID 0x0431
     1779#define os2_MM_SETDEFAULTITEMID 0x0432
    17631780#define _MENUITEM os2__MENUITEM
    17641781#define MENUITEM os2_MENUITEM
     
    17721789#define OWNERITEM os2_OWNERITEM
    17731790#define POWNERITEM os2_POWNERITEM
    1774 #define os2_WinCheckMenuItem (hwndMenu,id,fcheck) \
    1775     ((os2_BOOL)WinSendMsg (hwndMenu, MM_SETITEMATTR, \
    1776                        os2_MPFROM2SHORT (id, TRUE), \
    1777                        os2_MPFROM2SHORT (os2_MIA_CHECKED, \
    1778                                      ((os2_USHORT)(fcheck) ? os2_MIA_CHECKED : 0))))
    1779 #define os2_WinEnableMenuItem (hwndMenu,id,fEnable) \
    1780     ((os2_BOOL)WinSendMsg (hwndMenu, MM_SETITEMATTR, os2_MPFROM2SHORT (id, TRUE), \
    1781                        os2_MPFROM2SHORT (os2_MIA_DISABLED, \
    1782                                      ((os2_USHORT)(fEnable) ? 0 : os2_MIA_DISABLED))))
    1783 #define os2_WinIsMenuItemChecked (hwndMenu,id) \
    1784     ((os2_BOOL)WinSendMsg (hwndMenu, MM_QUERYITEMATTR, \
    1785                        os2_MPFROM2SHORT (id, TRUE), \
    1786                        os2_MPFROMLONG (os2_MIA_CHECKED)))
    1787 #define os2_WinIsMenuItemEnabled (hwndMenu,id)  \
    1788     (!(os2_BOOL)WinSendMsg (hwndMenu, MM_QUERYITEMATTR, \
    1789                         os2_MPFROM2SHORT (id, TRUE), \
    1790                         os2_MPFROMLONG (os2_MIA_DISABLED)))
    1791 #define os2_WinIsMenuItemValid (hwndMenu,id) \
    1792     ((os2_BOOL)WinSendMsg (hwndMenu, MM_ISITEMVALID, \
    1793                        os2_MPFROM2SHORT (id, TRUE), os2_MPFROMLONG (FALSE)))
    1794 #define os2_WinSetMenuItemText (hwndMenu,id,psz) \
    1795     ((os2_BOOL)WinSendMsg (hwndMenu, MM_SETITEMTEXT, \
    1796                        os2_MPFROMLONG (id), os2_MPFROMP (psz)))
    17971791#define os2_QS_KEY 0x0001
    17981792#define os2_QS_MOUSEBUTTON 0x0002
     
    19501944#define MLE_SEARCHDATA os2_MLE_SEARCHDATA
    19511945#define PMLE_SEARCHDATA os2_PMLE_SEARCHDATA
     1946#define os2_BM_ERROR (-1)
     1947#define os2_BM_DEFAULT 0
     1948#define os2_BM_OR 1
     1949#define os2_BM_OVERPAINT 2
     1950#define os2_BM_LEAVEALONE 5
     1951#define os2_BM_XOR 4
     1952#define os2_BM_AND 6
     1953#define os2_BM_SUBTRACT 7
     1954#define os2_BM_MASKSRCNOT 8
     1955#define os2_BM_ZERO 9
     1956#define os2_BM_NOTMERGESRC 10
     1957#define os2_BM_NOTXORSRC 11
     1958#define os2_BM_INVERT 12
     1959#define os2_BM_MERGESRCNOT 13
     1960#define os2_BM_NOTCOPYSRC 14
     1961#define os2_BM_MERGENOTSRC 15
     1962#define os2_BM_NOTMASKSRC 16
     1963#define os2_BM_ONE 17
     1964#define os2_BM_SRCTRANSPARENT 18
     1965#define os2_BM_DESTTRANSPARENT 19
    19521966#define os2_TA_NORMAL_HORIZ 0x0001
    19531967#define os2_TA_LEFT 0x0002
     
    24842498#define os2_OBJ_LOCATION 0x01000000
    24852499#define os2_OBJ_FORK 0x02000000
    2486 #define os2_DosAllocMem (a, b, c)       DosAllocMemEx((a),(b),(c) | os2_OBJ_FORK)
    2487 #define os2_DosAllocSharedMem (a,b,c,d) DosAllocSharedMemEx((a),(b),(c),(d) | os2_OBJ_FORK)
    24882500
    24892501/* include the main OS/2 API wrapper */
     
    40334045#undef ATOM
    40344046#undef MAKEINTATOM
     4047#undef BM_CLICK
     4048#undef BM_QUERYCHECKINDEX
     4049#undef BM_QUERYHILITE
     4050#undef BM_SETHILITE
     4051#undef BM_QUERYCHECK
     4052#undef BM_SETCHECK
     4053#undef BM_SETDEFAULT
    40354054#undef _BTNCDATA
    40364055#undef BTNCDATA
     
    41204139#undef PMB2INFO
    41214140#undef WinCheckButton
     4141#define WinCheckButton(hwndDlg,id,usCheckState) \
     4142    ((os2_ULONG)WinSendDlgItemMsg (hwndDlg, id, os2_BM_SETCHECK, \
     4143                               os2_MPFROMSHORT (usCheckState), (os2_MPARAM)NULL))
    41224144#undef WinIsControlEnabled
     4145#define WinIsControlEnabled(hwndDlg,id) \
     4146    ((os2_BOOL)WinIsWindowEnabled (WinWindowFromID (hwndDlg, id)))
    41234147#undef WinQueryButtonCheckstate
     4148#define WinQueryButtonCheckstate(hwndDlg,id) \
     4149    ((os2_ULONG)WinSendDlgItemMsg (hwndDlg, id, os2_BM_QUERYCHECK, \
     4150                               (os2_MPARAM)NULL, (os2_MPARAM)NULL))
    41244151#undef _DLGTITEM
    41254152#undef DLGTITEM
     
    41984225#undef CHARMSG
    41994226#undef MOUSEMSG
     4227#undef LM_QUERYITEMCOUNT
     4228#undef LM_INSERTITEM
     4229#undef LM_SETTOPINDEX
     4230#undef LM_DELETEITEM
     4231#undef LM_SELECTITEM
     4232#undef LM_QUERYSELECTION
     4233#undef LM_SETITEMTEXT
     4234#undef LM_QUERYITEMTEXTLENGTH
     4235#undef LM_QUERYITEMTEXT
     4236#undef LM_SETITEMHANDLE
     4237#undef LM_QUERYITEMHANDLE
     4238#undef LM_SEARCHSTRING
     4239#undef LM_SETITEMHEIGHT
     4240#undef LM_QUERYTOPINDEX
     4241#undef LM_DELETEALL
     4242#undef LM_INSERTMULTITEMS
     4243#undef LM_SETITEMWIDTH
    42004244#undef _LBOXINFO
    42014245#undef LBOXINFO
    42024246#undef PLBOXINFO
    42034247#undef WinDeleteLboxItem
     4248#define WinDeleteLboxItem(hwndLbox,index) \
     4249    ((os2_LONG)WinSendMsg (hwndLbox, os2_LM_DELETEITEM, os2_MPFROMLONG (index), \
     4250                       (os2_MPARAM)NULL))
    42044251#undef WinInsertLboxItem
     4252#define WinInsertLboxItem(hwndLbox,index,psz) \
     4253    ((os2_LONG)WinSendMsg (hwndLbox, os2_LM_INSERTITEM, os2_MPFROMLONG(index), \
     4254                       os2_MPFROMP (psz)))
    42054255#undef WinQueryLboxCount
     4256#define WinQueryLboxCount(hwndLbox) \
     4257    ((os2_LONG)WinSendMsg (hwndLbox, os2_LM_QUERYITEMCOUNT, (os2_MPARAM)NULL, \
     4258                       (os2_MPARAM)NULL))
    42064259#undef WinQueryLboxItemText
     4260#define WinQueryLboxItemText(hwndLbox,index,psz,cchMax) \
     4261    ((os2_LONG)WinSendMsg (hwndLbox, os2_LM_QUERYITEMTEXT, \
     4262                       os2_MPFROM2SHORT((index), (cchMax)), os2_MPFROMP (psz)))
    42074263#undef WinQueryLboxItemTextLength
     4264#define WinQueryLboxItemTextLength(hwndLbox,index) \
     4265    ((os2_SHORT)WinSendMsg (hwndLbox, os2_LM_QUERYITEMTEXTLENGTH, \
     4266                        os2_MPFROMSHORT (index), (os2_MPARAM)NULL))
    42084267#undef WinQueryLboxSelectedItem
     4268#define WinQueryLboxSelectedItem(hwndLbox) \
     4269    ((os2_LONG)WinSendMsg (hwndLbox, os2_LM_QUERYSELECTION, os2_MPFROMLONG (LIT_FIRST), \
     4270                       (os2_MPARAM)NULL))
    42094271#undef WinSetLboxItemText
     4272#define WinSetLboxItemText(hwndLbox,index,psz) \
     4273    ((os2_BOOL)WinSendMsg (hwndLbox, os2_LM_SETITEMTEXT, \
     4274                       os2_MPFROMLONG (index), os2_MPFROMP (psz)))
    42104275#undef MIA_NODISMISS
    42114276#undef MIA_FRAMED
     
    42134278#undef MIA_DISABLED
    42144279#undef MIA_HILITED
     4280#undef MM_INSERTITEM
     4281#undef MM_DELETEITEM
     4282#undef MM_QUERYITEM
     4283#undef MM_SETITEM
     4284#undef MM_QUERYITEMCOUNT
     4285#undef MM_STARTMENUMODE
     4286#undef MM_ENDMENUMODE
     4287#undef MM_REMOVEITEM
     4288#undef MM_SELECTITEM
     4289#undef MM_QUERYSELITEMID
     4290#undef MM_QUERYITEMTEXT
     4291#undef MM_QUERYITEMTEXTLENGTH
     4292#undef MM_SETITEMHANDLE
     4293#undef MM_SETITEMTEXT
     4294#undef MM_ITEMPOSITIONFROMID
     4295#undef MM_ITEMIDFROMPOSITION
     4296#undef MM_QUERYITEMATTR
     4297#undef MM_SETITEMATTR
     4298#undef MM_ISITEMVALID
     4299#undef MM_QUERYITEMRECT
     4300#undef MM_QUERYDEFAULTITEMID
     4301#undef MM_SETDEFAULTITEMID
    42154302#undef _MENUITEM
    42164303#undef MENUITEM
     
    42254312#undef POWNERITEM
    42264313#undef WinCheckMenuItem
     4314#define WinCheckMenuItem(hwndMenu,id,fcheck) \
     4315    ((os2_BOOL)WinSendMsg (hwndMenu, os2_MM_SETITEMATTR, \
     4316                       os2_MPFROM2SHORT (id, TRUE), \
     4317                       os2_MPFROM2SHORT (os2_MIA_CHECKED, \
     4318                                     ((os2_USHORT)(fcheck) ? os2_MIA_CHECKED : 0))))
    42274319#undef WinEnableMenuItem
     4320#define WinEnableMenuItem(hwndMenu,id,fEnable) \
     4321    ((os2_BOOL)WinSendMsg (hwndMenu, os2_MM_SETITEMATTR, os2_MPFROM2SHORT (id, TRUE), \
     4322                       os2_MPFROM2SHORT (os2_MIA_DISABLED, \
     4323                                     ((os2_USHORT)(fEnable) ? 0 : os2_MIA_DISABLED))))
    42284324#undef WinIsMenuItemChecked
     4325#define WinIsMenuItemChecked(hwndMenu,id) \
     4326    ((os2_BOOL)WinSendMsg (hwndMenu, os2_MM_QUERYITEMATTR, \
     4327                       os2_MPFROM2SHORT (id, TRUE), \
     4328                       os2_MPFROMLONG (os2_MIA_CHECKED)))
    42294329#undef WinIsMenuItemEnabled
     4330#define WinIsMenuItemEnabled(hwndMenu,id)  \
     4331    (!(os2_BOOL)WinSendMsg (hwndMenu, os2_MM_QUERYITEMATTR, \
     4332                        os2_MPFROM2SHORT (id, TRUE), \
     4333                        os2_MPFROMLONG (os2_MIA_DISABLED)))
    42304334#undef WinIsMenuItemValid
     4335#define WinIsMenuItemValid(hwndMenu,id) \
     4336    ((os2_BOOL)WinSendMsg (hwndMenu, os2_MM_ISITEMVALID, \
     4337                       os2_MPFROM2SHORT (id, TRUE), os2_MPFROMLONG (FALSE)))
    42314338#undef WinSetMenuItemText
     4339#define WinSetMenuItemText(hwndMenu,id,psz) \
     4340    ((os2_BOOL)WinSendMsg (hwndMenu, os2_MM_SETITEMTEXT, \
     4341                       os2_MPFROMLONG (id), os2_MPFROMP (psz)))
    42324342#undef QS_KEY
    42334343#undef QS_MOUSEBUTTON
     
    43854495#undef MLE_SEARCHDATA
    43864496#undef PMLE_SEARCHDATA
     4497#undef BM_ERROR
     4498#undef BM_DEFAULT
     4499#undef BM_OR
     4500#undef BM_OVERPAINT
     4501#undef BM_LEAVEALONE
     4502#undef BM_XOR
     4503#undef BM_AND
     4504#undef BM_SUBTRACT
     4505#undef BM_MASKSRCNOT
     4506#undef BM_ZERO
     4507#undef BM_NOTMERGESRC
     4508#undef BM_NOTXORSRC
     4509#undef BM_INVERT
     4510#undef BM_MERGESRCNOT
     4511#undef BM_NOTCOPYSRC
     4512#undef BM_MERGENOTSRC
     4513#undef BM_NOTMASKSRC
     4514#undef BM_ONE
     4515#undef BM_SRCTRANSPARENT
     4516#undef BM_DESTTRANSPARENT
    43874517#undef TA_NORMAL_HORIZ
    43884518#undef TA_LEFT
     
    49205050#undef OBJ_FORK
    49215051#undef DosAllocMem
     5052#define DosAllocMem(a, b, c)       DosAllocMemEx((a),(b),(c) | os2_OBJ_FORK)
    49225053#undef DosAllocSharedMem
     5054#define DosAllocSharedMem(a,b,c,d) DosAllocSharedMemEx((a),(b),(c),(d) | os2_OBJ_FORK)
    49235055
    49245056#endif /* __OS2WRAP2_H__ */
Note: See TracChangeset for help on using the changeset viewer.