/* **********************************************************************
 * *                                                                    *
 * *      Global Variables and Functions for WINDOW                     *
 * *                                                                    *
 * **********************************************************************
 * File: iris/window/window.h
 *
 *                  COPYRIGHT (c) 2000, 2002, 2003  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 * 
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */

#ifndef WINDOW_H
#define WINDOW_H

#ifdef WINDOW_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif


//#define DEBUG_PRINTF


/* defines */
#define DEG_CHAR          176


#define NO_TOOL            0
#define CONTROL_TOOL       1
#define CURSOR_TOOL        2
#define TRACK_TOOL         3
#define ANIMATION_TOOL     4
#define FORECAST_TOOL      5
#define XSECT_TOOL         6
#define COLOR_TOOL         7
#define DPYOPTIONS_TOOL    8
#define PRODUCT_TOOL       9
#define PRODUCT_TIME_TOOL  10 
#define OPTIONS_TOOL       11 
#define SITE_TOOL          12 
#define EXPORT_TOOL        13 
#define MULTILAYER_TOOL    14 
#define SLIDESHOW_TOOL     15 
#define LIVE_TOOL          16 

#define  PIXMAP_TYPE_ICON   1
#define  PIXMAP_TYPE_LABEL  2
#define  PIXMAP_SENSITIVE   1
#define  PIXMAP_DESENSITIVE 2

#define LOOP_EVENT_STOP              1
#define LOOP_EVENT_PLAY_FWD          2
#define LOOP_EVENT_PLAY_FWD_REVS     3
#define LOOP_EVENT_PLAY_REVS         4
#define LOOP_EVENT_STEP_FWD          5
#define LOOP_EVENT_STEP_REVS         6
#define LOOP_EVENT_TOGGLE            7

#define LOOP_STATE_STOP      1
#define LOOP_STATE_FWD       2
#define LOOP_STATE_REVS      3
#define LOOP_STATE_FWD_REVS  4

#define SLIDE_SHOW_EVENT_STOP        1
#define SLIDE_SHOW_EVENT_START       2

#define SLIDE_SHOW_STATE_STOP        1
#define SLIDE_SHOW_STATE_START       2

#define XSECT_WINDOW_SMALL      1
#define XSECT_WINDOW_LARGE      2

#define WINDOW_FILE_FORMAT  "window_file_format_2_10_98"

#define ZOOM1               1
#define ZOOM2               2
#define ZOOM3               3
#define ZOOM4               4

#define SIZE_MEDIUM         1
#define SIZE_MEDIUM_LGND    2
#define SIZE_LARGE          3
#define SIZE_LARGE_LGND     4
#define SIZE_XLARGE         5
#define SIZE_XLARGE_LGND    6

#define LAT_LON_UNITS_DEG    1
#define LAT_LON_UNITS_MIN    2

#define SPEED_M_SEC          1
#define SPEED_KM_HR          2
#define SPEED_KNOTS          3
#define SPEED_MPH            4

#define MULTILAYER_UP        1
#define MULTILAYER_DOWN      2

#define USER_TYPE_OBSERVER   1
#define USER_TYPE_OPERATOR   2

#define RIGHT_MOUSE_TOOLS    1

#define RES_CONVERT( res_name, res_value) \
        XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1

