/* **********************************************************************
 * *                                                                    *
 * *   POM Header file                                                  *
 * *                                                                    *
 * **********************************************************************
 * File: iris/xuif/pom.h
 *
 *                        COPYRIGHT (c) 2005  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 POM_H
#define POM_H

#ifdef POM_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif


/*-----------------------------------------------------------------------------
  POM 
*/
#define POMTAG_X_P    0
#define POMSITE_X_P   3
#define POMTYPE_X_P   7
#define POMNAME_X_P  13
#define POMPARM_X_P  26
#define POMTASK_X_P  54
#define POMTIME_X_P  67
#define POMRQST_X_P  90

/*The default width and height are set after first XtManagedChild call*/
EXTERN SINT2 ipom_defl_width_c;   
EXTERN SINT2 ipom_defl_height_c;

EXTERN int          pom_num_sel_prodlst_c; 
EXTERN int          pom_has_all_raw_c;
EXTERN int          pom_making_selection_c;
EXTERN SPHD_SUM     arrhotprodsuma_c[MAX_SCROLL_SIZE];

EXTERN SOUT_OPT     pomoptions_c;


EXTERN Widget pom_mainbar;

EXTERN char   spomname_c[17];
EXTERN Widget pom_filebtn, pom_filepdw;
void pom_file_cbf( Widget wgt, int idx_a, XmPushButtonCallbackStruct* cbd );
EXTERN XsFLB* pom_open;
EXTERN Widget pom_svaspop, pom_svashelppop;
EXTERN XsFLB* pom_dele;


EXTERN Widget pom_cmdsbtn, pom_cmdspdw;
void pom_cmds_cbf( Widget wgt, int idx_a, XmPushButtonCallbackStruct* cbd );

EXTERN Widget pom_devsbtn, pom_devspdw;
void pom_devs_cbf( Widget wgt, int idx_a, XmPushButtonCallbackStruct* cbd );

EXTERN Widget pom_menubtn, pom_menupdw;
void pom_menu_cbf( Widget wgt, int idx_a, XmPushButtonCallbackStruct* cbd );

EXTERN Widget pom_helpbtn, pom_helppdw;

EXTERN Widget pom_printpdw;

EXTERN Widget    pom_showtgl;
void pom_showtgl_cbf(Widget wgt, void* tag, void* cbd);

EXTERN Widget pom_showopt, pom_showbtns[4];
void pom_showopt_cbf(Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a);

/* OVERLAY */

EXTERN Widget pom_overbtn;
void pom_over_cbf( Widget wgt, void* tag, void *cbd_a );

EXTERN Widget pom_overnameopt, pom_overnamebtns[8];
void pom_overnameopt_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );

EXTERN Widget pom_outoptbtn, pom_colorbtn;
void pom_outoptbtn_cbf( Widget wgt, void *idx_a, void* cbd );
void pom_colorbtn_cbf( Widget wgt, void* idx_a, void* cbd );


/* List Filter */
EXTERN struct pom_list_header pomlsthdr_c;
EXTERN struct server_filter   pomfilter_c;
EXTERN Widget    pom_filtertxt;

EXTERN Widget    pom_flgndlab;         /* Line one */


EXTERN XsPDW_TXT pom_fsite;
void pom_fsitepdw_cbf( Widget wgt_a, void *idx_a, void *cbd_a );
void pom_fsitetxt_cbf( Widget wgt, void* tag, void* cbd );

EXTERN XsPDW_TXT pom_ftype;
void pom_ftypepdw_cbf( Widget wgt_a, void *idx_a, void* cbd_a );
void pom_ftypetxt_cbf( Widget wgt, void* tag, void* cbd );

EXTERN Widget    pom_fprodtxt;
void pom_fprodtxt_cbf( Widget wgt, void* tag, void* cbd );
EXTERN Widget    pom_ftasktxt;
void pom_ftasktxt_cbf( Widget wgt, void* tag, void* cbd );

