2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "SDL_config.h"
27 #include "SDL_syswm_c.h"
28 #include "SDL_error.h"
29 #include "../SDL_cursor_c.h"
31 void BE_SetWMCaption(_THIS, const char *title, const char *icon)
33 SDL_Win->SetTitle(title);
36 int BE_IconifyWindow(_THIS)
38 SDL_Win->Minimize(true);
42 SDL_GrabMode BE_GrabInput(_THIS, SDL_GrabMode mode)
44 if ( mode == SDL_GRAB_OFF ) {
45 // be_app->ShowCursor();
46 if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
47 /* BeSman: Jan 2, 2006
48 must be leaving relative mode, move mouse from
49 center of window to where it belongs ... */
52 SDL_GetMouseState(&x,&y);
56 SDL_Win->ConvertToScreen(&pt);
58 set_mouse_position((int)pt.x, (int)pt.y);
61 // be_app->HideCursor();
62 if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
63 /* BeSman: Jan 2, 2006
64 must be entering relative mode, get ready by
65 moving mouse to center of window ... */
67 pt.x = (SDL_VideoSurface->w/2);
68 pt.y = (SDL_VideoSurface->h/2);
70 SDL_Win->ConvertToScreen(&pt);
72 set_mouse_position((int)pt.x, (int)pt.y);
78 int BE_GetWMInfo(_THIS, SDL_SysWMinfo *info)
80 if (info->version.major <= SDL_MAJOR_VERSION)
86 SDL_SetError("Application not compiled with SDL %d.%d\n",
87 SDL_MAJOR_VERSION, SDL_MINOR_VERSION);