!************
!
!  $Id: xfacilities.inc,v 1.1 2008/07/19 22:30:29 jgs Exp $
!  
!  Description:	Facilities structures for X-Windows graphics primitives 
!		wishing to use points, annotate, boxes, etc
!
!************


!************************
! These are mode flags shared by all facilities
!************************

	integer*4 L_CleanExit
	parameter (L_CleanExit = 0)
	integer*4 L_Draw
	parameter (L_Draw = 1)
	integer*4 L_Interactive
	parameter (L_Interactive = (-1))
	integer*4 L_OneShot
	parameter (L_OneShot = (-2))
	integer*4 L_Preload
	parameter (L_Preload = (-3))
	integer*4 L_InitFacilities
	parameter (L_InitFacilities = 999)

!************************
! Annotate specific flags
!************************

	integer*4 L_RemoveText
	parameter (L_RemoveText = (-1))
	integer*4 L_DeselectText
	parameter (L_DeselectText = 0)
	integer*4 L_SelectText
	parameter (L_SelectText = 1)
	integer*4 L_MoveText
	parameter (L_MoveText = 2)

	integer*4 L_FreeFonts
	parameter (L_FreeFonts = (-2))
	integer*4 L_LoadOneFont
	parameter (L_LoadOneFont = (-1))
	integer*4 L_FontAttributes
	parameter (L_FontAttributes = 0)
	integer*4 L_ChangeBG
	parameter (L_ChangeBG = 1)
	integer*4 L_LoadAllFonts
	parameter (L_LoadAllFonts = 2)
	integer*4 L_ChangeColor
	parameter (L_ChangeColor = 3)
	integer*4 L_ChangeAnchor
	parameter (L_ChangeAnchor = 4)
	integer*4 L_GetFontPtr
	parameter (L_GetFontPtr = 5)
	integer*4 L_FreeFontPtr
	parameter (L_FreeFontPtr = (-5))
	integer*4 L_GetTextExtents
	parameter (L_GetTextExtents = (-4))
	integer*4 L_SetPixel
	parameter (L_SetPixel = (-3))
	integer*4 L_NotSet
	parameter (L_NotSet = (-1))

	integer*4 L_XFAFill
	parameter (L_XFAFill = 1)
	integer*4 L_XFAMidAnchor
	parameter (L_XFAMidAnchor = 2)
	integer*4 L_XFAEndAnchor
	parameter (L_XFAEndAnchor = 4)
	integer*4 L_XFANoGravity
	parameter (L_XFANoGravity = 8)
	integer*4 L_XFANoBS
	parameter (L_XFANoBS = 16)

	structure /XFANNOTATION/
	  integer*2 x, y
	  integer*2 mode
	  integer*2 size
	  character*128 text
	  character*128 font
	  character*24 color
	  integer*4 f_id
	  integer*4 p_id
	  integer*4 pixel
	  integer*2 w, h
	  integer*2 a, xc, yc, d
	end structure

	integer*4 L_xfannotation
	parameter (L_xfannotation = 312)

!************************
! Box specific flags
!************************

	structure /XFBOX/
	  union
	    map  ! xy
	      real*8 xyX
	      real*8 xyY
	      real*8 xyW
	      real*8 xyH
	    endmap
	    map  ! yx
	      real*8 yxY
	      real*8 yxX
	      real*8 yxH
	      real*8 yxW
	    endmap
	    map  ! alt
	      real*8 x1
	      real*8 y1
	      real*8 x2
	      real*8 y2
	    endmap
	  endunion
	endstructure

	integer*4 L_xfbox
	parameter (L_xfbox = 32)

