c************
c  Description:	Includes for the XGEOPLOT primitive
c
c  Author:	JGS	
c
c  $Revision: 1.1 $
c  $Modtime:   17 Oct 1996 06:08:44  $
c
c  Revisions:	GED 9/98  Add Gx.xoffs, .linew, .svh, .sview, .mview, .aoaspec
c
c************
	implicit none
	include 'primitive.inc'
	include 'xdsprim.inc'
	include 'xfacilities.inc'
	include 'msgmask.inc'

	integer*4 L_eventsz,L_layersz,L_eventmx,L_layermx,L_t5recsz
	parameter (L_eventmx=32,L_layermx=32)
	integer*4 L_nball,L_mg,L_grid,L_ctmp,L_pix
	parameter (L_nball=8,L_mg=21,L_grid=4232,L_ctmp=65536,L_pix=8192)

	structure /EVENT/ 
	  character*32  name
	  byte		gsmode,tdmode,fdmode,svmode
	  byte		iballa,iballb,fill(2)
	  integer*4	enable, flags
	  real*8	time,dtime
	  real*8	tdoa,dtdoa
	  real*8	fdoa,dfdoa
	  real*8	flinkt,flinka,flinkb
	  real*8	site(3),sva(6),svb(6)
	end structure
	record /EVENT/ ev
	parameter (L_eventsz = 32 + 1*8 + 2*4 + 3*2*8 + 3*8 + 15*8)

	structure /LAYER/ 
	  character*32  name
	  integer*4	spa,dim,bpe,fill
	  integer*4	lhcb,bufloc,bufsize,type,nelem,nsub
	  integer*4	line,thick,symbol,radius,color,tunits
	  integer*4	enable,pipemode,piperead,pipelen
	  UNION
	  MAP
	  real*8	tstart,tdelta
	  ENDMAP
	  MAP
	  real*4	xstart,xdelta,ystart,ydelta
	  ENDMAP
	  ENDUNION
	endstructure
	record /LAYER/ ly
	parameter (L_layersz = 1*32 + 4*4 + 6*4 + 6*4 + 4*4 + 2*8)

	structure /BS/ 
	  integer*2	x,y,w,h
	  integer*4	ip,wid
	  integer*4	mask
	endstructure

	structure /POS/
	  UNION
	  MAP
	  real*8  alt,lat,lon
	  ENDMAP
	  MAP
	  real*8  x,y,z
	  ENDMAP
	  ENDUNION
	endstructure

	structure /GEOPOS/
	  UNION
	  MAP
	  real*8  alt,lat,lon
	  ENDMAP
	  MAP
	  real*8  z,y,x
	  ENDMAP
	  ENDUNION
	endstructure

	structure /T5REC/
	 UNION
	 MAP
	  real*8	alt,lat,lon
	  real*8	azim,elev,roll
	  real*8	r,a,b
	  character*8	name
	  byte		name_len,name_pos,color,colorbg
	  byte		cone,invert,symbol,size
	 ENDMAP
	 MAP
	  real*8	z,y,x
	  real*8	palt,plat,plon
	  real*8	major,minor,tilt
	  character*8	fill1
	  integer*4	flags(2)
	 ENDMAP
	 MAP
	  real*8	talt,tlat,tlon
	  character*48	text
	  character*8	fill2
	  byte		b1,b2,b3,b4,b5,text_len,b7,b8
	 ENDMAP
	 ENDUNION
	endstructure
	parameter (L_t5recsz = 3*8 + 3*8 + 3*8 + 8 + 8)

	structure /GX/ 
	  record/GEOPOS/ret
	  real*8	rlat1,rlon1,rlat2,rlon2
	  real*8	pdis,plat,plon,palt
	  real*8	time,timel,tmin,tmax,site(3)
	  real*4	x1,x2,y1,y2
	  real*4	x1p,x2p,y1p,y2p
	  real*4	xoffs
	  integer*4	nlayer,lloc(0:L_layermx+1)
	  integer*4	nevent,eloc(L_eventmx)
	  integer*4	nball,lhsv(L_nball),iballa,iballb,lhadb
	  integer*4	glmode,glevn1,glevn2,glstat
	  real*4	glstd1,glstd2,cepstep
	  real*4	speed,rtdelta,rtlast
	  integer*4	nmg,lmg,tlmax,tlreg
	  integer*4	zx,zy,zw,zh,zk
	  real*4	coneang
	  integer*4	conediv,conelev,conemod,coneveh
	  integer*4	status,view,cntrls,ncolors,bsmask,units,linew
	  integer*4	mimic,nomenu
	  record /T5REC/ mrk,evp(5)
	  record /BS/	bsmap(L_stack)
	  record /XFACILITIES/ xf
	  UNION
	  MAP
	  logical*1	labs,axes,spec,prop,pan,split,bar,bs
	  logical*1	evnt,cep,sorg,mark,vcon,zfill,hold,svh
	  logical*1	sview,mview,aoaspec,zs,placeholder(4)
	  ENDMAP
	  MAP
	  logical*1	options(24)
	  ENDMAP
	  ENDUNION
	endstructure
	record /GX/ Gx

	integer*4 L_colors,PC_MAPOFF,PC_USEROFF
	parameter (L_colors=32,PC_MAPOFF=5,PC_USEROFF=16)
	integer*4  PC_GRID,PC_HORIZON,PC_TDOA,PC_FDOA,PC_TRACE
	integer*4  PC_CEP,PC_MAP,PC_USER,PC_RAW
	parameter (PC_GRID=1,PC_HORIZON=2,PC_TDOA=3,PC_FDOA=4,PC_TRACE=5)
	parameter (PC_CEP=-1,PC_MAP=-2,PC_USER=-3,PC_RAW=-4)
	character*93 colors

	integer*4 PG_TDOA,PG_FDOA,PG_TFDOA
	parameter (PG_TDOA=1,PG_FDOA=2,PG_TFDOA=3)

	integer*4 PG_CURRENT,PG_CURROFF,PG_FIXED
	parameter (PG_CURRENT=1,PG_CURROFF=2,PG_FIXED=3)

	integer*4 PG_LINE,PG_CONTOUR,PG_REGION,PG_NONE
	parameter (PG_LINE=1,PG_CONTOUR=2,PG_REGION=3,PG_NONE=4)

	integer*4 P_ON,P_OFF
	parameter (P_ON=1,P_OFF=2)

	integer*4 P_NOCONE,P_GEOCONE,P_DEFCONE,P_TEXT
	parameter (P_NOCONE=0,P_GEOCONE=-1,P_DEFCONE=-9,P_TEXT=-99)

	integer*4 P_INIT,P_NORM,P_ZOOM,P_FAST,P_GRID,P_MENU
	parameter (P_INIT=-1,P_NORM=0,P_ZOOM=1,P_FAST=2,P_GRID=3,P_MENU=-9)
	integer*4 P_BASE,P_WIDE,P_NARROW,P_RESIZE
	parameter (P_BASE=1,P_WIDE=2,P_NARROW=-2,P_RESIZE=3)

	integer*4 P_ENABLE,P_DISABLE
	parameter (P_ENABLE=255,P_DISABLE=P_ENABLE-2)

	integer*4 PM_GLOBAL,PM_LABEL,PM_BS
	integer*4 PM_BASE,PM_ZOOM,PM_FBASE,PM_FZOOM
	parameter (PM_GLOBAL=1,PM_LABEL=2,PM_BS=3)
	parameter (PM_BASE=4,PM_ZOOM=5,PM_FBASE=6,PM_FZOOM=7)

	integer*4 PP_CLEAR,PP_OFF,PP_FIFO,PP_WRAP,PP_CONSUME
	parameter (PP_CLEAR=-1,PP_OFF=0,PP_FIFO=1,PP_WRAP=2,PP_CONSUME=3)

	integer*4 PM_LTC,PM_DWNLNK,PM_HORIZON,PM_POINTS,PM_AUTOTF
	parameter (PM_LTC=1,PM_DWNLNK=2,PM_HORIZON=3,PM_POINTS=4)
	parameter (PM_AUTOTF=5)

	integer*4 P_CFG,P_EVN,P_SITE,P_SV,P_LAYER,P_EVENT,P_ALTDB
	parameter (P_SITE=1,P_SV=2,P_LAYER=3,P_EVENT=4,P_ALTDB=5)
	parameter (P_CFG=-1,P_EVN=-2)

	integer*4 P_METRIC,P_ENGLISH,P_NAUTICAL
	parameter (P_METRIC=1,P_ENGLISH=2,P_NAUTICAL=3)

	integer*4 P_METERS,P_DEGREES
	parameter (P_METERS=5,P_DEGREES=34)

	integer*4 i,i1,i2,j,k,l,m,n,n1,n2	! generic loop counters
	integer*4 ii,jj,kk,ll,mm,nn		! generic loop counters
	integer*4 ix,iy,ix1,ix2,iy1,iy2		! screen cursor coords
	real*8    dval,time,t1,t2
	real*4    fval
	integer*4 lval,flag
	integer*2 ival
	byte	  bval
	character*256 str

	logical*4 XGEO_PAN_HANDLE, XGEO_LOCATE, XGEO_ENABLED

!	integer*4 lMx,lGx
!	common /xgeoplot/ lMx,lGx,colors
!	pointer (lMx,Mx),(lGx,Gx)

	common /xgeoplot/ Mx,Gx,colors
