Changeset 1209 for trunk/src/user32/clipboard.cpp
- Timestamp:
- Oct 9, 1999, 11:45:28 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/clipboard.cpp
r949 r1209 1 /* $Id: clipboard.cpp,v 1. 1 1999-09-15 23:18:48sandervl Exp $ */1 /* $Id: clipboard.cpp,v 1.2 1999-10-09 09:45:27 sandervl Exp $ */ 2 2 3 3 /* … … 9 9 * 10 10 * 11 * NOTE: Use OS/2 frame handles for Open32 functions 12 * 11 13 * Project Odin Software License can be found in LICENSE.TXT 12 14 * … … 14 16 15 17 #include <os2win.h> 16 17 BOOL WIN32API ChangeClipboardChain( HWND arg1, HWND arg2) 18 { 19 #ifdef DEBUG 20 WriteLog("USER32: ChangeClipboardChain\n"); 21 #endif 22 return O32_ChangeClipboardChain(arg1, arg2); 18 #include "win32wbase.h" 19 20 //****************************************************************************** 21 //****************************************************************************** 22 BOOL WIN32API ChangeClipboardChain( HWND hwndRemove, HWND hwndNext) 23 { 24 Win32BaseWindow *wndRemove, *wndNext; 25 26 wndRemove = Win32BaseWindow::GetWindowFromHandle(hwndRemove); 27 if(!wndRemove) { 28 dprintf(("ChangeClipboardChain, window %x not found", hwndRemove)); 29 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 30 return 0; 31 } 32 wndNext = Win32BaseWindow::GetWindowFromHandle(hwndNext); 33 if(!wndNext) { 34 dprintf(("ChangeClipboardChain, window %x not found", hwndNext)); 35 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 36 return 0; 37 } 38 dprintf(("USER32: ChangeClipboardChain\n")); 39 return O32_ChangeClipboardChain(wndRemove->getOS2FrameWindowHandle(), 40 wndNext->getOS2FrameWindowHandle()); 23 41 } 24 42 //****************************************************************************** … … 26 44 BOOL WIN32API CloseClipboard(void) 27 45 { 28 #ifdef DEBUG 29 WriteLog("USER32: CloseClipboard\n"); 30 #endif 46 dprintf(("USER32: CloseClipboard\n")); 31 47 return O32_CloseClipboard(); 32 48 } … … 35 51 int WIN32API CountClipboardFormats(void) 36 52 { 37 #ifdef DEBUG 38 WriteLog("USER32: CountClipboardFormats\n"); 39 #endif 53 dprintf(("USER32: CountClipboardFormats\n")); 40 54 return O32_CountClipboardFormats(); 41 55 } … … 44 58 BOOL WIN32API EmptyClipboard(void) 45 59 { 46 #ifdef DEBUG 47 WriteLog("USER32: EmptyClipboard\n"); 48 #endif 60 dprintf(("USER32: EmptyClipboard\n")); 49 61 return O32_EmptyClipboard(); 50 62 } … … 53 65 UINT WIN32API EnumClipboardFormats(UINT arg1) 54 66 { 55 #ifdef DEBUG 56 WriteLog("USER32: EnumClipboardFormats\n"); 57 #endif 67 dprintf(("USER32: EnumClipboardFormats\n")); 58 68 return O32_EnumClipboardFormats(arg1); 59 69 } … … 62 72 HANDLE WIN32API GetClipboardData( UINT arg1) 63 73 { 64 #ifdef DEBUG 65 WriteLog("USER32: GetClipboardData\n"); 66 #endif 74 dprintf(("USER32: GetClipboardData\n")); 67 75 return O32_GetClipboardData(arg1); 68 76 } … … 71 79 int WIN32API GetClipboardFormatNameA( UINT arg1, LPSTR arg2, int arg3) 72 80 { 73 #ifdef DEBUG 74 WriteLog("USER32: GetClipboardFormatNameA %s\n", arg2); 75 #endif 81 dprintf(("USER32: GetClipboardFormatNameA %s\n", arg2)); 76 82 return O32_GetClipboardFormatName(arg1, arg2, arg3); 77 83 } … … 83 89 char *astring = UnicodeToAsciiString(arg2); 84 90 85 #ifdef DEBUG 86 WriteLog("USER32: GetClipboardFormatNameW %s\n", astring); 87 #endif 91 dprintf(("USER32: GetClipboardFormatNameW %s\n", astring)); 88 92 rc = O32_GetClipboardFormatName(arg1, astring, arg3); 89 93 FreeAsciiString(astring); … … 94 98 HWND WIN32API GetClipboardOwner(void) 95 99 { 96 #ifdef DEBUG 97 WriteLog("USER32: GetClipboardOwner\n"); 98 #endif 99 return O32_GetClipboardOwner(); 100 HWND hwndOwner; 101 Win32BaseWindow *window; 102 103 dprintf(("USER32: GetClipboardOwner\n")); 104 hwndOwner = O32_GetClipboardOwner(); 105 106 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndOwner); 107 if(!window) { 108 //an OS/2 window probably owns the clipboard, we pretend nobody owns it 109 return NULL; 110 } 111 return window->getWindowHandle(); 100 112 } 101 113 //****************************************************************************** … … 103 115 HWND WIN32API GetClipboardViewer(void) 104 116 { 105 #ifdef DEBUG 106 WriteLog("USER32: GetClipboardViewer\n"); 107 #endif 108 return O32_GetClipboardViewer(); 117 Win32BaseWindow *window; 118 HWND hwndViewer; 119 120 dprintf(("USER32: GetClipboardViewer\n")); 121 hwndViewer = O32_GetClipboardViewer(); 122 123 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndViewer); 124 if(!window) { 125 //probably an OS/2 window, we pretend it's nobody 126 return NULL; 127 } 128 return window->getWindowHandle(); 109 129 } 110 130 //****************************************************************************** … … 112 132 HWND WIN32API GetOpenClipboardWindow(void) 113 133 { 114 #ifdef DEBUG 115 WriteLog("USER32: GetOpenClipboardWindow\n"); 116 #endif 117 return O32_GetOpenClipboardWindow(); 134 Win32BaseWindow *window; 135 HWND hwnd; 136 137 dprintf(("USER32: GetOpenClipboardWindow\n")); 138 hwnd = O32_GetOpenClipboardWindow(); 139 140 window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd); 141 if(!window) { 142 //probably an OS/2 window, we pretend it's nobody 143 return NULL; 144 } 145 return window->getWindowHandle(); 118 146 } 119 147 //****************************************************************************** … … 121 149 int WIN32API GetPriorityClipboardFormat( PUINT arg1, int arg2) 122 150 { 123 #ifdef DEBUG 124 WriteLog("USER32: GetPriorityClipboardFormat\n"); 125 #endif 151 dprintf(("USER32: GetPriorityClipboardFormat\n")); 126 152 return O32_GetPriorityClipboardFormat(arg1, arg2); 127 153 } … … 130 156 BOOL WIN32API IsClipboardFormatAvailable( UINT arg1) 131 157 { 132 #ifdef DEBUG 133 WriteLog("USER32: IsClipboardFormatAvailable\n"); 134 #endif 158 dprintf(("USER32: IsClipboardFormatAvailable\n")); 135 159 return O32_IsClipboardFormatAvailable(arg1); 136 160 } 137 161 //****************************************************************************** 138 162 //****************************************************************************** 139 BOOL WIN32API OpenClipboard( HWND arg1) 140 { 141 #ifdef DEBUG 142 WriteLog("USER32: OpenClipboard\n"); 143 #endif 144 return O32_OpenClipboard(arg1); 163 BOOL WIN32API OpenClipboard( HWND hwnd) 164 { 165 Win32BaseWindow *window; 166 167 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 168 if(!window) { 169 dprintf(("OpenClipboard, window %x not found", hwnd)); 170 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 171 return 0; 172 } 173 dprintf(("USER32: OpenClipboard\n")); 174 return O32_OpenClipboard(window->getOS2FrameWindowHandle()); 145 175 } 146 176 //****************************************************************************** … … 148 178 UINT WIN32API RegisterClipboardFormatA( LPCSTR arg1) 149 179 { 150 #ifdef DEBUG 151 WriteLog("USER32: RegisterClipboardFormatA\n"); 152 #endif 180 dprintf(("USER32: RegisterClipboardFormatA\n")); 153 181 return O32_RegisterClipboardFormat(arg1); 154 182 } … … 160 188 char *astring = UnicodeToAsciiString((LPWSTR)arg1); 161 189 162 #ifdef DEBUG 163 WriteLog("USER32: RegisterClipboardFormatW %s\n", astring); 164 #endif 190 dprintf(("USER32: RegisterClipboardFormatW %s\n", astring)); 165 191 rc = O32_RegisterClipboardFormat(astring); 166 192 FreeAsciiString(astring); 167 #ifdef DEBUG 168 WriteLog("USER32: RegisterClipboardFormatW returned %d\n", rc); 169 #endif 193 dprintf(("USER32: RegisterClipboardFormatW returned %d\n", rc)); 170 194 return(rc); 171 195 } … … 179 203 //****************************************************************************** 180 204 //****************************************************************************** 181 HWND WIN32API SetClipboardViewer( HWND arg1) 182 { 205 HWND WIN32API SetClipboardViewer( HWND hwndNew) 206 { 207 Win32BaseWindow *wndnew, *wndold; 208 HWND hwndOld; 209 210 wndnew = Win32BaseWindow::GetWindowFromHandle(hwndNew); 211 if(!wndnew) { 212 dprintf(("OpenClipboard, window %x not found", hwndNew)); 213 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 214 return 0; 215 } 183 216 dprintf(("USER32: SetClipboardViewer\n")); 184 return O32_SetClipboardViewer(arg1); 185 } 186 //****************************************************************************** 187 //****************************************************************************** 217 hwndOld = O32_SetClipboardViewer(wndnew->getOS2FrameWindowHandle()); 218 219 wndold = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndOld); 220 if(!wndold) { 221 //probably an OS/2 window, so pretend it's nobody 222 return 0; 223 } 224 return wndold->getWindowHandle(); 225 } 226 //****************************************************************************** 227 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.