00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <gtk/gtk.h>
00024
00025 #include <Alloc.hh>
00026
00027 #include "Config.h"
00028 #include "CfgFile.hh"
00029 #include "GtkUtils.hh"
00030 #include "Messages.hh"
00031 #include "Palette.hh"
00032 #include "SockClie.hh"
00033 #include "SockOp.hh"
00034
00035
00036 #ifndef GUILOCATE_HH
00037 #define GUILOCATE_HH
00038
00039 #define GUILOC_VER_MAJ GLOBAL_VERSMAJ
00040 #define GUILOC_VER_MIN GLOBAL_VERSMIN
00041 #define GUILOC_VER_PL GLOBAL_VERSPL
00042 #define GUILOC_WSPACING 8
00043 #define GUILOC_ENTRY_WIDTH 80
00044 #define GUILOC_SERVER_MAXLEN 256
00045 #define GUILOC_LOCATE_BG 0x00000000
00046 #define GUILOC_LOCATE_FG 0x00ffffff
00047
00048 #define GUILOC_PALETTE_ITEMS 9
00049
00050
00054 enum
00055 {
00056 GUILOC_PAL_BW = 0,
00057 GUILOC_PAL_HSV = 1,
00058 GUILOC_PAL_LIGHT = 2,
00059 GUILOC_PAL_TEMP = 3,
00060 GUILOC_PAL_DIR = 4,
00061 GUILOC_PAL_GREEN = 5,
00062 GUILOC_PAL_GREEN2 = 6,
00063 GUILOC_PAL_PUREGREEN = 7,
00064 GUILOC_PAL_WB = 8
00065 };
00066
00067
00071 class clGUILocate
00072 {
00073 bool bRun;
00074 bool bConnected;
00075 int iPalette;
00076 int iMsgSize;
00077 stLocateHdr sHdr;
00078 stLocateRes sRes;
00079
00080 gint iGdkInputTag;
00081 GList *glServer;
00082
00083
00084 GdkGC *ggcLocateBG;
00085 GdkGC *ggcLocateFG;
00086 GdkCursor *gcCrossHair;
00087
00088
00089
00090 GtkWidget *gwWindow;
00091 GtkWidget *gwVBox;
00092
00093 GtkWidget *gwTable1;
00094 GtkWidget *gwLServer;
00095 GtkWidget *gwCServer;
00096 GtkWidget *gwBConnect;
00097
00098 GtkWidget *gwTable2;
00099 GtkWidget *gwLPalette;
00100 GtkWidget *gwOMPalette;
00101 GtkWidget *gwMPalette;
00102 GtkWidget *gwaMIPalette[GUILOC_PALETTE_ITEMS];
00103
00104 GtkWidget *gwSWLocate;
00105 GtkWidget *gwDALocate;
00106
00107 clAlloc ResMsg;
00108 clAlloc ResMatrix;
00109 clAlloc ResFrame;
00110 clCfgFile Cfg;
00111 clGtkUtils GtkUtils;
00112 clLocateMsg Msg;
00113 clPalette Pal;
00114 clSockClie SClient;
00115 clSockOp SOp;
00116 bool GetCfg ();
00117 bool Build ();
00118 bool BuildTable1 ();
00119 bool BuildTable2 ();
00120 bool BuildLocate ();
00121 bool ConnectSignals ();
00122 bool BuildDrawingPrims ();
00123 bool ConnectToServer (const char *, int);
00124 void DisplayResults ();
00125 public:
00126 clGUILocate ();
00127 ~clGUILocate ();
00128 int Main (int *, char ***);
00129 gboolean OnDelete (GtkWidget *, GdkEvent *, gpointer);
00130 void OnConnectClick (GtkButton *, gpointer);
00131 void OnPaletteActivate (GtkMenuItem *, gpointer);
00132 gboolean OnLocateExpose (GtkWidget *, GdkEventExpose *, gpointer);
00133 gboolean OnLocateMotion (GtkWidget *, GdkEventMotion *, gpointer);
00134 void OnGdkInput (gpointer, gint, GdkInputCondition);
00135 };
00136
00137 #endif
00138