home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tk42r2s.zip / tk4.2 / os2 / WinToOS2 < prev    next >
Text File  |  1997-07-02  |  9KB  |  254 lines

  1. copy tkPort.h, default.h to ..\generic
  2.  
  3. TkWin<function> -> TkOS2<function>
  4. HDC TkWinGetDrawableDC -> HPS TkOS2GetDrawablePS
  5. TkWinDCState -> TkOS2PSState
  6. TkWinReleaseDrawableDC (..,DC,..) -> TkOS2ReleaseDrawablePS (..,HPS,..)
  7. TkWinSelectPalette (DC,..) -> TkOS2SelectPalette (HPS,HWND,..)
  8. WINDOWPOS -> SWP
  9. GetModuleFileName -> DosQueryModuleName
  10. _ANSI_ARGS_() -> 
  11. HPALLETTE -> HPAL
  12. TWD -> TOD (Drawable)
  13. UINT -> ULONG
  14. WPARAM -> MPARAM
  15. wParam -> param1
  16. LPARAM -> MPARAM
  17. lParam -> param2
  18. HINSTANCE -> HAB
  19. LRESULT CALLBACK -> MRESULT EXPENTRY
  20. MessageBox -> WinGetMessageBox
  21. MB_ICONSTOP -> MB_ERROR
  22. MB_TASKMODAL -> MB_APPLMODAL
  23. GetDC -> DevOpenDC/WinGetPS
  24. GetDeviceCaps -> DevQueryCaps
  25. SetWindowLong GWL_USERDATA -> WinSetWindowULong (hwnd, QWL_USER, (ULONG) pPtr)
  26. SetWindowLong GWL_STYLE -> WinSetWindowBits (hwnd, QWL_STYLE, ...)
  27. GetWindowLong GWL_USERDATA -> WinQueryWindowULong (hwnd, QWL_USER)
  28. WM_GETMINMAXINFO -> WM_QUERYTRACKINFO
  29. MINMAXINFO -> TRACKINFO
  30. WM_PALETTECHANGED -> WM_REALIZEPALETTE
  31. WM_QUERYNEWPALETTE ---> WM_SETFOCUS
  32. WM_KILLFOCUS -> WM_SETFOCUS
  33. WM_LBUTTONDOWN -> WM_BUTTON1DOWN
  34. WM_LBUTTONUP -> WM_BUTTON1UP
  35. WM_MBUTTONDOWN -> WM_BUTTON2DOWN
  36. WM_MBUTTONUP -> WM_BUTTON2UP
  37. WM_RBUTTONDOWN -> WM_BUTTON3DOWN
  38. WM_RBUTTONUP -> WM_BUTTON3UP
  39. WM_SYSKEYDOWN -> (Alt key, kan ook als geen window focus heeft->actieve window)
  40.                  WM_CHAR, flag KC_ALT
  41. WM_SYSKEYUP -> (Alt key, kan ook als geen window focus heeft->actieve window)
  42.                WM_CHAR, flag KC_ALT
  43. WM_KEYDOWN -> (niet-Alt key) WM_CHAR
  44. WM_KEYUP -> (niet-Alt key) WM_CHAR
  45. WM_ERASEBKGND -> WM_ERASEBACKGROUND
  46. WM_RENDERFORMAT -> WM_RENDERFMT
  47. BeginPaint -> WinBeginPaint
  48. EndPaint -> WinEndPaint
  49. PAINTSTRUCT -> RECTL
  50. GetCurrentTime -> WinGetCurrentTime(hab)
  51. POINT -> POINTL
  52. GetMessagePos -> WinQueryMsgPos
  53. ScreenToClient -> WinMapWindowPoints (HWND_DESKTOP, ....)
  54. WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | 
  55.    WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX -> ?
  56. CS_DBLCLKS -> ?
  57. RECT -> RECTL
  58. MSG -> QMSG
  59. PeekMessage -> WinPeekMsg
  60. GetMessage -> WinGetMsg
  61. CreateWindow -> WinCreateWindow
  62. SetParent -> WinSetParent (..,TRUE)
  63. DefWindowProc -> WinDefWindowProc
  64. GetKeyState -> WinGetKeyState (HWND_DESKTOP, ...)
  65. VK_LBUTTON -> VK_BUTTON1
  66. VK_MBUTTON -> VK_BUTTON2
  67. VK_RBUTTON -> VK_BUTTON3
  68. RGB -> R*65536 + G*256 + B (in macro)
  69. CW_USEDEFAULT -> ?? (none)
  70. WS_CHILD -> non, all OS/2 windows are childs of some window
  71. ShowWindow -> WinShowWindow
  72.     SW_SHOWMINNOACTIVE -> FALSE
  73.     SW_SHOWMAXIMIZED -> TRUE (after max?)
  74.     SW_SHOWNORMAL -> TRUE
  75.     SW_HIDE -> FALSE
  76. DestroyWindow -> WinDestroyWindow
  77. SendMessage -> WinSendMsg
  78. SetWindowText -> WinSetWindowText
  79. MoveWindow -> WinSetWindowPos(winPtr, HWND_TOP, x, y, cx, cy, SWP_MOVE)
  80. WindowFromPoint -> WinWindowFromPoint (HWND_DESKTOP, &pos, TRUE)
  81. AdjustWindowRect ->
  82.       WinCalcFrameRect (TkOS2GetHWND(winPtr->parentPtr->window), PRECTL, FALSE)
  83. IsIconic -> WinQueryWindowPos, swp.fl & SWP_MINIMIZE
  84. IsZoomed -> WinQueryWindowPos, swp.fl & SWP_MAXIMIZE
  85. SWP_NOMOVE -> !(... SWP_MOVE)
  86. CloseWindow -> WinSetWindowPos(winPtr, HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE)
  87. DeiconifyWindow -> WinSetWindowPos(winPtr, HWND_TOP, 0, 0, 0, 0, SWP_RESTORE)
  88. DC/GetDC/ReleaseDC -> (palette) HPS / WinGetPS / WinReleasePS
  89. SelectPalette (DC, HPALETTE, BOOL) -> GpiSelectPalette (HPS, HPAL)
  90. RealizePalette -> WinRealizePalette (HWND, HPS, PCCLR) (*NOT* allowed in WM_SETFOCUS processing)
  91. UpdateColors -> <nothing>
  92. HGLOBAL -> PVOID (DosAllocSharedMem) / LHANDLE
  93. OpenClipboard -> WinOpenClipbrd (HAB)
  94. GetClipboardData (type) -> WinQueryClipbrdData (HAB, ULtype)
  95. GlobalLock -> <nothing>, but cast return value WinQueryClipbrdData
  96. GlobalUnlock -> <nothing>
  97. CloseClipboard -> WinCloseClipbrd (HAB)
  98. GetClipboardOwner -> WinQueryClipbrdOwner (HAB)
  99. EmptyClipboard -> WinEmptyClipbrd (HAB)
  100. SetClipboardData -> WinSetClipbrdData (HAB, ULhandle, ULfmt, ULflags)
  101. GlobalAlloc (for clipboard) -> DosAllocSharedMem (OBJ_GIVEABLE)
  102. COLOR_* -> SYSCLR_**
  103. COLORREF -> LONG (R*65536+G*256+B)
  104. GetSysColor -> WinQuerySysColor(HWND_DESKTOP, color, 0)
  105. GetRValue -> RGB / 65536
  106. GetGValue -> (RGB % 65536) / 256
  107. GetBValue -> (RGB % 65536) % 256
  108. QueryETTERGB = RGB + 2 in high-order byte -> LONG (R*65536+G*256+B)
  109. SIZEPALETTE (in GetDeviceCaps) -> aDevCaps[CAPS_COLOR_INDEX]
  110. PALETTEENTRY -> RGB2
  111. GetNearestPaletteIndex (palette, color) ->
  112.     WinGetPS (HWND_DESKTOP)
  113.     GpiSelectPalette (HPS, HPAL)
  114.     GpiQueryColorIndex (HPS, 0, LCOLOR)
  115.     WinReleasePS (HPS)
  116. GetPaletteEntries -> GpiQueryPaletteInfo (HPAL, HPS, 0, ...)
  117. ResizePalette (including SetPaletteEntries) ->
  118.     WinGetPS (HWND_DESKTOP)
  119.     GpiSelectPalette (HPS, HPAL)
  120.     GpiQueryPaletteInfo
  121.     (set new entries in array in info)
  122.     GpiSetPaletteEntries (LCOLF_CONSECRGB, count changed)
  123.     WinReleasePS (HPS)
  124. SetPaletteEntries ->
  125.     WinGetPS (HWND_DESKTOP)
  126.     GpiSelectPalette (HPS, HPAL)
  127.     GpiSetPaletteEntries
  128.     WinReleasePS (HPS)
  129. GetNearestColor ->
  130.     WinGetPS (HWND_DESKTOP)
  131.     GpiQueryNearestColor (HPS, 0, LCOLOR)
  132.     WinReleasePS (HPS)
  133. COLORREF = RGB 0x00bbggrr    or   palette index 0x0100iiii (macro PALETTEINDEX)
  134.     or     palette relative RGB 0x02bbggrr (macro PALETTERGB)
  135.     -> ULONG
  136. LOGPALETTE ->  ULONG[]
  137. CreatePalette -> GpiCreatePalette
  138. DeleteObject (palette) -> GpiDeletePalette
  139. DeleteObject (region) -> GpiDestroyRegion
  140. DeleteObject (font) -> GpiDeleteSetId
  141. HCURSOR -> HPOINTER
  142. LPCTSTR -> LONG
  143. IDC_... -> SPTR_...
  144. cursor -> pointer
  145. caret -> cursor
  146. LoadCursor -> WinLoadPointer
  147. SetCursor -> WinSetPointer
  148. HPEN -> LINEBUNDLE (color, width, type)
  149. SelectObject -> GpiSetBitmap/GpiSetPattern (brush, first query for old one)
  150.              -> GpiSetCharSet (font, first query for old one)
  151.              -> GpiSetLineType (pen, ditto)
  152. BitBlt -> GpiBitBlt
  153. HBRUSH -> LONG (PATSYM)
  154. CreateSolidBrush -> GpiSetColor (using brush via GpiSetPattern, first query for old one)
  155. SetBkMode -> GpiSetBackMix
  156.     (with OPAQUE->BM_OVERPAINT, TRANSPARANT->BM_LEAVEALONE)
  157. SetBkColor -> GpiSetBackColor
  158. SetTextColor -> GpiSetAttrs (hps, PRIM_CHAR, CBB_COLOR, CHARBUNDLE->color)
  159. CreateBitmap -> GpiCreateBitmap
  160. BITMAPINFO -> BITMAPINFO2
  161. BITMAPINFOHEADER -> BITMAPINFOHEADER2
  162. SetROP2 -> GpiSetMix
  163. RGBQUAD -> RGB2
  164. (compression) BI_RGB -> BCA_UNCOMP
  165. HFONT -> LONG (local ID)
  166. TEXTMETRIC -> FONTMETRICS
  167. SIZE -> SIZEL
  168. CreatePatternBrush,SetPatternOrgEx,SelectObject ->
  169.     GpiSetBitmapId,
  170.     GpiSetPatternSet, (after query for old value)
  171.     GpiSetPatternRefPoint,
  172.     GpiDeleteSetId
  173. SetTextAlign -> GpiSetTextAlignment
  174. GetTextExtentPoint -> GpiQueryTextBox
  175. GetTextMetrics -> GpiQueryFontMetrics
  176. CreateCompatibleBitmap -> GpiCreateBitmap
  177. PatBlt -> GpiCreateRegion, GpiSetColor, GpiPaintRegion
  178. TextOut -> GpiCharStringAt
  179. FillRect -> WinFillRect
  180. SetPolyFillMode, Polygon -> GpiPolygons
  181.     (ALTERNATE -> POLYGON_ALTERNATE, WINDING -> POLYGON_WINDING)
  182. Polyline -> GpiPolyLine
  183. Arc -> GpiPartialArc, but us original X angles
  184. Pie -> GpiMove to center of Pie
  185.     GpiPartialArc, drawing one spoke and the arc
  186.     GpiLine back to center of pie
  187. Chord (arc whose end points are connected by a straight line) ->
  188.     GpiSetLineType(hps, LINETYPE_INVISIBLE)
  189.     GpiPartialArc
  190.     GpiSetLineType(hps, LINETYPE_SOLID)
  191.     GpiPartialArc (same as first arc)
  192.     or (as in TkOS2Draw.c)
  193.     Move to end point, GpiPartialArc
  194. ScrollWindowEx -> WinScrollWindow
  195. LOGFONT -> FATTRS
  196. LF_FACESIZE -> FACESIZE
  197. ANSI_CHARSET -> 1004L
  198. SYMBOL_CHARSET -> 65400L
  199. CreateFontIndirect -> GpiCreateLogFont
  200. GetCharWidth -> GpiQueryCharStringPos
  201.       GpiQueryWidthTable
  202. XGetFontProperty not implemented in Windows, but FONTMETRICS is specific
  203.     enoguh to do it in OS/2 PM.
  204. RegOpenKeyEx/ReQueryValueEx/RegCloseKey -> PrfQueryProfileData
  205. VK_CANCEL -> VK_BREAK
  206. VK_BACK -> VK_BACKSPACE
  207. VK_RETURN -> VK_ENTER
  208. VK_CONTROL -> VK_CTRL
  209. VK_CAPITAL -> VK_CAPSLOCK
  210. VK_ESCAPE -> VK_ESC
  211. VK_PRIOR -> VK_PAGEUP
  212. VK_NEXT -> VK_PAGEDOWN
  213. VK_SELECT -> no equivalent virtual key code
  214. VK_PRINT -> VK_PRINTSCRN
  215. VK_EXECUTE -> no equivalent virtual key code
  216. VK_HELP -> no equivalent virtual key code
  217. VK_SCROLL -> VK_SCRLLOCK
  218. Vk_KeyScan -> no equivalent in OS/2
  219. MapVirtualKey -> no equivalent in OS/2
  220. ToAscii -> no equivalent in OS/2
  221. UINT -> HTIMER (Timer related)
  222. KillTimer -> WinStopTimer
  223. SetTimer -> WinStartTimer
  224. TranslateMessage -> not necessary in OS/2
  225. GetCursorPos -> WinQueryPointerPos
  226. ReleaseCapture -> WinSetCapture(.., NULLHANDLE)
  227. SetCapture -> WinSetCapture(.., HWND)
  228. GetFocus -> WinQueryFocus
  229. SetFocus -> WinSetFocus
  230. CreateRectRgnIndirect -> GpiCreateRegion(...,1,..)
  231. GetRgnBox -> GpiQueryRegionBox
  232. CombineRgn -> GpiCombineRegion
  233. RGN_AND -> CRGN_AND
  234. RGN_OR -> CRGN_OR
  235. RectangleIn not implemented in Windows, but GpiRectInRegion offers this -> added
  236. WS_POPUP -> FCF_NOMOVEWITHOWNER in frame control flags (parent HWND_DESKTOP)
  237. NULL parentWin -> HWND_DESKTOP
  238. ShowWindow -> WinSetWindowPos (showing) and WinShowWindow (hiding)
  239. SetWindowPos -> WinSetWindowPos
  240. GetWindowRect -> WinQueryWindowRect
  241. InvalidateRect -> WinInvalidateRect
  242. GetModuleHandle -> DosQueryModuleHandle
  243. MessageBeep -> WinAlarm+WinMessageBox
  244.  
  245. Check Y coordinates!
  246.  
  247. WM_COMMAND -> WM_CONTROL
  248.  
  249. Tk 4.2
  250. ======
  251. OPENFILENAME -> FILEDLG
  252. SelectClipRgn -> GpiSetClipRegion
  253. OffsetClipRgn -> GpiOffsetClipRegion
  254.