class WindowXParams
{
   public :
      SINT4        iWindowImageDepth;
      SINT4        iIconDepth;               //depth of icon pixmap
      SINT4        iIconImageDepth;          //depth of icon image
      UINT2        lDrawingAreaEnter;
      UINT4        iCurrentMode;
      SINT4        iUserKickOutTime;         //minutes
      SINT4        iStaleImageKickOutTime;         //minutes
      UINT2        lStaleImageFault;      
      UINT2        lBadDataFault;      
      UINT2        lWindowScrolling;
      UINT2        lWindowExposing;
      XtIntervalId windowExposingTimerID;
      Display      *getDisplay(void);
      Visual       *getVisual(void);
      Screen       *getScreen(void);
      Pixmap       slideShowStartPM;
      Pixmap       slideShowStopPM;
      SINT4        getDepth(void);
      XtAppContext getAppContext(void);
      GC           getCopyGC(void);
      GC           getWhiteGC(void);
      GC           getBlackGC(void);
      GC           getRedGC(void);
      Window       getDrawAreaWnd(void);
      Window       getRootWnd(void);
      Window       getColorScaleWnd(void);
      Widget       getTopWidget(void);
      Widget       getWindowApplShellWidget(void);
      void         init();
      void         setSiteID(void);
      void         manageLiveScrollBars(UINT2 lmanage_scrollbars_a);
      void         setSensitiveLiveScrollBars(UINT2 lsensitive_scrollbars_a);
      void         setLiveScrollBarSliderSize(int islider_size_a);
      void         setLiveScrollBarMax(int imax_range_aa);
      void         initLiveScrollBar(void);
      void         movedLiveScrollBar(void);
      void         setLiveRadarPosition(void);
      void         getScrlBarPos(SINT4 *x_a, SINT4 *y_a);
      void         getScrlBarSize(SINT4 *width_a, SINT4 *height_a);
      void         setScrlBarXAndWidth(SINT4 x_a, SINT4 width_a, SINT4 mag_a);
      void         setScrlBarYAndHeight(SINT4 y_a, SINT4 height_a, SINT4 mag_a);
      void         setDABackgroundColor(const char * color_a);
      void         setDAWidthHeight(SINT4 width_a, SINT4 height);
      void         setWindowWidthHeight(SINT4 width_a, SINT4 height);
      void         getWindowWidthHeight(SINT4 *width_a, SINT4 *height);
      void         setWindowTitle( SINT4 mag_a, SINT4 image_width_a, SINT4 image_height_a,
                     const char *stime_a );
      void         changeToolTypeButtonState(UINT4 tool_type_a, UINT2 lset_a);
      void         setProductTimeScaleMax(UINT4 max_a);
      void         setProductTimeScaleValue(UINT4 val_a);
      void         setIconPixmap(XImage *image_icon_a);
      void         setExposeDelay(void);
      void         changeControlPanelState(void);
      void         checkOptionsToolValid(SINT4 iprod_type_a);
      void         setProductInfo(const char *prod_type_a, 
                                  const char *prod_name_a,
                                  const  char *task_name_a,
                                  const char *str1_a, const char *str2_a);
      void         setProductTimeDate(const char *time_a, const char *date_a);
      void         setColorScaleLabels(char left_lab[16][8],
                     char right_lab[16][8], SINT4 lab_cnt);
      void         setColorScale(UINT4 pixel_value_a[2][16], 
                      SINT4 lab_cnt_a, UINT2 lnew_colors_a);
      void         setColorScaleLabel(const char *scale_label_a, UINT2 lnew_label_a);
      void         setLoopStateBtns(UINT4 loop_state_a);
      void         setSlideShowStateEnableTgl(UINT4 slide_show_state_a);
      void         setWindowModeTxtF(UINT2 iwindow_mode_a);
      void         notifyServerOfWindowMode(void);
      void         resetUserKickOutTime(void);
      void         resetStaleImageKickOutTime(void);
      void         setOperatorPrivilegeTgl(void);
      void         manageBadDataLab(char *stxt_a);
      void         manageStaleImageLab(char *stxt_a);
      void         unmanageBadDataLab(void);
      void         unmanageStaleImageLab(void);
  private :
      Display      *dpyPtr;
  //      Visual       *visualPtr;
      Screen       *screenPtr;
      SINT4        iWindowDepth;      /* Depth of window */
      XtAppContext appContext;


