Update of /cvsroot/netrek/client/netrekxp/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2251/include

Modified Files:
	bitmaps.h data.h defs.h playerlist.h proto.h struct.h 
	version.h 
Log Message:
This large patch brings the client up to Stas's version 4.4.0.4.  The visible changes to the user are:
- added "allowWheelActions: (on)/off" to be able to disable wheel in non-scrolling windows
- added new window "player2" that behaves exactly as player list window, but allows to
  select alternate custom layout and could be toggled with 'A' key
- added "playerList2: (string)" option that allows to select different player list layout
  for alternate player list window, by default it will be "n T R N l M K W L r O D d "
- fixed bug that caused main thread to continue in case player died while scrolling
  message window using scrollbar (which forced him close client window and reconnect)
- fixed incorrect behavior of 'windowMove: off' feature. Previously window would snap
  back to wrong place if the main window top-left corner was not (0,0) coordinates
- long lines are now wrapped by words instead of by chars. Maximum message length was
  reduced to 4 full message lines (4 * 69 characters)
- message input window will now show Sender->Recipient even when the input line is longer
  than 69 characters
- changed 'Forum' URL on metaserver window to open Google's r.g.n location

There are also several internal changes, such as a new format for error messages.

Index: bitmaps.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- bitmaps.h	18 Apr 2006 13:41:48 -0000	1.3
+++ bitmaps.h	21 Apr 2006 12:00:06 -0000	1.4
@@ -1,5 +1,4 @@
 #include "config.h"
-
 // Ships
 // -----
 

Index: defs.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- defs.h	18 Apr 2006 13:41:48 -0000	1.3
+++ defs.h	21 Apr 2006 12:00:06 -0000	1.4
@@ -219,7 +219,7 @@
 #define INVISIBLE(j)        (((j)->p_flags & PFCLOAK) && \
         ((j)->p_cloakphase == (CLOAK_PHASES-1)))
 
-#define ANNOUNCESOCKET      if (me!=NULL)printf("***  socket %d, player %d  ***\n",nextSocket,me->p_no); else
+#define ANNOUNCESOCKET      if (me!=NULL)LineToConsole("***  socket %d, player %d  ***\n",nextSocket,me->p_no); else
 
 
 #if !defined(_IBMR2)
@@ -320,7 +320,7 @@
 #define UDP_UPDATE_WAIT	5
 
 /* client version of UDPDIAG */
-#define UDPDIAG(x)      { if (udpDebug) { printf("UDP: "); printf x; }}
+#define UDPDIAG(x)      { if (udpDebug) { LineToConsole("UDP: "); LineToConsole x; }}
 #define V_UDPDIAG(x)    UDPDIAG(x)
 
 #ifdef ROTATERACE
@@ -452,4 +452,7 @@
 #define T_USER      4   /* user reset timer */
 #define T_TOTAL     5   /* number of T_ defs */
 
+/* The maximum length of message in buffer */
+#define MAX_MLENGTH 286
+
 #endif /* _h_defs */

Index: version.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/version.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- version.h	12 Apr 2006 04:20:03 -0000	1.2
+++ version.h	21 Apr 2006 12:00:06 -0000	1.3
@@ -2,5 +2,5 @@
 
 /* store the version info here */
 
-static char mvers[] = "4.4.0.3";
+static char mvers[] = "4.4.0.4";
 static char version[] = "Netrek XP Mod";
\ No newline at end of file

Index: struct.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- struct.h	12 Apr 2006 04:20:03 -0000	1.2
+++ struct.h	21 Apr 2006 12:00:06 -0000	1.3
@@ -129,6 +129,7 @@
 #define PFOBSERV	0x8000000       /* for observers */
 #define PFTWARP     0x40000000      /* transwarping to base */
 
+#define KLOGIN      0x00    /* initial state */
 #define KQUIT		0x01    /* Player quit */
 #define KTORP		0x02    /* killed by torp */
 #define KPHASER		0x03    /* killed by phaser */
