MHEG5  18.9.0
MHEG5 Documentation
mh5final.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  *******************************************************************************/
33 /*---includes for this file--------------------------------------------------*/
34 #include "mh5profile.h"
35 #include "mh5final.h"
36 #include "mh5classes.h"
37 #include "mh5memory.h"
38 #include "mh5debug.h"
39 #include <string.h>
40 
41 /*---constant definitions for this file--------------------------------------*/
42 
43 
44 /*---local typedef structs for this file-------------------------------------*/
45 
46 /*---local (static) variable declarations for this file----------------------*/
47 
48 /*---local function definitions----------------------------------------------*/
49 
50 /*---global function definitions---------------------------------------------*/
51 
57 /*
58  Debug
59  */
60 #ifdef MH5PRINTOUT
61 
62 void MHEG5finalPrint(MHEG5Root *item, char *out)
63 {
64  switch (item->clazz)
65  {
66 /*
67  case MHEG5SCENE:
68  case MHEG5APPLICATION:
69  */
70  case MHEG5LINK:
71  MHEG5linkPrint((MHEG5Link *) item, out);
72  break;
73  case MHEG5BITMAP:
74  MHEG5bitmapPrint((MHEG5Bitmap *) item, out);
75  break;
76  case MHEG5TEXT:
77  MHEG5textPrint((MHEG5Text *) item, out);
78  break;
79  case MHEG5LINEART:
80  MHEG5lineartPrint((MHEG5Lineart *) item, out);
81  break;
83  MHEG5dynamicLineartPrint((MHEG5DynamicLineart *) item, out);
84  break;
85  case MHEG5RECTANGLE:
86  MHEG5rectanglePrint((MHEG5Rectangle *) item, out);
87  break;
89  case MHEG5REMOTEPROGRAM:
91  MHEG5programPrint((MHEG5Program *) item, out);
92  break;
98  MHEG5variablePrint((MHEG5Ingredient *) item, out);
99  break;
100  case MHEG5AUDIO:
101  case MHEG5VIDEO:
102  /*ignor these, as they get printed from stream multiplex*/
103  return;
104  case MHEG5STREAM:
105  MHEG5streamPrint((MHEG5Stream *) item, out);
106  break;
107 #ifndef MHEG5PROFILE_UK1_06
108  case MHEG5HOTSPOT:
109  MHEG5hotspotPrint((MHEG5Hotspot *)item, out);
110  break;
111  case MHEG5PUSHBUTTON:
112  MHEG5pushbuttonPrint((MHEG5Pushbutton *)item, out);
113  break;
114  case MHEG5SWITCHBUTTON:
115  MHEG5switchbuttonPrint((MHEG5Switchbutton *)item, out);
116  break;
117  case MHEG5RTGRAPHICS:
118  return;
119  case MHEG5PALETTE:
120  MHEG5palettePrint((MHEG5Palette *)item, out);
121  break;
122  case MHEG5CURSORSHAPE:
123  MHEG5cursorShapePrint((MHEG5CursorShape *)item, out);
124  break;
125 #endif
126  case MHEG5FONT:
127  MHEG5fontPrint((MHEG5Font *)item, out);
128  break;
129  case MHEG5TOKENGROUP:
130  MHEG5tokenGroupPrint((MHEG5TokenGroup *)item, out);
131  break;
132  case MHEG5LISTGROUP:
133  MHEG5listGroupPrint((MHEG5ListGroup *)item, out);
134  break;
135  case MHEG5ENTRYFIELD:
136  MHEG5entryfieldPrint((MHEG5Entryfield *)item, out);
137  break;
138  case MHEG5HYPERTEXT:
139  MHEG5hypertextPrint((MHEG5Hypertext *)item, out);
140  break;
141  case MHEG5SLIDER:
142  MHEG5sliderPrint((MHEG5Slider *)item, out);
143  break;
144  default:
145  ERROR_PRINT(("INTERNAL ERROR: MHEG5finalPrint Unrecognised class %d\n", item->clazz));
146  assert(0);
147  return;
148  }
149  MHEG5decIndent();
150  MHEG5indent(out);
151  MHEG_PRINT(out, "}");
152  MHEG5newLine(out);
153 }
154 
155 #endif /* #ifdef MH5PRINTOUT */
156 
157 
158 
159 
161 {
162  assert(item);
163 #ifdef MHEG5LOG
164  MHEG5LogPrintf(MHEG5CALLS, "MHEG5finalDestruct called for ");
165  MHEG5LogPrintObjectPtr(MHEG5CALLS, item);
166  MHEG5LogPrintf(MHEG5CALLS, "\n");
167 #endif
168  switch (item->clazz)
169  {
170  case MHEG5SCENE:
171  MHEG5sceneDestruct((MHEG5Scene *) item);
172  break;
173  case MHEG5APPLICATION:
175  break;
176  case MHEG5LINK:
177  MHEG5linkDestruct((MHEG5Link *) item);
178  break;
179  case MHEG5BITMAP:
181  break;
182  case MHEG5TEXT:
183  MHEG5textDestruct((MHEG5Text *) item);
184  break;
185  case MHEG5LINEART:
187  break;
188  case MHEG5DYNAMICLINEART:
190  break;
191  case MHEG5RECTANGLE:
193  break;
195  case MHEG5REMOTEPROGRAM:
198  break;
205  break;
206  case MHEG5STREAM:
208  break;
209  case MHEG5AUDIO:
210  MHEG5audioDestruct((MHEG5Audio *) item);
211  break;
212  case MHEG5VIDEO:
213  MHEG5videoDestruct((MHEG5Video *) item);
214  break;
215 #ifndef MHEG5PROFILE_UK1_06
216  case MHEG5HOTSPOT:
218  break;
219  case MHEG5PUSHBUTTON:
221  break;
222  case MHEG5SWITCHBUTTON:
224  break;
225  case MHEG5RTGRAPHICS:
227  break;
228  case MHEG5PALETTE:
230  break;
231  case MHEG5CURSORSHAPE:
233  break;
234 #endif
235  case MHEG5FONT:
236  MHEG5fontDestruct((MHEG5Font *)item);
237  break;
238  case MHEG5TOKENGROUP:
240  break;
241  case MHEG5LISTGROUP:
243  break;
244  case MHEG5ENTRYFIELD:
246  break;
247  case MHEG5HYPERTEXT:
249  break;
250  case MHEG5SLIDER:
252  break;
253  default:
254  ERROR_PRINT(("INTERNAL ERROR: MHEG5finalDestruct Unrecognised class %d\n", item->clazz));
255  assert(0);
256  return;
257  }
258 }
259 
261 {
262  assert(item);
263 #ifdef MHEG5LOG
264  MHEG5LogPrintf(MHEG5CALLS, "MHEG5finalActivate called for ");
265  MHEG5LogPrintObjectPtr(MHEG5CALLS, item);
266  MHEG5LogPrintf(MHEG5CALLS, "\n");
267 #endif
268  switch (item->clazz)
269  {
270  case MHEG5LINK:
271  MHEG5linkActivate((MHEG5Link *) item);
272  break;
273  case MHEG5BITMAP:
275  break;
276  case MHEG5TEXT:
277  MHEG5textActivate((MHEG5Text *) item);
278  break;
279  case MHEG5LINEART:
281  break;
282  case MHEG5DYNAMICLINEART:
284  break;
285  case MHEG5RECTANGLE:
287  break;
289  case MHEG5REMOTEPROGRAM:
292  break;
299  break;
300  case MHEG5STREAM:
302  break;
303  case MHEG5AUDIO:
304  MHEG5audioActivate((MHEG5Audio *) item);
305  break;
306  case MHEG5VIDEO:
307  MHEG5videoActivate((MHEG5Video *) item);
308  break;
309 #ifndef MHEG5PROFILE_UK1_06
310  case MHEG5HOTSPOT:
312  break;
313  case MHEG5PUSHBUTTON:
315  break;
316  case MHEG5SWITCHBUTTON:
318  break;
319  case MHEG5RTGRAPHICS:
321  break;
322  case MHEG5PALETTE:
324  break;
325  case MHEG5CURSORSHAPE:
327  break;
328 #endif
329  case MHEG5FONT:
330  MHEG5fontActivate((MHEG5Font *)item);
331  break;
332  case MHEG5TOKENGROUP:
334  break;
335  case MHEG5LISTGROUP:
337  break;
338  case MHEG5ENTRYFIELD:
340  break;
341  case MHEG5HYPERTEXT:
343  break;
344  case MHEG5SLIDER:
346  break;
347  default:
348  ERROR_PRINT(("INTERNAL ERROR: MHEG5finalActivate Unrecognised class %d\n", item->clazz));
349  assert(0);
350  return;
351  }
352 }
353 
355 {
356  assert(item);
357 #ifdef MHEG5LOG
358  MHEG5LogPrintf(MHEG5CALLS, "MHEG5finalDeactivate called for ");
359  MHEG5LogPrintObjectPtr(MHEG5CALLS, item);
360  MHEG5LogPrintf(MHEG5CALLS, "\n");
361 #endif
362  switch (item->clazz)
363  {
364  case MHEG5SCENE:
366  break;
367  case MHEG5APPLICATION:
369  break;
370  case MHEG5LINK:
371  MHEG5linkDeactivate((MHEG5Link *) item);
372  break;
373  case MHEG5BITMAP:
375  break;
376  case MHEG5TEXT:
377  MHEG5textDeactivate((MHEG5Text *) item);
378  break;
379  case MHEG5LINEART:
381  break;
382  case MHEG5DYNAMICLINEART:
384  break;
385  case MHEG5RECTANGLE:
387  break;
389  case MHEG5REMOTEPROGRAM:
392  break;
399  break;
400  case MHEG5STREAM:
402  break;
403  case MHEG5AUDIO:
405  break;
406  case MHEG5VIDEO:
408  break;
409 #ifndef MHEG5PROFILE_UK1_06
410  case MHEG5HOTSPOT:
412  break;
413  case MHEG5PUSHBUTTON:
415  break;
416  case MHEG5SWITCHBUTTON:
418  break;
419  case MHEG5RTGRAPHICS:
421  break;
422  case MHEG5PALETTE:
424  break;
425  case MHEG5CURSORSHAPE:
427  break;
428 #endif
429  case MHEG5FONT:
431  break;
432  case MHEG5TOKENGROUP:
434  break;
435  case MHEG5LISTGROUP:
437  break;
438  case MHEG5ENTRYFIELD:
440  break;
441  case MHEG5HYPERTEXT:
443  break;
444  case MHEG5SLIDER:
446  break;
447  default:
448  ERROR_PRINT(("INTERNAL ERROR: MHEG5finalDeactivate Unrecognised class %d\n", item->clazz));
449  assert(0);
450  return;
451  }
452 }
453 
void MHEG5sliderDestruct(MHEG5Slider *slider)
Destruct a slider object.
Definition: mh5slider.c:292
void MHEG5videoDestruct(MHEG5Video *video)
Destruct a video object. See also MHEG5videoInit.
Definition: mh5video.c:200
void MHEG5hotspotDeactivate(MHEG5Hotspot *hotspot)
Definition: mh5hotspot.c:101
void MHEG5sceneDestruct(MHEG5Scene *scene)
Destruct a scene object.
Definition: mh5scene.c:446
void MHEG5bitmapDestruct(MHEG5Bitmap *bitmap)
Destruct a bitmap object.
Definition: mh5bitmap.c:250
Distributor for Prepare, Destruct, Activate, Deactivate and Clone calls. Distribute the +Prepare +Des...
void MHEG5finalDestruct(MHEG5Root *item)
<Function description>="">
Definition: mh5final.c:160
void MHEG5rtgraphicsActivate(MHEG5RTGraphics *rtgraphics)
Apply the activation behaviour of the RTGraphics class.
void MHEG5finalDeactivate(MHEG5Root *item)
Definition: mh5final.c:354
void MHEG5programDeactivate(MHEG5Program *program)
Definition: mh5program.c:314
void MHEG5tokenGroupActivate(MHEG5TokenGroup *tokenGroup)
void MHEG5dynamicLineartDeactivate(MHEG5DynamicLineart *dynamicLineart)
Apply the deactivation behaviour of the dynamiclineart class.
void MHEG5fontActivate(MHEG5Font *font)
Definition: mh5font.c:160
void MHEG5videoDeactivate(MHEG5Video *video)
Apply the deactivation behaviour of the video class. As this class has no own deactivation behaviour ...
Definition: mh5video.c:171
void MHEG5pushbuttonActivate(MHEG5Pushbutton *pushbutton)
void MHEG5variableDestruct(MHEG5Ingredient *variable)
Destruct a variable object.
Definition: mh5variable.c:720
void MHEG5rectangleDeactivate(MHEG5Rectangle *rectangle)
Definition: mh5rectangle.c:130
void MHEG5switchbuttonActivate(MHEG5Switchbutton *switchbutton)
Apply the activation behaviour of the switchbutton class. As this class has no own activation behavio...
void MHEG5audioDeactivate(MHEG5Audio *audio)
Apply the deactivation behaviour off the audio class. As this class has no own deactivation behaviour...
Definition: mh5audio.c:177
void MHEG5textDestruct(MHEG5Text *text)
Destruct a text object.
Definition: mh5text.c:365
MHEG5Final clazz
Definition: mh5root.h:55
void MHEG5listGroupActivate(MHEG5ListGroup *listGroup)
Implementation of the ListGroup Activation behaviour.
Definition: mh5listgroup.c:423
void MHEG5finalActivate(MHEG5Root *item)
Definition: mh5final.c:260
void MHEG5rectangleActivate(MHEG5Rectangle *rectangle)
Definition: mh5rectangle.c:125
void MHEG5streamDeactivate(MHEG5Stream *stream)
Apply the deactivation behaviour of the stream class. Execute the following sequence of actions: ...
Definition: mh5stream.c:406
void MHEG5listGroupDeactivate(MHEG5ListGroup *listGroup)
Implementation of the ListGroup Deactivation behaviour.
Definition: mh5listgroup.c:462
void MHEG5listGroupDestruct(MHEG5ListGroup *listGroup)
Implementation of the ListGroup Destruction behaviour.
Definition: mh5listgroup.c:404
void MHEG5fontDestruct(MHEG5Font *font)
Definition: mh5font.c:151
void MHEG5hotspotDestruct(MHEG5Hotspot *hotspot)
Definition: mh5hotspot.c:107
void MHEG5entryfieldDestruct(MHEG5Entryfield *entryfield)
Destruct a entryfield object.
void MHEG5streamActivate(MHEG5Stream *stream)
Apply the activation behaviour of the stream class. Execute the following sequence of actions: ...
Definition: mh5stream.c:340
void MHEG5videoActivate(MHEG5Video *video)
Apply the activation behaviour of the video class.
Definition: mh5video.c:141
void MHEG5tokenGroupDestruct(MHEG5TokenGroup *tokenGroup)
This file defines the profile for the MHEG engine.
void MHEG5sliderActivate(MHEG5Slider *slider)
Apply the activation behaviour of the slider class. As this class has no own activation behaviour thi...
Definition: mh5slider.c:257
void MHEG5cursorShapeDestruct(MHEG5CursorShape *cursorShape)
Destruct a cursorshape object.
void MHEG5variableActivate(MHEG5Ingredient *variable)
Apply the activation behaviour of the Variable class. Apply the activation behaviour of the variable ...
Definition: mh5variable.c:665
void MHEG5tokenGroupDeactivate(MHEG5TokenGroup *tokenGroup)
void MHEG5hypertextDeactivate(MHEG5Hypertext *hypertext)
Definition: mh5hypertext.c:291
void MHEG5variableDeactivate(MHEG5Ingredient *variable)
Apply the deactivation behaviour of the variable class. As this class has no own deactivation behavio...
Definition: mh5variable.c:708
void MHEG5streamDestruct(MHEG5Stream *stream)
Destruct a stream object. Execute the following sequence of actions:
Definition: mh5stream.c:451
void MHEG5fontDeactivate(MHEG5Font *font)
Definition: mh5font.c:178
void MHEG5entryfieldDeactivate(MHEG5Entryfield *entryfield)
Apply the deactivation behaviour of the entryfield class. As this class has no own deactivation behav...
void MHEG5paletteActivate(MHEG5Palette *palette)
Definition: mh5palette.c:102
void MHEG5applicationDestruct(MHEG5Application *application)
Destruct an application object. This function destructs all parts of an application object...
void MHEG5paletteDestruct(MHEG5Palette *palette)
Definition: mh5palette.c:93
void MHEG5textDeactivate(MHEG5Text *text)
Apply the deactivation behaviour of the text class. As this class has no own deactivation behaviour t...
Definition: mh5text.c:348
void MHEG5switchbuttonDestruct(MHEG5Switchbutton *switchbutton)
Destruct a switchbutton object.
void MHEG5entryfieldActivate(MHEG5Entryfield *entryfield)
Apply the activation behaviour of the entryfield class. As this class has no own activation behaviour...
Mheg5 logging and debug printing.
void MHEG5bitmapActivate(MHEG5Bitmap *bitmap)
Apply the activation behaviour of the bitmap class. As this class has no own activation behaviour thi...
Definition: mh5bitmap.c:164
void MHEG5textActivate(MHEG5Text *text)
Apply the activation behaviour of the text class. As this class has no own activation behaviour this ...
Definition: mh5text.c:330
void MHEG5audioActivate(MHEG5Audio *audio)
Apply the activation behaviour off the audio class. Apply the activation behaviour of the base class...
Definition: mh5audio.c:144
void MHEG5lineartDeactivate(MHEG5Lineart *lineart)
Definition: mh5lineart.c:238
void MHEG5switchbuttonDeactivate(MHEG5Switchbutton *switchbutton)
Apply the deactivation behaviour of the switchbutton class. As this class has no own deactivation beh...
redirection include
void MHEG5rtgraphicsDeactivate(MHEG5RTGraphics *rtgraphics)
Apply the deactivation behaviour of the RTGraphics class. As this class has no own deactivation behav...
void MHEG5cursorShapeActivate(MHEG5CursorShape *cursorShape)
Apply the activation behaviour of the cursorshape class. As this class has no own activation behaviou...
void MHEG5rtgraphicsDestruct(MHEG5RTGraphics *rtgraphics)
Destruct a RTGraphics object.
#define ERROR_PRINT(x)
Definition: mh5debug.h:76
void MHEG5sceneDeactivate(MHEG5Scene *scene)
Apply the deactivation behaviour of the scene class. As this class has no own deactivation behaviour ...
Definition: mh5scene.c:511
void MHEG5hotspotActivate(MHEG5Hotspot *hotspot)
Definition: mh5hotspot.c:95
MHEG5ErrorCode MHEG5programActivate(MHEG5Program *program)
Definition: mh5program.c:236
void MHEG5lineartDestruct(MHEG5Lineart *lineart)
Definition: mh5lineart.c:245
void MHEG5pushbuttonDeactivate(MHEG5Pushbutton *pushbutton)
Include all classes.
void MHEG5cursorShapeDeactivate(MHEG5CursorShape *cursorShape)
Apply the deactivation behaviour of the cursorshape class. As this class has no own deactivation beha...
void MHEG5applicationDeactivate(MHEG5Application *application)
Apply the application deactivation behaviour +Apply the CloseConnection action to all opened auxiliar...
void MHEG5dynamicLineartDestruct(MHEG5DynamicLineart *dynamicLineart)
Destruct a dynamiclineart object.
void MHEG5hypertextDestruct(MHEG5Hypertext *hypertext)
Definition: mh5hypertext.c:300
void MHEG5hypertextActivate(MHEG5Hypertext *hypertext)
Definition: mh5hypertext.c:276
void MHEG5dynamicLineartActivate(MHEG5DynamicLineart *dynamicLineart)
Apply the activation behaviour of the dynamiclineart class.
void MHEG5sliderDeactivate(MHEG5Slider *slider)
Apply the deactivation behaviour of the slider class. As this class has no own deactivation behaviour...
Definition: mh5slider.c:276
void MHEG5paletteDeactivate(MHEG5Palette *palette)
Definition: mh5palette.c:117
void MHEG5audioDestruct(MHEG5Audio *audio)
Destruct an audio object.
Definition: mh5audio.c:205
void MHEG5rectangleDestruct(MHEG5Rectangle *rectangle)
Definition: mh5rectangle.c:135
void MHEG5lineartActivate(MHEG5Lineart *lineart)
Definition: mh5lineart.c:227
void MHEG5pushbuttonDestruct(MHEG5Pushbutton *pushbutton)
void MHEG5bitmapDeactivate(MHEG5Bitmap *bitmap)
Apply the deactivation behaviour of the bitmap class. As this class has no own deactivation behaviour...
Definition: mh5bitmap.c:210
void MHEG5programDestruct(MHEG5Program *program)
Definition: mh5program.c:327