      GC           copyGC;
      GC           blackGC;
      GC           whiteGC;
      GC           redGC;
      GC           eraseGC;
      Window       drawAreaWnd;
      Window       rootWnd;
      Window       colorScaleWnd;
      Window       colorScaleLabelWnd;
      Pixmap       colorScalePM;
      Pixmap       colorScaleLabelPM;
      Widget       vertScrlBar_wgt;
      Widget       horzScrlBar_wgt;
      Dimension    colorScaleDAWid;
      Dimension    colorScaleDAHgt;
      Dimension    colorScaleLabelDAWid;
      Dimension    colorScaleLabelDAHgt;
      Widget       topWidget;
      FLT4         fLiveSliderSize;
      FLT4         fLiveSliderZoom;
      FLT4         fLiveScrollBarCenterX;
      FLT4         fLiveScrollBarCenterY;

};
EXTERN WindowXParams windowXParams;

class CursorTool 
{
   private :
   public :
      UINT4 curLatLonUnits;
      UINT2 lValidLat;
      UINT2 lValidLon;
      FLT4  fLat;
      FLT4  fLon;
      void create(Widget parent);
      void popup(void);
      void popdown(void);
      void setValueTxtF(char *value_a);
      void setLatTxtF(FLT4 fLat_a, UINT2 lValid_a);
      void setLonTxtF(FLT4 fLon_a, UINT2 lValid_a);
      void setHeightTxtF(char *height_a);
      void setNorthTxtF(char *north_a);
      void setEastTxtF(char *east_a);
      void setRangeTxtF(char *range_a);
      void setSlantTxtF(char *slant_a);
      void setBearingTxtF(char *bearing_a);
      void setElevTxtF(char *elev_a);
      void setHomeTxtF(char *home_a);
};
EXTERN CursorTool cursorTool;


class TrackTool 
{
   private :
      unsigned int cursorHeight;
      unsigned int cursorWidth;
   public :
      UINT4 curTextPixelValue;
      UINT4 curAction;
      UINT4 curFontIdx;
      UINT4 curIconIdx;
      UINT4 curLatLonUnits;
      UINT4 curSpeedUnits;
      UINT2 lValidLat;
      UINT2 lValidLon;
      UINT2 lValidSpeed;
      FLT4  fLat;
      FLT4  fLon;
      FLT4  fSpeed;
      void create(Widget parent);
      void popup();
      void popdown();
      void loadIconList(char *sptr_a, SINT4 ilen_a);
      void loadFontList(char *sptr_a, SINT4 ilen_a);
      void loadTrackListPB(char *track_name, UINT4 track_idx);
      void loadTrackList(char *sptr_a, SINT4 ilen_a);
      void loadTrackTextListPB(char *track_txt, UINT4 track_txt_idx);
      void loadTrackTextList(char *sptr_a, SINT4 ilen_a);
      void setNameTxtF(char *sname_a);
      void setActionOM(UINT4 action_type_a);
      void setTextColor(UINT4 icolor_a);
      void setIconOM(UINT4 icon_idx_a);
      void setTextTxtF(const char *text_a);
      void setTargetTxtF(const char *target_a);
      void setLastPointTxtF(const char *lat_a);
      void setLatTxtF(FLT4 fLat_a, UINT2 lValid_a);
      void setLonTxtF(FLT4 fLon_a, UINT2 lValid_a);
      void setSpeedTxtF(FLT4 fSpeed_a, UINT2 lValid_a);
      void setDirectionTxtF(const char *dir_a);
      void setForecastTxtF(UINT4 time_sec_a);
      void setRangeTxtF(const char *range_a);
      void setBearingTxtF(const char *bearing_a);
      void setTimeToTxtF(const char *time_to_a);
      void setTimeAtTxtF(const char *time_at_a);
      void setApproachTxtF(const char *approach_a);
      void createPointCursor(void);
      void createTextCursor(void);
      void createIconCursor(void);
};
EXTERN TrackTool trackTool;

class AnimationTool 
{
   private :
   public :
      void create(Widget parent);
      void popup();
      void popdown();
      void setLoopStateBtns(UINT4 loop_state_a);

