src/video/gem/SDL_gemvideo.h
author Patrice Mandin <patmandin@gmail.com>
Sat, 30 Sep 2017 23:40:38 +0200
branchSDL-1.2
changeset 11561 e990d334b75a
parent 11560 c267eabdc97f
child 11564 eb391d3461f1
permissions -rw-r--r--
atari:gem: Do not align work area when window is iconified
slouken@281
     1
/*
slouken@281
     2
    SDL - Simple DirectMedia Layer
slouken@6137
     3
    Copyright (C) 1997-2012 Sam Lantinga
slouken@281
     4
slouken@281
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@281
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 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@1312
    13
    Lesser General Public License for more details.
slouken@281
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@281
    18
slouken@281
    19
    Sam Lantinga
slouken@281
    20
    slouken@libsdl.org
slouken@281
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@281
    23
slouken@281
    24
#ifndef _SDL_gemvideo_h
slouken@281
    25
#define _SDL_gemvideo_h
slouken@281
    26
slouken@281
    27
#include "SDL_mutex.h"
slouken@1361
    28
#include "../SDL_sysvideo.h"
slouken@281
    29
patmandin@1857
    30
/* The implementation dependent data for the window manager cursor */
patmandin@1857
    31
struct WMcursor {
patmandin@1857
    32
	MFORM *mform_p;
patmandin@1857
    33
};
patmandin@1857
    34
slouken@281
    35
/* Hidden "this" pointer for the video functions */
slouken@281
    36
#define _THIS	SDL_VideoDevice *this
slouken@281
    37
slouken@281
    38
/* Functions prototypes */
slouken@281
    39
void GEM_wind_redraw(_THIS, int winhandle, short *inside);
patmandin@11561
    40
void GEM_align_work_area(_THIS, short windowid, int clear_pads, int iconified);
slouken@281
    41
slouken@281
    42
/* Private display data */
slouken@281
    43
patmandin@736
    44
#define B2S_C2P_1TO2		(1<<0)	/* C2P convert buffer 1 to buffer 2 */
patmandin@736
    45
#define B2S_C2P_1TOS		(1<<1)	/* C2P convert buffer 1 to screen */
patmandin@736
    46
#define B2S_VROCPYFM_1TOS	(1<<2)	/* vro_cpyfm() buffer 1 to screen */
patmandin@736
    47
#define B2S_VROCPYFM_2TOS	(1<<3)	/* vro_cpyfm() buffer 2 to screen */
patmandin@736
    48
slouken@281
    49
#define SDL_NUMMODES	1		/* Fullscreen */
slouken@281
    50
slouken@281
    51
