1 |
/* |
2 |
* EmulatorView.h - Custom NSView for Basilisk II window input & output |
3 |
* |
4 |
* $Id: EmulatorView.h,v 1.7 2003/03/26 23:35:23 nigel Exp $ |
5 |
* |
6 |
* Basilisk II (C) 1997-2004 Christian Bauer |
7 |
* |
8 |
* This program is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
10 |
* the Free Software Foundation; either version 2 of the License, or |
11 |
* (at your option) any later version. |
12 |
* |
13 |
* This program is distributed in the hope that it will be useful, |
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
* GNU General Public License for more details. |
17 |
* |
18 |
* You should have received a copy of the GNU General Public License |
19 |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
*/ |
22 |
|
23 |
#ifdef NSBITMAP |
24 |
#import <AppKit/NSBitmapImageRep.h> |
25 |
#endif |
26 |
|
27 |
#import <AppKit/NSView.h> |
28 |
|
29 |
|
30 |
@interface EmulatorView : NSView |
31 |
{ |
32 |
#ifdef CGIMAGEREF |
33 |
CGImageRef cgImgRep; |
34 |
#endif |
35 |
#ifdef NSBITMAP |
36 |
NSBitmapImageRep *bitmap; |
37 |
#else |
38 |
void *bitmap; |
39 |
#endif |
40 |
#ifdef CGDRAWBITMAP |
41 |
short bps, spp, bpp; |
42 |
int bytesPerRow; |
43 |
BOOL isPlanar, hasAlpha; |
44 |
#endif |
45 |
float numBytes; |
46 |
|
47 |
short x, y; |
48 |
|
49 |
BOOL drawView, // Set when the bitmap is all set up |
50 |
// and ready to display |
51 |
fullScreen; // Is this Emulator using the whole screen? |
52 |
|
53 |
NSRect displayBox; // Cached dimensions of the screen |
54 |
|
55 |
int screen_height; // Height of the screen with the key window |
56 |
} |
57 |
|
58 |
- (void) benchmark; |
59 |
- (NSData *) TIFFrep; // Used for snapshot function |
60 |
|
61 |
// Enable display of, and drawing into, the view |
62 |
#ifdef NSBITMAP |
63 |
- (void) readyToDraw: (NSBitmapImageRep *) theBitmap |
64 |
imageWidth: (short) width |
65 |
imageHeight: (short) height; |
66 |
#endif |
67 |
#ifdef CGIMAGEREF |
68 |
- (void) readyToDraw: (CGImageRef) image |
69 |
bitmap: (void *) theBitmap |
70 |
imageWidth: (short) width |
71 |
imageHeight: (short) height; |
72 |
#endif |
73 |
#ifdef CGDRAWBITMAP |
74 |
- (void) readyToDraw: (void *) theBitmap |
75 |
width: (short) width |
76 |
height: (short) height |
77 |
bps: (short) bitsPerSample |
78 |
spp: (short) samplesPerPixel |
79 |
bpp: (short) bitsPerPixel |
80 |
bpr: (int) bpr |
81 |
isPlanar: (BOOL) planar |
82 |
hasAlpha: (BOOL) alpha; |
83 |
#endif |
84 |
|
85 |
- (void) disableDrawing; |
86 |
- (void) startedFullScreen: (CGDirectDisplayID) theDisplay; |
87 |
|
88 |
- (void) blacken; |
89 |
- (void) clear; |
90 |
|
91 |
- (short) width; |
92 |
- (short) height; |
93 |
|
94 |
- (BOOL) isFullScreen; |
95 |
- (BOOL) mouseInView: (NSEvent *) event; |
96 |
- (BOOL) mouseInView; |
97 |
- (void) fullscreenMouseMove; |
98 |
- (BOOL) processMouseMove: (NSEvent *) event; |
99 |
|
100 |
#ifdef CGDRAWBITMAP |
101 |
- (void) CGDrawBitmap; |
102 |
#endif |
103 |
|
104 |
#ifdef CGIMAGEREF |
105 |
void cgDrawInto(NSRect rect, CGImageRef bitmap); |
106 |
#endif |
107 |
|
108 |
@end |