      void setFramesTxtF(const char *frames_a);
      void setSpanTxtF(const char *span_a);
      void setSkipScaleTxtF(UINT4 iskip_a);
      void setMaxTimeScaleTxtF(UINT4 imax_speed_a);
      void setSpeedScaleTxtF(FLT4 fspeed_a);
      void setPauseScaleTxtF(UINT4 ipause_a);
      void setMostRecentTgl(UINT2 lmost_recent_a);
      void setCurrentFrameTgl(UINT2 lcurrent_frame_a);
      void setEndTimeTxtF(const char *end_time_txt_a);
};
EXTERN AnimationTool animationTool;

class SlideShowTool 
{
   private :
   public :
      void  create(Widget parent);
      void  popup();
      void  popdown();
      void  loadSlideShowWgts(UINT4 inum_slides_in_show,
              struct SlideShowList slide_list[]);
      void  loadProductList(char *sptr_a, SINT4 ilen_a);
      void  loadTaskList(char *sptr_a, SINT4 ilen_a);
      UINT2 loadSlideListRqst(
         struct SlideShowList slide_list_rqst_a[]);
      void setSlideShowStateEnableTgl(UINT4 slide_show_state_a); 
};
EXTERN SlideShowTool slideShowTool;

class ForecastTool 
{
   private :
   public :
      UINT4 curSpeedUnits;
      void  create(Widget parent);
      void  popup();
      void  popdown();
      void  loadForecastProductList(char *sptr_a, SINT4 ilen_a);
      void  loadForecastOptions(char *sptr_a, SINT4 ilen_a);
      void  updateForecastOptions(void);
      void  setInputProduct(const char *site_type_a,
            const char *name_a, const char *time, const char *date_a);
      void setSensitive(UINT2 lset_a);
};
EXTERN ForecastTool forecastTool;

class XSectTool 
{
   private :
   public :
     #define DATA_DISPLAY_LIST_MAX (18)
      SINT2 iDataIn[DATA_DISPLAY_LIST_MAX];
      SINT2 iDataOut[DATA_DISPLAY_LIST_MAX];
      void create(Widget parent);
      void popup();
      void popdown();
      void setSizeOM(UINT2 size_a);
      void setDataOM(UINT2 data_a);
      void setHeightTxtF(const char *height_a);
      void setWidthTxtF(const char *width_a);
      void setOrientTxtF(const char *orient_a);
      void setRangeTxtF(const char *range_a);
      void setAzTxtF(const char *az_a);
      void setStatusTxtF(const char *status_a);
      void loadDataOut(void);
};
EXTERN XSectTool xSectTool;


class XSectWindow 
{
  private :
    SINT4  iCursorPosX;
    SINT4  iCursorPosY;
  public :
    UINT2  lCursorToolPoppedUp;
    XImage *xImage;
    void  create(Widget parent);
    void  popup(UINT1 *image_ptr_a, SINT4 image_wid_a, SINT4 image_hgt_a);
    void  popdown();
    UINT2 isManaged();
    void  loadImage(UINT1 *image_ptr_a, SINT4 image_wid_a, SINT4 image_hgt_a);
    void  drawCursor(SINT4 ix_a, SINT4 iy_a);
    void  exposeCursor();
    void  eraseCursor();

};
EXTERN XSectWindow xSectWindow;

class DpyOptionsTool 
{
   private :
   public :
      void create(Widget parent);
      void popup();
      void popdown();
};
EXTERN  DpyOptionsTool  dpyOptionsTool;

class SetLonLatTool 
{
   private :
   public :
      void create(Widget parent);
      void popup();
      void popdown();
      void loadCurrentHome(void);
      void loadHomeListPB(char *home_point_nume, UINT4 home_point_idx);
      void loadHomeList(char *sptr_a, SINT4 ilen_a);
      void loadSelectedHome(char *sptr_a, SINT4 ilen_a);
      void updateLonLat(void);
};
EXTERN  SetLonLatTool  setLonLatTool;

class ProductTool 
{
   private :
      void setProductTypePB(void);
   public :
      SINT4 iRqstProductType;
      char  sRqstProductName[16];
      void  create(Widget parent);
      void  popup();
      void  popdown();
      void  loadProductTypes(char *sptr_a, SINT4 ilen_a);
      void  loadProductList(char *sptr_a, SINT4 ilen_a);
      void  changeProductType(Widget wgt_a);
};
EXTERN  ProductTool  productTool;

