/* *********************************************************************
 * *                                                                   *
 * * Header file for uxsig                                             *
 * *                                                                   *
 * *********************************************************************
 * File: libs/include/uxsig_lib.h
 *
 *               COPYRIGHT (c) 1996, 1999, 2002, 2006 BY
 *            VAISALA INC., 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 SIGMET_UXSIG_LIB_H
#define SIGMET_UXSIG_LIB_H 1

#ifdef __cplusplus
extern "C" {
#endif

/* PRINTER QUEUE */
#define PRINTER_TOTAL_QUES     4
#define SS_MIN_QUADS      2
#define SS_MAX_QUADS      6

  /* Background color to use for the body of IRIS windows created in the uxsig library.
   * The foreground color to go with this should be "Black".
   */
#define UXSIG_BACK_COLOR "#C5B2A8"

  /* Background color to use for text fields created in the uxsig library.
   * The foreground color to go with this should be "White".
   */
#define UXSIG_TEXT_COLOR "#66717F"


/*************************************************************
**   xfunc.c 
**************************************************************/
extern char    *XsGetLabelString(Widget wgt);
extern char    *XsGetOptionString(Widget wgt);
extern void     XsWriteLabelVertical(Widget wgt);
extern XtArgVal XsGetPixel(Widget wgt, const char *colorstr);
extern void     XsPutTrans(Widget wgt, char *transTbl);
extern void     XsDrawGrid(Widget wgt, int gridLinesX, int gridLinesY,
                           int leftOffSet, int rightOffset);
extern void     XsWriteXGridVals(Widget wgt[], int startVal, int endVal,
                                 int numLines,  int width,  int xPos);
extern void     XsWriteYGridVals(Widget wgt[], int startVal, int endVal,
                                 int numLines,  int height,  int yPos);

  extern Pixmap  XsCreateCursor
  (Display *disp, const char *abitmap, const char *abitmap_mask);
  extern Pixmap  XsCreateColorCursorFromFile
  (Display *disp, const char *abitmap, const char *abitmap_mask,
   Pixel bitmap_color, Pixel bitmap_mask_color);
  
  extern Pixmap XsCreateColorCursorFromPixmap(Display *disp,
					      Pixmap pixmap, Pixmap pixmap_mask,
               Pixel bitmap_color, Pixel bitmap_mask_color, int hotx, int hoty);
extern void    execErrDiag(const char *err_title_a, const char *err_msg_a);

/*************************************************************
** ouput_file_format.c
**************************************************************/
extern void imageToFileFormat(Window window_a, char *hostname_a,
   char *path_filename_a, int file_format_type_a);
extern void imageToFileFormat1(Window window_a, char *hostname_a,
   char *path_filename_a, int file_format_type_a);


/*************************************************************
** printer_setup.c 
**************************************************************/
void  setPrinterNameOfQueSelected(const char *printer_name_of_que);
const char *getPrinterNameOfQueSelected(void);
int   getPrinterNumOfQues(void);
const char *getPrinterNameOfQue(int que_num);
void  loadPrinterQues(void);

int   isPrinterQueSelected(void);
void  checkPrintSensitive(Widget print_wgt);

void   setPrinterHourglass(void);
Pixmap getPrinterHourglass(void);
void   setPrinterWindowID(Window window_id);
Window getPrinterWindowID(void);

void  setPrinterOutputFilename(const char *printer_output_filename);
const char  *getPrinterOutputFilename(void);

void  getPrinterImageWidthHeight(int *image_width, int *image_height);
void  setPrinterOutputFormat(int output_format);
int   getPrinterOutputFormat(void);
void  setPrinterPaperSizeIdx(int paper_size_idx);
int   getPrinterPaperSizeIdx(void);
void  setPrinterPaperOrientation(int paper_orientation);
int   getPrinterPaperOrientation(void);
void  setPrinterImagePosition(int image_position);
int   getPrinterImagePosition(void);
void  setPrinterImageSize(int image_size);
int   getPrinterImageSize(void);
void  setPrinterImageColor(int image_color);
int   getPrinterImageColor(void);

/* this is hidden features. they can be set by holding down the Shift and
** Ctrl key along the pressing Button 1
*/
void  setPrinterPaperSuperSize(int num_wid_hgt_quad);
void  getPrinterPaperSuperSize(int *num_wid_hgt_quad);
void  setPrinterPaperQuadSel(int sel_quad);
int   getPrinterPaperQuadSel(int sel_quad);


void  loadPrinterSetup(void);
void  savePrinterSetup(void);
void  print_timer_cbf( XtPointer cdata_a, XtIntervalId *id_a );
void  printer_options(int option_type);
int   getWindowManagerType(void);

/*************************************************************
** uxprinter_setup.c 
**************************************************************/
/* create printer setup. This should be called at initial startup */
void createUxPrinterSetup(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);

void destroyUxPrinterSetup(void);

/* Poping up printer setup */
void popupUxPrinterSetup(void);

/*************************************************************
** uxmsgbox.c 
**************************************************************/
/* create message box. This should be called at initial startup */
void createUxMsgBox(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);

void destroyUxMsgBox(void);

/* pop down message box. This is only needed when maybe you need 
** a message box to popped down from a timeout routine */
void popdownUxMsgBox(void);

/* Before Poping up message box you should use the below 
** setUxMsgBox... function to configure the message box the way 
** you want it. */
void popupUxMsgBox(void);
void popupUxMsgBoxXY(int ix_a, int iy_a);

/* This is a quick popup.  Just pass the message label
** and bitmap */
void popupUxMsgBoxWithMsg(const char *msg_label, const char *msg_bitmap);

