home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tk42r2s.zip
/
tk4.2
/
os2
/
WinToOS2
< prev
next >
Wrap
Text File
|
1997-07-02
|
9KB
|
254 lines
copy tkPort.h, default.h to ..\generic
TkWin<function> -> TkOS2<function>
HDC TkWinGetDrawableDC -> HPS TkOS2GetDrawablePS
TkWinDCState -> TkOS2PSState
TkWinReleaseDrawableDC (..,DC,..) -> TkOS2ReleaseDrawablePS (..,HPS,..)
TkWinSelectPalette (DC,..) -> TkOS2SelectPalette (HPS,HWND,..)
WINDOWPOS -> SWP
GetModuleFileName -> DosQueryModuleName
_ANSI_ARGS_() ->
HPALLETTE -> HPAL
TWD -> TOD (Drawable)
UINT -> ULONG
WPARAM -> MPARAM
wParam -> param1
LPARAM -> MPARAM
lParam -> param2
HINSTANCE -> HAB
LRESULT CALLBACK -> MRESULT EXPENTRY
MessageBox -> WinGetMessageBox
MB_ICONSTOP -> MB_ERROR
MB_TASKMODAL -> MB_APPLMODAL
GetDC -> DevOpenDC/WinGetPS
GetDeviceCaps -> DevQueryCaps
SetWindowLong GWL_USERDATA -> WinSetWindowULong (hwnd, QWL_USER, (ULONG) pPtr)
SetWindowLong GWL_STYLE -> WinSetWindowBits (hwnd, QWL_STYLE, ...)
GetWindowLong GWL_USERDATA -> WinQueryWindowULong (hwnd, QWL_USER)
WM_GETMINMAXINFO -> WM_QUERYTRACKINFO
MINMAXINFO -> TRACKINFO
WM_PALETTECHANGED -> WM_REALIZEPALETTE
WM_QUERYNEWPALETTE ---> WM_SETFOCUS
WM_KILLFOCUS -> WM_SETFOCUS
WM_LBUTTONDOWN -> WM_BUTTON1DOWN
WM_LBUTTONUP -> WM_BUTTON1UP
WM_MBUTTONDOWN -> WM_BUTTON2DOWN
WM_MBUTTONUP -> WM_BUTTON2UP
WM_RBUTTONDOWN -> WM_BUTTON3DOWN
WM_RBUTTONUP -> WM_BUTTON3UP
WM_SYSKEYDOWN -> (Alt key, kan ook als geen window focus heeft->actieve window)
WM_CHAR, flag KC_ALT
WM_SYSKEYUP -> (Alt key, kan ook als geen window focus heeft->actieve window)
WM_CHAR, flag KC_ALT
WM_KEYDOWN -> (niet-Alt key) WM_CHAR
WM_KEYUP -> (niet-Alt key) WM_CHAR
WM_ERASEBKGND -> WM_ERASEBACKGROUND
WM_RENDERFORMAT -> WM_RENDERFMT
BeginPaint -> WinBeginPaint
EndPaint -> WinEndPaint
PAINTSTRUCT -> RECTL
GetCurrentTime -> WinGetCurrentTime(hab)
POINT -> POINTL
GetMessagePos -> WinQueryMsgPos
ScreenToClient -> WinMapWindowPoints (HWND_DESKTOP, ....)
WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX -> ?
CS_DBLCLKS -> ?
RECT -> RECTL
MSG -> QMSG
PeekMessage -> WinPeekMsg
GetMessage -> WinGetMsg
CreateWindow -> WinCreateWindow
SetParent -> WinSetParent (..,TRUE)
DefWindowProc -> WinDefWindowProc
GetKeyState -> WinGetKeyState (HWND_DESKTOP, ...)
VK_LBUTTON -> VK_BUTTON1
VK_MBUTTON -> VK_BUTTON2
VK_RBUTTON -> VK_BUTTON3
RGB -> R*65536 + G*256 + B (in macro)
CW_USEDEFAULT -> ?? (none)
WS_CHILD -> non, all OS/2 windows are childs of some window
ShowWindow -> WinShowWindow
SW_SHOWMINNOACTIVE -> FALSE
SW_SHOWMAXIMIZED -> TRUE (after max?)
SW_SHOWNORMAL -> TRUE
SW_HIDE -> FALSE
DestroyWindow -> WinDestroyWindow
SendMessage -> WinSendMsg
SetWindowText -> WinSetWindowText
MoveWindow -> WinSetWindowPos(winPtr, HWND_TOP, x, y, cx, cy, SWP_MOVE)
WindowFromPoint -> WinWindowFromPoint (HWND_DESKTOP, &pos, TRUE)
AdjustWindowRect ->
WinCalcFrameRect (TkOS2GetHWND(winPtr->parentPtr->window), PRECTL, FALSE)
IsIconic -> WinQueryWindowPos, swp.fl & SWP_MINIMIZE
IsZoomed -> WinQueryWindowPos, swp.fl & SWP_MAXIMIZE
SWP_NOMOVE -> !(... SWP_MOVE)
CloseWindow -> WinSetWindowPos(winPtr, HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE)
DeiconifyWindow -> WinSetWindowPos(winPtr, HWND_TOP, 0, 0, 0, 0, SWP_RESTORE)
DC/GetDC/ReleaseDC -> (palette) HPS / WinGetPS / WinReleasePS
SelectPalette (DC, HPALETTE, BOOL) -> GpiSelectPalette (HPS, HPAL)
RealizePalette -> WinRealizePalette (HWND, HPS, PCCLR) (*NOT* allowed in WM_SETFOCUS processing)
UpdateColors -> <nothing>
HGLOBAL -> PVOID (DosAllocSharedMem) / LHANDLE
OpenClipboard -> WinOpenClipbrd (HAB)
GetClipboardData (type) -> WinQueryClipbrdData (HAB, ULtype)
GlobalLock -> <nothing>, but cast return value WinQueryClipbrdData
GlobalUnlock -> <nothing>
CloseClipboard -> WinCloseClipbrd (HAB)
GetClipboardOwner -> WinQueryClipbrdOwner (HAB)
EmptyClipboard -> WinEmptyClipbrd (HAB)
SetClipboardData -> WinSetClipbrdData (HAB, ULhandle, ULfmt, ULflags)
GlobalAlloc (for clipboard) -> DosAllocSharedMem (OBJ_GIVEABLE)
COLOR_* -> SYSCLR_**
COLORREF -> LONG (R*65536+G*256+B)
GetSysColor -> WinQuerySysColor(HWND_DESKTOP, color, 0)
GetRValue -> RGB / 65536
GetGValue -> (RGB % 65536) / 256
GetBValue -> (RGB % 65536) % 256
QueryETTERGB = RGB + 2 in high-order byte -> LONG (R*65536+G*256+B)
SIZEPALETTE (in GetDeviceCaps) -> aDevCaps[CAPS_COLOR_INDEX]
PALETTEENTRY -> RGB2
GetNearestPaletteIndex (palette, color) ->
WinGetPS (HWND_DESKTOP)
GpiSelectPalette (HPS, HPAL)
GpiQueryColorIndex (HPS, 0, LCOLOR)
WinReleasePS (HPS)
GetPaletteEntries -> GpiQueryPaletteInfo (HPAL, HPS, 0, ...)
ResizePalette (including SetPaletteEntries) ->
WinGetPS (HWND_DESKTOP)
GpiSelectPalette (HPS, HPAL)
GpiQueryPaletteInfo
(set new entries in array in info)
GpiSetPaletteEntries (LCOLF_CONSECRGB, count changed)
WinReleasePS (HPS)
SetPaletteEntries ->
WinGetPS (HWND_DESKTOP)
GpiSelectPalette (HPS, HPAL)
GpiSetPaletteEntries
WinReleasePS (HPS)
GetNearestColor ->
WinGetPS (HWND_DESKTOP)
GpiQueryNearestColor (HPS, 0, LCOLOR)
WinReleasePS (HPS)
COLORREF = RGB 0x00bbggrr or palette index 0x0100iiii (macro PALETTEINDEX)
or palette relative RGB 0x02bbggrr (macro PALETTERGB)
-> ULONG
LOGPALETTE -> ULONG[]
CreatePalette -> GpiCreatePalette
DeleteObject (palette) -> GpiDeletePalette
DeleteObject (region) -> GpiDestroyRegion
DeleteObject (font) -> GpiDeleteSetId
HCURSOR -> HPOINTER
LPCTSTR -> LONG
IDC_... -> SPTR_...
cursor -> pointer
caret -> cursor
LoadCursor -> WinLoadPointer
SetCursor -> WinSetPointer
HPEN -> LINEBUNDLE (color, width, type)
SelectObject -> GpiSetBitmap/GpiSetPattern (brush, first query for old one)
-> GpiSetCharSet (font, first query for old one)
-> GpiSetLineType (pen, ditto)
BitBlt -> GpiBitBlt
HBRUSH -> LONG (PATSYM)
CreateSolidBrush -> GpiSetColor (using brush via GpiSetPattern, first query for old one)
SetBkMode -> GpiSetBackMix
(with OPAQUE->BM_OVERPAINT, TRANSPARANT->BM_LEAVEALONE)
SetBkColor -> GpiSetBackColor
SetTextColor -> GpiSetAttrs (hps, PRIM_CHAR, CBB_COLOR, CHARBUNDLE->color)
CreateBitmap -> GpiCreateBitmap
BITMAPINFO -> BITMAPINFO2
BITMAPINFOHEADER -> BITMAPINFOHEADER2
SetROP2 -> GpiSetMix
RGBQUAD -> RGB2
(compression) BI_RGB -> BCA_UNCOMP
HFONT -> LONG (local ID)
TEXTMETRIC -> FONTMETRICS
SIZE -> SIZEL
CreatePatternBrush,SetPatternOrgEx,SelectObject ->
GpiSetBitmapId,
GpiSetPatternSet, (after query for old value)
GpiSetPatternRefPoint,
GpiDeleteSetId
SetTextAlign -> GpiSetTextAlignment
GetTextExtentPoint -> GpiQueryTextBox
GetTextMetrics -> GpiQueryFontMetrics
CreateCompatibleBitmap -> GpiCreateBitmap
PatBlt -> GpiCreateRegion, GpiSetColor, GpiPaintRegion
TextOut -> GpiCharStringAt
FillRect -> WinFillRect
SetPolyFillMode, Polygon -> GpiPolygons
(ALTERNATE -> POLYGON_ALTERNATE, WINDING -> POLYGON_WINDING)
Polyline -> GpiPolyLine
Arc -> GpiPartialArc, but us original X angles
Pie -> GpiMove to center of Pie
GpiPartialArc, drawing one spoke and the arc
GpiLine back to center of pie
Chord (arc whose end points are connected by a straight line) ->
GpiSetLineType(hps, LINETYPE_INVISIBLE)
GpiPartialArc
GpiSetLineType(hps, LINETYPE_SOLID)
GpiPartialArc (same as first arc)
or (as in TkOS2Draw.c)
Move to end point, GpiPartialArc
ScrollWindowEx -> WinScrollWindow
LOGFONT -> FATTRS
LF_FACESIZE -> FACESIZE
ANSI_CHARSET -> 1004L
SYMBOL_CHARSET -> 65400L
CreateFontIndirect -> GpiCreateLogFont
GetCharWidth -> GpiQueryCharStringPos
GpiQueryWidthTable
XGetFontProperty not implemented in Windows, but FONTMETRICS is specific
enoguh to do it in OS/2 PM.
RegOpenKeyEx/ReQueryValueEx/RegCloseKey -> PrfQueryProfileData
VK_CANCEL -> VK_BREAK
VK_BACK -> VK_BACKSPACE
VK_RETURN -> VK_ENTER
VK_CONTROL -> VK_CTRL
VK_CAPITAL -> VK_CAPSLOCK
VK_ESCAPE -> VK_ESC
VK_PRIOR -> VK_PAGEUP
VK_NEXT -> VK_PAGEDOWN
VK_SELECT -> no equivalent virtual key code
VK_PRINT -> VK_PRINTSCRN
VK_EXECUTE -> no equivalent virtual key code
VK_HELP -> no equivalent virtual key code
VK_SCROLL -> VK_SCRLLOCK
Vk_KeyScan -> no equivalent in OS/2
MapVirtualKey -> no equivalent in OS/2
ToAscii -> no equivalent in OS/2
UINT -> HTIMER (Timer related)
KillTimer -> WinStopTimer
SetTimer -> WinStartTimer
TranslateMessage -> not necessary in OS/2
GetCursorPos -> WinQueryPointerPos
ReleaseCapture -> WinSetCapture(.., NULLHANDLE)
SetCapture -> WinSetCapture(.., HWND)
GetFocus -> WinQueryFocus
SetFocus -> WinSetFocus
CreateRectRgnIndirect -> GpiCreateRegion(...,1,..)
GetRgnBox -> GpiQueryRegionBox
CombineRgn -> GpiCombineRegion
RGN_AND -> CRGN_AND
RGN_OR -> CRGN_OR
RectangleIn not implemented in Windows, but GpiRectInRegion offers this -> added
WS_POPUP -> FCF_NOMOVEWITHOWNER in frame control flags (parent HWND_DESKTOP)
NULL parentWin -> HWND_DESKTOP
ShowWindow -> WinSetWindowPos (showing) and WinShowWindow (hiding)
SetWindowPos -> WinSetWindowPos
GetWindowRect -> WinQueryWindowRect
InvalidateRect -> WinInvalidateRect
GetModuleHandle -> DosQueryModuleHandle
MessageBeep -> WinAlarm+WinMessageBox
Check Y coordinates!
WM_COMMAND -> WM_CONTROL
Tk 4.2
======
OPENFILENAME -> FILEDLG
SelectClipRgn -> GpiSetClipRegion
OffsetClipRgn -> GpiOffsetClipRegion