class ProductTimeTool 
{
   private :
   public :
      void   create(Widget parent);
      void   popup();
      void   popdown();
      void   loadProductTimes(struct server_timelist List_a[], SINT4 ilen_a);
      void   loadTaskTimes(char *sptr_a, SINT4 ilen_a);
};
EXTERN  ProductTimeTool  productTimeTool;


class SiteTool
{
   private :
   public :
      UINT4 iRqstProductSiteNum;
      void  create(Widget parent);
      void  popup();
      void  popdown();
};
EXTERN  SiteTool siteTool;

class LiveTool
{
   private :
   public :
      void  create(Widget parent);
      void  popup();
      void  popdown();
      UINT2 isManaged();
      void  setSensitive(UINT2 lsensitive_a);
      void  update();
      void  loadTaskList( char *sptr_a, SINT4 ilen_a );
      void  loadTaskInfoFromIsmFind( char *sptr_a, SINT4 ilen_a );
      void  loadErrorFromIsmFind( const char *sptr_a);
      void  updateAfterToggle(void);
      void  setStatusTxtF( const char *sptr_a);
};
EXTERN  LiveTool liveTool;


class ExportTool
{
   private :
   public :
      void  create(Widget parent);
      void  popup();
      void  popdown();
};
EXTERN  ExportTool exportTool;

class MultiLayerTool
{
   private :
   public :
      SINT4 iHeightBottom;
      SINT4 iLayerStep;
      SINT4 iMaxNumLayers;
      SINT4 iCurLayerIdx;
      void  create(Widget parent);
      void  popup();
      void  popdown();
      void  requestPSO(void);
      void  loadPSO(char *sptr_a, UINT4 ilen_a);
      void  updateScale(SINT4 isize, SINT4 iscale, SINT4 ihgt);
      void  getNewLayer(UINT4 up_down);

};
EXTERN  MultiLayerTool multiLayerTool;

class ErrorDiag 
{
   private :
   public :
      void  create(Widget parent);
      void  popup(const char *err_str_a);
      void  popdown();
};
EXTERN  ErrorDiag errorDiag;

class PrivilegeTool
{
   private :
   public :
      void  create(Widget parent);
      void  popup(void);
      void  popdown(void);
};
EXTERN  PrivilegeTool privilegeTool;

class WarnTool
{
   private :
   public :
      void  create(Widget parent);
      void  popup();
      void  popdown();
      void  requestPSO(void);
      void  loadPSO(char *sptr_a, UINT4 ilen_a);
};
EXTERN  WarnTool warnTool;

#define MAX_CATCH_WINDOWS 10
class CatchWindow
{
   private :
 
      UINT4   iWinWid;          //Saved Param
      UINT4   iWinHgt;          //Saved Param
      UINT4   iColorIdx;        //Saved Param
      UINT4   iScaleIdx;        //Saved Param
      UINT2   lSave;
      UINT4   iHourCount;
      UINT4   iSpan;
      FLT4    fRainHourly[96];
      Widget  mainDiagWgt;
      Widget  daWgt;
      Window  wnd;
      Pixmap  pm;
      GC      colorGC;
      GC      fontGC;
      GC      fontRedGC;
      void    createDiag(char *diagTitle_a);
      void    loadParams(void);
   public :
      CatchWindow(void);
      UINT2  createDrawData(UINT4 iwin_num_a, 
              struct server_catch_results *catch_results_a, SINT4 ilen_a);
      UINT2  avail(void);

      void   saveParams(void);
      void   setSaveFlag(void);
      Widget getMainDiagWgt(void);
      void   draw(UINT2 iscale_chg_a);
      void   copyPmToWnd(UINT4 ix_a, UINT4 iy_a, UINT4 iw_a, UINT4 ih_a);
      void   changeColor(UINT4 icolor_idx_a);
      void   destroyMakeAvail(void);

};
EXTERN  CatchWindow catchWindow[MAX_CATCH_WINDOWS];