struct SDL_PrivateVideoData {
patmandin@736
    52
	Uint16	buf2scr_ops;		/* Operations to get buffer to screen */
patmandin@4057
    53
	void *buffer1;				/* Our shadow buffers */
patmandin@736
    54
	void *buffer2;
patmandin@736
    55
slouken@281
    56
	/* VDI infos */
slouken@281
    57
	short vdi_handle;			/* VDI handle */
slouken@281
    58
	short full_w, full_h;		/* Fullscreen size */
patmandin@4057
    59
	short bpp;					/* Colour depth */
patmandin@736
    60
	short pixelsize;			/* Bytes per pixel */
patmandin@736
    61
	short old_numcolors;		/* Number of colors in saved palette */
slouken@281
    62
	Uint16 pitch;				/* Line length */
patmandin@736
    63
	Uint16 format;				/* Screen format */
slouken@281
    64
	void *screen;				/* Screen address */
slouken@281
    65
	Uint32 red, green, blue, alpha;	/* Screen components */
slouken@281
    66
	Uint32 screensize;
patmandin@9059
    67
	MFDB	dst_mfdb;		/* VDI MFDB for bitblt */
patmandin@736
    68
	Uint16 old_palette[256][3];	/* Saved current palette */
patmandin@1074
    69
	Uint16 cur_palette[256][3];	/* SDL application palette */
patmandin@1074
    70
								/* Function to set/restore palette */
patmandin@1074
    71
	void (*setpalette)(_THIS, Uint16 newpal[256][3]);
patmandin@736
    72
slouken@557
    73
	/* GEM infos */
patmandin@9131
    74
	short ap_id;
slouken@281
    75
	short desk_x, desk_y;		/* Desktop properties */
slouken@281
    76
	short desk_w, desk_h;
slouken@281
    77
	short win_handle;			/* Our window handle */
slouken@281
    78
	int window_type;			/* Window type */
patmandin@11555
    79
	short work_x, work_y;		/* Window work area x,y,w,h */
patmandin@11555
    80
	short work_w, work_h;
slouken@281
    81
	const char *title_name;		/* Window title */
slouken@281
    82
	const char *icon_name;		/* Icon title */
slouken@281
    83
	short version;				/* AES version */
slouken@281
    84
	short wfeatures;			/* AES window features */
patmandin@736
    85
	SDL_bool refresh_name;		/* Change window title ? */
slouken@281
    86
	SDL_bool window_fulled;		/* Window maximized ? */
slouken@281
    87
	SDL_bool mouse_relative;	/* Report relative mouse movement */
slouken@281
    88
	SDL_bool locked;			/* AES locked for fullscreen ? */
patmandin@964
    89
	SDL_bool lock_redraw;		/* Prevent redraw till buffers are setup */
patmandin@9058
    90
	SDL_bool cursor_hidden;		/* Mouse cursor hidden flag */
patmandin@736
    91
	short message[8];			/* To self-send an AES message */
patmandin@1069
    92
	void *menubar;				/* Menu bar save buffer when going fullscreen */
patmandin@1420
    93
	SDL_bool use_dev_mouse;		/* Use /dev/mouse ? */
patmandin@1857
    94
	WMcursor *cursor;			/* To restore cursor when leaving/entering window */
patmandin@926
    95
patmandin@926
    96
	SDL_bool fullscreen;		/* Fullscreen or windowed mode ? */
slouken@281
    97
	SDL_Rect *SDL_modelist[SDL_NUMMODES+1];	/* Mode list */
patmandin@736
    98
	SDL_Surface *icon;			/* The icon */
slouken@281
    99
};
slouken@281
   100
slouken@281
   101
/* Hidden structure -> variables names */
slouken@281
   102
#define VDI_handle			(this->hidden->vdi_handle)
slouken@281
   103
#define VDI_w				(this->hidden->full_w)
slouken@281
   104
#define VDI_h				(this->hidden->full_h)
slouken@281
   105
#define VDI_bpp				(this->hidden->bpp)
slouken@281
   106
#define VDI_pixelsize		(this->hidden->pixelsize)
slouken@281
   107
#define VDI_oldnumcolors	(this->hidden->old_numcolors)
slouken@281
   108
#define VDI_oldpalette		(this->hidden->old_palette)
patmandin@1074
   109
#define VDI_curpalette		(this->hidden->cur_palette)
patmandin@1074
   110
#define VDI_setpalette		(this->hidden->setpalette)
slouken@281
   111
#define VDI_pitch			(this->hidden->pitch)
slouken@281
   112
#define VDI_format			(this->hidden->format)
slouken@281
   113
#define VDI_screen			(this->hidden->screen)
slouken@281
   114
#define VDI_redmask			(this->hidden->red)
slouken@281
   115
#define VDI_greenmask		(this->hidden->green)
slouken@281
   116
#define VDI_bluemask		(this->hidden->blue)
slouken@281
   117
#define VDI_alphamask		(this->hidden->alpha)
slouken@281
   118
#define VDI_screensize		(this->hidden->screensize)
slouken@281
   119
#define VDI_dst_mfdb		(this->hidden->dst_mfdb)
slouken@557
   120
patmandin@11555
   121
#define GEM_ap_id			(this->hidden->ap_id)
slouken@281
   122
#define GEM_desk_x			(this->hidden->desk_x)
slouken@281
   123
#define GEM_desk_y			(this->hidden->desk_y)
slouken@281
   124
#define GEM_desk_w			(this->hidden->desk_w)
slouken@281
   125
#define GEM_desk_h			(this->hidden->desk_h)
slouken@281
   126
#define GEM_handle			(this->hidden->win_handle)
slouken@281
   127
#define GEM_win_type		(this->hidden->window_type)
patmandin@11555
   128
#define GEM_work_x			(this->hidden->work_x)
patmandin@11555
   129
#define GEM_work_y			(this->hidden->work_y)
patmandin@11555
   130
#define GEM_work_w			(this->hidden->work_w)
patmandin@11555
   131
#define GEM_work_h			(this->hidden->work_h)
slouken@281
   132
