1 /* $Id: LobbyClientView.h,v 1.10 2003/07/13 04:39:35 nan Exp $ */ 2 3 // Copyright (C) 2001-2003 $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 _LobbyClientView_ 20 #define _LobbyClientView_ 21 22 #include <gtk/gtk.h> 23 #include <gdk/gdkkeysyms.h> 24 25 class LobbyClient; 26 27 class LobbyClientView { 28 public: 29 LobbyClientView(); 30 ~LobbyClientView(); 31 32 void Init( LobbyClient *lobby ); 33 34 void SetSensitive( bool sensitive ); 35 void UpdateTable(); 36 void ShowUpdateDialog( char *version, char *URL ); 37 void AddChatMessage( long channelID, char *message ); 38 39 protected: 40 static gint IdleFunc( gpointer data ); 41 static gboolean checkSelection( GtkTreeSelection *selection, 42 GtkTreeModel *model, 43 GtkTreePath *path, 44 gboolean path_currently_selected, 45 gpointer data); 46 47 static void Connect( GtkWidget *widget, gpointer data ); 48 static void WarmUp( GtkWidget *widget, gpointer data ); 49 static gboolean KeyPress( GtkWidget *widget, GdkEventKey *event, gpointer data ); 50 static void SwitchChatPage( GtkNotebook *notebook, GtkNotebookPage *page, 51 gint page_num, gpointer data ); 52 static void Quit( GtkWidget *widget, gpointer data ); 53 54 #ifdef WIN32 55 static LRESULT CALLBACK EditWindowProc( HWND hwnd, UINT msg, 56 WPARAM wparam, LPARAM lparam); 57 #endif 58 59 guint m_timeout; 60 guint m_idle; 61 62 gint m_chatChannel; 63 int m_langID[2]; 64 65 LobbyClient *m_parent; 66 67 GtkWidget *m_window; 68 GtkWidget *m_table; 69 GtkWidget *m_chat[2]; 70 GtkWidget *m_chatinput; 71 GtkWidget *m_connectButton; 72 GtkWidget *m_warmUpButton; 73 74 long m_selected; // Selected row of the table 75 }; 76 77 class PIDialog { 78 public: 79 PIDialog(); 80 PIDialog( LobbyClient *parent ); 81 ~PIDialog(); 82 83 void PopupDialog( long uniqID ); 84 85 GtkWidget *m_window; 86 LobbyClient *m_parent; 87 88 long m_uniqID; 89 90 static void PIOK( GtkWidget *widget, gpointer data ); 91 static void PINo( GtkWidget *widget, gpointer data ); 92 }; 93 94 #endif // _LobbyClientView_ 95