Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

wingdi.cpp

Go to the documentation of this file.
00001 /* $Id: wingdi.cpp,v 1.6 2000/02/16 14:28:27 sandervl Exp $ */
00002 /*
00003  * Win32 Window graphics apis for OS/2
00004  *
00005  *
00006  * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
00007  * Copyright 1999 Daniela Engert (dani@ngrt.de)
00008  *
00009  *
00010  * Project Odin Software License can be found in LICENSE.TXT
00011  *
00012  */
00013 #include <os2win.h>
00014 #include <misc.h>
00015 
00016 #include <win32wbase.h>
00017 #include <oslibwin.h>
00018 #include <oslibgdi.h>
00019 
00020 #define DBG_LOCALLOG    DBG_wingdi
00021 #include "dbglocal.h"
00022 
00023 #define OPEN32_GDI
00024 
00025 #if 0
00026 //******************************************************************************
00027 //TODO: Not complete
00028 //******************************************************************************
00029 HDC WIN32API BeginPaint(HWND hwnd, PPAINTSTRUCT lps)
00030 {
00031   Win32BaseWindow *window;
00032   HDC hdc;
00033 
00034     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00035     if(!window) {
00036     dprintf(("GetDC, window %x not found", hwnd));
00037     return 0;
00038     }
00039 // !! there is no HDC to paint on !!!    window->MsgEraseBackGround(hdc);
00040 #ifdef OPEN32_GDI
00041     hdc = O32_BeginPaint(window->getOS2WindowHandle(),lps);
00042     //CB: conflict with Open32 mechanism
00043 #else
00044     hdc = OSLibWinBeginPaint(window->getOS2WindowHandle(), &lps->rcPaint);
00045     lps->hdc = hdc;
00046 #endif
00047     dprintf(("BeginPaint %X returned %x\n", hwnd, hdc));
00048 
00049     lps->fErase = !window->MsgEraseBackGround(hdc);
00050     return hdc;
00051 
00052 //    return lps->hdc;
00053 }
00054 //******************************************************************************
00055 //******************************************************************************
00056 BOOL WIN32API EndPaint(HWND hwnd, const PAINTSTRUCT *lps)
00057 {
00058     dprintf(("EndPaint %x\n", hwnd));
00059 #ifdef OPEN32_GDI
00060     return O32_EndPaint(hwnd,lps);
00061     //CB: dito
00062 #else
00063     return OSLibWinEndPaint(lps->hdc);
00064 #endif
00065 }
00066 
00067 //******************************************************************************
00068 //TODO: PARENT_DC flag
00069 //******************************************************************************
00070 HDC WIN32API GetDC(HWND hwnd)
00071 {
00072   Win32BaseWindow *window;
00073 
00074    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00075    if(!window) {
00076     dprintf(("GetDC, window %x not found", hwnd));
00077 #ifdef OPEN32_GDI
00078     dprintf(("GetDC %x", hwnd));
00079     return O32_GetDC(0);
00080 #else
00081     //desktop window?
00082     dprintf(("GetDC %x", hwnd));
00083     return OSLibWinGetPS(OSLIB_HWND_DESKTOP);
00084 #endif
00085    }
00086    dprintf(("GetDC %x", hwnd));
00087 #ifdef OPEN32_GDI
00088    return O32_GetDC(window->getOS2WindowHandle());
00089 #else
00090    return OSLibWinGetPS(window->getOS2WindowHandle());
00091 #endif
00092 }
00093 //******************************************************************************
00094 //TODO
00095 //******************************************************************************
00096 HDC WIN32API GetDCEx(HWND hwnd, HRGN arg2, DWORD arg3)
00097 {
00098 #ifdef DEBUG
00099     WriteLog("USER32:  GetDCEx NOT CORRECT!\n");
00100 #endif
00101     return GetDC(hwnd);
00102 }
00103 
00104 //******************************************************************************
00105 //******************************************************************************
00106 int WIN32API ReleaseDC(HWND hwnd, HDC hdc)
00107 {
00108     dprintf(("ReleaseDC %x %x", hwnd, hdc));
00109 #ifdef OPEN32_GDI
00110     return O32_ReleaseDC(hwnd,hdc);
00111 #else
00112     return OSLibWinReleasePS(hdc);
00113 #endif
00114 }
00115 //******************************************************************************
00116 //******************************************************************************
00117 
00118 HDC WIN32API GetWindowDC(HWND hwnd)
00119 {
00120   Win32BaseWindow *window;
00121 
00122    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00123    if(!window) {
00124         dprintf(("GetWindowDC, window %x not found", hwnd));
00125         return 0;
00126    }
00127    dprintf(("GetWindowDC %x", hwnd));
00128 #ifdef OPEN32_GDI
00129    return O32_GetWindowDC(window->getOS2FrameWindowHandle());
00130 #else
00131    return OSLibWinGetPS(window->getOS2FrameWindowHandle());
00132 #endif
00133 }
00134 #endif
00135 //******************************************************************************
00136 //******************************************************************************

Generated on Wed Jan 23 23:17:53 2002 for ODIN-user32 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001