2002-03-16 04:01:09 +00:00
|
|
|
/*
|
|
|
|
* EmulatorView.h - Custom NSView for Basilisk II window input & output
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Basilisk II (C) 1997-2002 Christian Bauer
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef NSBITMAP
|
|
|
|
#import <AppKit/NSBitmapImageRep.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#import <AppKit/NSView.h>
|
|
|
|
|
|
|
|
|
|
|
|
@interface EmulatorView : NSView
|
|
|
|
{
|
|
|
|
#ifdef CGIMAGEREF
|
2002-12-18 11:53:11 +00:00
|
|
|
CGImageRef cgImgRep;
|
2002-03-16 04:01:09 +00:00
|
|
|
#endif
|
|
|
|
#ifdef NSBITMAP
|
|
|
|
NSBitmapImageRep *bitmap;
|
|
|
|
#endif
|
|
|
|
#ifdef CGDRAWBITMAP
|
|
|
|
void *bitmap;
|
|
|
|
short bps, spp, bpp;
|
|
|
|
int bytesPerRow;
|
|
|
|
BOOL isPlanar, hasAlpha;
|
|
|
|
#endif
|
2002-12-18 11:53:11 +00:00
|
|
|
float numBytes;
|
|
|
|
|
2002-03-16 04:01:09 +00:00
|
|
|
short x, y;
|
|
|
|
|
2002-05-30 12:46:15 +00:00
|
|
|
BOOL drawView, // Set when the bitmap is all set up
|
2002-03-16 04:01:09 +00:00
|
|
|
// and ready to display
|
2002-06-05 10:18:51 +00:00
|
|
|
fullScreen; // Is this Emulator using the whole screen?
|
|
|
|
|
|
|
|
NSRect displayBox; // Cached dimensions of the screen
|
|
|
|
int screen_height;
|
2002-03-16 04:01:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void) benchmark;
|
|
|
|
- (NSData *) TIFFrep; // Used for snapshot function
|
|
|
|
|
|
|
|
// Enable display of, and drawing into, the view
|
|
|
|
#ifdef NSBITMAP
|
|
|
|
- (void) readyToDraw: (NSBitmapImageRep *) theBitmap
|
|
|
|
imageWidth: (short) width
|
|
|
|
imageHeight: (short) height;
|
|
|
|
#endif
|
|
|
|
#ifdef CGIMAGEREF
|
|
|
|
- (void) readyToDraw: (CGImageRef) image
|
|
|
|
imageWidth: (short) width
|
|
|
|
imageHeight: (short) height;
|
|
|
|
#endif
|
|
|
|
#ifdef CGDRAWBITMAP
|
|
|
|
- (void) readyToDraw: (void *) theBitmap
|
|
|
|
width: (short) width
|
|
|
|
height: (short) height
|
|
|
|
bps: (short) bitsPerSample
|
|
|
|
spp: (short) samplesPerPixel
|
|
|
|
bpp: (short) bitsPerPixel
|
|
|
|
bpr: (int) bpr
|
|
|
|
isPlanar: (BOOL) planar
|
|
|
|
hasAlpha: (BOOL) alpha;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
- (void) disableDrawing;
|
2002-06-05 10:18:51 +00:00
|
|
|
- (void) startedFullScreen: (CGDirectDisplayID) theDisplay;
|
2002-03-16 04:01:09 +00:00
|
|
|
|
|
|
|
- (short) width;
|
|
|
|
- (short) height;
|
|
|
|
|
2002-05-30 12:46:15 +00:00
|
|
|
- (BOOL) isFullScreen;
|
2002-03-16 04:01:09 +00:00
|
|
|
- (BOOL) mouseInView: (NSEvent *) event;
|
|
|
|
- (BOOL) mouseInView;
|
|
|
|
- (BOOL) processMouseMove: (NSEvent *) event;
|
|
|
|
|
|
|
|
#ifdef CGDRAWBITMAP
|
|
|
|
- (void) CGDrawBitmap;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CGIMAGEREF
|
|
|
|
void cgDrawInto(NSRect rect, CGImageRef bitmap);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@end
|