Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
119 lines (94 loc) · 2.59 KB

SDL_gemwm.c

File metadata and controls

119 lines (94 loc) · 2.59 KB
 
1
2
/*
SDL - Simple DirectMedia Layer
Feb 1, 2006
Feb 1, 2006
3
Copyright (C) 1997-2006 Sam Lantinga
4
5
This library is free software; you can redistribute it and/or
Feb 1, 2006
Feb 1, 2006
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
Feb 1, 2006
Feb 1, 2006
8
version 2.1 of the License, or (at your option) any later version.
9
10
11
12
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
Feb 1, 2006
Feb 1, 2006
13
Lesser General Public License for more details.
Feb 1, 2006
Feb 1, 2006
15
16
17
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
18
19
20
21
Sam Lantinga
slouken@libsdl.org
*/
Feb 21, 2006
Feb 21, 2006
22
#include "SDL_config.h"
Nov 12, 2003
Nov 12, 2003
25
26
27
28
29
GEM SDL video driver
Window manager functions
Patrice Mandin
*/
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Mint includes */
#include <gem.h>
#include "SDL_gemwm_c.h"
/* Defines */
#define ICONWIDTH 64
#define ICONHEIGHT 64
/* Functions */
Jul 10, 2006
Jul 10, 2006
43
44
void
GEM_SetCaption(_THIS, const char *title, const char *icon)
Jul 10, 2006
Jul 10, 2006
46
47
48
49
50
51
52
53
54
if (title) {
GEM_title_name = title;
GEM_refresh_name = SDL_TRUE;
}
if (icon) {
GEM_icon_name = icon;
GEM_refresh_name = SDL_TRUE;
}
Jul 10, 2006
Jul 10, 2006
57
58
void
GEM_SetIcon(_THIS, SDL_Surface * icon, Uint8 * mask)
Jul 10, 2006
Jul 10, 2006
60
61
SDL_Surface *sicon;
SDL_Rect bounds;
Nov 12, 2003
Nov 12, 2003
62
63
#if 0
Jul 10, 2006
Jul 10, 2006
64
65
66
if ((GEM_wfeatures & (1 << WF_ICONIFY)) == 0) {
return;
}
Nov 12, 2003
Nov 12, 2003
67
68
#endif
Jul 10, 2006
Jul 10, 2006
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
if (icon == NULL) {
return;
}
/* Convert icon to the screen format */
sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
VDI_bpp, VDI_redmask, VDI_greenmask,
VDI_bluemask, 0);
if (sicon == NULL) {
return;
}
bounds.x = 0;
bounds.y = 0;
bounds.w = icon->w;
bounds.h = icon->h;
if (SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0) {
SDL_FreeSurface(sicon);
return;
}
GEM_icon = sicon;
Jul 10, 2006
Jul 10, 2006
93
94
int
GEM_IconifyWindow(_THIS)
Jul 10, 2006
Jul 10, 2006
96
97
if ((GEM_wfeatures & (1 << WF_ICONIFY)) == 0)
return 0;
Jul 10, 2006
Jul 10, 2006
99
100
101
102
103
104
105
106
GEM_message[0] = WM_ICONIFY;
GEM_message[1] = gl_apid;
GEM_message[2] = 0;
GEM_message[3] = GEM_handle;
GEM_message[4] = 0;
GEM_message[5] = GEM_desk_h - ICONHEIGHT;
GEM_message[6] = ICONWIDTH;
GEM_message[7] = ICONHEIGHT;
Jul 10, 2006
Jul 10, 2006
108
appl_write(gl_apid, sizeof(GEM_message), GEM_message);
Jul 10, 2006
Jul 10, 2006
110
return 1;
Jul 10, 2006
Jul 10, 2006
113
114
SDL_GrabMode
GEM_GrabInput(_THIS, SDL_GrabMode mode)
Jul 10, 2006
Jul 10, 2006
116
return SDL_GRAB_OFF;
Jul 10, 2006
Jul 10, 2006
118
119
/* vi: set ts=4 sw=4 expandtab: */