comparison src/video/gem/SDL_gemwm.c @ 281:c5010ab8ba35

Added initial support for Atari (thanks Patrice!)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 17 Feb 2002 19:54:28 +0000
parents
children f6ffac90895c
comparison
equal deleted inserted replaced
280:0ddcea45d829 281:c5010ab8ba35
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
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 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22
23 #ifdef SAVE_RCSID
24 static char rcsid =
25 "@(#) $Id$";
26 #endif
27
28 /*
29 * GEM SDL video driver implementation
30 * Window manager functions
31 *
32 * Patrice Mandin
33 */
34
35 /* Mint includes */
36 #include <gem.h>
37
38 #include "SDL_gemwm_c.h"
39
40 /* Defines */
41
42 #define ICONWIDTH 64
43 #define ICONHEIGHT 64
44
45 /* Functions */
46
47 void GEM_SetCaption(_THIS, const char *title, const char *icon)
48 {
49 short parm[4];
50 const char *new_name;
51
52 new_name = NULL;
53
54 if (title)
55 GEM_title_name = title;
56
57 if (icon)
58 GEM_icon_name = icon;
59
60 /* Is window iconified ? */
61 parm[0]=0;
62 if (GEM_wfeatures & (1<<WF_ICONIFY))
63 wind_get(GEM_handle, WF_ICONIFY, &parm[0], &parm[1], &parm[2], &parm[3]);
64
65 if (parm[0]==0) {
66 /* Change window name */
67 if (title)
68 new_name = title;
69 } else {
70 /* Change icon name */
71 if (icon)
72 new_name = icon;
73 }
74
75 parm[0]= ((unsigned long) new_name)>>16;
76 parm[1]= ((unsigned long) new_name) & 65535;
77
78 if (new_name) {
79 wind_set(GEM_handle, WF_NAME, parm[0], parm[1], 0, 0);
80 }
81 }
82
83 void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
84 {
85 if ((GEM_wfeatures & (1<<WF_ICONIFY))==0)
86 return;
87
88 /* Todo */
89 }
90
91 int GEM_IconifyWindow(_THIS)
92 {
93 short message[8];
94
95 if ((GEM_wfeatures & (1<<WF_ICONIFY))==0)
96 return 0;
97
98 message[0] = WM_ICONIFY;
99 message[1] = GEM_ap_id;
100 message[2] = 0;
101 message[3] = GEM_handle;
102 message[4] = 0;
103 message[5] = GEM_desk_h-ICONHEIGHT;
104 message[6] = ICONWIDTH;
105 message[7] = ICONHEIGHT;
106
107 appl_write(GEM_ap_id, sizeof(message), message);
108
109 return 1;
110 }
111
112 SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode)
113 {
114 return mode;
115 }