void setUxMsgBoxModeless(void);
void setUxMsgBoxApplicationModal(void);


/* Pass a message label and message bitmap.  Bitmaps can be found in 
** /usr/sigmet/bin/bitmaps.  Use the bitmaps starting with xm_
** or create your own.  */ 
void setUxMsgBoxMsgLabAndBitmap(const char *msg_label, const char *msg_bitmap);


/* The below four button fuctions  can be used in the msgbox.  Just pass in
** the button label string, a fuction to call if the button is pressed,
** NULL if no fuction is needed,  and finially TRUE or FALSE if message
** box should popdown when a button is pressed.  */
void setUxMsgBoxOkLabAndFunc(
     const char  *ok_label,
     void  (*ok_func_ptr)(void),
     int   ok_unmanage_when_pushed);

void setUxMsgBoxApplyLabAndFunc(
     const char  *apply_label,
     void  (*apply_func_ptr)(void),
     int   apply_unmanage_when_pushed);

void setUxMsgBoxCancelLabAndFunc(
     const char  *cancel_label,
     void  (*cancel_func_ptr)(void),
     int   cancel_unmanage_when_pushed);

void setUxMsgBoxHelpLabAndFunc(
     const char  *help_label,
     void  (*help_func_ptr)(void),
     int   help_unmanage_when_pushed);

/*************************************************************
** uxfileselbox.c 
**************************************************************/
/* create file selection box. This should be called at initial startup */
void createUxFileSelBox(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);

/* pop down file selection box. This is only needed when maybe you need 
** a message box to popped down from a timeout routine */
void popdownUxFileSelBox(void);

/* Before Poping up file selection box you should use the below 
** setUxMsgBox... function to configure the message box the way 
** you want it. */
void popupUxFileSelBox(void);

/* Dir and pattern to search */
void popupUxFileSelBoxDirAndPattern(const char *dir, const char *pattern,
                                    void  (*ok_func_ptr_fsb)(char *file_name));

char *getUxFileSelBoxFileSelected(void);
/*************************************************************
** uxselbox.c 
**************************************************************/
/* create selection box. This should be called at initial startup */
void createUxSelBox(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);

/* pop down selection box. This is only needed when maybe you need 
** a message box to popped down from a timeout routine */
void popdownUxSelBox(void);

/* Before Poping up selection box you should use the below 
** setUxMsgBox... function to configure the message box the way 
** you want it. */
void popupUxSelBox(void);

/* Dir and pattern to search */
void popupUxSelBoxList(const char *str_list,
                       void  (*ok_func_ptr_sb)(char *file_name));

/*************************************************************
** uxpromptbox.c 
**************************************************************/
/* create selection box. This should be called at initial startup */
void createUxPromptBox(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);

/* pop down selection box. This is only needed when maybe you need 
** a message box to popped down from a timeout routine */
void popdownUxPromptBox(void);

/* Before Poping up selection box you should use the below 
** setUxMsgBox... function to configure the message box the way 
** you want it. */
void popupUxPromptBox(void  (*ok_func_ptr_pb)(char *file_name));
void setUxPromptBoxText(const char *prompt_text);
void setUxPromptBoxLabel(const char *prompt_label);

/*************************************************************
** uxAddRemoveDiag.c 
**************************************************************/
void createUxAddRemoveDiag(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);
void popupUxAddRemoveDiag(char remove_list_a[100][30],
     char add_list_a[100][30], void (*ok_func_ptr)());
void popdownUxAddRemoveDiag(void);
void getAddRemoveList(char remove_list_a[100][30], char add_list_a[100][30]);


/*************************************************************
** uxDualSysSelDiag.c 
**************************************************************/
void createUxDualSysSelDiag(Widget parent_widget,
   Colormap colormap_a, Visual *visual_a);
void popupUxDualSysSelDiag(UINT2 lIsOperator_a,
        void (*tgl_set_func_ptr)(char *which_tgl_a));
void popdownUxDualSysSelDiag(void);
#ifdef SIGMET_ANTENNA_LIB_H
void setDualSysSelDiag(struct drcp_status drcp_a, UINT2 lrcp_ok_a);
#endif

/*************************************************************
** uxcommon_cbf.c 
**************************************************************/
/* defines passed as UxClientData in uxcommon_print_cbf */
#define UXCOMMON_PRINT_TO_PRINTER 0
#define UXCOMMON_PRINT_TO_FILE    1
#define UXCOMMON_PRINT_SETUP      2
void uxSetCommonPrintFilename(const char *print_filename);
void uxSetCommonWVHelpFilename(const char *wv_help_filename);
void uxSetCommonWVHelpManualType(const UINT2 iwv_help_manual_type_a);
void uxSetCommonShellWidget(Widget shell_widget);
void uxSetCommonPrintPBWidget(Widget print_widget);

void uxcommon__timer_cbf(XtPointer client_data, XtIntervalId *id);

void uxcommon_print_cbf(
     Widget wgt_a, XtPointer UxClientData, XtPointer UxCallbackArg);

void uxcommon_print_sensitive_cbf(
     Widget wgt_a, XtPointer UxClientData, XtPointer UxCallbackArg);

void uxcommon_wvhelp_cbf(
     Widget wgt_a, XtPointer UxClientData, XtPointer UxCallbackArg);

void uxcommon_exit_cbf(
     Widget wgt_a, XtPointer UxClientData, XtPointer UxCallbackArg);

#ifdef __cplusplus
}
#endif
#endif /* #ifndef SIGMET_UXSIG_LIB_H */
