Mercurial > sdl-ios-xcode
annotate src/video/cybergfx/SDL_cgxvideo.h @ 1327:d12a63a8d95a
Resolved bug #130
Use XFilterEvent() to handle dead-key composition under X11
Cleaned up the code in preparation for 1.3 API changes
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 04 Feb 2006 08:35:11 +0000 |
parents | c9b51268668f |
children | 604d73db6802 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 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 | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
21
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #ifndef _SDL_cgxvideo_h | |
24 #define _SDL_cgxvideo_h | |
25 | |
26 | |
27 #include <stdio.h> | |
28 #include <stdlib.h> | |
29 #include <string.h> | |
30 | |
31 #include <exec/exec.h> | |
32 #include <cybergraphx/cybergraphics.h> | |
33 #include <graphics/scale.h> | |
34 #include <graphics/gfx.h> | |
35 #include <intuition/intuition.h> | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
36 #if defined(__SASC) || defined(STORMC4_WOS) |
0 | 37 #include <proto/exec.h> |
38 #include <proto/cybergraphics.h> | |
39 #include <proto/graphics.h> | |
40 #include <proto/intuition.h> | |
41 #include <proto/console.h> | |
42 #else | |
43 #include <inline/exec.h> | |
44 #include <inline/cybergraphics.h> | |
45 #include <inline/graphics.h> | |
46 #include <inline/intuition.h> | |
47 #include <inline/console.h> | |
48 #endif | |
49 | |
50 #include "mydebug.h" | |
51 #include "SDL_mouse.h" | |
52 #include "SDL_sysvideo.h" | |
53 | |
54 #define USE_CGX_WRITELUTPIXEL | |
55 | |
56 /* Hidden "this" pointer for the video functions */ | |
57 #define _THIS SDL_VideoDevice *this | |
58 | |
59 /* Private display data */ | |
60 struct SDL_PrivateVideoData { | |
61 struct Screen *Public_Display; /* Used for events and window management */ | |
62 struct Screen *GFX_Display; /* Used for graphics and colormap stuff */ | |
63 Uint32 SDL_VisualUnused; /* The visual used by our window */ | |
64 struct Window *SDL_Window; /* Shared by both displays (no X security?) */ | |
65 unsigned char *BlankCursor; /* The invisible cursor */ | |
66 | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
67 char *SDL_windowid; /* Flag: true if we have been passed a window */ |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
68 |
0 | 69 /* The variables used for displaying graphics */ |
70 Uint8 *Ximage; /* The X image for our window */ | |
71 int swap_pixels; /* Flag: true if display is swapped endian */ | |
72 | |
73 /* The current width and height of the fullscreen mode */ | |
74 int current_w; | |
75 int current_h; | |
76 | |
77 /* Support for internal mouse warping */ | |
78 struct { | |
79 int x; | |
80 int y; | |
81 } mouse_last; | |
82 struct { | |
83 int numerator; | |
84 int denominator; | |
85 int threshold; | |
86 } mouse_accel; | |
87 int mouse_relative; | |
88 | |
89 /* The current list of available video modes */ | |
90 SDL_Rect **modelist; | |
91 | |
92 /* available visuals of interest to us, sorted deepest first */ | |
93 struct { | |
94 Uint32 visual; | |
95 int depth; /* number of significant bits/pixel */ | |
96 int bpp; /* pixel quantum in bits */ | |
97 } visuals[5]; /* at most entries for 8, 15, 16, 24 */ | |
98 int nvisuals; | |
99 | |
100 Uint32 vis; /* current visual in use */ | |
101 int depth; /* current visual depth (not bpp) */ | |
102 int BytesPerPixel; | |
103 int currently_fullscreen,same_format,dbuffer; | |
104 | |
105 /* Automatic mode switching support (entering/leaving fullscreen) */ | |
106 Uint32 switch_waiting; | |
107 Uint32 switch_time; | |
108 | |
109 /* Prevent too many XSync() calls */ | |
110 int blit_queued; | |
111 | |
112 /* Colormap handling */ | |
113 LONG Pens; | |
114 Sint32 *XPixels; /* A list of pixels that have been allocated, the size depends on the screen format */ | |
115 struct ScreenBuffer *SB[2]; | |
116 struct RastPort *RP; | |
117 short *iconcolors; /* List of colors used by the icon */ | |
118 }; | |
119 | |
120 /* Old variable names */ | |
121 #define local_X11 (this->hidden->local_X11) | |
122 #define SDL_Display (this->hidden->Public_Display) | |
123 #define GFX_Display (this->hidden->GFX_Display) | |
124 #define SDL_Screen DefaultScreen(this->hidden->Public_Display) | |
125 | |
126 #define SDL_Visual (this->hidden->vis) | |
127 | |
128 #define SDL_Root RootWindow(SDL_Display, SDL_Screen) | |
129 #define WMwindow (this->hidden->WMwindow) | |
130 #define FSwindow (this->hidden->FSwindow) | |
131 #define SDL_Window (this->hidden->SDL_Window) | |
132 #define WM_DELETE_WINDOW (this->hidden->WM_DELETE_WINDOW) | |
133 #define SDL_BlankCursor (this->hidden->BlankCursor) | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
134 #define SDL_windowid (this->hidden->SDL_windowid) |
0 | 135 #define SDL_Ximage (this->hidden->Ximage) |
136 #define SDL_GC (this->hidden->gc) | |
137 #define swap_pixels (this->hidden->swap_pixels) | |
138 #define current_w (this->hidden->current_w) | |
139 #define current_h (this->hidden->current_h) | |
140 #define mouse_last (this->hidden->mouse_last) | |
141 #define mouse_accel (this->hidden->mouse_accel) | |
142 #define mouse_relative (this->hidden->mouse_relative) | |
143 #define SDL_modelist (this->hidden->modelist) | |
144 #define SDL_RastPort (this->hidden->RP) | |
145 #define saved_mode (this->hidden->saved_mode) | |
146 #define saved_view (this->hidden->saved_view) | |
147 #define currently_fullscreen (this->hidden->currently_fullscreen) | |
148 #define blit_queued (this->hidden->blit_queued) | |
149 #define SDL_DisplayColormap (this->hidden->GFX_Display->ViewPort.ColorMap) | |
150 #define SDL_XPixels (this->hidden->XPixels) | |
151 #define SDL_iconcolors (this->hidden->iconcolors) | |
152 | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
153 /* Used to get the X cursor from a window-manager specific cursor */ |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
154 // extern Cursor SDL_GetWMXCursor(WMcursor *cursor); |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
155 |
0 | 156 extern int CGX_CreateWindow(_THIS, SDL_Surface *screen, |
157 int w, int h, int bpp, Uint32 flags); | |
158 extern int CGX_ResizeWindow(_THIS, | |
159 SDL_Surface *screen, int w, int h, Uint32 flags); | |
160 | |
161 extern void CGX_DestroyWindow(_THIS, SDL_Surface *screen); | |
162 | |
163 extern struct Library *CyberGfxBase; | |
164 extern struct IntuitionBase *IntuitionBase; | |
165 extern struct GfxBase *GfxBase; | |
166 extern struct ExecBase *SysBase; | |
167 extern struct DosLibrary *DOSBase; | |
168 | |
169 struct private_hwdata | |
170 { | |
171 struct BitMap *bmap; | |
172 APTR lock; | |
173 struct SDL_VideoDevice *videodata; | |
174 APTR mask; | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
175 int allocated; |
0 | 176 }; |
177 | |
178 int CGX_CheckHWBlit(_THIS,SDL_Surface *src,SDL_Surface *dst); | |
179 int CGX_FillHWRect(_THIS,SDL_Surface *dst,SDL_Rect *dstrect,Uint32 color); | |
180 int CGX_SetHWColorKey(_THIS,SDL_Surface *surface, Uint32 key); | |
181 #endif /* _SDL_x11video_h */ |