1 /* ----====----====----====----====----====----====----====----====----====----
4 JewelToy is a simple game played against the clock.
5 Copyright (C) 2001 Giles Williams
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 ----====----====----====----====----====----====----====----====----====---- */
22 #import <Cocoa/Cocoa.h>
25 @
class Game
, GameController
, OpenGLSprite
;
27 @interface GameView
: NSOpenGLView
29 IBOutlet GameController
*gameController
;
31 BOOL m_glContextInitialized
;
33 NSColor
*backgroundColor
;
34 NSMutableArray
*_gemImageArray
;
35 NSImage
*backgroundImage
;
36 NSImage
*crosshairImage
;
37 NSImage
*movehintImage
;
40 OpenGLSprite
*backgroundSprite
, *crosshairSprite
, *movehintSprite
;
41 NSMutableArray
*_gemSpriteArray
;
44 NSMutableArray
*backgroundImagePathArray
;
47 NSAttributedString
*hiScoreLegend
;
50 OpenGLSprite
*legendSprite
;
52 NSArray
*hiScoreNumbers
, *hiScoreNames
;
53 int ticksSinceLastMove
, scoreScroll
;
55 NSPoint dragStartPoint
;
59 NSDictionary
*docTypeDictionary
;
61 BOOL _animating
, showHighScores
, paused
, _muted
, animationStatus
, showHint
;
64 @property BOOL animating
;
67 @
property (assign
) Game
*game
;
69 // ???: @property (readonly) NSArray *gemImageArray;
71 @
property (readonly
) NSArray
*gemSpriteArray
;
73 - (void) graphicSetUp
;
74 - (void) loadImageArray
;
77 - (void) setShowHint
:(BOOL
)value
;
78 - (void) setPaused
:(BOOL
)value
;
81 - (void) newBackground
;
82 - (void) setLegend
:(id
)value
;
83 - (void) setHTMLLegend
:(NSString
*)value
;
84 - (void) setHiScoreLegend
:(NSAttributedString
*)value
;
85 - (void) setHTMLHiScoreLegend
:(NSString
*)value
;
86 - (void) setLastMoveDate
;
88 - (void) showHighScores
:(NSArray
*)scores andNames
:(NSArray
*)names
;
90 // Standard view create/free methods
91 - (id
)initWithFrame
:(NSRect
)frame
;
95 - (void)drawRect
:(NSRect
)rect
;
100 - (void)mouseDown
:(NSEvent
*)event
;
101 - (void)mouseDragged
:(NSEvent
*)event
;
102 - (void)mouseUp
:(NSEvent
*)event
;