/* ===========================================================================

  IRISNETDRAW.H    Global variables and functions for IRISNETDRAW 

=============================================================================*/
#ifndef IRISNETDRAW_H
#define IRISNETDRAW_H

#ifdef IRISNETDRAW_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

// Classes
class IrisNetDraw
{
   private :
      int       lForcedUpdateSiteStatus;
      int       siteSelected;
      int       siteMove;
      int       skipRedraw;
      int       pointerOffsetX;
      int       pointerOffsetY;
      int       siteDoubleClicked;
      int       connectIdx;
      Pixel     blackPixel;
      Pixel     whitePixel;
      GC        fillGC;
      GC        defaultGC;
      GC        eraseGC;
      GC        blackGC;
      GC        whiteGC;
      GC        greenGC;
      GC        redGC;
      GC        yellowGC;
      Pixmap    radarGrn_pm;
      Pixmap    radarGrnRedX_pm;
      Pixmap    radarGrnYelX_pm;
      Pixmap    radarRed_pm;
      Pixmap    radarYel_pm;
      Pixmap    analGrn_pm;
      Pixmap    analGrnRedX_pm;
      Pixmap    analGrnYelX_pm;
      Pixmap    analRed_pm;
      Pixmap    analYel_pm;
      Pixmap    rvpGrn_pm;
      Pixmap    rvpGrnRedX_pm;
      Pixmap    rvpGrnYelX_pm;
      Pixmap    rvpRed_pm;
      Pixmap    rvpYel_pm;
      Pixmap    rcpGrn_pm;
      Pixmap    rcpGrnRedX_pm;
      Pixmap    rcpGrnYelX_pm;
      Pixmap    rcpRed_pm;
      Pixmap    rcpYel_pm;
      Pixmap    iris_pm;
      Pixmap    manuals_pm;
      Dimension irisNetDAWid;
      Dimension irisNetDAHgt;
      Window    irisNetDA_win;
      Pixmap    irisNetDA_pm;
      int       getAvailSite(void);
      int       checkDeleteLine(struct ConnectInfo connect_site_a, 
                  int x_a, int y_a);
      int       getAvailConnect(void);
      int       getConnectEdge(int x_a, int y_a, int *site_num_ptr_a,
                  int *connect_edge_ptr_a);
      void      getIconCenterEdge(int site_num_a, int connect_edge_a, 
                  int *x_ptr_a, int *y_ptr_a);
      void      redraw(void);
      Pixmap    getSitePixmap(struct SiteInfo site_a);
      GC        getConnectColor(int alloced_a, int start_site_num_a,
                  int stop_site_num_a);
   public  :
             IrisNetDraw();
      void   setupGraphics(void);
      GC     getFillGC(void);
      Window getIrisNetDA_win(void);
      Pixmap getIrisNetDA_pm(void);
      void   setHourglassCursor(void);
      void   setPointerCursor(void);
      void   unhighlightSite(void);
      void   setSiteDoubleClicked(int lsense_a);
      void   moveSite(int x_a, int y_a);
      void   nailSite(void);
      void   addSite(int x_a, int y_a);
      void   deleteSiteOrConnection(int x_a, int y_a);
      void   selectSite(int x_a, int y_a);
      void   connectSiteStart(int x_a, int y_a);
      void   connectSiteStop(int x_a, int y_a);
      void   connectSiteMove(int x_a, int y_a);
      void   forceUpdateSiteStatus(void);
      void   updateSiteStatus(void);
      void   updateAudio(UINT4 isite_num_a);
      void   updateHeartBeat(UINT4 imode_a);
      void   drawPixmap(Display *display, Window window, Pixmap pixmap,
                      unsigned long foreground, int x, int y, int w, int h);
      int    validDrop(int x_a, int y_a);

};

EXTERN IrisNetDraw irisNetDraw;


#undef EXTERN
#endif

