MHEG5  18.9.0
MHEG5 Documentation
mh5dynamiclineart.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  *******************************************************************************/
30 /*---includes for this file--------------------------------------------------*/
31 #include "mh5debug.h"
32 #include "mh5dynamiclineart.h"
33 #include "mh5object.h" /*for actions */
34 #include "mh5variable.h" /*for actions */
35 #include "mh5display.h" /*for actions */
36 #include "mh5memory.h"
37 #include "mh5action.h"
38 #include "tmcolor.h"
39 #include "mg_dla.h"
40 
41 /*---constant definitions for this file--------------------------------------*/
42 
43 
44 /*---local typedef structs for this file-------------------------------------*/
45 
46 typedef struct sMHEG5DrawAction
47 {
51  int lWidth;
55 
56 /*---local (static) variable declarations for this file----------------------*/
57 
58 /*---local function definitions----------------------------------------------*/
59 
60 static MHEG5ErrorCode DrawArc(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol)
61 {
62  MHEG5ErrorCode error_val;
63  MHEG5Int values[6];
64  int count = 0;
65  while ((count != 6) && params)
66  {
67  params = MHEG5resolveGenericInteger( params, &(values[count]));
68  count++;
69  }
70  if (count != 6)
71  {
72  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
73  }
74  /* Check elipseWidth and elipseHeight are within range specified by COR.1 18.2 */
75  else if ((values[2] < 0) || (values[3] < 0))
76  {
77  error_val = MHEG5ERR_WRONGPARAM;
78  }
79  else
80  {
81  TRACE(TGRAPHICS,("gd=%p lcol=%x",graphic,lcol))
82  OSDdrawArc( graphic,
83  values[0], values[1], /* x, y, */
84  values[2], values[3], /* elipseWidth, elipseHeight */
85  values[4], values[5], /* startAngle, arcAngle */
86  lwidth, lcol );
87  error_val = MHEG5ERR_NOERROR;
88  }
89  return error_val;
90 }
91 
92 static MHEG5ErrorCode DrawSector(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol, OSDColor fcol)
93 {
94  MHEG5ErrorCode error_val;
95  MHEG5Int values[6];
96  int count = 0;
97  while ((count != 6) && params)
98  {
99  params = MHEG5resolveGenericInteger( params, &(values[count]));
100  count++;
101  }
102  if (count != 6)
103  {
104  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
105  }
106  /* Check elipseWidth and elipseHeight are within range specified by COR.1 18.2 */
107  else if ((values[2] < 0) || (values[3] < 0))
108  {
109  error_val = MHEG5ERR_WRONGPARAM;
110  }
111  else
112  {
113  TRACE(TGRAPHICS,("gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
114  OSDdrawSector( graphic,
115  values[0], values[1], /* x, y, */
116  values[2], values[3], /* elipseWidth, elipseHeight */
117  values[4], values[5], /* startAngle, arcAngle */
118  lwidth, lcol, fcol);
119  error_val = MHEG5ERR_NOERROR;
120  }
121  return error_val;
122 }
123 
124 static MHEG5ErrorCode DrawLine(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol)
125 {
126  MHEG5ErrorCode error_val;
127  MHEG5Int values[6];
128  int count = 0;
129  while ((count != 4) && params)
130  {
131  params = MHEG5resolveGenericInteger( params, &(values[count]));
132  count++;
133  }
134  if (count != 4)
135  {
136  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
137  }
138  else
139  {
140  TRACE(TGRAPHICS,("gd=%p lcol=%x",graphic,lcol))
141  OSDdrawDrawLine( graphic,
142  values[0], values[1], /* x1, y1, */
143  values[2], values[3], /* x2, y2, */
144  lwidth, lcol );
145  error_val = MHEG5ERR_NOERROR;
146  }
147  return error_val;
148 }
149 
150 static MHEG5ErrorCode DrawOval(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol, OSDColor fcol)
151 {
152  MHEG5ErrorCode error_val;
153  MHEG5Int values[6];
154  int count = 0;
155  while ((count != 4) && params)
156  {
157  params = MHEG5resolveGenericInteger( params, &(values[count]));
158  count++;
159  }
160  if (count != 4)
161  {
162  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
163  }
164  /* Check elipseWidth and elipseHeight are within range specified by COR.1 18.2 */
165  else if ((values[2] < 0) || (values[3] < 0))
166  {
167  error_val = MHEG5ERR_WRONGPARAM;
168  }
169  else
170  {
171  TRACE(TGRAPHICS,("gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
172  OSDdrawEllipse(graphic,
173  values[0], values[1], /* x, y, */
174  values[2], values[3], /* elipseWidth, elipseHeight */
175  lwidth, lcol, fcol);
176  error_val = MHEG5ERR_NOERROR;
177  }
178  return error_val;
179 }
180 
181 static MHEG5ErrorCode DrawPolygon(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol, OSDColor fcol)
182 {
183  MHEG5Int x = 0, y = 0;
184  OSDdrawPolygonStart( graphic );
185  params = params->next;
186  while (params)
187  {
188  params = params->next;
189  if (!params)
190  {
191  break;;
192  }
193  params = MHEG5resolveGenericInteger(params, &x);
194  if (!params)
195  {
197  }
198  params = MHEG5resolveGenericInteger(params, &y);
199  params = params->next;
200  OSDdrawPolygonAdd( graphic, x, y );
201  }
202  TRACE(TGRAPHICS,("gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
203  OSDdrawPolygon( graphic, lwidth, lcol, fcol, MHEG5TRUE );
204  return MHEG5ERR_NOERROR;
205 }
206 
207 static MHEG5ErrorCode DrawPolyline(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol, OSDColor fcol)
208 {
209  MHEG5Int x = 0, y = 0;
210  OSDdrawPolygonStart( graphic );
211  params = params->next;
212  while (params)
213  {
214  params = params->next;
215  if (!params)
216  {
217  break;
218  }
219  params = MHEG5resolveGenericInteger(params, &x);
220  if (!params)
221  {
223  }
224  params = MHEG5resolveGenericInteger(params, &y);
225  params = params->next;
226  OSDdrawPolygonAdd( graphic, x, y );
227  }
228  TRACE(TGRAPHICS,("gd=%p lcol=%x",graphic,lcol))
229  OSDdrawPolygon( graphic, lwidth, lcol, fcol, MHEG5FALSE );
230  return MHEG5ERR_NOERROR;
231 }
232 
233 static MHEG5ErrorCode DrawRectangle(void *graphic, MHEG5GList *params, int lwidth, OSDColor lcol, OSDColor fcol)
234 {
235  MHEG5ErrorCode error_val;
236  MHEG5Int values[6];
237  int count = 0;
238  while ((count != 4) && params)
239  {
240  params = MHEG5resolveGenericInteger(params, &(values[count]));
241  count++;
242  }
243  if (count != 4)
244  {
245  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
246  }
247  else
248  {
249  TRACE(TGRAPHICS,("gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
250  OSDdrawRectangle( graphic,
251  values[0], values[1], /* x1, y1, */
252  values[2], values[3], /* x2, y2, */
253  lwidth, lcol, fcol );
254  error_val = MHEG5ERR_NOERROR;
255  }
256  return error_val;
257 }
258 
259 static MHEG5ErrorCode DrawAction(void *gdata, pMHEG5DrawAction pda)
260 {
261  switch (pda->action)
262  {
263  case MHEG5DRAWARC:
264  return DrawArc(gdata,pda->params,pda->lWidth,pda->lineCol);
265  case MHEG5DRAWLINE:
266  return DrawLine(gdata,pda->params,pda->lWidth,pda->lineCol);
267  case MHEG5DRAWOVAL:
268  return DrawOval(gdata,pda->params,pda->lWidth,pda->lineCol,pda->fillCol);
269  case MHEG5DRAWPOLYGON:
270  return DrawPolygon(gdata,pda->params,pda->lWidth,pda->lineCol,pda->fillCol);
271  case MHEG5DRAWPOLYLINE:
272  return DrawPolyline(gdata,pda->params,pda->lWidth,pda->lineCol,pda->fillCol);
273  case MHEG5DRAWRECTANGLE:
274  return DrawRectangle(gdata,pda->params,pda->lWidth,pda->lineCol,pda->fillCol);
275  case MHEG5DRAWSECTOR:
276  return DrawSector(gdata,pda->params,pda->lWidth,pda->lineCol,pda->fillCol);
277  default:;
278  }
279  TRACE(TERROR,("act=%d",pda->action))
280  return MHEG5ERR_WRONGPARAM;
281 }
282 
286 static MHEG5ErrorCode AddActionDraw(MHEG5DynamicLineart *dl, E_ElementryAction action, MHEG5GList *params)
287 {
288  MHEG5ErrorCode err;
289  pMHEG5DrawAction pda;
290  pda = MHEG5getMem(sizeof(MHEG5DrawAction));
291  if (pda == NULL)
292  {
294  }
295  else
296  {
297  pda->next = NULL;
298  pda->action = action;
299  pda->params = params;
300  pda->lWidth = dl->lineart.lineWidth;
303  TRACE(TGRAPHICS, ("dl=%p posn=%ld,%ld", dl, dl->lineart.visible.position[0], dl->lineart.visible.position[1]))
304  err = DrawAction(dl->lineart.visible.graphic_data,pda);
305  if (err == MHEG5ERR_NOERROR)
306  {
307  pMHEG5DrawAction *ppda;
308  ppda = &(dl->drawing);
309  while (*ppda != NULL)
310  {
311  ppda = &((*ppda)->next);
312  }
313  *ppda = pda;
315  }
316  else
317  {
318  TRACE(TERROR,("err=%d",err))
319  MHEG5freeMem(pda);
320  }
321  }
322  return err;
323 }
324 
328 static void ClearActionDraws(MHEG5DynamicLineart *dynamicLineart)
329 {
330  pMHEG5DrawAction pda,nxt;
331  DBGTRACE(TGRAPHICS,"XXXXXXXXXX dl=%p",dynamicLineart)
332  pda = dynamicLineart->drawing;
333  if (pda != NULL && pda->action == MHEG5NONEACTION)
334  {
335  nxt = pda->next;
336  pda->next = NULL;
337  pda = nxt;
338  }
339  else
340  {
341  dynamicLineart->drawing = NULL;
342  }
343  while (pda != NULL)
344  {
345  nxt = pda->next;
346  MHEG5freeMem(pda);
347  pda = nxt;
348  }
349 }
350 
354 static void DrawAgain(MHEG5DynamicLineart *dl)
355 {
356  pMHEG5DrawAction pda;
357  DBGTRACE(TGRAPHICS,"*********** dl=%p",dl)
358  pda = dl->drawing;
359  if (pda != NULL && pda->action == MHEG5NONEACTION)
360  {
363  dl->lineart.visible.boxSize[0], dl->lineart.visible.boxSize[1],
364  pda->lWidth, dl->lineart.borderedBoundingBox, pda->lineCol, pda->fillCol );
365  while (pda != NULL)
366  {
367  (void)DrawAction(dl->lineart.visible.graphic_data,pda);
368  pda = pda->next;
369  }
371  }
372 }
373 
374 /*---global function definitions---------------------------------------------*/
375 
376 /*
377  Debug
378  */
379 #ifdef MH5PRINTOUT
380 
381 void MHEG5dynamicLineartPrint(MHEG5DynamicLineart *dynamicLineart, char *out)
382 {
383  MHEG5lineartPrint(&dynamicLineart->lineart, out);
384 }
385 
386 #endif
387 
388 
395 {
396  assert(dynamicLineart);
397 
398  MHEG5lineartInit(&dynamicLineart->lineart);
399 }
400 
409 {
410  assert(dynamicLineart);
411 
412  MHEG5lineartFree(&dynamicLineart->lineart);
413 }
414 
422 {
423  pMHEG5DrawAction pda;
424  assert(dynamicLineart);
425  assert(dynamicLineart->lineart.visible.graphic_data == NULL);
426  pda = dynamicLineart->drawing;
427  if (pda == NULL)
428  {
429  pda = MHEG5getMem(sizeof(MHEG5DrawAction));
430  if (pda == NULL)
431  {
432  TRACE(TERROR,("Mem fail"))
433  }
434  else
435  {
436  pda->next = NULL;
437  pda->action = MHEG5NONEACTION;
438  pda->params = NULL;
439  pda->lWidth = dynamicLineart->lineart.originalLineWidth;
440  pda->lineCol = MHEG5displayColour(&dynamicLineart->lineart.refLineColour);
441  pda->fillCol = MHEG5displayColour(&dynamicLineart->lineart.refFillColour);
442  dynamicLineart->drawing = pda;
443  }
444  }
445  if (pda != NULL)
446  {
447  dynamicLineart->lineart.visible.graphic_data =
448  OSDinitDynamicLineart( dynamicLineart->lineart.visible.position[0],
449  dynamicLineart->lineart.visible.position[1],
450  dynamicLineart->lineart.visible.boxSize[0],
451  dynamicLineart->lineart.visible.boxSize[1],
452  /* BUG FIX - use original line width, line colour and fill colour. */
453  dynamicLineart->lineart.originalLineWidth,
454  dynamicLineart->lineart.borderedBoundingBox,
455  pda->lineCol, pda->fillCol );
456  }
457 }
458 
466 {
467  if (dynamicLineart->lineart.visible.graphic_data)
468  {
469  /* Free canvas */
471  dynamicLineart->lineart.visible.graphic_data = NULL;
472  }
473 }
474 
485 {
486  MHEG5lineartPrepare(&dynamicLineart->lineart);
487  MHEG5initDynamicLineart( dynamicLineart );
488 }
489 
497 {
498  if (!dynamicLineart->lineart.visible.ingredient.root.runningStatus)
499  {
500  if (!dynamicLineart->lineart.visible.ingredient.root.availabilityStatus)
501  {
502  MHEG5dynamicLineartPrepare( dynamicLineart );
503  }
504  else if (!dynamicLineart->lineart.visible.graphic_data)
505  {
506  /* Must have been stopped and now re-starting */
507  DrawAgain( dynamicLineart );
508  }
509  MHEG5visibleActivate(&dynamicLineart->lineart.visible);
510  }
511 }
512 
520 {
521  if (dynamicLineart->lineart.visible.ingredient.root.runningStatus)
522  {
523  MHEG5freeDynamicLineart( dynamicLineart );
524  MHEG5lineartDeactivate(&dynamicLineart->lineart);
525  }
526 }
527 
535 {
536  MHEG5freeDynamicLineart( dynamicLineart );
537  ClearActionDraws(dynamicLineart);
538  if (dynamicLineart->drawing != NULL)
539  {
540  MHEG5freeMem(dynamicLineart->drawing);
541  dynamicLineart->drawing = NULL;
542  }
543  MHEG5lineartDestruct(&dynamicLineart->lineart);
544 }
545 
546 /*
547  Actions
548  */
559 {
560  MHEG5ErrorCode error_val;
561 
562  assert(target);
563 
564  if (target->clazz != MHEG5DYNAMICLINEART)
565  {
566  error_val = MHEG5ERR_WRONGTARGET;
567  }
568  else if (!params)
569  {
570  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
571  }
572  else
573  {
575 
576  MHEG5resolveORef(params, &target);
577  if (!target)
578  {
579  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
580  }
581  else if (!target->runningStatus)
582  {
583  error_val = MHEG5ERR_PARAMNOTACTIVE;
584  }
585  else if (target->clazz == MHEG5INTEGERVARIABLE)
586  {
587  ((MHEG5IntegerVariable *) target)->value = dl->lineart.lineWidth;
588  error_val = MHEG5ERR_NOERROR;
589  }
590  else
591  {
592  error_val = MHEG5ERR_WRONGPARAM;
593  }
594  }
595  return error_val;
596 }
597 
608 {
609  MHEG5ErrorCode error_val;
610 
611  assert(target);
612 
613  if (target->clazz != MHEG5DYNAMICLINEART)
614  {
615  error_val = MHEG5ERR_WRONGTARGET;
616  }
617  else if (!params)
618  {
619  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
620  }
621  else
622  {
624 
625  MHEG5resolveORef(params, &target);
626  if (!target)
627  {
628  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
629  }
630  else if (!target->runningStatus)
631  {
632  error_val = MHEG5ERR_PARAMNOTACTIVE;
633  }
634  else if (target->clazz == MHEG5INTEGERVARIABLE)
635  {
636  ((MHEG5IntegerVariable *) target)->value = dl->lineart.lineStyle;
637  error_val = MHEG5ERR_NOERROR;
638  }
639  else
640  {
641  error_val = MHEG5ERR_WRONGPARAM;
642  }
643  }
644  return error_val;
645 }
646 
657 {
658  MHEG5ErrorCode error_val;
659 
660  assert(target);
661 
662  if (target->clazz != MHEG5DYNAMICLINEART)
663  {
664  error_val = MHEG5ERR_WRONGTARGET;
665  }
666  else if (!params)
667  {
668  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
669  }
670  else
671  {
673 
674  MHEG5resolveORef(params, &target);
675  if (!target)
676  {
677  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
678  }
679  else if (!target->runningStatus)
680  {
681  error_val = MHEG5ERR_PARAMNOTACTIVE;
682  }
683  else if (target->clazz == MHEG5INTEGERVARIABLE)
684  {
685  if (dl->lineart.refLineColour.type == MHEG5INT)
686  {
687  ((MHEG5IntegerVariable *) target)->value = dl->lineart.refLineColour.value.i;
688  }
689  error_val = MHEG5ERR_NOERROR;
690  }
691  else if (target->clazz == MHEG5OCTETSTRINGVARIABLE)
692  {
693  if (dl->lineart.refLineColour.type == MHEG5INT)
694  {
695  /* This colour has been cached by MHEG5displayColour. Convert it back */
696  MHEG5stringDestruct( &((MHEG5OctetStringVariable *) target)->value );
697  ((MHEG5OctetStringVariable *) target)->value = OSDsetColour( dl->lineart.refLineColour.value.i );
698  }
699  else if (dl->lineart.refLineColour.type == MHEG5OCTETSTRING)
700  {
701  MHEG5stringDestruct( &((MHEG5OctetStringVariable *) target)->value);
703  }
704  error_val = MHEG5ERR_NOERROR;
705  }
706  else
707  {
708  error_val = MHEG5ERR_WRONGPARAM;
709  }
710  }
711  return error_val;
712 }
713 
724 {
725  MHEG5ErrorCode error_val;
726 
727  assert(target);
728 
729  if (target->clazz != MHEG5DYNAMICLINEART)
730  {
731  error_val = MHEG5ERR_WRONGTARGET;
732  }
733  else if (!params)
734  {
735  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
736  }
737  else
738  {
740 
741  MHEG5resolveORef(params, &target);
742  if (!target)
743  {
744  error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
745  }
746  else if (!target->runningStatus)
747  {
748  error_val = MHEG5ERR_PARAMNOTACTIVE;
749  }
750  else if (target->clazz == MHEG5INTEGERVARIABLE)
751  {
752  if (dl->lineart.refLineColour.type == MHEG5INT)
753  {
754  ((MHEG5IntegerVariable *) target)->value = dl->lineart.refLineColour.value.i;
755  }
756  error_val = MHEG5ERR_NOERROR;
757  }
758  else if (target->clazz == MHEG5OCTETSTRINGVARIABLE)
759  {
760  if (dl->lineart.refLineColour.type == MHEG5INT)
761  {
762  /* This colour has been cached by MHEG5displayColour. Convert it back */
763  MHEG5stringDestruct( &((MHEG5OctetStringVariable *) target)->value );
764  ((MHEG5OctetStringVariable *) target)->value = OSDsetColour( dl->lineart.refFillColour.value.i );
765  }
766  else if (dl->lineart.refLineColour.type == MHEG5OCTETSTRING)
767  {
768  MHEG5stringDestruct( &((MHEG5OctetStringVariable *) target)->value);
770  }
771  error_val = MHEG5ERR_NOERROR;
772  }
773  else
774  {
775  error_val = MHEG5ERR_WRONGPARAM;
776  }
777  }
778  return error_val;
779 }
780 
791 {
792  MHEG5ErrorCode error_val;
793  assert(target);
794  if (target->clazz != MHEG5DYNAMICLINEART)
795  {
796  error_val = MHEG5ERR_WRONGTARGET;
797  }
798  else
799  {
800  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWARC,params);
801  }
802  return error_val;
803 }
804 
815 {
816  MHEG5ErrorCode error_val;
817  if (target->clazz != MHEG5DYNAMICLINEART)
818  {
819  error_val = MHEG5ERR_WRONGTARGET;
820  }
821  else
822  {
823  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWSECTOR,params);
824  }
825  return error_val;
826 }
827 
838 {
839  MHEG5ErrorCode error_val;
840 
841  assert(target);
842  if (target->clazz != MHEG5DYNAMICLINEART)
843  {
844  error_val = MHEG5ERR_WRONGTARGET;
845  }
846  else
847  {
848  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWLINE,params);
849  }
850  return error_val;
851 }
852 
863 {
864  MHEG5ErrorCode error_val;
865 
866  assert(target);
867 
868  if (target->clazz != MHEG5DYNAMICLINEART)
869  {
870  error_val = MHEG5ERR_WRONGTARGET;
871  }
872  else
873  {
874  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWOVAL,params);
875  }
876  return error_val;
877 }
878 
889 {
890  MHEG5ErrorCode error_val;
891 
892  assert(target);
893 
894  if (target->clazz != MHEG5DYNAMICLINEART)
895  {
896  error_val = MHEG5ERR_WRONGTARGET;
897  }
898  else
899  {
900  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWPOLYGON,params);
901  }
902  return error_val;
903 }
904 
915 {
916  MHEG5ErrorCode error_val;
917 
918  assert(target);
919 
920  if (target->clazz != MHEG5DYNAMICLINEART)
921  {
922  error_val = MHEG5ERR_WRONGTARGET;
923  }
924  else
925  {
926  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWPOLYLINE,params);
927  }
928  return error_val;
929 }
930 
941 {
942  MHEG5ErrorCode error_val;
943 
944  assert(target);
945 
946  if (target->clazz != MHEG5DYNAMICLINEART)
947  {
948  error_val = MHEG5ERR_WRONGTARGET;
949  }
950  else
951  {
952  error_val = AddActionDraw((MHEG5DynamicLineart *)target,MHEG5DRAWRECTANGLE,params);
953  }
954  return error_val;
955 }
956 
967 {
969 
970  assert(target);
971 
972  if (target->clazz != MHEG5DYNAMICLINEART)
973  {
974  return MHEG5ERR_WRONGTARGET;
975  }
976 
977  dl = (MHEG5DynamicLineart *)target;
978 
979  ClearActionDraws(dl);
980 
982 
984 
985  return MHEG5ERR_NOERROR;
986 }
987 
MHEG5Bool availabilityStatus
Definition: mh5root.h:52
void MHEG5visibleActivate(MHEG5Visible *visible)
Apply the activation behaviour of the visible class. Apply the activation behaviour off the visible c...
Definition: mh5visible.c:306
void MHEG5dynamicLineartPrepare(MHEG5DynamicLineart *dynamicLineart)
Apply the preparation behaviour of the dynamiclineart class Apply the preparation behaviour of the dy...
pMHEG5DrawAction next
MHEG5Int boxSize[2]
Definition: mh5visible.h:58
Implement the MHEG5 Dynamiclineart Class Defines means to dynamically draw vectorial graphical object...
void * OSDinitDynamicLineart(int x, int y, int w, int h, int lineWidth, int bordered, OSDColor lineColour, OSDColor fillColour)
On screen display - initialise dynamic line art.
Definition: mg_dla.c:311
#define DBGTRACE(...)
Definition: glue_debug.h:126
void OSDdrawSector(void *data, int x, int y, int w, int h, int startAngle, int arcAngle, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Add a draw sector action to the action list.
Definition: mg_dla.c:662
E_ElementryAction
Definition: mh5action.h:48
MHEG5Int i
Definition: mh5base.h:154
MHEG5Int originalLineWidth
Definition: mh5lineart.h:55
MHEG5String s
Definition: mh5base.h:156
U16BIT type
Definition: mh5base.h:151
Dynamic lineart for graphics layer.
MHEG5GList * MHEG5resolveGenericInteger(MHEG5GList *params, MHEG5Int *value)
Definition: mh5object.c:510
U32BIT OSDColor
Definition: osdtypes.h:41
void OSDclearDynamicLineart(void *data)
On screen display - clear dynamic line art.
Definition: mg_dla.c:183
#define MHEG5getMem
Definition: glue_memory.h:93
MHEG5Final clazz
Definition: mh5root.h:55
pMHEG5DrawAction drawing
MHEG5ErrorCode MHEG5clear(MHEG5Root *target, MHEG5GList *params)
Fills up the bounding box with the OriginalRefFillColour. Implementation of the Clear action of the d...
void OSDfreeDynamicLineart(void *data)
On screen display - free resources dla.
Definition: mg_dla.c:452
void OSDdrawArc(void *data, int x, int y, int w, int h, int startAngle, int arcAngle, int lineWidth, OSDColor lineColour)
Add a draw arc action to the action list.
Definition: mg_dla.c:499
MHEG5ErrorCode MHEG5drawOval(MHEG5Root *target, MHEG5GList *params)
Draws an ellipse bounded by the rectangle defined by the parameters. Implementation of the DrawOval a...
union MHEG5Generic::@6 value
void MHEG5dynamicLineartDestruct(MHEG5DynamicLineart *dynamicLineart)
Destruct a dynamiclineart object.
E_ElementryAction action
OSDColor MHEG5displayColour(MHEG5Colour *colour)
Convert Generic Colour value to OSD specific value. If the generic colour is encoded as a string it i...
Definition: mh5display.c:256
void MHEG5dynamicLineartActivate(MHEG5DynamicLineart *dynamicLineart)
Apply the activation behaviour of the dynamiclineart class.
MHEG5String MHEG5stringCopy(MHEG5String source)
<Function description>="">
Definition: mh5base.c:574
Implement the MHEG5 Variable Class 21 Variable Class Defines a variable within the context of a Group...
void MHEG5stringDestruct(MHEG5String *item)
Destruct a MHEG5String.
Definition: mh5base.c:686
void * graphic_data
Definition: mh5visible.h:64
long MHEG5Int
Definition: mh5base.h:73
void MHEG5freeDynamicLineart(MHEG5DynamicLineart *dynamicLineart)
Create the canvas for a dynamic lineart object.
MHEG5ErrorCode MHEG5drawSector(MHEG5Root *target, MHEG5GList *params)
Draws a sector between "StartAngle" and "StartAngle" + "ArcAngle". Implementation of the DrawSector a...
#define MHEG5freeMem
Definition: glue_memory.h:94
void OSDdrawPolygon(void *data, int lineWidth, OSDColor lineColour, OSDColor fillColour, int filled)
Add a draw polygon instruction to the action list.
Definition: mg_dla.c:871
void OSDdrawRectangle(void *data, int x1, int y1, int x2, int y2, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Add a draw rectangle action to the action list.
Definition: mg_dla.c:974
void OSDdrawPolygonAdd(void *data, int x, int y)
Add co-ordinates that describe a polygon to draw to the action list.
Definition: mg_dla.c:832
Manage elementary actions Manage a table of all actions and call a specific action which is defined b...
void MHEG5lineartFree(MHEG5Lineart *lineart)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5lineart.c:198
#define MHEG5displayRedraw(v)
Definition: mh5display.h:47
MHEG5ErrorCode MHEG5drawPolyline(MHEG5Root *target, MHEG5GList *params)
Draws series of joint lines. Implementation of the DrawPolyline action of the dynamiclineart class...
void MHEG5dynamicLineartFree(MHEG5DynamicLineart *dynamicLineart)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
MHEG5Int lineWidth
Definition: mh5lineart.h:61
MHEG5ErrorCode MHEG5drawArc(MHEG5Root *target, MHEG5GList *params)
Draws an arc between "StartAngle" and "StartAngle" + "ArcAngle". Implementation of the DrawArc action...
struct sMHEG5DrawAction MHEG5DrawAction
MHEG5Bool borderedBoundingBox
Definition: mh5lineart.h:54
MHEG5ErrorCode MHEG5getLineColour(MHEG5Root *target, MHEG5GList *params)
Retrieve the current LineColour of the DynamicLineart Object Implementation of the GetLineColour acti...
MHEG5ErrorCode
Definition: mh5base.h:222
void MHEG5dynamicLineartDeactivate(MHEG5DynamicLineart *dynamicLineart)
Apply the deactivation behaviour of the dynamiclineart class.
MHEG5ErrorCode MHEG5drawPolygon(MHEG5Root *target, MHEG5GList *params)
Draw a closed polygon. Implementation of the DrawPolygon action of the dynamiclineart class...
#define MHEG5TRUE
Definition: mh5base.h:49
MHEG5String OSDsetColour(OSDColor colour)
Converts an OSDColor type into an MHEG5 colour value For UK1 profile only RGBTCOLOR is defined...
Definition: tmcolor.c:210
void MHEG5dynamicLineartInit(MHEG5DynamicLineart *dynamicLineart)
Initialise a dynamicLineart object with default values.
MHEG5GList * params
MHEG5ErrorCode MHEG5getLineStyle(MHEG5Root *target, MHEG5GList *params)
Retrieve the current Line Style of the DynamicLineArt object Implementation of the GetLineStyle actio...
Implement functions to retrieve MHEG5objects by GroupID and ID.
Mheg5 logging and debug printing.
MHEG5Colour refFillColour
Definition: mh5lineart.h:64
void OSDdrawDrawLine(void *data, int x1, int y1, int x2, int y2, int lineWidth, OSDColor lineColour)
Add a draw line action to the action list.
Definition: mg_dla.c:741
MHEG5Bool runningStatus
Definition: mh5root.h:51
MHEG5Colour refLineColour
Definition: mh5lineart.h:63
void OSDdrawEllipse(void *data, int x, int y, int w, int h, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Add a draw ellipse action to the action list.
Definition: mg_dla.c:579
void MHEG5lineartDeactivate(MHEG5Lineart *lineart)
Definition: mh5lineart.c:238
MHEG5Ingredient ingredient
Definition: mh5visible.h:49
redirection include
void MHEG5lineartDestruct(MHEG5Lineart *lineart)
Definition: mh5lineart.c:245
MHEG5Visible visible
Definition: mh5lineart.h:51
Definition of colour type for MHEG5 - settings and conversions.
MHEG5ErrorCode MHEG5getLineWidth(MHEG5Root *target, MHEG5GList *params)
Retrieve the current Line Width of the DynamicLineart object Implementation of the GetLineWidth actio...
void OSDdrawPolygonStart(void *data)
Initialise a new draw polygon to add to the action list.
Definition: mg_dla.c:808
MHEG5GList * MHEG5resolveORef(MHEG5GList *params, MHEG5Root **object)
Definition: mh5object.c:126
void MHEG5lineartPrepare(MHEG5Lineart *lineart)
Definition: mh5lineart.c:215
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
void MHEG5lineartInit(MHEG5Lineart *lineart)
Initialise a lineart object with default values.
Definition: mh5lineart.c:178
void MHEG5initDynamicLineart(MHEG5DynamicLineart *dynamicLineart)
Create the canvas for a dynamic lineart object.
struct sMHEG5GList * next
Definition: mh5base.h:172
MHEG5Int position[2]
Definition: mh5visible.h:59
#define MHEG5FALSE
Definition: mh5base.h:48
MHEG5ErrorCode MHEG5drawLine(MHEG5Root *target, MHEG5GList *params)
Draws a line between ("X1", "Y1") and ("X2", "Y2"). Implementation of the DrawLine action of the dyna...
MHEG5ErrorCode MHEG5getFillColour(MHEG5Root *target, MHEG5GList *params)
Retrieve the current FillColour of the Dynamic Lineart object. Implementation of the GetFillColour ac...
MHEG5Int lineStyle
Definition: mh5lineart.h:62
MHEG5ErrorCode MHEG5drawRectangle(MHEG5Root *target, MHEG5GList *params)
Draws a rectangle. Implementation of the DrawRectangle action of the dynamiclineart class...
#define TRACE(t, x)
Definition: glue_debug.h:118