@@ -139,12 +140,14 @@
 #define KGHOST		0x08    /* killed because a ghost */
 #define KGENOCIDE	0x09    /* killed by genocide */
 #define KPROVIDENCE	0x0a    /* killed by a hacker */
-#define KPLASMA         0x0b    /* killed by a plasma
-                                 * torpedo */
+#define KPLASMA     0x0b    /* killed by a plasma torpedo */
 #define TOURNEND	0x0c    /* tournament game ended */
 #define KOVER		0x0d    /* game over  */
 #define TOURNSTART	0x0e    /* tournament game starting */
 #define KBADBIN		0x0f    /* bad binary */
+#define KTORP2      0x10    /* killed by detted torps */
+#define KSHIP2      0x11    /* chain-reaction explosions */
+#define KPLASMA2    0x12    /* killed by zapped plasma */
 
 #define NUM_TYPES 8
 #define SCOUT 0
@@ -673,4 +676,11 @@
     HBITMAP old_bmp;    /* saved bitmap */
 }SDBUFFER;
 
+// Linked list for console buffer
+struct cons_buffer
+{
+    char * string;
+    struct cons_buffer * next;
+};
+
 #endif /* _h_struct */

Index: proto.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- proto.h	19 Apr 2006 13:02:33 -0000	1.5
+++ proto.h	21 Apr 2006 12:00:06 -0000	1.6
@@ -39,6 +39,13 @@
 /******************************************************************************/
 void getColorDefs (void);
 
+/******************************************************************************/
+/***  console.c                                                             ***/
+/******************************************************************************/
+int IsConsoleVisible (void);
+void ShowConsole (void);
+void LineToConsole (char * format, ...);
+void BufferToConsole (void);
 
 /******************************************************************************/
 /***  cowmain.c                                                             ***/
@@ -479,6 +486,13 @@
                                 int height,
                                 W_Window parent,
                                 int border);
+W_Window W_MakeScrollingRichTextWindow (char *name,
+                                        int x,
+                                        int y,
+                                        int width,
+                                        int height,
+                                        W_Window parent,
+                                        int border);
 W_Window W_MakeMenu (char *name,
                      int x,
                      int y,
@@ -635,6 +649,10 @@
                      W_Color color,
                      char *str,
                      int len);
+void AddToRichText (Window * win,
+                    W_Color color,
+                    char *str,
+                    int len);
 void RedrawScrolling (Window * win,
                       HDC hdc);
 void W_FlushScrollingWindow (W_Window window);
@@ -708,6 +726,11 @@
                               int len,
                               W_Font font);
 void W_SetWAM (W_Window win);
+/* RichText */
+LRESULT CALLBACK RichTextWndProc (HWND hwnd,
+                                  UINT msg,
+                                  WPARAM wParam,
+                                  LPARAM lParam);
 /* DoubleBuffering */
 SDBUFFER * W_InitSDB (W_Window window);
 void W_Win2Mem (SDBUFFER * sdb);
@@ -855,13 +878,10 @@
 /******************************************************************************/
 void InitPlayerList ();
 int PlistMaxWidth ();
+int PlistMaxWidth2 ();
 void RedrawPlayerList ();
 void UpdatePlistFn ();
 int GetPlayerFromPlist (int x, int y);
-//static void WriteSortedPlist();
-//static void WriteUnsortedPlist(void);
-//static int PlistHeader(char *layout, int doWrite);
-//static void PlistLine(struct player *j, int pos);
 
 /******************************************************************************/
 /***  ranklist.c
@@ -954,19 +974,19 @@
 /******************************************************************************/
 void DisplayMessage ();
 void smessage (char ichar);
-pmessage (char *str,
-          short recip,
-          short group);
+void pmessage (char *str, 
+               short recip, 
+               short group);
 char *getaddr2 (int flags,
                 int recip);
-message_on (void);
-message_off (void);
+void message_on (void);
+void message_off (void);
 #ifdef XTRA_MESSAGE_UI
-message_hold (void);
+void message_hold (void);
 #endif
 int getgroup (char addr,
               int *recip);