EXTERN XsPDW_TXT pom_fhour;
void pom_fhourpdw_cbf( Widget wgt_a, void *idx_a, void* cbd_a );
void pom_fhourfromtxt_cbf( Widget wgt, void* tag, void* cbd );
EXTERN Widget    pom_fhourtotxt;
void pom_fhourtotxt_cbf( Widget wgt, void* tag, void* cbd );

EXTERN XsPDW_TXT pom_fday;
void pom_fdaypdw_cbf( Widget wgt_a, void *idx_a, void* cbd_a );
void pom_fdaytxt_cbf( Widget wgt, void* tag, void* cbd );
EXTERN XsPDW_TXT pom_fmon;
void pom_fmonpdw_cbf( Widget wgt_a, int idx_a, XmAnyCallbackStruct* cbd_a );
EXTERN XsPDW_TXT pom_fyear;
void pom_fyearpdw_cbf( Widget wgt_a, void *idx_a, void *cbd_a );
void pom_fyeartxt_cbf( Widget wgt, void* tag, void* cbd );

EXTERN XsPDW_TXT pom_fmax;
void pom_fmaxpdw_cbf( Widget wgt_a, void *idx_a, void* cbd_a );
void pom_fmaxtxt_cbf( Widget wgt, void* tag, void* cbd );
EXTERN Widget    pom_ffilelab;

EXTERN Widget    pom_fgrabbtn;         /* Line two */
void pom_fgrabbtn_cbf( Widget wgt, void* tag, void* cbd );
EXTERN Widget    pom_fapplybtn;
void pom_fapplybtn_cbf( Widget wgt, void* tag, void* cbd );
EXTERN Widget    pom_fwildbtn;
void pom_fwildbtn_cbf( Widget wgt, void* tag, void* cbd );
EXTERN Widget    pom_ftimebtn,  pom_ftimebtns[4];
void pom_ftimebtn_cbf( Widget wgt, void* tag, void* cbd );

EXTERN Widget pom_fcmdsbar, pom_fcmdsbtn, pom_fcmdspdw;
void pom_fcmdspdw_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
EXTERN int pom_fcmds_idx_c;


EXTERN Widget pom_legendlab;
EXTERN Widget pom_prodslst;
void pom_postit( Widget wgtbase_a, void *wgtpop_a, XEvent *evt_a, Boolean *lCont_a );
void pom_prodlst_focus( Widget wgtbase_a, void *wgtpop_a, XEvent *evt_a, Boolean *lCont_a );
void pom_prodlst_cbf( Widget wgt,char* tag,XmListCallbackStruct* cbd );
void StrToPOMEntry( char str_a[], SPHD_SUM* suma_a );
EXTERN char*  spom_suma_txt_f( SPHD_SUM* pomentry_a );

EXTERN Widget pom_quickshl;
void pom_quick_cbf( Widget wgt_a, int idx_a,XmPushButtonCallbackStruct* cbd_a );
EXTERN Widget pom_keepshl, pom_clutbtn, pom_reinbtn;
void pom_keep_cbf( Widget wgt_a, int idx_a,XmPushButtonCallbackStruct* cbd_a );
EXTERN Widget pom_sendshl;
void pom_send_cbf( Widget wgt_a, int idx_a, XmPushButtonCallbackStruct* cbd_a );
EXTERN Widget pom_nullshl;

EXTERN Widget   pom_dumshl;
EXTERN XsFLB*   pom_rqst;

void   pom_delelist( char *sptr_a, UINT4 ilen_a );
void   pom_openlist( char *sptr_a, UINT4 ilen_a );
void   pom_options( char *sptr_a, UINT4 ilen_a );
void   pom_poverlist( char *sptr_a, UINT4 ilen_a );
void   pom_typelist( char *sptr_a, UINT4 ilen_a );
void   pom_update_rqst( void );
void   pom_update( struct pom_list *pdata_a, UINT4 ilen_a );


/*-----------------------------------------------------------------------------
   Shared routines 
*/
const char* sprod_rqst_f( SINT2 irqst_a );
SINT2 iprod_rqst_f( char* srqst_a );
SINT2 iprod_tag_f( char* stag_a );


#define SMSG_DELEDEFLO "\
The DEFAULT POM can not be deleted."

#undef EXTERN
#endif