!************************
! Control panel specific flags
!************************

	integer*4 L_SavePanel
	parameter (L_SavePanel = 4)
	integer*4 L_FocusPanel
	parameter (L_FocusPanel = 5)
	integer*4 xfc_disp
	parameter (xfc_disp = 1)
	integer*4 xfc_awake
	parameter (xfc_awake = 2)
	integer*4 xfc_edit
	parameter (xfc_edit = 4)
	integer*4 xfc_monitor
	parameter (xfc_monitor = 8)
	integer*4 xfc_mfocus
	parameter (xfc_mfocus = 16)
	integer*4 xfc_blink
	parameter (xfc_blink = 32)

! Added for headless
!
! MENU
	integer*4 xfc_moption
	parameter (xfc_moption = 64)
	integer*4 xfc_mleft
	parameter (xfc_mleft = 128)
	integer*4 xfc_mtop
	parameter (xfc_mtop = 256)
	integer*4 xfc_mright
	parameter (xfc_mright = 512)

!************************
! Point specific flags
!************************

	structure /XFPOINT/
	  union
	    map  ! xy
	      real*8 xyX
	      real*8 xyY
	    endmap
	    map  ! yx
	      real*8 yxY
	      real*8 yxX
	    endmap
	  endunion
	endstructure

	integer*4 L_xfpoint
	parameter (L_xfpoint = 16)

	structure /XFACILITIES/
	  record /M_PTR/ ROUTINE   ! primitive's local specs routine
	  record /M_PTR/ mqdloc    ! queued message data structure
	  record /M_PTR/ annt      ! array of ptrs to /XFANNOTATE/ structs
	  record /M_PTR/ adefault  ! the default /XFANNOTATE/ struct
	  record /M_PTR/ box       ! array of /XFBOX/ structs
	  record /M_PTR/ con       ! array of /XWIDGET/ structs
	  record /M_PTR/ cpsetup   ! int_4 array of (x,y,flag)
	  record /M_PTR/ chcb      ! optional keyword file header
	  record /M_PTR/ pwork     ! work buffer to convert to pixels in
	  record /M_PTR/ point     ! array of /XFPOINT/ structs

	  logical*4 xy         ! indicates whether pts,boxes are ordered x,y
	  integer*4 iarg        ! integer used for message passing
	  integer*4 msgid       ! id of primitive to send info messages to
	  integer*4 msgmask     ! mask specifying which messages to send
	  logical*4 clip       ! TRUE: Boxes, Points, Annt clip to area below
	  integer*4 x1, x2       ! left and right pixel coords for clipping
	  integer*4 y1, y2       ! top and bottom pixel coords for clipping

	  logical*4 aview      ! when FALSE annotate visibility is toggled off
	  integer*4 mannt       ! maximum number of points in array
	  integer*4 nannt       ! number of valid points in array

	  logical*4 bview      ! when FALSE box visibility is toggled off
	  integer*4 bnumbers! < 0: XOR text, 0 no numbers, > 0 tied to ANNOTATE
	  integer*4 mbox        ! maximum number of boxes in array
	  integer*4 nbox        ! number of valid boxes in array

	  logical*4 configure  ! when TRUE panel widgets are being configured
	  integer*4 cstatus     ! return status of XCALL
	  integer*4 current     ! current panel widget to receive keypresses
	  integer*4 cmenulit    ! number of last menu to be entered
	  integer*4 mcon        ! maximum number of controls in array
	  integer*4 ncon        ! number of valid conrols in array

	  logical*4 psort      ! when TRUE points are sorted
	  integer*4 pline       ! indicates width of connecting line (1 or 0)
	  integer*4 pdot        ! type of symbols to be drawn
	  integer*4 prad        ! radius of the symbol to be drawn on screen
	  integer*4 mpoint      ! maximum number of points in array
	  integer*4 npoint      ! number of valid points in array

!+++
! wgd added
	  integer*4 MRMMaster   ! Master Macro MRM Pointer
	  integer*4 MRMPtr      ! 8 Byte alignment...
!---

	end structure

! const int_4 L_xfacilities 10*L_M_Ptr+112
	integer*4 L_xfacilities     !jdh updated for MRM additions
	parameter (L_xfacilities = 10*L_M_Ptr+120)

