1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 
11 
12 #ifndef	tdmDeclarations_h
13 #define	tdmDeclarations_h
14 /*---------------------------------------------------------------------------*\
15  $Source: /src/master/dx/src/exec/hwrender/hwDeclarations.h,v $
16   Author: Mark Hood
17 
18   This file contains ANSI prototypes for globally scoped TDM routines.
19   These are essential for many non-AIX compilers in order to pass arguments
20   correctly.  The initial revision doesn't yet contain all appropriate TDM
21   routines, just the ones that have caused trouble so far.
22 
23 \*---------------------------------------------------------------------------*/
24 
25 /*---------------------------------------------------------------------------*\
26   Defines
27 \*---------------------------------------------------------------------------*/
28 
29 #include "hwObject.h"
30 
31 /*
32  * Values for the attribute & gather 'flags' parameter
33  */
34 #define CONTAINS_TRANSPARENT         (1<<0)
35 #define CONTAINS_VOLUME              (1<<1)
36 #define CONTAINS_CLIP_OBJECT         (1<<2)
37 #define CONTAINS_NORMALS             (1<<3)
38 #define CONTAINS_LIGHT               (1<<4)
39 #define CONTAINS_SCREEN              (1<<5)
40 #define CONTAINS_IMAGE_ONLY          (1<<6)
41 #define CONTAINS_TRANSPARENT_TEXTURE (1<<7)
42 
43 #define IGNORE_PARAMS		(1<<16)
44 #define IN_SCREEN_OBJECT	(1<<17)
45 #define BEING_CLIPPED		(1<<18)
46 #define IN_CLIP_OBJECT		(1<<19)
47 #define PERSPECTIVE_CAMERA	(1<<20)
48 #define CORRECTED_COLORS	(1<<21)
49 
50 /*
51  * Values for Xfield/porting layer services flags
52  */
53 #define	SF_VOLUME_BOUNDARY	(1<<0)
54 #define SF_TMESH		(1<<1)
55 #define SF_QMESH		(1<<2)
56 #define	SF_TEXTURE_MAP		(1<<3)
57 #define SF_CONST_COEF_HELP	(1<<4)
58 #define SF_POLYLINES		(1<<5)
59 #define SF_GAMMA_CORRECT_COLORS	(1<<6)
60 #define SF_INVALIDATE_BACKSTORE (1<<7)	/* For machines that do slow blits */
61 #define SF_FLING                (1<<8)	/* Undocumented -- for marketing */
62 #define SF_TRANSPARENT_OFF      (1<<9)  /* For DEC PXG */
63 #define SF_USE_DISPLAYLISTS    (1<<10)
64 #define SF_DOES_TRANS          (1<<31)
65 
66 /*---------------------------------------------------------------------------*\
67   Structure Pointers
68 \*---------------------------------------------------------------------------*/
69 typedef struct tdmChildGlobalS		*tdmChildGlobalP;
70 typedef struct WinT			*WinP;
71 typedef struct mediumS  		*mediumP;
72 typedef struct xfieldS 			*xfieldP;
73 typedef struct sortS  			*sortP;
74 typedef struct sortIndexS  		*sortIndexP;
75 typedef struct tdmInteractorEchoS  	*tdmInteractorEchoP;
76 typedef struct attributeS	  	*attributeP;
77 typedef struct tdmHWDescS		*tdmHWDescP;
78 typedef struct tdmParsedFormatS		*tdmParsedFormatP;
79 typedef struct screenS			*screenP;
80 typedef struct tdmPortHandleS		*tdmPortHandleP;
81 typedef struct tdmDrawPortS		*tdmDrawPortP;
82 typedef struct tdmSimpleLightS		*tdmSimpleLightP;
83 typedef struct translationS		*hwTranslationP;
84 
85 typedef void				*SortList;
86 
87 #if !defined(DX_NATIVE_WINDOWS)
88 #include <X11/Xlib.h>
89 #endif
90 
91 #include "hwFlags.h"
92 #include "hwPortLayer.h"
93 #include "hwInteractor.h"
94 
95 
96 /*
97  * From hwMatrix.c
98  */
99 void
100 _dxfInitStack(void *stack, int resolution, float view[4][4], int projection,
101 	     float width, float aspect, float Near, float Far);
102 
103 void
104   _dxfGetNearFar(int projection, int resolution, float width,
105 		 float from[3], float zaxis[3], float box[8][3],
106 		 float *Near, float *Far);
107 
108 /*
109  *  from tdmRender.c and tdmRenderOptions.c
110  */
111 
112 Error
113   _dxfAsyncRender (dxObject r, Camera c, char *obsolete, char *displayString) ;
114 Error
115   _dxfAsyncDelete (char *where) ;
116 Error
117   _dxfLoadRenderOptionsFile (tdmChildGlobalP globals) ;
118 Error
119   _dxfSetRenderOptions
120     (tdmChildGlobalP globals, char *renderString, char *densityString) ;
121 
122 tdmChildGlobalP
123   _dxfCreateRenderModule (tdmParsedFormatP pFormat) ;
124 
125 /*
126  *  from hwWindow.c
127  */
128 
129 Error
130   _dxfCreateWindow (tdmChildGlobalP globals, char *winName) ;
131 Error
132   _dxfProcessEvents (int fd, tdmChildGlobalP globals, int flag) ;
133 void
134   _dxfSWImageDraw (WinP win) ;
135 void
136   _dxfChangeBufferMode(WinP win, int mode) ;
137 int
138   _dxfTrySaveBuffer (WinP win) ;
139 int
140   _dxfTryRestoreBuffer (WinP win) ;
141 int
142   _dxfConvertWinName (char *winName) ;
143 
144 /*
145  *  from tdmInitScreen.c
146  */
147 
148 Error
149   _dxfInitRenderObject (WinP win) ;
150 int
151   _dxfEndRenderPass (WinP win) ;
152 int
153   _dxfEndSWRenderPass (WinP win, Field image) ;
154 Error
155   _dxfEndRenderModule (tdmChildGlobalP globals) ;
156 
157 /*
158  *  from _dxfDraw.c
159  */
160 
161 void
162   tdmMakeGLMatrix (float m1[4][4], dxMatrix m2) ;
163 
164 /*
165  * from hwXfield.c,hwGather.c
166  */
167 
168 void* 	_dxf_initPort(tdmParsedFormatP format);
169 
170 int	_dxf_xfieldNconnections(xfieldP xf);
171 int	_dxf_xfieldSidesPerConnection(xfieldP xf);
172 attributeP _dxf_xfieldAttributes(xfieldP xf);
173 
174 attributeP _dxf_newAttribute(attributeP from);
175 float	*_dxf_attributeFuzz(attributeP att, double *ff);
176 hwFlags _dxf_attributeFlags(attributeP att);
177 void	_dxf_attributeMatrix(attributeP att, float m[4][4]);
178 void	_dxf_setAttributeMatrix(attributeP att, float m[4][4]);
179 
180 attributeP _dxf_parameters(dxObject o, attributeP old);
181 
182 #endif /* tdmDeclarations_h */
183 
184 
185