1 /* $Id: LauncherView.h,v 1.3 2003/07/19 18:33:31 nan Exp $ */ 2 3 // Copyright (C) 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 #include <gtk/gtk.h> 20 21 // Upper half of initial window 22 class LauncherHeader { 23 public: 24 LauncherHeader(); 25 ~LauncherHeader(); 26 27 void Init( GtkBox *box ); 28 29 protected: 30 GtkWidget * FullScreenFrame(); 31 GtkWidget * SoundFrame(); 32 GtkWidget * GraphicsFrame(); 33 34 static void Toggle( GtkWidget *widget, gpointer data ); 35 static void ToggleFullScreen( GtkWidget *widget, gpointer data ); 36 static void ToggleSound( GtkWidget *widget, gpointer data ); 37 38 #ifdef ENABLE_IPV6 39 GtkWidget * ProtocolFrame(); 40 static void ToggleProtocol( GtkWidget *widget, gpointer data ); 41 #endif 42 }; 43 44 45 // Lower half of initial window 46 class ModeNote { 47 public: 48 ModeNote(); 49 ~ModeNote(); 50 51 void Init( GtkBox *box ); 52 53 GtkWidget *m_serverName; 54 GtkWidget *m_lobbyEdit[2]; 55 protected: 56 GtkWidget * InitSoloPlayPanel(); 57 GtkWidget * InitLANPlayPanel(); 58 GtkWidget * InitInternetPlayPanel(); 59 60 static void Toggle( GtkWidget *widget, gpointer data ); 61 static void StartGame( GtkWidget *widget, gpointer data ); 62 static void LANStartGame( GtkWidget *widget, gpointer data ); 63 static void InternetStartGame( GtkWidget *widget, gpointer data ); 64 65 #ifdef WIN32 66 static LRESULT CALLBACK EditWindowProc( HWND hwnd, UINT msg, 67 WPARAM wparam, LPARAM lparam); 68 static LRESULT CALLBACK ParentWindowProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam); 69 static LONG pEditWndProc; 70 static LONG pParentWndProc; 71 static HWND pChildHWnd; 72 #endif 73 }; 74 75 class LauncherView { 76 public: 77 LauncherView(); 78 ~LauncherView(); 79 80 void Init(); 81 82 static void Destroy(GtkWidget *widget, gpointer data); 83 static void ConnectionFailedDialog(); 84 85 #ifdef WIN32 86 static HWND hWnd; 87 #endif 88 protected: 89 GtkWidget *m_window; // main window 90 LauncherHeader *m_header; // upper area 91 ModeNote *m_note; // mode notebook(solo, LAN, Internet) 92 93 GtkWidget *m_quit; // quit button 94 }; 95