FreeWRL/FreeX3D  3.0.0
EAIHeaders.h
1 /*
2 
3 
4 EAI and java CLASS invocation
5 
6 */
7 
8 /****************************************************************************
9  This file is part of the FreeWRL/FreeX3D Distribution.
10 
11  Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12 
13  FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14  it under the terms of the GNU Lesser Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25 ****************************************************************************/
26 
27 
28 
29 /**********************************************************************************************/
30 /* */
31 /* This file is part of the FreeWRL/FreeX3D Distribution, from http://freewrl.sourceforge.net */
32 /* */
33 /**********************************************************************************************/
34 
35 
36 #ifndef __FREEWRL_EAI_H__
37 #define __FREEWRL_EAI_H__
38 
39 #define _MULTI_THREADED
40 #include <pthread.h>
41 
42 #define EBUFFLOCK pthread_mutex_lock(&p->eaibufferlock)
43 #define EBUFFUNLOCK pthread_mutex_unlock(&p->eaibufferlock)
44 
45 //extern int eaiverbose;
46 
47 /* void shutdown_EAI(void); */
48 int EAI_GetNode(const char *str);
49 struct X3D_Node *EAI_GetViewpoint(const char *str);
50 void EAI_killBindables (void);
51 
52 /* function prototypes */
53 void EAIListener (void);
54 /* void EAI_clearListenerNode(void); */
55 unsigned int EAI_SendEvent (char *ptr);
56 void EAI_RNewW(char *bufptr);
57 void EAI_RW(char *bufptr);
58 
59 /* more function prototypes to avoid implicit declarations */
60 void Parser_deleteParserForScanStringValueToMem(void); /* from EAI_C_CommonFunctions.c */
61 void Parser_scanStringValueToMem(struct X3D_Node *node, size_t coffset, int ctype, char *value, int isXML);
62 //JAS void Parser_scanStringValueToMem_B(union anyVrml* any, indexT ctype, char *value, int isXML);
63 void Parser_scanStringValueToMem_C(void *node, int ctype, char *value, int isXML);
64 
65  /* from EAI_C_CommonFunctions.c */
66 int returnRoutingElementLength(int); /* from EAI_C_CommonFunctions.c */
67 void createLoadURL(char *); /* from EAIEventsIn.c */
68 void EAI_core_commands(void); /* from EAIEventsIn.c */
69 void EAI_Anchor_Response(int); /* from EAIEventsIn.c */
70 
71 /* debugging */
72 char *eaiPrintCommand (char command);
73 
74 
75 // structure for passing data to Listener nodes.
77  int field_id; // an internal table entry
78  int node_id; // an internal table entry
79  int field_type; // type of the field - eg FIELDTYPE_SFBool
80  int listener_id;// the EAI program connecting - this is the ID of the RegisterListener for it.
81 };
82 
83 
84 
85 // #define EAIREADSIZE 8192
86 #define EAI_NODETYPE_STANDARD 93435
87 #define EAI_NODETYPE_PROTO 43534
88 #define EAI_NODETYPE_SCRIPT 234425
89 
90 /* these are commands accepted from the EAI client */
91 #define GETNODE 'A'
92 #define GETEAINODETYPE 'B'
93 #define SENDCHILD 'C'
94 #define SENDEVENT 'D'
95 #define GETVALUE 'E'
96 #define GETFIELDTYPE 'F'
97 #define REGLISTENER 'G'
98 #define ADDROUTE 'H'
99 #define REREADWRL 'I'
100 #define DELETEROUTE 'J'
101 #define GETNAME 'K'
102 #define GETVERSION 'L'
103 #define GETCURSPEED 'M'
104 #define GETFRAMERATE 'N'
105 #define GETURL 'O'
106 #define REPLACEWORLD 'P'
107 #define LOADURL 'Q'
108 #define VIEWPOINT 'R'
109 #define CREATEVS 'S'
110 #define CREATEVU 'T'
111 #define STOPFREEWRL 'U'
112 #define UNREGLISTENER 'W'
113 #define GETRENDPROP 'X'
114 #define GETENCODING 'Y'
115 #define CREATENODE 'a'
116 #define CREATEPROTO 'b'
117 #define UPDNAMEDNODE 'c'
118 #define REMNAMEDNODE 'd'
119 #define GETPROTODECL 'e'
120 #define UPDPROTODECL 'f'
121 #define REMPROTODECL 'g'
122 #define GETFIELDDEFS 'h'
123 #define GETNODEDEFNAME 'i'
124 #define GETROUTES 'j'
125 #define GETNODETYPE 'k'
126 #define DUMPSCENE 'n'
127 #define CREATEXS 'o'
128 #define GETNODEPARENTS 'p'
129 
130 
131 /* command string to get the rootNode - this is a special match... */
132 #define SYSTEMROOTNODE "_Sarah_this_is_the_FreeWRL_System_Root_Node"
133 
134 
135 /* Subtypes - types of data to get from EAI - we don't use the ones defined in
136  headers.h, because we want ASCII characters */
137 
138 #define EAI_SFBool 'b'
139 #define EAI_SFColor 'c'
140 #define EAI_SFFloat 'd'
141 #define EAI_SFTime 'e'
142 #define EAI_SFInt32 'f'
143 #define EAI_SFString 'g'
144 #define EAI_SFNode 'h'
145 #define EAI_SFRotation 'i'
146 #define EAI_SFVec2f 'j'
147 #define EAI_SFImage 'k'
148 #define EAI_MFColor 'l'
149 #define EAI_MFFloat 'm'
150 #define EAI_MFTime 'n'
151 #define EAI_MFInt32 'o'
152 #define EAI_MFString 'p'
153 #define EAI_MFNode 'q'
154 #define EAI_MFRotation 'r'
155 #define EAI_MFVec2f 's'
156 #define EAI_MFVec3f 't'
157 #define EAI_SFVec3f 'u'
158 #define EAI_MFColorRGBA 'v'
159 #define EAI_SFColorRGBA 'w'
160 #define EAI_MFBool 'x'
161 #define EAI_FreeWRLPTR 'y'
162 #define EAI_FreeWRLThread 'z'
163 #define EAI_MFVec3d 'A'
164 #define EAI_SFVec2d 'B'
165 #define EAI_SFVec3d 'C'
166 #define EAI_MFVec2d 'D'
167 #define EAI_SFVec4d 'E'
168 #define EAI_MFDouble 'F'
169 #define EAI_SFDouble 'G'
170 #define EAI_SFMatrix3f 'H'
171 #define EAI_MFMatrix3f 'I'
172 #define EAI_SFMatrix3d 'J'
173 #define EAI_MFMatrix3d 'K'
174 #define EAI_SFMatrix4f 'L'
175 #define EAI_MFMatrix4f 'M'
176 #define EAI_SFMatrix4d 'N'
177 #define EAI_MFMatrix4d 'O'
178 #define EAI_SFVec4f 'P'
179 #define EAI_MFVec4f 'Q'
180 #define EAI_MFVec4d 'R'
181 
182 
183 
184 extern int E_SOCK_bufsize;
185 extern int E_SOCK_bufcount;
186 #define EAIREADSIZE 8192
187 
188 #endif /* __FREEWRL_EAI_H__ */