Sweden-Number/dlls/win32u/cursoricon.c

82 lines
2.2 KiB
C
Raw Normal View History

/*
* Cursor and icon support
*
* Copyright 1995 Alexandre Julliard
* Copyright 1996 Martin Von Loewis
* Copyright 1997 Alex Korobka
* Copyright 1998 Turchanov Sergey
* Copyright 2007 Henri Verbeet
* Copyright 2009 Vincent Povirk for CodeWeavers
* Copyright 2016 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "win32u_private.h"
#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(cursor);
/***********************************************************************
* NtUserShowCursor (win32u.@)
*/
INT WINAPI NtUserShowCursor( BOOL show )
{
HCURSOR cursor;
int increment = show ? 1 : -1;
int count;
SERVER_START_REQ( set_cursor )
{
req->flags = SET_CURSOR_COUNT;
req->show_count = increment;
wine_server_call( req );
cursor = wine_server_ptr_handle( reply->prev_handle );
count = reply->prev_count + increment;
}
SERVER_END_REQ;
TRACE("%d, count=%d\n", show, count );
if (show && !count) user_driver->pSetCursor( cursor );
else if (!show && count == -1) user_driver->pSetCursor( 0 );
return count;
}
/***********************************************************************
* NtUserGetCursor (win32u.@)
*/
HCURSOR WINAPI NtUserGetCursor(void)
{
HCURSOR ret;
SERVER_START_REQ( set_cursor )
{
req->flags = 0;
wine_server_call( req );
ret = wine_server_ptr_handle( reply->prev_handle );
}
SERVER_END_REQ;
return ret;
}