#define MAX_GAGE_WINDOWS 10
class GageWindow
{
   private :
 
      UINT4   iWinWid;          //Saved Param
      UINT4   iWinHgt;          //Saved Param
      UINT4   iColorIdx;        //Saved Param
      UINT4   iScaleIdx;        //Saved Param
      UINT2   lSave;
      UINT4   iHourCount;
      UINT4   iFlag;
      UINT4   iSpan;
      FLT4    fRainHourly[96];
      FLT4    fZRConst[96];
      FLT4    fZRExp[96];
      Widget  mainDiagWgt;
      Widget  daWgt;
      Widget  titleLabWgt;
      Window  wnd;
      Pixmap  pm;
      GC      colorGC;
      GC      fontGC;
      GC      fontRedGC;
      void    createDiag(char *diagTitle_a);
      void    loadParams(void);
   public :
      GageWindow(void);
      UINT2  createDrawData(UINT4 iwin_num_a, 
              struct server_catch_results *catch_results_a, SINT4 ilen_a);
      UINT2  avail(void);

      void   saveParams(void);
      void   setSaveFlag(void);
      Widget getMainDiagWgt(void);
      void   draw(UINT2 iscale_chg_a);
      void   copyPmToWnd(UINT4 ix_a, UINT4 iy_a, UINT4 iw_a, UINT4 ih_a);
      void   changeColor(UINT4 icolor_idx_a);
      void   destroyMakeAvail(void);

};
EXTERN  GageWindow gageWindow[MAX_GAGE_WINDOWS];

#define MAX_ICON_SIZE   100

#ifdef SIGMET_HEADERS_H
#ifdef SIGMET_PROJECTION_H
class WindowParams
{
   private :
      SINT4        iImageReceiverPID;
      UINT4        iToolType;
      XtInputId    appInputID;
      char         sDataUnits[10];
      char         sLeftCenterLab[16][8];
      char         sCenterLab[16][8];
      char         sRightCenterLab[16][8];
      char         sCrossDataUnits[10];
      char         sCrossLeftCenterLab[16][8];
      char         sCrossCenterLab[16][8];
      char         sCrossRightCenterLab[16][8];
      char         *cbuffer_ptr; //Malloced storage for xZoomImage
      int          iLoopState;
      void         setDataUnitsStr(char *sdata_units_a);
      void         setCrossDataUnitsStr(char *sdata_units_a);

   public :
     /* Cannot use scale_text structure here because of includes*/
      char         sNodeName[20];
      char         sAliasName[20];
      UINT2        lHasOperatorPrivilege;
      UINT4        iScaleCount;
      UINT2        lSkipExpose;
      UINT2        lMoveXScrlBar;
      UINT2        lMoveYScrlBar;
      UINT2        lImageDataValid;
      UINT2        lProductOnScreen;
      UINT2        lProductIsLive;
      UINT2        lZoomImage;
      SINT4        iMag;              // Current zoom 1, 2, 3, 4
      SINT4        iOldMag;              // Current zoom 1, 2, 3, 4
      SINT4        iWinNum; 
      SINT4        iDeviceNum;
      SINT4        iReadFD;
      SINT4        iClntRecvReadFD;
      SINT4        iDisplayMaxWidth;  // Display Max Width 
      SINT4        iDisplayMaxHeight; // Display Max Height
      SINT4        iCustWinWidth;     // Custom Window Width - Scrollbar
      SINT4        iCustWinHeight;    // Custom Window Height - Scrollbar
      unsigned int iIconWidth;
      unsigned int iIconHeight;
      SINT4        iScrlBarXPos;      // scrollbar x pos
      SINT4        iScrlBarYPos;      // scrollbar y pos
      SINT4        iScrlBarOffset;    // Corrects for different sb thickness 
      SINT4        iWinWidth;         // Window Width - Scrollbar 
      SINT4        iWinHeight;        // Window Height - Scrollbar 
      SINT4        iWinWidthOffset;   // 
      SINT4        iWinHeightOffset;  // 
      SINT4        iDrawAreaWidth;    // Drawing Area Width 
      SINT4        iDrawAreaHeight;   // Drawing Area Height 
      SINT4        iImageWidth;       // Image Width
      SINT4        iImageHeight;      // Image Height 
      SINT4        iOnScreenProductTimesCnt;
      struct server_timelist onScreenProductTimes[MAX_SCROLL_SIZE];
      struct on_screen_picture8 *pOnScreen;  /* Pointer to current on_screen_picture8 */
      UINT1 *pImage;                        /* Current image on the screen */
      UINT1 *pCrossImage;
      UINT4 iStandardVtvMapServer[256];
      UINT4 iStandardVtvMapClient[256];
      XImage *xImageZoom;