#define GEM_title_name		(this->hidden->title_name)
slouken@281
   133
#define GEM_icon_name		(this->hidden->icon_name)
patmandin@736
   134
#define GEM_refresh_name	(this->hidden->refresh_name)
slouken@281
   135
#define GEM_version			(this->hidden->version)
slouken@281
   136
#define GEM_wfeatures		(this->hidden->wfeatures)
slouken@281
   137
#define GEM_win_fulled		(this->hidden->window_fulled)
slouken@281
   138
#define GEM_mouse_relative	(this->hidden->mouse_relative)
slouken@281
   139
#define GEM_locked			(this->hidden->locked)
patmandin@964
   140
#define GEM_lock_redraw		(this->hidden->lock_redraw)
patmandin@9058
   141
#define GEM_cursor_hidden	(this->hidden->cursor_hidden)
patmandin@736
   142
#define GEM_message			(this->hidden->message)
slouken@281
   143
#define SDL_modelist		(this->hidden->SDL_modelist)
patmandin@736
   144
#define GEM_icon			(this->hidden->icon)
patmandin@926
   145
#define GEM_fullscreen		(this->hidden->fullscreen)
patmandin@1069
   146
#define GEM_menubar			(this->hidden->menubar)
patmandin@1420
   147
#define GEM_usedevmouse		(this->hidden->use_dev_mouse)
patmandin@1857
   148
#define GEM_cursor			(this->hidden->cursor)
patmandin@736
   149
patmandin@736
   150
#define GEM_buffer1			(this->hidden->buffer1)
patmandin@736
   151
#define GEM_buffer2			(this->hidden->buffer2)
patmandin@736
   152
#define GEM_bufops			(this->hidden->buf2scr_ops)
patmandin@736
   153
patmandin@736
   154
#define VDI_FBMASK(amask, rmask, gmask, bmask) \
patmandin@736
   155
	VDI_alphamask = (amask); \
patmandin@736
   156
	VDI_redmask = (rmask); \
patmandin@736
   157
	VDI_greenmask = (gmask); \
patmandin@736
   158
	VDI_bluemask = (bmask);
patmandin@736
   159
patmandin@736
   160
/*
patmandin@736
   161
	Possible buffer to screen operations:
patmandin@736
   162
patmandin@736
   163
	TC: 8 (chunky),15,16,24,32 bpp
patmandin@736
   164
	8I: 8 bpp planes
patmandin@736
   165
	FB: screen framebuffer address available
patmandin@736
   166
	FS: fullscreen
patmandin@736
   167
patmandin@736
   168
	TC, FB, FS:
patmandin@736
   169
		- draw to screen
patmandin@736
   170
	8I, FB, FS:
patmandin@736
   171
		- draw to buffer 1
patmandin@736
   172
		- C2P from buffer 1 to screen
patmandin@736
   173
patmandin@736
   174
	TC, !FB, FS:
patmandin@736
   175
		- draw to buffer 1
patmandin@736
   176
		- vro_cpyfm() from buffer 1 to screen
patmandin@736
   177
	8I, !FB, FS:
patmandin@736
   178
		- draw to buffer 1
patmandin@736
   179
		- C2P from buffer 1 to buffer 2
patmandin@736
   180
		- vro_cpyfm() from buffer 2 to screen
patmandin@736
   181
patmandin@736
   182
	TC, FB, !FS:
patmandin@736
   183
		- draw to buffer 1
patmandin@736
   184
		- vro_cpyfm() from buffer 1 to screen
patmandin@736
   185
	8I, FB, !FS:
patmandin@736
   186
		- draw to buffer 1
patmandin@736
   187
		- C2P from buffer 1 to buffer 2
patmandin@736
   188
		- vro_cpyfm() from buffer 2 to screen
patmandin@736
   189
patmandin@736
   190
	TC, !FB, !FS:
patmandin@736
   191
		- draw to buffer 1
patmandin@736
   192
		- vro_cpyfm() from buffer 1 to screen
patmandin@736
   193
	8I, !FB, !FS:
patmandin@736
   194
		- draw to buffer 1
patmandin@736
   195
		- C2P from buffer 1 to buffer 2
patmandin@736
   196
		- vro_cpyfm() from buffer 2 to screen
patmandin@736
   197
*/
slouken@281
   198
slouken@281
   199
#endif /* _SDL_gemvideo_h */