49 E_ElementryAction action;
60 static MHEG5ErrorCode DrawArc(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol)
62 MHEG5ErrorCode error_val;
65 while ((count != 6) && params)
67 params = MHEG5resolveGenericInteger( params, &(values[count]));
72 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
75 else if ((values[2] < 0) || (values[3] < 0))
77 error_val = MHEG5ERR_WRONGPARAM;
81 TRACE(TGRAPHICS,(
"gd=%p lcol=%x",graphic,lcol))
87 error_val = MHEG5ERR_NOERROR;
92 static MHEG5ErrorCode DrawSector(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol, OSDColor fcol)
94 MHEG5ErrorCode error_val;
97 while ((count != 6) && params)
99 params = MHEG5resolveGenericInteger( params, &(values[count]));
104 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
107 else if ((values[2] < 0) || (values[3] < 0))
109 error_val = MHEG5ERR_WRONGPARAM;
113 TRACE(TGRAPHICS,(
"gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
115 values[0], values[1],
116 values[2], values[3],
117 values[4], values[5],
119 error_val = MHEG5ERR_NOERROR;
124 static MHEG5ErrorCode DrawLine(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol)
126 MHEG5ErrorCode error_val;
129 while ((count != 4) && params)
131 params = MHEG5resolveGenericInteger( params, &(values[count]));
136 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
140 TRACE(TGRAPHICS,(
"gd=%p lcol=%x",graphic,lcol))
142 values[0], values[1],
143 values[2], values[3],
145 error_val = MHEG5ERR_NOERROR;
150 static MHEG5ErrorCode DrawOval(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol, OSDColor fcol)
152 MHEG5ErrorCode error_val;
155 while ((count != 4) && params)
157 params = MHEG5resolveGenericInteger( params, &(values[count]));
162 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
165 else if ((values[2] < 0) || (values[3] < 0))
167 error_val = MHEG5ERR_WRONGPARAM;
171 TRACE(TGRAPHICS,(
"gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
173 values[0], values[1],
174 values[2], values[3],
176 error_val = MHEG5ERR_NOERROR;
181 static MHEG5ErrorCode DrawPolygon(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol, OSDColor fcol)
183 MHEG5Int x = 0, y = 0;
185 params = params->next;
188 params = params->next;
193 params = MHEG5resolveGenericInteger(params, &x);
196 return MHEG5ERR_WRONGNUMBEROFPARAMS;
198 params = MHEG5resolveGenericInteger(params, &y);
199 params = params->next;
202 TRACE(TGRAPHICS,(
"gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
204 return MHEG5ERR_NOERROR;
207 static MHEG5ErrorCode DrawPolyline(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol, OSDColor fcol)
209 MHEG5Int x = 0, y = 0;
211 params = params->next;
214 params = params->next;
219 params = MHEG5resolveGenericInteger(params, &x);
222 return MHEG5ERR_WRONGNUMBEROFPARAMS;
224 params = MHEG5resolveGenericInteger(params, &y);
225 params = params->next;
228 TRACE(TGRAPHICS,(
"gd=%p lcol=%x",graphic,lcol))
230 return MHEG5ERR_NOERROR;
233 static MHEG5ErrorCode DrawRectangle(
void *graphic,
MHEG5GList *params,
int lwidth, OSDColor lcol, OSDColor fcol)
235 MHEG5ErrorCode error_val;
238 while ((count != 4) && params)
240 params = MHEG5resolveGenericInteger(params, &(values[count]));
245 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
249 TRACE(TGRAPHICS,(
"gd=%p lcol=%x fcol=%x",graphic,lcol,fcol))
251 values[0], values[1],
252 values[2], values[3],
253 lwidth, lcol, fcol );
254 error_val = MHEG5ERR_NOERROR;
264 return DrawArc(gdata,pda->params,pda->lWidth,pda->lineCol);
266 return DrawLine(gdata,pda->params,pda->lWidth,pda->lineCol);
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);
279 TRACE(TERROR,(
"act=%d",pda->action))
280 return MHEG5ERR_WRONGPARAM;
293 err = MHEG5ERR_TARGETNOTAVAILABLE;
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)
308 ppda = &(dl->drawing);
309 while (*ppda != NULL)
311 ppda = &((*ppda)->next);
318 TRACE(TERROR,(
"err=%d",err))
331 DBGTRACE(TGRAPHICS,
"XXXXXXXXXX dl=%p",dynamicLineart)
332 pda = dynamicLineart->drawing;
333 if (pda != NULL && pda->action == MHEG5NONEACTION)
341 dynamicLineart->drawing = NULL;
357 DBGTRACE(TGRAPHICS,
"*********** dl=%p",dl)
359 if (pda != NULL && pda->action == MHEG5NONEACTION)
361 dl->lineart.visible.graphic_data =
363 dl->lineart.visible.boxSize[0], dl->lineart.visible.boxSize[1],
364 pda->lWidth, dl->lineart.borderedBoundingBox, pda->lineCol, pda->fillCol );
367 (void)DrawAction(dl->lineart.visible.graphic_data,pda);
383 MHEG5lineartPrint(&dynamicLineart->lineart, out);
396 assert(dynamicLineart);
410 assert(dynamicLineart);
424 assert(dynamicLineart);
425 assert(dynamicLineart->lineart.visible.graphic_data == NULL);
426 pda = dynamicLineart->drawing;
432 TRACE(TERROR,(
"Mem fail"))
437 pda->action = MHEG5NONEACTION;
439 pda->lWidth = dynamicLineart->lineart.originalLineWidth;
442 dynamicLineart->drawing = pda;
447 dynamicLineart->lineart.visible.graphic_data =
449 dynamicLineart->lineart.visible.position[1],
450 dynamicLineart->lineart.visible.boxSize[0],
451 dynamicLineart->lineart.visible.boxSize[1],
453 dynamicLineart->lineart.originalLineWidth,
454 dynamicLineart->lineart.borderedBoundingBox,
455 pda->lineCol, pda->fillCol );
467 if (dynamicLineart->lineart.visible.graphic_data)
471 dynamicLineart->lineart.visible.graphic_data = NULL;
486 MHEG5lineartPrepare(&dynamicLineart->lineart);
498 if (!dynamicLineart->lineart.visible.ingredient.root.runningStatus)
500 if (!dynamicLineart->lineart.visible.ingredient.root.availabilityStatus)
504 else if (!dynamicLineart->lineart.visible.graphic_data)
507 DrawAgain( dynamicLineart );
521 if (dynamicLineart->lineart.visible.ingredient.root.runningStatus)
524 MHEG5lineartDeactivate(&dynamicLineart->lineart);
537 ClearActionDraws(dynamicLineart);
538 if (dynamicLineart->drawing != NULL)
540 MHEG5freeMem(dynamicLineart->drawing);
541 dynamicLineart->drawing = NULL;
543 MHEG5lineartDestruct(&dynamicLineart->lineart);
560 MHEG5ErrorCode error_val;
564 if (target->clazz != MHEG5DYNAMICLINEART)
566 error_val = MHEG5ERR_WRONGTARGET;
570 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
576 MHEG5resolveORef(params, &target);
579 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
581 else if (!target->runningStatus)
583 error_val = MHEG5ERR_PARAMNOTACTIVE;
585 else if (target->clazz == MHEG5INTEGERVARIABLE)
588 error_val = MHEG5ERR_NOERROR;
592 error_val = MHEG5ERR_WRONGPARAM;
609 MHEG5ErrorCode error_val;
613 if (target->clazz != MHEG5DYNAMICLINEART)
615 error_val = MHEG5ERR_WRONGTARGET;
619 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
625 MHEG5resolveORef(params, &target);
628 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
630 else if (!target->runningStatus)
632 error_val = MHEG5ERR_PARAMNOTACTIVE;
634 else if (target->clazz == MHEG5INTEGERVARIABLE)
637 error_val = MHEG5ERR_NOERROR;
641 error_val = MHEG5ERR_WRONGPARAM;
658 MHEG5ErrorCode error_val;
662 if (target->clazz != MHEG5DYNAMICLINEART)
664 error_val = MHEG5ERR_WRONGTARGET;
668 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
674 MHEG5resolveORef(params, &target);
677 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
679 else if (!target->runningStatus)
681 error_val = MHEG5ERR_PARAMNOTACTIVE;
683 else if (target->clazz == MHEG5INTEGERVARIABLE)
685 if (dl->lineart.refLineColour.type == MHEG5INT)
689 error_val = MHEG5ERR_NOERROR;
691 else if (target->clazz == MHEG5OCTETSTRINGVARIABLE)
693 if (dl->lineart.refLineColour.type == MHEG5INT)
699 else if (dl->lineart.refLineColour.type == MHEG5OCTETSTRING)
704 error_val = MHEG5ERR_NOERROR;
708 error_val = MHEG5ERR_WRONGPARAM;
725 MHEG5ErrorCode error_val;
729 if (target->clazz != MHEG5DYNAMICLINEART)
731 error_val = MHEG5ERR_WRONGTARGET;
735 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
741 MHEG5resolveORef(params, &target);
744 error_val = MHEG5ERR_WRONGNUMBEROFPARAMS;
746 else if (!target->runningStatus)
748 error_val = MHEG5ERR_PARAMNOTACTIVE;
750 else if (target->clazz == MHEG5INTEGERVARIABLE)
752 if (dl->lineart.refLineColour.type == MHEG5INT)
756 error_val = MHEG5ERR_NOERROR;
758 else if (target->clazz == MHEG5OCTETSTRINGVARIABLE)
760 if (dl->lineart.refLineColour.type == MHEG5INT)
766 else if (dl->lineart.refLineColour.type == MHEG5OCTETSTRING)
771 error_val = MHEG5ERR_NOERROR;
775 error_val = MHEG5ERR_WRONGPARAM;
792 MHEG5ErrorCode error_val;
794 if (target->clazz != MHEG5DYNAMICLINEART)
796 error_val = MHEG5ERR_WRONGTARGET;
816 MHEG5ErrorCode error_val;
817 if (target->clazz != MHEG5DYNAMICLINEART)
819 error_val = MHEG5ERR_WRONGTARGET;
839 MHEG5ErrorCode error_val;
842 if (target->clazz != MHEG5DYNAMICLINEART)
844 error_val = MHEG5ERR_WRONGTARGET;
864 MHEG5ErrorCode error_val;
868 if (target->clazz != MHEG5DYNAMICLINEART)
870 error_val = MHEG5ERR_WRONGTARGET;
890 MHEG5ErrorCode error_val;
894 if (target->clazz != MHEG5DYNAMICLINEART)
896 error_val = MHEG5ERR_WRONGTARGET;
916 MHEG5ErrorCode error_val;
920 if (target->clazz != MHEG5DYNAMICLINEART)
922 error_val = MHEG5ERR_WRONGTARGET;
942 MHEG5ErrorCode error_val;
946 if (target->clazz != MHEG5DYNAMICLINEART)
948 error_val = MHEG5ERR_WRONGTARGET;
972 if (target->clazz != MHEG5DYNAMICLINEART)
974 return MHEG5ERR_WRONGTARGET;
979 ClearActionDraws(dl);
985 return MHEG5ERR_NOERROR;
void MHEG5visibleActivate(MHEG5Visible *visible)
Apply the activation behaviour of the visible class. Apply the activation behaviour off the visible c...
void MHEG5dynamicLineartPrepare(MHEG5DynamicLineart *dynamicLineart)
Apply the preparation behaviour of the dynamiclineart class Apply the preparation behaviour of the dy...
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.
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.
Dynamic lineart for graphics layer.
void OSDclearDynamicLineart(void *data)
On screen display - clear dynamic line art.
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.
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.
MHEG5ErrorCode MHEG5drawOval(MHEG5Root *target, MHEG5GList *params)
Draws an ellipse bounded by the rectangle defined by the parameters. Implementation of the DrawOval a...
void MHEG5dynamicLineartDestruct(MHEG5DynamicLineart *dynamicLineart)
Destruct a dynamiclineart object.
OSDColor MHEG5displayColour(MHEG5Colour *colour)
Convert Generic Colour value to OSD specific value. If the generic colour is encoded as a string it i...
void MHEG5dynamicLineartActivate(MHEG5DynamicLineart *dynamicLineart)
Apply the activation behaviour of the dynamiclineart class.
MHEG5String MHEG5stringCopy(MHEG5String source)
<Function description>="">
Implement the MHEG5 Variable Class 21 Variable Class Defines a variable within the context of a Group...
void MHEG5stringDestruct(MHEG5String *item)
Destruct a MHEG5String.
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...
void OSDdrawPolygon(void *data, int lineWidth, OSDColor lineColour, OSDColor fillColour, int filled)
Add a draw polygon instruction to the action list.
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.
void OSDdrawPolygonAdd(void *data, int x, int y)
Add co-ordinates that describe a polygon to draw to the action list.
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...
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...
MHEG5ErrorCode MHEG5drawArc(MHEG5Root *target, MHEG5GList *params)
Draws an arc between "StartAngle" and "StartAngle" + "ArcAngle". Implementation of the DrawArc action...
MHEG5ErrorCode MHEG5getLineColour(MHEG5Root *target, MHEG5GList *params)
Retrieve the current LineColour of the DynamicLineart Object Implementation of the GetLineColour acti...
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...
MHEG5String OSDsetColour(OSDColor colour)
Converts an OSDColor type into an MHEG5 colour value For UK1 profile only RGBTCOLOR is defined...
void MHEG5dynamicLineartInit(MHEG5DynamicLineart *dynamicLineart)
Initialise a dynamicLineart object with default values.
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.
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.
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 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.
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.
void MHEG5initDynamicLineart(MHEG5DynamicLineart *dynamicLineart)
Create the canvas for a dynamic lineart object.
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...
MHEG5ErrorCode MHEG5drawRectangle(MHEG5Root *target, MHEG5GList *params)
Draws a rectangle. Implementation of the DrawRectangle action of the dynamiclineart class...