1 /*- 2 # X-BASED RUBIK'S CUBE(tm) 3 # 4 # Rubik2dP.h 5 # 6 ### 7 # 8 # Copyright (c) 1994 - 99 David Albert Bagley, bagleyd@tux.org 9 # 10 # All Rights Reserved 11 # 12 # Permission to use, copy, modify, and distribute this software and 13 # its documentation for any purpose and without fee is hereby granted, 14 # provided that the above copyright notice appear in all copies and 15 # that both that copyright notice and this permission notice appear in 16 # supporting documentation, and that the name of the author not be 17 # used in advertising or publicity pertaining to distribution of the 18 # software without specific, written prior permission. 19 # 20 # This program is distributed in the hope that it will be "playable", 21 # but WITHOUT ANY WARRANTY; without even the implied warranty of 22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23 # 24 */ 25 26 /* Private header file for Rubik2d */ 27 28 #ifndef _Rubik2dP_h 29 #define _Rubik2dP_h 30 31 #include "Rubik2d.h" 32 33 #define FRONTLOC 0 34 #define BACKLOC 11 35 #define COORD2D 8 36 #define MAXX 3 37 #define MAXY 4 38 #define MAXXY 4 /* (MAX(MAXX,MAXY)) */ 39 #define MAXRECT (MAXX*MAXY) 40 41 typedef struct _Rubik2DPart { 42 Position cubeLength; 43 Position faceLengthx, faceLengthy, faceLengthz; 44 Position viewLengthx, viewLengthy, viewLengthz; 45 } Rubik2DPart; 46 47 typedef struct _Rubik2DRec { 48 CorePart core; 49 RubikPart rubik; 50 Rubik2DPart rubik2d; 51 } Rubik2DRec; 52 53 /* This gets around C's inability to do inheritance */ 54 typedef struct _Rubik2DClassPart { 55 int ignore; 56 } Rubik2DClassPart; 57 58 typedef struct _Rubik2DClassRec { 59 CoreClassPart core_class; 60 RubikClassPart rubik_class; 61 Rubik2DClassPart rubik2d_class; 62 } Rubik2DClassRec; 63 64 extern Rubik2DClassRec rubik2dClassRec; 65 66 extern Boolean SelectPolyhedrons2D(Rubik2DWidget w, int x, int y, int *face, int *position); 67 extern Boolean NarrowSelection2D(Rubik2DWidget w, int *face, int *position, int *direction); 68 extern void DrawSquare2D(Rubik2DWidget w, int face, int position, int offset); 69 70 #endif /* _Rubik2dP_h */ 71