2006-08-30 20:40:07 +00:00
|
|
|
/*
|
|
|
|
* ReactOS kernel
|
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2005-01-06 13:58:04 +00:00
|
|
|
/* $Id$
|
2002-06-13 20:36:40 +00:00
|
|
|
*
|
|
|
|
* PROJECT: ReactOS user32.dll
|
2003-12-28 08:59:24 +00:00
|
|
|
* FILE: lib/user32/windows/clipboard.c
|
2002-06-13 20:36:40 +00:00
|
|
|
* PURPOSE: Input
|
|
|
|
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 09-05-2001 CSH Created
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2005-06-19 18:06:53 +00:00
|
|
|
#include <user32.h>
|
2005-07-27 19:21:46 +00:00
|
|
|
|
2006-06-26 13:16:43 +00:00
|
|
|
#include <wine/debug.h>
|
2003-12-28 08:59:24 +00:00
|
|
|
|
2002-06-13 20:36:40 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2004-01-23 23:38:26 +00:00
|
|
|
BOOL STDCALL
|
2003-12-14 12:39:32 +00:00
|
|
|
OpenClipboard(HWND hWndNewOwner)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserOpenClipboard(hWndNewOwner, 0);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
2003-12-14 12:39:32 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2004-01-23 23:38:26 +00:00
|
|
|
BOOL STDCALL
|
2003-12-14 12:39:32 +00:00
|
|
|
CloseClipboard(VOID)
|
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserCloseClipboard();
|
2003-12-14 12:39:32 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
INT STDCALL
|
2002-06-13 20:36:40 +00:00
|
|
|
CountClipboardFormats(VOID)
|
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserCountClipboardFormats();
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2004-01-23 23:38:26 +00:00
|
|
|
BOOL STDCALL
|
2002-06-13 20:36:40 +00:00
|
|
|
EmptyClipboard(VOID)
|
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserEmptyClipboard();
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
UINT STDCALL
|
|
|
|
EnumClipboardFormats(UINT format)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserEnumClipboardFormats(format);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
HANDLE STDCALL
|
|
|
|
GetClipboardData(UINT uFormat)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserGetClipboardData(uFormat, 0);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
INT STDCALL
|
|
|
|
GetClipboardFormatNameA(UINT format, LPSTR lpszFormatName, int cchMaxCount)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
LPWSTR lpBuffer;
|
|
|
|
UNICODE_STRING FormatName;
|
|
|
|
INT Length;
|
2002-06-13 20:36:40 +00:00
|
|
|
|
2006-08-30 20:40:07 +00:00
|
|
|
lpBuffer = HEAP_alloc(cchMaxCount * sizeof(WCHAR));
|
|
|
|
if (!lpBuffer)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_OUTOFMEMORY);
|
|
|
|
return 0;
|
|
|
|
}
|
2005-10-16 01:22:18 +00:00
|
|
|
|
2003-12-14 13:55:01 +00:00
|
|
|
FormatName.Length = 0;
|
|
|
|
FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR);
|
|
|
|
FormatName.Buffer = lpBuffer;
|
2005-10-16 01:22:18 +00:00
|
|
|
|
2003-12-14 13:26:20 +00:00
|
|
|
Length = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount);
|
2006-08-30 20:40:07 +00:00
|
|
|
DPRINT("GetClipboardFormatNameA(%x): %S\n", format, lpBuffer);
|
|
|
|
HEAP_strcpyWtoA(lpszFormatName, lpBuffer, Length);
|
|
|
|
HEAP_free(lpBuffer);
|
|
|
|
DPRINT("GetClipboardFormatNameA(%x): returning %s\n", format, lpszFormatName);
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2006-08-30 20:40:07 +00:00
|
|
|
return Length;
|
2003-12-14 12:39:32 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
INT STDCALL
|
|
|
|
GetClipboardFormatNameW(UINT format, LPWSTR lpszFormatName, INT cchMaxCount)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
UNICODE_STRING FormatName;
|
|
|
|
ULONG Ret;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2006-08-30 20:40:07 +00:00
|
|
|
FormatName.Length = 0;
|
|
|
|
FormatName.MaximumLength = cchMaxCount * sizeof(WCHAR);
|
|
|
|
FormatName.Buffer = (PWSTR)lpszFormatName;
|
|
|
|
Ret = NtUserGetClipboardFormatName(format, &FormatName, cchMaxCount);
|
|
|
|
DPRINT("GetClipboardFormatNameW(%x): returning %S\n", format, lpszFormatName);
|
|
|
|
return Ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
HWND STDCALL
|
2002-06-13 20:36:40 +00:00
|
|
|
GetClipboardOwner(VOID)
|
|
|
|
{
|
2003-12-14 12:39:32 +00:00
|
|
|
return NtUserGetClipboardOwner();
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
DWORD STDCALL
|
2002-06-13 20:36:40 +00:00
|
|
|
GetClipboardSequenceNumber(VOID)
|
|
|
|
{
|
2003-12-14 12:39:32 +00:00
|
|
|
return NtUserGetClipboardSequenceNumber();
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
HWND STDCALL
|
2002-06-13 20:36:40 +00:00
|
|
|
GetClipboardViewer(VOID)
|
|
|
|
{
|
2003-12-14 12:39:32 +00:00
|
|
|
return NtUserGetClipboardViewer();
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-05-12 19:30:00 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
HWND STDCALL
|
2002-06-13 20:36:40 +00:00
|
|
|
GetOpenClipboardWindow(VOID)
|
|
|
|
{
|
2003-12-14 12:39:32 +00:00
|
|
|
return NtUserGetOpenClipboardWindow();
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
INT STDCALL
|
|
|
|
GetPriorityClipboardFormat(UINT *paFormatPriorityList, INT cFormats)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserGetPriorityClipboardFormat(paFormatPriorityList, cFormats);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-05-12 19:30:00 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2004-01-23 23:38:26 +00:00
|
|
|
BOOL STDCALL
|
2003-12-14 12:39:32 +00:00
|
|
|
IsClipboardFormatAvailable(UINT format)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserIsClipboardFormatAvailable(format);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-05-12 19:30:00 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
UINT STDCALL
|
|
|
|
RegisterClipboardFormatA(LPCSTR lpszFormat)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
ULONG Ret = RegisterWindowMessageA(lpszFormat);
|
|
|
|
DPRINT("RegisterClipboardFormatA(%s) - %x\n", lpszFormat, Ret);
|
|
|
|
return Ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
UINT STDCALL
|
|
|
|
RegisterClipboardFormatW(LPCWSTR lpszFormat)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
ULONG Ret = RegisterWindowMessageW(lpszFormat);
|
|
|
|
DPRINT("RegisterClipboardFormatW(%S) - %x\n", lpszFormat, Ret);
|
|
|
|
return Ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-05-12 19:30:00 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
HANDLE STDCALL
|
|
|
|
SetClipboardData(UINT uFormat, HANDLE hMem)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2006-08-30 20:40:07 +00:00
|
|
|
return NtUserSetClipboardData(uFormat, hMem, 0);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2003-12-14 12:39:32 +00:00
|
|
|
HWND STDCALL
|
|
|
|
SetClipboardViewer(HWND hWndNewViewer)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2003-12-14 12:39:32 +00:00
|
|
|
return NtUserSetClipboardViewer(hWndNewViewer);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2003-05-12 19:30:00 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-12-14 12:39:32 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2004-01-23 23:38:26 +00:00
|
|
|
BOOL STDCALL
|
2003-12-14 12:39:32 +00:00
|
|
|
ChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2003-12-14 12:39:32 +00:00
|
|
|
return NtUserChangeClipboardChain(hWndRemove, hWndNewNext);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|