Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

GUILocate.hh

Go to the documentation of this file.
00001 /*
00002 
00003     GUI for locating
00004     Copyright (C) 2000-2001 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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             /* glib types */
00080             gint iGdkInputTag;
00081             GList *glServer;
00082             /* --- === --- */
00083             /* Gdk types */
00084             GdkGC *ggcLocateBG;
00085             GdkGC *ggcLocateFG;
00086             GdkCursor *gcCrossHair;
00087             /* --- === --- */
00088             /* Gtk+ widgets */
00089             // Top level
00090             GtkWidget *gwWindow;
00091             GtkWidget *gwVBox;
00092             // Table 1
00093             GtkWidget *gwTable1;
00094             GtkWidget *gwLServer;
00095             GtkWidget *gwCServer;
00096             GtkWidget *gwBConnect;
00097             // Table 2
00098             GtkWidget *gwTable2;
00099             GtkWidget *gwLPalette;
00100             GtkWidget *gwOMPalette;
00101             GtkWidget *gwMPalette;
00102             GtkWidget *gwaMIPalette[GUILOC_PALETTE_ITEMS];
00103             // Locate
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 

Generated on Sun Oct 26 19:11:20 2003 for HASAS by doxygen 1.3.3