-pnbtmacro (int c);
+void pnbtmacro (int c);
 
 /******************************************************************************/
 /***  socket.c

Index: playerlist.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/playerlist.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- playerlist.h	21 Jan 2003 21:27:55 -0000	1.1.1.1
+++ playerlist.h	21 Apr 2006 12:00:06 -0000	1.2
@@ -152,5 +152,4 @@
 void UpdatePlistFn (void);
 #define UpdatePlayerList()	if (plistUpdated) UpdatePlistFn()
 
-
 #endif /* defined h_playerlist */

Index: data.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- data.h	19 Apr 2006 13:02:33 -0000	1.5
+++ data.h	21 Apr 2006 12:00:06 -0000	1.6
@@ -80,7 +80,6 @@
 extern int warncount;
 extern int warntimer;
 extern int infomapped;
-extern int scanmapped;          /* ATM - scanner stuff */
 extern int mustexit;
 extern int messtime;
 extern int keepPeace;
@@ -106,10 +105,7 @@
 #endif
 
 #ifdef META
-extern char *metaServer;
-extern char *metaServer1;
-extern char *metaServer2;
-extern char *metaServer3;
+extern char *metaServer[];
 extern int metaPort;
 #ifdef METAPING
 extern int metaPing;
@@ -169,7 +165,6 @@
 extern int newDashboard, old_db;
 extern int niftyNewMessages;
 extern int fastQuit;
-extern int babes;
 extern char *shipnos;
 extern int sock;
 extern int xtrekPort;
@@ -316,8 +311,9 @@
 
 extern W_Window messagew, w, mapw, statwin, baseWin, infow, tstatw,
     war, warnw, helpWin, teamWin[4], qwin, messwa, messwt, messwi,
-    messwk, planetw, rankw, playerw, optionWin, reviewWin;
-extern W_Window scanw, scanwin, udpWin, phaserwin, hintWin;
+    messwk, planetw, rankw, playerw, playerw2, optionWin, reviewWin;
+extern W_Window udpWin, phaserwin, hintWin;
+extern W_Window waitWin, qwin, countWin, motdButtonWin, motdWin;
 
 #ifdef SHORT_PACKETS
 extern W_Window spWin;
@@ -548,8 +544,10 @@
 extern char *ind_ship_bmp_M;
 
 // Added to fix thread creation issue
-HANDLE ThreadCreated;
-DWORD ThreadCreatedID;
+HANDLE MainThread;
+DWORD MainThreadID;
+HANDLE InputThread;
+DWORD InputThreadID;
 
 // Missing global variables
 #include <time.h>
@@ -561,7 +559,7 @@
 extern int mungScrollbarColors;
 extern int showMotd;
 
-extern char *saveFile;  /* file name to save options to */
+extern char * saveFile;  /* file name to save options to */
 extern int saveBig;     /* save options with comments */
 extern int saveMacro;   /* save options with macros */
 extern int saveRCD;     /* save options with RCD */
@@ -604,12 +602,23 @@
 
 extern int viewBox;     /* show local window box on map */
 
-extern struct stringlist *defaults; /* pointer to defaults list */
+extern struct stringlist * defaults; /* pointer to defaults list */
 
 /* DoubleBufering */
-extern SDBUFFER *localSDB;    /* double buffer for local window */
-extern SDBUFFER *mapSDB;      /* double buffer for map window */
+extern SDBUFFER * localSDB;    /* double buffer for local window */
+extern SDBUFFER * mapSDB;      /* double buffer for map window */
 
 extern int disableWinkey;   /* disable WinKey + ContextKey during the game */
 
+extern int exitFlag;        /* indicates exit state for W_WaitForEvent() */
+
+extern struct cons_buffer * consHead;    /* head of the linked list for console buffer */
+extern struct cons_buffer * consTail;    /* tail of the linked list for console buffer */
+
+extern int allowWheelActions;    /* allow mouse wheel actions */
+
+extern WNDPROC lpfnDefRichEditWndProc;  /* default window procedure for our richedit controls */
+
+extern int richText;    /* temporary variable to enable/disable rich text windows */
+
 #endif /* _h_data */