Ignore:
Timestamp:
Jul 18, 1999, 7:12:03 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/user32.cpp

    r329 r330  
    1 /* $Id: user32.cpp,v 1.7 1999-07-18 14:56:36 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.8 1999-07-18 17:12:02 sandervl Exp $ */
    22
    33/*
     
    7777// WIN32API YieldTask
    7878
    79 //Window handle transformation
    80 
    81 inline HWND Win32ToOS2Handle(HWND hwnd)
    82 {
    83   Win32Window *window;
    84 
    85   window = Win32Window::GetWindowFromHandle(hwnd);
    86   if (window) return window->getOS2WindowHandle();
    87   else return hwnd; //already OS/2 handle?
    88 }
    89 
    90 inline HWND OS2ToWin32Handle(HWND hwnd)
    91 {
    92   Win32Window *window;
    93 
    94   window = Win32Window::GetWindowFromOS2Handle(hwnd);
    95   if (window) return window->getWindowHandle();
    96   else return hwnd; //OS/2 window
    97 }
    98 
    9979//Coordinate transformation
    10080
     
    272252//******************************************************************************
    273253
    274 /*******************************************************************
    275  *      InternalGetWindowText    (USER32.326)
    276  */
    277 int WIN32API InternalGetWindowText(HWND   hwnd,
    278                                    LPWSTR lpString,
    279                                    INT    nMaxCount )
    280 {
    281     dprintf(("USER32: InternalGetWindowText(%08xh,%08xh,%08xh) not properly implemented.\n",
    282              hwnd,
    283              lpString,
    284              nMaxCount));
    285 
    286     return GetWindowTextW(hwnd,lpString,nMaxCount);
    287 }
    288 //******************************************************************************
    289 //******************************************************************************
    290 HWND WIN32API GetFocus(void)
    291 {
    292     HWND hwnd;
    293 //    dprintf(("USER32:  GetFocus\n"));
    294 
    295     hwnd = OSLibWinQueryFocus(OSLIB_HWND_DESKTOP);
    296     return OS2ToWin32Handle(hwnd);
    297 }
    298 //******************************************************************************
    299 //******************************************************************************
    300 HWND WIN32API GetDesktopWindow(void)
    301 {
    302     dprintf(("USER32:  GetDesktopWindow\n"));
    303     return OSLIB_HWND_DESKTOP;
    304 }
    305 //******************************************************************************
    306 //******************************************************************************
    307 BOOL WIN32API EnumThreadWindows(DWORD dwThreadId, WNDENUMPROC lpfn, LPARAM lParam)
    308 {
    309  BOOL                rc;
    310  EnumWindowCallback *callback = new EnumWindowCallback(lpfn, lParam);
    311 
    312   dprintf(("USER32:  EnumThreadWindows\n"));
    313   //CB: replace
    314   rc = O32_EnumThreadWindows(dwThreadId, callback->GetOS2Callback(), (LPARAM)callback);
    315   if(callback)
    316     delete callback;
    317   return(rc);
    318 }
    319254//******************************************************************************
    320255//******************************************************************************
     
    347282//******************************************************************************
    348283//******************************************************************************
    349 HWND WIN32API SetFocus( HWND hwnd)
    350 {
    351     HWND lastFocus;
    352 
    353     dprintf(("USER32:  SetFocus\n"));
    354 
    355     lastFocus = GetFocus();
    356     hwnd = Win32ToOS2Handle(hwnd);
    357     return (OSLibWinSetFocus(OSLIB_HWND_DESKTOP,hwnd)) ? lastFocus:0;
    358 }
    359 //******************************************************************************
    360 //******************************************************************************
    361284BOOL WIN32API InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase)
    362285{
     
    368291
    369292    //CB: bErase no quite the same
    370     hWnd = Win32ToOS2Handle(hWnd);
     293    hWnd = Win32Window::Win32ToOS2Handle(hWnd);
    371294    if (lpRect)
    372295    {
     
    378301      return OSLibWinInvalidateRect(hWnd,&rect,bErase); //rect == RECTL
    379302    } else return OSLibWinInvalidateRect(hWnd,NULL,bErase);
    380 }
    381 //******************************************************************************
    382 //******************************************************************************
    383 BOOL WIN32API GetUpdateRect( HWND hWnd, PRECT lpRect, BOOL  bErase)
    384 {
    385     ULONG windowH;
    386     BOOL rc;
    387 
    388 #ifdef DEBUG
    389     WriteLog("USER32:  GetUpdateRect\n");
    390 #endif
    391     if (!lpRect) return FALSE;
    392 
    393     hWnd = Win32ToOS2Handle(hWnd);
    394     return OSLibWinQueryUpdateRect(hWnd, (PVOID)&lpRect);
    395303}
    396304//******************************************************************************
     
    515423    WriteLog("USER32: SetTimer INCORRECT CALLING CONVENTION FOR HANDLER!!!!!\n");
    516424#endif
    517     hwnd = Win32ToOS2Handle(hwnd);
     425    hwnd = Win32Window::Win32ToOS2Handle(hwnd);
    518426    //SvL: Write callback handler class for this one
    519427    //CB: replace
     
    527435    WriteLog("USER32:  KillTimer\n");
    528436#endif
    529     hWnd = Win32ToOS2Handle(hWnd);
     437    hWnd = Win32Window::Win32ToOS2Handle(hWnd);
    530438    //WinStopTimer
    531439    //CB: replace
     
    595503    WriteLog("USER32:  WinHelp not implemented %s\n", lpszHelp);
    596504#endif
    597 //    hwnd = Win32ToOS2Handle(hwnd);
     505//    hwnd = Win32Window::Win32ToOS2Handle(hwnd);
    598506//    return O32_WinHelp(arg1, arg2, arg3, arg4);
    599507
    600508    return(TRUE);
    601 }
    602 //******************************************************************************
    603 //******************************************************************************
    604 int WIN32API TranslateAcceleratorA(HWND hwnd, HACCEL haccel, LPMSG  lpmsg)
    605 {
    606 #ifdef DEBUG
    607 ////    WriteLog("USER32:  TranslateAccelerator\n");
    608 #endif
    609     //CB: needs more work
    610     //WinTranslateAccel();
    611     //get hab, translate
    612     hwnd = Win32ToOS2Handle(hwnd);
    613     return O32_TranslateAccelerator(hwnd,haccel,lpmsg);
    614509}
    615510//******************************************************************************
     
    713608//******************************************************************************
    714609//******************************************************************************
    715 BOOL WIN32API EnableScrollBar( HWND arg1, INT arg2, UINT  arg3)
    716 {
    717 #ifdef DEBUG
    718     WriteLog("USER32:  EnableScrollBar\n");
    719 #endif
    720     //CB: implement in window class
    721     return O32_EnableScrollBar(arg1, arg2, arg3);
    722 }
    723 //******************************************************************************
    724 //******************************************************************************
    725610HWND WIN32API SetCapture( HWND arg1)
    726611{
     
    756641#endif
    757642    return O32_ChangeClipboardChain(arg1, arg2);
    758 }
    759 //******************************************************************************
    760 //******************************************************************************
    761 UINT WIN32API ArrangeIconicWindows( HWND arg1)
    762 {
    763 #ifdef DEBUG
    764     WriteLog("USER32:  ArrangeIconicWindows\n");
    765 #endif
    766     return O32_ArrangeIconicWindows(arg1);
    767643}
    768644//******************************************************************************
     
    810686//******************************************************************************
    811687//******************************************************************************
    812 HACCEL WIN32API CreateAcceleratorTableA( LPACCEL arg1, int  arg2)
    813 {
    814 #ifdef DEBUG
    815     WriteLog("USER32:  CreateAcceleratorTableA\n");
    816 #endif
    817     return O32_CreateAcceleratorTable(arg1, arg2);
    818 }
    819 //******************************************************************************
    820 //******************************************************************************
    821 HACCEL WIN32API CreateAcceleratorTableW( LPACCEL arg1, int  arg2)
    822 {
    823 #ifdef DEBUG
    824     WriteLog("USER32:  CreateAcceleratorTableW\n");
    825 #endif
    826     // NOTE: This will not work as is (needs UNICODE support)
    827     return O32_CreateAcceleratorTable(arg1, arg2);
    828 }
    829 //******************************************************************************
    830 //******************************************************************************
    831688BOOL WIN32API CreateCaret( HWND arg1, HBITMAP arg2, int arg3, int  arg4)
    832689{
     
    898755//******************************************************************************
    899756//******************************************************************************
    900 BOOL WIN32API DestroyAcceleratorTable( HACCEL arg1)
    901 {
    902 #ifdef DEBUG
    903     WriteLog("USER32:  DestroyAcceleratorTable\n");
    904 #endif
    905     return O32_DestroyAcceleratorTable(arg1);
    906 }
    907 //******************************************************************************
    908 //******************************************************************************
    909757BOOL WIN32API DestroyCaret(void)
    910758{
     
    12291077#endif
    12301078    return O32_GetQueueStatus(arg1);
    1231 }
    1232 //******************************************************************************
    1233 //******************************************************************************
    1234 int WIN32API GetScrollPos(HWND hwnd, int fnBar)
    1235 {
    1236  int pos;
    1237 
    1238     pos = O32_GetScrollPos(hwnd, fnBar);
    1239 #ifdef DEBUG
    1240     WriteLog("USER32:  GetScrollPos of %X type %d returned %d\n", hwnd, fnBar, pos);
    1241 #endif
    1242     return(pos);
    1243 }
    1244 //******************************************************************************
    1245 //******************************************************************************
    1246 BOOL WIN32API GetScrollRange( HWND arg1, int arg2, int * arg3, int *  arg4)
    1247 {
    1248 #ifdef DEBUG
    1249     WriteLog("USER32:  GetScrollRange\n");
    1250 #endif
    1251     return O32_GetScrollRange(arg1, arg2, arg3, arg4);
    12521079}
    12531080//******************************************************************************
     
    14851312//******************************************************************************
    14861313//******************************************************************************
    1487 BOOL WIN32API ScrollWindow( HWND arg1, int arg2, int arg3, const RECT * arg4, const RECT *  arg5)
    1488 {
    1489 #ifdef DEBUG
    1490     WriteLog("USER32:  ScrollWindow\n");
    1491 #endif
    1492     return O32_ScrollWindow(arg1, arg2, arg3, arg4, arg5);
    1493 }
    1494 //******************************************************************************
    1495 //******************************************************************************
    1496 BOOL WIN32API ScrollWindowEx( HWND arg1, int arg2, int arg3, const RECT * arg4, const RECT * arg5, HRGN arg6, PRECT arg7, UINT  arg8)
    1497 {
    1498 #ifdef DEBUG
    1499     WriteLog("USER32:  ScrollWindowEx\n");
    1500 #endif
    1501     return O32_ScrollWindowEx(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
    1502 }
    1503 //******************************************************************************
    1504 //******************************************************************************
    15051314BOOL WIN32API SetCaretBlinkTime( UINT arg1)
    15061315{
     
    15511360//******************************************************************************
    15521361//******************************************************************************
    1553 int WIN32API SetScrollPos( HWND arg1, int arg2, int arg3, BOOL  arg4)
    1554 {
    1555 #ifdef DEBUG
    1556     WriteLog("USER32:  SetScrollPos\n");
    1557 #endif
    1558     return O32_SetScrollPos(arg1, arg2, arg3, arg4);
    1559 }
    1560 //******************************************************************************
    1561 //******************************************************************************
    1562 BOOL WIN32API SetScrollRange( HWND arg1, int arg2, int arg3, int arg4, BOOL  arg5)
    1563 {
    1564 #ifdef DEBUG
    1565     WriteLog("USER32:  SetScrollRange\n");
    1566 #endif
    1567     return O32_SetScrollRange(arg1, arg2, arg3, arg4, arg5);
    1568 }
    1569 //******************************************************************************
    1570 //******************************************************************************
    1571 BOOL WIN32API SetWindowPlacement( HWND arg1, const WINDOWPLACEMENT *  arg2)
    1572 {
    1573     dprintf(("USER32:  SetWindowPlacement\n"));
    1574     return O32_SetWindowPlacement(arg1, arg2);
    1575 }
    1576 //******************************************************************************
    1577 //******************************************************************************
    15781362BOOL WIN32API ShowCaret( HWND arg1)
    15791363{
    15801364    dprintf(("USER32:  ShowCaret\n"));
    15811365    return O32_ShowCaret(arg1);
    1582 }
    1583 //******************************************************************************
    1584 //******************************************************************************
    1585 BOOL WIN32API ShowOwnedPopups( HWND arg1, BOOL  arg2)
    1586 {
    1587     dprintf(("USER32:  ShowOwnedPopups\n"));
    1588     return O32_ShowOwnedPopups(arg1, arg2);
    1589 }
    1590 //******************************************************************************
    1591 //******************************************************************************
    1592 BOOL WIN32API ShowScrollBar( HWND arg1, int arg2, BOOL  arg3)
    1593 {
    1594 #ifdef DEBUG
    1595     WriteLog("USER32:  ShowScrollBar\n");
    1596 #endif
    1597     return O32_ShowScrollBar(arg1, arg2, arg3);
    15981366}
    15991367//******************************************************************************
     
    17491517//******************************************************************************
    17501518//******************************************************************************
    1751 int WIN32API TranslateAccelerator( HWND arg1, HACCEL arg2, LPMSG  arg3)
    1752 {
    1753 #ifdef DEBUG
    1754     WriteLog("USER32:  TranslateAccelerator\n");
    1755 #endif
    1756     return O32_TranslateAccelerator(arg1, arg2, arg3);
    1757 }
    1758 //******************************************************************************
    1759 //******************************************************************************
    1760 int WIN32API TranslateAcceleratorW( HWND arg1, HACCEL arg2, LPMSG  arg3)
    1761 {
    1762 #ifdef DEBUG
    1763     WriteLog("USER32:  TranslateAcceleratorW\n");
    1764 #endif
    1765     // NOTE: This will not work as is (needs UNICODE support)
    1766     return O32_TranslateAccelerator(arg1, arg2, arg3);
    1767 }
    1768 //******************************************************************************
    1769 //******************************************************************************
    1770 BOOL WIN32API TranslateMDISysAccel( HWND arg1, LPMSG  arg2)
    1771 {
    1772 #ifdef DEBUG
    1773 ////    WriteLog("USER32:  TranslateMDISysAccel\n");
    1774 #endif
    1775     return O32_TranslateMDISysAccel(arg1, arg2);
    1776 }
    1777 //******************************************************************************
    1778 //******************************************************************************
    17791519BOOL WIN32API UnionRect( PRECT arg1, const RECT * arg2, const RECT *  arg3)
    17801520{
     
    18591599//******************************************************************************
    18601600//TODO: Not complete
    1861 //******************************************************************************
    1862 BOOL WIN32API GetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
    1863 {
    1864 #ifdef DEBUG
    1865   WriteLog("USER32:  GetScrollInfo\n");
    1866 #endif
    1867   if(lpsi == NULL)
    1868     return(FALSE);
    1869 
    1870   if(lpsi->fMask & SIF_POS)
    1871     lpsi->nPos = GetScrollPos(hwnd, fnBar);
    1872   if(lpsi->fMask & SIF_RANGE)
    1873     GetScrollRange(hwnd, fnBar, &lpsi->nMin, &lpsi->nMax);
    1874   if(lpsi->fMask & SIF_PAGE) {
    1875 #ifdef DEBUG
    1876     WriteLog("USER32:  GetScrollInfo, page info not implemented\n");
    1877 #endif
    1878     lpsi->nPage     = 25;
    1879   }
    1880   return(TRUE);
    1881 }
    1882 //******************************************************************************
    1883 //TODO: Not complete
    1884 //******************************************************************************
    1885 INT WIN32API SetScrollInfo(HWND hwnd, INT fnBar, const SCROLLINFO *lpsi, BOOL fRedraw)
    1886 {
    1887  int smin, smax;
    1888 
    1889 #ifdef DEBUG
    1890   WriteLog("USER32:  SetScrollInfo\n");
    1891 #endif
    1892   if(lpsi == NULL)
    1893     return(FALSE);
    1894 
    1895   if(lpsi->fMask & SIF_POS)
    1896         SetScrollPos(hwnd, fnBar, lpsi->nPos, fRedraw);
    1897   if(lpsi->fMask & SIF_RANGE)
    1898         SetScrollRange(hwnd, fnBar, lpsi->nMin, lpsi->nMax, fRedraw);
    1899   if(lpsi->fMask & SIF_PAGE) {
    1900 #ifdef DEBUG
    1901         WriteLog("USER32:  GetScrollInfo, page info not implemented\n");
    1902 #endif
    1903   }
    1904   if(lpsi->fMask & SIF_DISABLENOSCROLL) {
    1905 #ifdef DEBUG
    1906         WriteLog("USER32:  GetScrollInfo, disable scrollbar not yet implemented\n");
    1907 #endif
    1908   }
    1909   return(TRUE);
    1910 }
    1911 //******************************************************************************
    19121601//******************************************************************************
    19131602BOOL WIN32API GrayStringA(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
     
    19741663//TODO:
    19751664//******************************************************************************
    1976 int WIN32API CopyAcceleratorTableA(HACCEL hAccelSrc, LPACCEL lpAccelDest,
    1977                       int cAccelEntries)
    1978 {
    1979 #ifdef DEBUG
    1980   WriteLog("USER32:  CopyAcceleratorTableA, not implemented\n");
    1981 #endif
    1982   return(0);
    1983 }
    1984 //******************************************************************************
    1985 //TODO:
    1986 //******************************************************************************
    1987 int WIN32API CopyAcceleratorTableW(HACCEL hAccelSrc, LPACCEL lpAccelDest,
    1988                       int cAccelEntries)
    1989 {
    1990 #ifdef DEBUG
    1991   WriteLog("USER32:  CopyAcceleratorTableW, not implemented\n");
    1992 #endif
    1993   return(0);
    1994 }
    1995 //******************************************************************************
    1996 //******************************************************************************
    19971665HANDLE WIN32API CopyImage(HANDLE hImage, UINT uType, int cxDesired, int cyDesired, UINT fuFlags)
    19981666{
     
    21351803#endif
    21361804  return(0);
    2137 }
    2138 //******************************************************************************
    2139 //restores iconized window to previous size/position
    2140 //******************************************************************************
    2141 BOOL WIN32API OpenIcon(HWND hwnd)
    2142 {
    2143 #ifdef DEBUG
    2144   WriteLog("USER32:  OpenIcon\n");
    2145 #endif
    2146   if(!IsIconic(hwnd))
    2147         return FALSE;
    2148   ShowWindow(hwnd, SW_SHOWNORMAL);
    2149   return TRUE;
    21501805}
    21511806//******************************************************************************
     
    22731928  return (FALSE);
    22741929}
    2275 
    2276 
    2277 /*****************************************************************************
    2278  * Name      : long WIN32API BroadcastSystemMessage
    2279  * Purpose   : The BroadcastSystemMessage function sends a message to the given
    2280  *             recipients. The recipients can be applications, installable
    2281  *             drivers, Windows-based network drivers, system-level device
    2282  *             drivers, or any combination of these system components.
    2283  * Parameters: DWORD   dwFlags,
    2284                LPDWORD lpdwRecipients,
    2285                UINT    uiMessage,
    2286                WPARAM  wParam,
    2287                LPARAM  lParam
    2288  * Variables :
    2289  * Result    : If the function succeeds, the return value is a positive value.
    2290  *             If the function is unable to broadcast the message, the return value is -1.
    2291  *             If the dwFlags parameter is BSF_QUERY and at least one recipient returned FALSE to the corresponding message, the return value is zero.
    2292  * Remark    :
    2293  * Status    : UNTESTED STUB
    2294  *
    2295  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    2296  *****************************************************************************/
    2297 
    2298 long WIN32API BroadcastSystemMessage(DWORD   dwFlags,
    2299                                         LPDWORD lpdwRecipients,
    2300                                         UINT    uiMessage,
    2301                                         WPARAM  wParam,
    2302                                         LPARAM  lParam)
    2303 {
    2304   dprintf(("USER32:BroadcastSystemMessage(%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    2305         dwFlags,
    2306         lpdwRecipients,
    2307         uiMessage,
    2308         wParam,
    2309         lParam));
    2310 
    2311   return (-1);
    2312 }
    2313 
    23141930
    23151931
Note: See TracChangeset for help on using the changeset viewer.