      void         init(void);
      MESSAGE      pwrUp(SINT2 iunit_a);
      void         execImageReceiver(void);
      void         connectToServer(void);
      void         disconnectFromServer(void);
      void         iWinGetUnit (unsigned int argc_a, char** argv_a);
      void         MapSharedMemory(void);
      void         sendWindowReady(void);
      void         sendImageReceived(void);
      void         sendWindowSize(SINT4 width_a, SINT4 height_a);
      void         requestProductTimesScale(void);
      void         requestTaskTimesScale(void);
      void         loadProductTimesScale(struct server_timelist List_a[], SINT4 ilen_a);
      void         loadTaskTimesScale(char *sptr_a, SINT4 ilen_a);
      void         popupToolType(UINT4 tool_type_a);
      void         popdownAllTools(void);
      void         loadColorScaleTextLabels(void); 
      void         loadCrossColorScaleTextLabels(struct on_screen_picture8 *ponscreen_a); 
      void         setLoopState(UINT4 loop_event_a);
      UINT2        lLoopStateStop();
      void         setSlideShowState(UINT4 slide_show_event_a);
      char*        getDataUnitsStr(void);
      char*        getLeftCenterLabStr(UINT4 idx_a);
      char*        getCenterLabStr(UINT4 idx_a);
      char*        getRightCenterLabStr(UINT4 idx_a);
      char*        getCrossDataUnitsStr(void);
      char*        getCrossLeftCenterLabStr(UINT4 idx_a);
      char*        getCrossCenterLabStr(UINT4 idx_a);
      char*        getCrossRightCenterLabStr(UINT4 idx_a);
      void         launchHelp(const char *help_str_a);
};
EXTERN WindowParams windowParams;
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_HEADERS_H */

void readImageFromSharedMemory(XtPointer client_data_a,
   int *ipipe_read_fd_a, XtInputId *id_a);

void readDataFromIrisServer(XtPointer client_data_a,
   int *ipipe_read_fd_a, XtInputId *id_a);


void decodeImage(void); 
void drawRedX(void);
void magAndRedrawImage (int iexp_x, int iexp_y, int iexp_w, int iexp_h);
void magAndCenterImage(SINT4 imag_a);
void BuildLegendTime         /* File: imageReceive.C */
( char sTime_a[16],            /* Time string returned here */
  const struct ymds_time *pDisplayYmds_a );  /* Time to format */


int readXWDImage(char *filename_and_path);  /* File: imageFromXWD.C */
void createImageAllocColors                 /* File: imageAllocColors.C */
(unsigned char *image_data_a,
 int bytes_per_line_a, int width_a, int height_a,
 XColor *colors_a, int ncolors_a);

void freeImageFreeColors(void);

EXTERN volatile struct output_to_window_info8 *pshared_control_c;
EXTERN UINT1 *pshared_data_c;
EXTERN SINT4 ishared_size_c;
EXTERN SINT4 ishared_channel_c;

/* Move these somewhere else later */
EXTERN Colormap           Colormap_c;
EXTERN XVisualInfo        VisualInfo_c;

/* Window configuration params 
** Currently just loading slide show data
*/
EXTERN struct WindowSetup windowSetup_c;



#undef EXTERN
#endif
