1 |
nigel |
1.1 |
/* |
2 |
|
|
* EmulatorView.h - Custom NSView for Basilisk II window input & output |
3 |
|
|
* |
4 |
nigel |
1.6 |
* $Id: EmulatorView.h,v 1.5 2003/03/11 11:27:20 nigel Exp $ |
5 |
nigel |
1.1 |
* |
6 |
nigel |
1.6 |
* Basilisk II (C) 1997-2003 Christian Bauer |
7 |
nigel |
1.1 |
* |
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 |
nigel |
1.4 |
CGImageRef cgImgRep; |
34 |
nigel |
1.1 |
#endif |
35 |
|
|
#ifdef NSBITMAP |
36 |
|
|
NSBitmapImageRep *bitmap; |
37 |
nigel |
1.6 |
#else |
38 |
|
|
void *bitmap; |
39 |
nigel |
1.1 |
#endif |
40 |
|
|
#ifdef CGDRAWBITMAP |
41 |
|
|
short bps, spp, bpp; |
42 |
|
|
int bytesPerRow; |
43 |
|
|
BOOL isPlanar, hasAlpha; |
44 |
|
|
#endif |
45 |
nigel |
1.4 |
float numBytes; |
46 |
|
|
|
47 |
nigel |
1.1 |
short x, y; |
48 |
|
|
|
49 |
nigel |
1.2 |
BOOL drawView, // Set when the bitmap is all set up |
50 |
nigel |
1.1 |
// and ready to display |
51 |
nigel |
1.3 |
fullScreen; // Is this Emulator using the whole screen? |
52 |
|
|
|
53 |
|
|
NSRect displayBox; // Cached dimensions of the screen |
54 |
nigel |
1.5 |
|
55 |
|
|
int screen_height; // Height of the screen with the key window |
56 |
nigel |
1.1 |
} |
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 |
nigel |
1.6 |
bitmap: (void *) theBitmap |
70 |
nigel |
1.1 |
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 |
nigel |
1.3 |
- (void) startedFullScreen: (CGDirectDisplayID) theDisplay; |
87 |
nigel |
1.1 |
|
88 |
|
|
- (short) width; |
89 |
|
|
- (short) height; |
90 |
|
|
|
91 |
nigel |
1.2 |
- (BOOL) isFullScreen; |
92 |
nigel |
1.1 |
- (BOOL) mouseInView: (NSEvent *) event; |
93 |
|
|
- (BOOL) mouseInView; |
94 |
nigel |
1.5 |
- (void) fullscreenMouseMove; |
95 |
nigel |
1.1 |
- (BOOL) processMouseMove: (NSEvent *) event; |
96 |
|
|
|
97 |
|
|
#ifdef CGDRAWBITMAP |
98 |
|
|
- (void) CGDrawBitmap; |
99 |
|
|
#endif |
100 |
|
|
|
101 |
|
|
#ifdef CGIMAGEREF |
102 |
|
|
void cgDrawInto(NSRect rect, CGImageRef bitmap); |
103 |
|
|
#endif |
104 |
|
|
|
105 |
|
|
@end |