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
;
66 - (void) graphicSetUp
;
67 - (void) loadImageArray
;
70 - (void) setMuted
:(BOOL
)value
;
71 - (void) setShowHint
:(BOOL
)value
;
72 - (void) setPaused
:(BOOL
)value
;
75 - (void) setGame
:(Game
*) agame
;
77 - (NSArray
*) imageArray
;
78 - (NSArray
*) spriteArray
;
79 - (void) newBackground
;
80 - (void) setLegend
:(id
)value
;
81 - (void) setHTMLLegend
:(NSString
*)value
;
82 - (void) setHiScoreLegend
:(NSAttributedString
*)value
;
83 - (void) setHTMLHiScoreLegend
:(NSString
*)value
;
84 - (void) setLastMoveDate
;
86 - (void) showHighScores
:(NSArray
*)scores andNames
:(NSArray
*)names
;
88 // Standard view create/free methods
89 - (id
)initWithFrame
:(NSRect
)frame
;
93 - (void)drawRect
:(NSRect
)rect
;
98 - (void)mouseDown
:(NSEvent
*)event
;
99 - (void)mouseDragged
:(NSEvent
*)event
;
100 - (void)mouseUp
:(NSEvent
*)event
;