1 /* 2 Project: Sudoku 3 SudokuView.h 4 5 Copyright (C) 2007-2011 The Free Software Foundation, Inc 6 7 Author: Marko Riedel 8 9 This application is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public 11 License as published by the Free Software Foundation; either 12 version 3 of the License, or (at your option) any later version. 13 14 This application is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 Library General Public License for more details. 18 19 You should have received a copy of the GNU General Public 20 License along with this library; if not, write to the Free 21 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 */ 23 24 #import <Foundation/Foundation.h> 25 #import <AppKit/NSView.h> 26 #import <AppKit/NSDragging.h> 27 28 #import "Sudoku.h" 29 30 #define FIELD_DIM 54 31 #define FONT_SIZE 36 32 #define MARKUP_SIZE 10 33 34 @interface SudokuView : NSView 35 { 36 Sudoku *sdk; 37 } 38 39 - initWithFrame:(NSRect)frame; 40 - (Sudoku *)sudoku; 41 42 - reset; 43 - loadSolution; 44 45 - (void)drawMarkupAtX:(int)x andY:(int)y; 46 - (void)drawString:(char *)str atX:(int)x andY:(int)y color:(NSColor *)col; 47 - (void)drawRect:(NSRect)rect; 48 49 - (void)mouseDown:(NSEvent *)theEvent; 50 51 - (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender; 52 - (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender; 53 54 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; 55 - (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender; 56 57 58 @end 59