MHEG5  18.9.0
MHEG5 Documentation
mh5actiontokens.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
26 /*---includes for this file--------------------------------------------------*/
27 #include "mh5actiontokens.h"
28 #include <string.h>
29 
30 /*---constant definitions for this file--------------------------------------*/
31 
32 
33 /*---local typedef structs for this file-------------------------------------*/
34 
35 /*---local (static) variable declarations for this file----------------------*/
36 
37 #if defined(MH5PRINTOUT) || defined(MHEG5LOG) || defined(TRACING)
38 
39 static struct
40 {
41  const char *token;
42  MHEG5ElemActionType action;
43 } MHEG5actiontoken[] =
44 
45 {
46 /*
47  ":AbsoluteTime",,
48  ":NewAbsoluteColour",,
49  ":NewColourIndex",,
50  ":NewCCPriority",,
51  ":NewContentSize",,
52  */
53 
54 /*
55  Root Actions
56  */
57  { ":GetAvailabilityStatus", MHEG5GETAVAILABILITYSTATUS },
58  { ":GetRunningStatus", MHEG5GETRUNNINGSTATUS },
59 
60 /*
61  Group Actions
62  */
63  { ":SetCachePriority", MHEG5SETCACHEPRIORITY },
64 
65 /*
66  Application Actions
67  */
68  { ":StorePersistent", MHEG5STOREPERSISTENT },
69  { ":ReadPersistent", MHEG5READPERSISTENT },
70  { ":Launch", MHEG5LAUNCH },
71  { ":Spawn", MHEG5SPAWN },
72  { ":Quit", MHEG5QUIT },
73  { ":LockScreen", MHEG5LOCKSCREEN },
74  { ":UnlockScreen", MHEG5UNLOCKSCREEN },
75  { ":OpenConnection", MHEG5OPENCONNECTION },
76  { ":CloseConnection", MHEG5CLOSECONNECTION },
77  { ":GetEngineSupport", MHEG5GETENGINESUPPORT },
78 
79 /*
80  Scene Actions
81  */
82  { ":TransitionTo", MHEG5TRANSITIONTO },
83  { ":SetTimer", MHEG5SETTIMER },
84  { ":SendEvent", MHEG5SENDEVENT },
85  { ":SetCursorShape", MHEG5SETCURSORSHAPE },
86  { ":SetCursorPosition", MHEG5SETCURSORPOSITION },
87  { ":GetCursorPosition", MHEG5GETCURSORPOSITION },
88  { ":SetInputReg", MHEG5SETINPUTREGISTER },
89  { ":SetInputMask", MHEG5SETINPUTMASK },
90 
91 /*
92  Ingredient Actions
93  */
94  { ":SetData", MHEG5SETDATA },
95  { ":Clone", MHEG5CLONE },
96  { ":Preload", MHEG5PRELOAD },
97  { ":Unload", MHEG5UNLOAD },
98 
99 /*
100  Link Actions
101  */
102  { ":Activate", MHEG5ACTIVATE },
103  { ":Deactivate", MHEG5DEACTIVATE },
104 
105 /*
106  Program Actions
107  */
108  { ":Call", MHEG5CALL },
109  { ":Fork", MHEG5FORK },
110  { ":Stop", MHEG5STOP },
111 
112 /*
113  Variable Actions
114  */
115  { ":SetVariable", MHEG5SETVARIABLE },
116  { ":TestVariable", MHEG5TESTVARIABLE },
117 
118 /*
119  IntegerVariable Actions
120  */
121  { ":Add", MHEG5ADD },
122  { ":Subtract", MHEG5SUBTRACT },
123  { ":Multiply", MHEG5MULTIPLY },
124  { ":Divide", MHEG5DIVIDE },
125  { ":Modulo", MHEG5MODULO },
126 
127 /*
128  OctetStringVariable Actions
129  */
130  { ":Append", MHEG5APPEND },
131 
132 
133 /*
134  Presentable Actions
135  */
136  { ":Run", MHEG5RUN },
137 
138 /*
139  TokenManager Actions
140  */
141  { ":Move", MHEG5MOVE },
142  { ":MoveTo", MHEG5MOVETO },
143  { ":GetTokenPosition", MHEG5GETTOKENPOSITION },
144 
145 /*
146  TokenGroup Actions
147  */
148  { ":CallActionSlot", MHEG5CALLACTIONSLOT },
149 
150 /*
151  ListGroup Actions
152  */
153  { ":AddItem", MHEG5ADDITEM },
154  { ":DelItem", MHEG5DELITEM },
155  { ":GetListItem", MHEG5GETLISTITEM },
156  { ":GetCellItem", MHEG5GETCELLITEM },
157  { ":GetItemStatus", MHEG5GETITEMSTATUS },
158  { ":SelectItem", MHEG5SELECTITEM },
159  { ":DeselectItem", MHEG5DESELECTITEM },
160  { ":ToggleItem", MHEG5TOGGLEITEM },
161  { ":ScrollItems", MHEG5SCROLLITEMS },
162  { ":SetFirstItem", MHEG5SETFIRSTITEM },
163  { ":GetFirstItem", MHEG5GETFIRSTITEM },
164  { ":GetListSize", MHEG5GETLISTSIZE },
165  { ":SetCellPosition", MHEG5SETCELLPOSITION },
166 
167 /*
168  Visible Actions
169  */
170  { ":SetPosition", MHEG5SETPOSITION },
171  { ":GetPosition", MHEG5GETPOSITION },
172  { ":SetBoxSize", MHEG5SETBOXSIZE },
173  { ":GetBoxSize", MHEG5GETBOXSIZE },
174  { ":BringToFront", MHEG5BRINGTOFRONT },
175  { ":SendToBack", MHEG5SENDTOBACK },
176  { ":PutBefore", MHEG5PUTBEFORE },
177  { ":PutBehind", MHEG5PUTBEHIND },
178  { ":SetPaletteRef", MHEG5SETPALETTEREF },
179 
180 /*
181  Bitmap Actions
182  */
183  { ":ScaleBitmap", MHEG5SCALEBITMAP },
184  { ":SetTransparency", MHEG5SETTRANSPARENCY },
185  { ":SetBitmapDecodeOffset", MHEG5SETBITMAPDECODEOFFSET },
186  { ":GetBitmapDecodeOffset", MHEG5GETBITMAPDECODEOFFSET },
187 
188 /*
189  LineArt Actions
190  */
191  { ":SetLineColour", MHEG5SETLINECOLOUR },
192  { ":SetLineStyle", MHEG5SETLINESTYLE },
193  { ":SetLineWidth", MHEG5SETLINEWIDTH },
194  { ":SetFillColour", MHEG5SETFILLCOLOUR },
195 
196 /*
197  DynamicLineArt Actions
198  */
199  { ":GetLineColour", MHEG5GETLINECOLOUR },
200  { ":GetLineStyle", MHEG5GETLINESTYLE },
201  { ":GetLineWidth", MHEG5GETLINEWIDTH },
202  { ":GetFillColour", MHEG5GETFILLCOLOUR },
203  { ":DrawArc", MHEG5DRAWARC },
204  { ":DrawLine", MHEG5DRAWLINE },
205  { ":DrawOval", MHEG5DRAWOVAL },
206  { ":DrawPolygon", MHEG5DRAWPOLYGON },
207  { ":DrawPolyline", MHEG5DRAWPOLYLINE },
208  { ":DrawRectangle", MHEG5DRAWRECTANGLE },
209  { ":DrawSector", MHEG5DRAWSECTOR },
210  { ":Clear", MHEG5CLEAR },
211 
212 /*
213  Text Actions
214  */
215  { ":GetTextContent", MHEG5GETTEXTCONTENT },
216  { ":GetTextData", MHEG5GETTEXTDATA },
217  { ":SetFontRef", MHEG5SETFONTREF },
218  { ":SetTextColour", MHEG5SETTEXTCOLOUR },
219  { ":SetFontAttributes", MHEG5SETFONTATTRIBUTES },
220  { ":SetBackgroundColour", MHEG5SETBACKGROUNDCOLOUR },
221 
222 /*
223  Stream Actions
224  */
225  { ":SetCounterTrigger", MHEG5SETCOUNTERTRIGGER },
226  { ":SetSpeed", MHEG5SETSPEED },
227  { ":SetCounterEndPosition", MHEG5SETCOUNTERENDPOSITION },
228  { ":SetCounterPosition", MHEG5SETCOUNTERPOSITION },
229  { ":GetCounterPosition", MHEG5GETCOUNTERPOSITION },
230  { ":GetCounterMaxPosition", MHEG5GETCOUNTERMAXPOSITION },
231 
232 /*
233  Audio Actions
234  */
235  { ":SetVolume", MHEG5SETVOLUME },
236  { ":GetVolume", MHEG5GETVOLUME },
237 
238 /*
239  Video Actions
240  */
241  { ":ScaleVideo", MHEG5SCALEVIDEO },
242  { ":SetVideoDecodeOffset", MHEG5SETVIDEODECODEOFFSET },
243  { ":GetVideoDecodeOffset", MHEG5GETVIDEODECODEOFFSET },
244 
245 /*
246  RTGraphics Actions
247  */
248 /*
249  Interactible Actions
250  */
251  { ":SetInteractionStatus", MHEG5SETINTERACTIONSTATUS },
252  { ":GetInteractionStatus", MHEG5GETINTERACTIONSTATUS },
253  { ":SetHighlightStatus", MHEG5SETHIGHLIGHTSTATUS },
254  { ":GetHighlightStatus", MHEG5GETHIGHLIGHTSTATUS },
255 
256 /*
257  Slider Actions
258  */
259  { ":Step", MHEG5STEP },
260  { ":SetSliderValue", MHEG5SETSLIDERVALUE },
261  { ":GetSliderValue", MHEG5GETSLIDERVALUE },
262  { ":SetPortion", MHEG5SETPORTION },
263  { ":GetPortion", MHEG5GETPORTION },
264  { ":SetSliderParams", MHEG5SETSLIDERPARAMETERS },
265 
266 /*
267  EntryField Actions
268  */
269  { ":SetOverwriteMode", MHEG5SETOVERWRITEMODE },
270  { ":GetOverwriteMode", MHEG5GETOVERWRITEMODE },
271  { ":SetEntryPoint", MHEG5SETENTRYPOINT },
272  { ":GetEntryPoint", MHEG5GETENTRYPOINT },
273 /*
274  HyperText Actions
275  */
276  { ":GetLastAnchorFired", MHEG5GETLASTANCHORFIRED },
277 
278 /*
279  Button Actions
280  */
281  { ":Select", MHEG5SELECT },
282  { ":Deselect", MHEG5DESELECT },
283 
284 /*
285  Hotspot Actions
286  */
287 /*
288  Pushbutton Actions
289  */
290  { ":SetLabel", MHEG5SETLABEL },
291  { ":GetLabel", MHEG5GETLABEL },
292 
293 /*
294  Switchbutton Actions
295  */
296  { ":GetSelectionStatus", MHEG5GETSELECTIONSTATUS },
297  { ":Toggle", MHEG5TOGGLE },
298 
299 /*
300  END
301  */
302  { 0, MHEG5NONEACTION }
303 };
304 
305 #endif /* #if defined (MH5PRINTOUT) || defined (MHEG5LOG) */
306 
307 
308 #if defined(MH5PRINTOUT) || defined(MHEG5LOG) || defined(TRACING)
309 
310 extern int event_indent_num;
311 /*
312  For debuging
313  */
314 const char* MHEG5actionToString(MHEG5ElemActionType action)
315 {
316  int i = 0;
317 
318  while (MHEG5actiontoken[i].token != 0)
319  {
320  if (MHEG5actiontoken[i].action == action)
321  return MHEG5actiontoken[i].token;
322  i++;
323  }
324  return 0;
325 }
326 
327 #endif
328 
329 #ifdef MH5PRINTOUT
330 
331 extern int mheg_trace_source;
332 
334 {
335  int ind = (event_indent_num << 1);
336  char buff[256];
337  if (mheg_trace_source & 2)
338  {
339  buff[ind + 1] = 0;
340  while (ind > 0)
341  buff[ind--] = ' ';
342  buff[0] = '\n';
343  strcat(buff, MHEG5actionToString(a));
344  printf(buff);
345  MHEG5gListPrint(l, buff, 255);
346  }
347 }
348 
349 #endif
MHEG5Short MHEG5ElemActionType
Definition: mh5action.h:184
const char * MHEG5actionToString(MHEG5ElemActionType action)
action to string conversion
void MHEG5PrintAction(MHEG5Root *t, MHEG5ElemActionType a, MHEG5GList *l)