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"
26 Window manager functions
34 #include "SDL_gemwm_c.h"
43 void GEM_SetCaption(_THIS, const char *title, const char *icon)
46 GEM_title_name = title;
47 GEM_refresh_name = SDL_TRUE;
52 GEM_refresh_name = SDL_TRUE;
56 void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
62 if ((GEM_wfeatures & (1<<WF_ICONIFY))==0) {
71 /* Convert icon to the screen format */
72 sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
73 VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, 0);
74 if ( sicon == NULL ) {
82 if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 ) {
83 SDL_FreeSurface(sicon);
90 int GEM_IconifyWindow(_THIS)
92 if ((GEM_wfeatures & (1<<WF_ICONIFY))==0)
95 GEM_message[0] = WM_ICONIFY;
96 GEM_message[1] = gl_apid;
98 GEM_message[3] = GEM_handle;
100 GEM_message[5] = GEM_desk_h-ICONHEIGHT;
101 GEM_message[6] = ICONWIDTH;
102 GEM_message[7] = ICONHEIGHT;
104 appl_write(gl_apid, sizeof(GEM_message), GEM_message);
109 SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode)
111 if (this->screen == NULL) {