1 /* $Id: Title.h,v 1.11 2003/07/16 15:58:17 nan Exp $ */
2 
3 // Copyright (C) 2000, 2001  $B?@Fn(B $B5H9((B(Kanna Yoshihiro)
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 
19 #ifndef _Title_
20 #define _Title_
21 #include "Control.h"
22 #include "TitleView.h"
23 
24 // major menu
25 #define MENU_MAIN	0
26 #define MENU_CONFIG	1
27 
28 // minor menu
29 #define MENU_ALL		0	// number of all menus
30 #define MENU_CONFIG_LEVEL	1	// level menu(in config menu)
31 #define MENU_CONFIG_MODE	2	// mode(in config menu)
32 #define MENU_CONFIG_PLAYER	3	// player(in config menu)
33 
34 class MenuItem;
35 
36 class Title : public Control {
37 public:
38   Title();
39   virtual ~Title();
40 
41   virtual bool Init();
42 
43   static void Create();
44 
45   virtual bool Move( SDL_keysym *KeyHistory, long *MouseXHistory,
46 		     long *MouseYHistory, unsigned long *MouseBHistory,
47 		     int Histptr );
48 
49   MenuItem *GetSelected();
50   long GetSelectMode();
51   long GetCount();
52   long GetMenuNum( long major, long minor=0 );
53 
54   virtual bool LookAt( double &srcX, double &srcY, double &srcZ,
55 		       double &destX, double &destY, double &destZ );
56 
IsPlaying()57   virtual bool IsPlaying() { return false; };
58 
GetView()59   virtual View *GetView() { return m_View; };
60 protected:
61   TitleView *m_View;
62   long m_selected;	// Selected : m_selected > 0
63   long m_selectMode;	// Normal   : 0
64 			// config   : 1
65   long m_count;
66 
67   MenuItem *m_menuItem[16];
68 
69   void CreateMenu( long menuMajorNum );
70   long SetSelected( long selected );
71   long HitTest( long x, long y );
72 };
73 
74 #endif	// _Title_
75