| 1 |
/* AbiSource Application Framework |
| 2 |
* Copyright (C) 1998 AbiSource, Inc. |
| 3 |
* Copyright (C) 2001, 2009 Hubert Figuiere |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU General Public License |
| 7 |
* as published by the Free Software Foundation; either version 2 |
| 8 |
* of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This program 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 |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 18 |
* 02110-1301 USA. |
| 19 |
*/ |
| 20 |
|
| 21 |
|
| 22 |
#ifndef XAP_COCOAFRAME_H |
| 23 |
#define XAP_COCOAFRAME_H |
| 24 |
|
| 25 |
#import <Cocoa/Cocoa.h> |
| 26 |
|
| 27 |
#include "xap_Frame.h" |
| 28 |
|
| 29 |
class XAP_CocoaApp; |
| 30 |
class EV_CocoaKeyboard; |
| 31 |
class EV_CocoaMouse; |
| 32 |
class EV_CocoaMenuBar; |
| 33 |
class EV_CocoaMenuPopup; |
| 34 |
|
| 35 |
/***************************************************************** |
| 36 |
****************************************************************** |
| 37 |
** This file defines the cocoa-platform-specific class for the |
| 38 |
** cross-platform application frame. This is used to hold all |
| 39 |
** cocoa-specific data. One of these is created for each top-level |
| 40 |
** document window. |
| 41 |
****************************************************************** |
| 42 |
*****************************************************************/ |
| 43 |
|
| 44 |
class GR_CocoaCairoGraphics; |
| 45 |
class FV_View; |
| 46 |
|
| 47 |
@protocol XAP_MouseEventDelegate |
| 48 |
- (void)mouseDown:(NSEvent *)theEvent from:(id)sender; |
| 49 |
- (void)mouseDragged:(NSEvent *)theEvent from:(id)sender; |
| 50 |
- (void)mouseUp:(NSEvent *)theEvent from:(id)sender; |
| 51 |
@end |
| 52 |
|
| 53 |
|
| 54 |
// TODO should figure out if need default values |
| 55 |
@interface XAP_CocoaNSView : NSView |
| 56 |
{ |
| 57 |
NSCursor *_cursor; |
| 58 |
XAP_Frame *m_pFrame; |
| 59 |
GR_CocoaCairoGraphics *m_pGR; |
| 60 |
NSObject<XAP_MouseEventDelegate> *_eventDelegate; |
| 61 |
} |
| 62 |
- (id)initWith:(XAP_Frame *)frame andFrame:(NSRect)windowFrame; |
| 63 |
- (BOOL)acceptsFirstResponder; |
| 64 |
- (BOOL)becomeFirstResponder; |
| 65 |
- (XAP_Frame *)xapFrame; |
| 66 |
- (void)setGraphics:(GR_CocoaCairoGraphics *)gr; |
| 67 |
- (void)setEventDelegate:(NSObject<XAP_MouseEventDelegate>*)delegate; |
| 68 |
- (NSObject<XAP_MouseEventDelegate>*)eventDelegate; |
| 69 |
- (void)drawRect:(NSRect)aRect; |
| 70 |
- (BOOL)isFlipped; |
| 71 |
- (BOOL)isOpaque; |
| 72 |
- (void)hasBeenResized:(NSNotification*)notif; |
| 73 |
- (void)setCursor:(NSCursor*)cursor; |
| 74 |
@end |
| 75 |
|
| 76 |
|
| 77 |
#endif /* XAP_COCOAFRAME_H */ |