2003-07-31 23:52:10 +00:00
|
|
|
/*
|
|
|
|
NSCursor.h
|
|
|
|
|
|
|
|
Holds an image to use as a cursor
|
|
|
|
|
|
|
|
Copyright (C) 1996,1999 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Date: 1996
|
|
|
|
|
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GNUstep_H_NSCursor
|
|
|
|
#define _GNUstep_H_NSCursor
|
|
|
|
|
|
|
|
#include <Foundation/NSCoder.h>
|
|
|
|
|
|
|
|
@class NSImage;
|
|
|
|
@class NSEvent;
|
|
|
|
@class NSColor;
|
|
|
|
|
|
|
|
@interface NSCursor : NSObject <NSCoding>
|
|
|
|
{
|
|
|
|
NSImage *_cursor_image;
|
|
|
|
NSPoint _hot_spot;
|
|
|
|
BOOL _is_set_on_mouse_entered;
|
|
|
|
BOOL _is_set_on_mouse_exited;
|
|
|
|
void *_cid;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initializing a New NSCursor Object
|
|
|
|
*/
|
|
|
|
- (id) initWithImage: (NSImage *)newImage;
|
|
|
|
- (id) initWithImage: (NSImage *)newImage
|
|
|
|
hotSpot: (NSPoint)hotSpot;
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
- (id)initWithImage:(NSImage *)newImage
|
|
|
|
foregroundColorHint:(NSColor *)fg
|
|
|
|
backgroundColorHint:(NSColor *)bg
|
|
|
|
hotSpot:(NSPoint)hotSpot;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Defining the Cursor
|
|
|
|
*/
|
|
|
|
- (NSPoint) hotSpot;
|
|
|
|
- (NSImage*) image;
|
2004-06-28 12:21:36 +00:00
|
|
|
#ifndef STRICT_MACOS_X
|
2003-07-31 23:52:10 +00:00
|
|
|
- (void) setHotSpot: (NSPoint)spot;
|
|
|
|
- (void) setImage: (NSImage *)newImage;
|
2004-06-28 12:21:36 +00:00
|
|
|
#endif
|
2003-07-31 23:52:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Setting the Cursor
|
|
|
|
*/
|
|
|
|
+ (void) hide;
|
|
|
|
+ (void) pop;
|
|
|
|
+ (void) setHiddenUntilMouseMoves: (BOOL)flag;
|
|
|
|
+ (BOOL) isHiddenUntilMouseMoves;
|
|
|
|
+ (void) unhide;
|
|
|
|
- (BOOL) isSetOnMouseEntered;
|
|
|
|
- (BOOL) isSetOnMouseExited;
|
|
|
|
- (void) mouseEntered: (NSEvent*)theEvent;
|
|
|
|
- (void) mouseExited: (NSEvent*)theEvent;
|
|
|
|
- (void) pop;
|
|
|
|
- (void) push;
|
|
|
|
- (void) set;
|
|
|
|
- (void) setOnMouseEntered: (BOOL)flag;
|
|
|
|
- (void) setOnMouseExited: (BOOL)flag;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Getting the Cursor
|
|
|
|
*/
|
|
|
|
+ (NSCursor*) arrowCursor;
|
|
|
|
+ (NSCursor*) currentCursor;
|
|
|
|
+ (NSCursor*) IBeamCursor;
|
|
|
|
|
|
|
|
#ifndef NO_GNUSTEP
|
|
|
|
+ (NSCursor*) greenArrowCursor;
|
|
|
|
#endif
|
|
|
|
|
2004-06-28 12:21:36 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
+ (NSCursor*) closedHandCursor;
|
|
|
|
+ (NSCursor*) crosshairCursor;
|
|
|
|
+ (NSCursor*) disappearingItemCursor;
|
|
|
|
+ (NSCursor*) openHandCursor;
|
|
|
|
+ (NSCursor*) pointingHandCursor;
|
|
|
|
+ (NSCursor*) resizeDownCursor;
|
|
|
|
+ (NSCursor*) resizeLeftCursor;
|
|
|
|
+ (NSCursor*) resizeLeftRightCursor;
|
|
|
|
+ (NSCursor*) resizeRightCursor;
|
|
|
|
+ (NSCursor*) resizeUpCursor;
|
|
|
|
+ (NSCursor*) resizeUpDownCursor;
|
|
|
|
#endif
|
|
|
|
|
2003-07-31 23:52:10 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
/* Cursor types */
|
|
|
|
typedef enum {
|
|
|
|
GSArrowCursor,
|
2004-06-28 12:21:36 +00:00
|
|
|
GSIBeamCursor,
|
|
|
|
GSClosedHandCursor,
|
|
|
|
GSCrosshairCursor,
|
|
|
|
GSDisappearingItemCursor,
|
|
|
|
GSOpenHandCursor,
|
|
|
|
GSPointingHandCursor,
|
|
|
|
GSResizeDownCursor,
|
|
|
|
GSResizeLeftCursor,
|
|
|
|
GSResizeLeftRightCursor,
|
|
|
|
GSResizeRightCursor,
|
|
|
|
GSResizeUpCursor,
|
|
|
|
GSResizeUpDownCursor,
|
2003-07-31 23:52:10 +00:00
|
|
|
} GSCursorTypes;
|
|
|
|
|
|
|
|
#endif /* _GNUstep_H_NSCursor */
|