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