MHEG5  18.9.0
MHEG5 Documentation
mh5drawtext.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2008 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 /*---includes for this file--------------------------------------------------*/
26 #include <string.h>
27 
28 #include "mg_drawtext.h"
29 #include "mh5drawtext.h"
30 #include "mh5application.h"
31 #include "mh5object.h"
32 #include "mh5font.h"
33 #include "mh5queue.h"
34 #include "mh5display.h"
35 #include "mh5debug.h"
36 #include "mg_api.h"
37 #include "mh5support.h"
38 
39 #include "tmcolor.h" /* for RGBT() */
40 
41 /* Default font attribute values */
42 #define FONT_ATTRIBUTES_DEFAULT_SIZE (24)
43 #define FONT_ATTRIBUTES_DEFAULT_LINESPACE (28)
44 #define FONT_ATTRIBUTES_DEFAULT_LETTERSPACE (0)
45 
46 /* 8 pixels - why would anyone have a text box with width or height of 8 pixels or less */
47 #define MINIMUM_BOX_DIMENSION 8
48 
49 /* Default hypertext link colours */
50 #define DEFAULT_LINK_COLOUR (RGBT(0x00, 0x00, 0xff, 0x00))
51 #define DEFAULT_ACTIVE_LINK_COLOUR (RGBT(0xff, 0x00, 0x00, 0x00))
52 #define DEFAULT_VISITED_LINK_COLOUR (RGBT(0x3f, 0x1f, 0x7f, 0x00))
53 
54 /* Characters used for Entryfield */
55 #define OBSCURED_INPUT_CHAR ('*')
56 
57 #ifdef HK_PROFILE
58 static MHEG5String hk_font_name = {(U32BIT)14, (U8BIT *)"rec://font/hk1"};
59 #endif
60 
72 static int parseInt(MHEG5String *string, int *offset)
73 {
74  int sgn;
75  int value;
76  int localOffset;
77 
78  /* Keep a local copy of offset */
79  localOffset = *offset;
80 
81  /* Check for a leading minus sign. sgn is set to 1 if the number is positive
82  * or -1 if it is negative.
83  */
84  sgn = 1;
85  if (string->data[localOffset] == '-')
86  {
87  /* Number is negative */
88  sgn = -1;
89 
90  /* Skip the minus sign */
91  localOffset++;
92  }
93  else if (string->data[localOffset] == '+')
94  {
95  /* Skip the plus sign */
96  localOffset++;
97  }
98 
99  /* Extract an integer value */
100  value = 0;
101  while ((localOffset < string->len) && (string->data[localOffset] <= '9') &&
102  (string->data[localOffset] >= '0'))
103  {
104  /* Multiply previous value by 10 and add the next digit */
105  value = value * 10 + (int) (string->data[localOffset]) - (int) '0';
106 
107  /* Increment the offset */
108  localOffset++;
109  }
110 
111  /* Copy the offset back to the return value */
112  *offset = localOffset;
113 
114  return value * sgn;
115 }
116 
159 static BOOLEAN getBoxAndAttribs( MHEG5Text *txt, VRect *pBox, pDrawTextAttrib pAttrib, pTextString pStr)
160 {
161  MHEG5String fa = txt->fontAttributes;
163  S16BIT font_index;
164  U8BIT font_size, font_style;
165 
166  /* Set the default values */
167  int retSize = FONT_ATTRIBUTES_DEFAULT_SIZE;
168  int retLinespace = FONT_ATTRIBUTES_DEFAULT_LINESPACE;
169  int retLetterspace = FONT_ATTRIBUTES_DEFAULT_LETTERSPACE;
170 
171  if (txt->visible.graphic_data)
172  {
174  txt->visible.graphic_data = NULL;
175  }
176  if ((txt->visible.boxSize[0] < MINIMUM_BOX_DIMENSION) ||
178  )
179  {
180  TRACE(TTEXT, ("TxtBox is too small (%ld,%ld)", txt->visible.boxSize[0], txt->visible.boxSize[1]));
181  return FALSE;
182  }
183  pBox->width = (U16BIT)txt->visible.boxSize[0];
184  pBox->height = (U16BIT)txt->visible.boxSize[1];
185  pBox->left = (S16BIT)txt->visible.position[0];
186  pBox->top = (S16BIT)txt->visible.position[1];
187  pStr->len = (U16BIT)txt->visible.ingredient.dataLen;
188  pStr->data = (U16BIT *)txt->visible.ingredient.data; /* conversion to unicode was done in MHEG5textContentAdapt */
189 
190  // hardware may not be able to cope with large surface sizes,
191  // so restrict to visible screen
192  txt->visible.restricted = FALSE;
193  if (pBox->width > 720)
194  {
195  pBox->width = txt->visible.rect.right - pBox->left;
196  txt->visible.restricted = TRUE;
197  }
198  if (pBox->height > 576)
199  {
200  pBox->height = txt->visible.rect.bottom - pBox->top;
201  txt->visible.restricted = TRUE;
202  }
203 
204  pAttrib->justify = (U8BIT)(txt->verticalJustification << 4) | (U8BIT)(txt->horizontalJustification);
205  if ((pAttrib->justify & JFY_HZ_MASK) == JUSTIFY_H_JUSTIFIED)
206  {
207  pAttrib->justify &= ~JUSTIFY_H_JUSTIFIED; /*treat "JUSTIFIED" just as "START" */
208  }
209  if (txt->textWrapping)
210  {
211  pAttrib->justify |= WRAP_WORDS;
212  }
213 
214  if (txt->textColour.type == MHEG5NONE)
215  {
216  /* Use application default text colour */
217  pAttrib->fore_colour = MHEG5displayColour( &application->textColour);
218  }
219  else
220  {
221  /* Retreive the text colour from the text object */
222  pAttrib->fore_colour = MHEG5displayColour( &txt->textColour );
223  }
224 
225  if (txt->backgroundColour.type == MHEG5NONE)
226  {
227  /* Use application default background colour */
228  pAttrib->back_colour = MHEG5displayColour( &application->backgroundColour );
229  }
230  else
231  {
232  /* Retreive the background colour from the text object */
233  pAttrib->back_colour = MHEG5displayColour( &txt->backgroundColour );
234  }
235 
236  /* use normal UK profile font as default */
237  font_index = 0;
238  font_style = FONT_STYLE_PLAIN;
239 
240  if (txt->font.referenced)
241  {
242  MHEG5Root *f_obj = MHEG5findObject( txt->font.ref.referenced.grp,
243  txt->font.ref.referenced.id );
244  /* use font object */
245  if (f_obj != NULL && f_obj->clazz == MHEG5FONT)
246  {
247  if (((MHEG5Font *)f_obj)->mg_fnt_index == INVALID_MG_FNT_INDEX)
248  {
249  /* need to display empty box, coz the font is still being loaded */
250  return FALSE;
251  }
252  font_index = ((MHEG5Font *)f_obj)->mg_fnt_index;
253  }
254  }
255  else if (!txt->font.ref.included.len) /* len > 0, then ref is in-built font */
256  {
257  /* check whether application default is pointing at font object */
258  if (application->fontBody.referenced)
259  {
260  MHEG5Root *f_obj = MHEG5findObject( application->fontBody.ref.referenced.grp,
261  application->fontBody.ref.referenced.id );
262  /* use font object */
263  if (f_obj != NULL && f_obj->clazz == MHEG5FONT)
264  {
265  if (((MHEG5Font *)f_obj)->mg_fnt_index == INVALID_MG_FNT_INDEX)
266  {
267  /* need to display empty box, coz the font is still being loaded */
268  return FALSE;
269  }
270  font_index = ((MHEG5Font *)f_obj)->mg_fnt_index;
271  }
272  }
273  }
274 
275  if (!txt->font.referenced && txt->font.ref.included.len > 0)
276  {
277  pAttrib->font_name.zptr = txt->font.ref.included.data;
278  pAttrib->font_name.zlen = txt->font.ref.included.len;
279  }
280  else if (!application->fontBody.referenced && application->fontBody.ref.included.len)
281  {
282  pAttrib->font_name.zptr = application->fontBody.ref.included.data;
283  pAttrib->font_name.zlen = application->fontBody.ref.included.len;
284  }
285  else
286  {
287  pAttrib->font_name.zlen = 0;
288  pAttrib->font_name.zptr = NULL;
289  }
290 
291  if (!txt->characterSetEncoded)
292  {
293  pAttrib->character_set = application->characterSet;
294  }
295  else
296  {
297  pAttrib->character_set = txt->characterSet;
298  }
299 
300  /* Parse the font attributes */
301  if (fa.len == 0)
302  {
303  /* This object does not have font attributes encoded - use the application defaults */
304  fa = application->fontAttributes;
305  }
306  if (fa.len != 0)
307  {
308  /* check for short Form */
309  if (fa.len == 5)
310  {
311  TRACE(TTEXT, ("Short FA=(0x%x,0x%x,0x%x,0x%x,0x%x)",
312  fa.data[0], fa.data[1], fa.data[2], fa.data[3], fa.data[4], fa.data[5]))
313  /* Parse the short form */
314  if (fa.data[0] & 0x10)
315  {
316  /* if not support HDGRAPHICS then ignore the style, fa.data[0], since we can only support plain
317  (see UK1.05 section 5.3.1.1) */
318  if (MH5_SupportHDGraphics())
319  {
320  font_style = FONT_STYLE_SQUARE;
321  }
322  }
323 
324  /* Extract the size, linespace and letterspace.
325  * Note: letterspace is a signed value, others are not
326  */
327  retSize = fa.data[1];
328  retLinespace = fa.data[2];
329  retLetterspace = fa.data[3] * 256 + fa.data[4];
330  if (retLetterspace > 0x7FFF)
331  {
332  /* Do sign conversion to negative letterspace */
333  retLetterspace -= 0x10000;
334  }
335  }
336  else
337  {
338  /* DAVIC-like long form */
339  int i = 0;
340  TRACE(TTEXT, ("Long FA=(%s)", fa.data))
341  if (MH5_SupportHDGraphics())
342  {
343  if (MHEG5strncmp((char *)fa.data, (char *)"square", 5) == 0)
344  {
345  font_style = FONT_STYLE_SQUARE;
346  }
347  }
348 
349  while ((i < fa.len) && (fa.data[i] != '.'))
350  {
351  i++;
352  }
353  if (i >= fa.len)
354  {
355  TRACE(TERROR, ("Unexpected end of font attributes %.*s", (int)fa.len, fa.data))
356  }
357  else
358  {
359  /* Skip the separating dot */
360  i++;
361 
362  retSize = parseInt(&fa, &i);
363  if ((i >= fa.len) || (fa.data[i] != '.'))
364  {
365  TRACE(TERROR, ("Unexpected end of font attributes or missing dot %.*s", (int)fa.len, fa.data))
367  }
368  else
369  {
370  /* Skip the separating dot */
371  i++;
372 
373  retLinespace = parseInt(&fa, &i);
374  if ((i >= fa.len) || (fa.data[i] != '.'))
375  {
376  TRACE(TERROR, ("Unexpected end of font attributes or missing dot %.*s", (int)fa.len, fa.data))
378  retLinespace = FONT_ATTRIBUTES_DEFAULT_LINESPACE;
379  }
380  else
381  {
382  /* Skip the separating dot */
383  i++;
384 
385  retLetterspace = parseInt(&fa, &i);
386  if (i != fa.len)
387  {
388  TRACE(TERROR, ("Expected end of font attributes %.*s", (int)fa.len, fa.data))
390  retLinespace = FONT_ATTRIBUTES_DEFAULT_LINESPACE;
391  retLetterspace = FONT_ATTRIBUTES_DEFAULT_LETTERSPACE;
392  }
393  }
394  }
395  }
396  }
397  }
398 
399  if (font_index != 0)
400  {
401  font_size = retSize; /* no restriction on size! */
402  }
403  else
404  {
405  /* When not doing CI+'s downloaded font ...
406  * If the font size does not match one of those of the in-built font the
407  * receiver shall substitute the next smaller size provided by the in-built
408  * font. If the required font is smaller than the smallest available, then
409  * the smallest available in-built size shall be used.
410  */
411  if (retSize < 26)
412  {
413  if ((retSize < 24) && (MH5_SupportHDGraphics()))
414  {
415  if (retSize < 22)
416  {
417  font_size = 20;
418  }
419  else
420  {
421  font_size = 22;
422  }
423  }
424  else
425  {
426  font_size = 24;
427  }
428  }
429  else if (retSize < 31)
430  {
431  font_size = 26;
432  }
433  else if (retSize < 36)
434  {
435  font_size = 31;
436  }
437  else
438  {
439  font_size = 36;
440  }
441  }
442 #ifdef HK_PROFILE
443  if (MHEG5stringEqual((MHEG5String *)&pAttrib->font_name, &hk_font_name))
444  {
445  pAttrib->font.fp.index = HK_FNT_MAGIC;
446  pAttrib->font.fp.size = font_size;
447  pAttrib->font.fp.style = font_style;
448  }
449  else
450 #endif
451  {
452  pAttrib->font.hdl = MG_AllocateFont( font_index, font_size, font_style );
453  }
454 
455  /* Check letterspace is in range [-32767, 32767] */
456  if (retLetterspace >= 32767)
457  {
458  pAttrib->letter_space = 32767;
459  }
460  else if (retLetterspace <= -32767)
461  {
462  pAttrib->letter_space = -32767;
463  }
464  else
465  {
466  pAttrib->letter_space = (S16BIT)retLetterspace;
467  }
468 
469  /* Check linespace is in range [0, 255] */
470  if (retLinespace >= 255)
471  {
472  pAttrib->line_space = 255;
473  }
474  else if (retLinespace <= 0)
475  {
476  pAttrib->line_space = 0;
477  }
478  else
479  {
480  pAttrib->line_space = (U8BIT)retLinespace;
481  }
482  return TRUE;
483 }
484 
486 {
487  VRect box;
488  DrawTextAttrib attrib;
489  TextString str;
490 
491  if (getBoxAndAttribs( txt, &box, &attrib, &str ))
492  {
493  if ((str.len > 0) && (str.data))
494  {
495  attrib.p_ha = NULL;
496  attrib.entry_point = -1;
497  txt->visible.graphic_data = MG_DrawText( str, &attrib, box );
498  }
499  }
500 }
501 
503 {
504  VRect box;
505  DrawTextAttrib attrib;
506  TextString str;
507 
508  if (getBoxAndAttribs((MHEG5Text *)entry, &box, &attrib, &str ))
509  {
510  if (entry->interactible.interactionStatus)
511  {
512  attrib.entry_point = (S16BIT)entry->entryPoint;
513  }
514  else
515  {
516  attrib.entry_point = -1;
517  }
518 
519  #ifdef INCLUDE_IC
520  if (cursor == CURSOR_REPLACE)
521  attrib.caret = ENTRY_OVERWRITE_CHAR;
522  else
523  #endif
524  attrib.caret = ENTRY_INSERT_CHAR;
525 
526  if ((str.len > 0) || (attrib.entry_point != -1))
527  {
528  /* For entryfields - No wrapping is allowed by UK profile 1.06 (sec 5.7.2)*/
529  #ifdef INCLUDE_IC
531  {
532  attrib.justify |= WRAP_WORDS;
533  }
534  else
535  #endif
536  {
537  attrib.justify &= ~(WRAP_WORDS | WRAP_VERTICAL);
538  }
539  /* Entryfields have a 4 pixel border for "manufacturer defined decoration".
540  * We use this to indicate highlight and interaction status.
541  */
542  box.top += 4;
543  box.height -= 8;
544  box.width -= 8;
545  box.left += 4;
546 
547  attrib.p_ha = NULL;
548 
549  if (entry->obscuredInput)
550  {
551  int i;
552  U16BIT o_str[256];
553  assert( str.len <= 255 );
554  if (str.len > 255)
555  str.len = 255;
556  for (i = 0; i != str.len; i++)
557  {
558  if (cursor == CURSOR_INSERT || i != attrib.entry_point - 1)
559  {
560  o_str[i] = OBSCURED_INPUT_CHAR;
561  }
562  else
563  {
564  o_str[i] = str.data[i];
565  }
566  }
567  str.data = o_str;
568  entry->text.visible.graphic_data = MG_DrawText( str, &attrib, box );
569  }
570  else
571  {
572  entry->text.visible.graphic_data = MG_DrawText( str, &attrib, box );
573  }
574  }
575  }
576 }
577 
579 {
580  VRect box;
581  DrawTextAttrib attrib;
582  HyperAttribs hyp_atb;
583  TextString str;
584 
585  if (getBoxAndAttribs((MHEG5Text *)hypertxt, &box, &attrib, &str ))
586  {
587  if ((str.len > 0) && (str.data))
588  {
589  attrib.entry_point = -1;
590  attrib.p_ha = &hyp_atb;
594  hyp_atb.markup_state = 0; /*initialise*/
595  hyp_atb.anchor_wrap = FALSE;
596  if (hypertxt->interactible.interactionStatus)
597  {
598  /* hyp_atb.interacting = TRUE; */
599  if (hypertxt->focusPosition == 0)
600  {
601  /* position is not yet initialised,
602  * so for the drawing the text, if there is a position, it's 1
603  */
604  hyp_atb.focus_position = 1;
605  }
606  else
607  {
608  hyp_atb.focus_position = (S16BIT)hypertxt->focusPosition;
609  }
610  }
611  else
612  {
613  /* hyp_atb.interacting = FALSE; */
614  hyp_atb.focus_position = 0;
615  }
616  hyp_atb.number_of_links = 0;
617 
618  hypertxt->text.visible.graphic_data = MG_DrawText( str, &attrib, box );
619 
620  /* Remember the anchor wrap state - from 'body' attributes */
621  if (hyp_atb.anchor_wrap)
622  {
623  hypertxt->anchorWrappingFlag = MHEG5TRUE;
624  }
625 
626  /* Remember the number of links in this hypertext object */
627  if (hypertxt->numberOfLinks == -1)
628  {
629  hypertxt->numberOfLinks = hyp_atb.number_of_links;
630  }
631  if (hypertxt->focusPosition == 0 && hypertxt->numberOfLinks > 0)
632  {
633  hypertxt->focusPosition = 1;
634  }
635 
636  /* Number of links changed - fire FocusMoved event */
637  if (hypertxt->focusPosition != hypertxt->lastFocusPosition)
638  {
639  MHEG5sendEvent((MHEG5Root *)hypertxt, MHEG5FOCUSMOVED, hypertxt->focusPosition );
640  hypertxt->lastFocusPosition = hypertxt->focusPosition;
641  }
642  }
643  }
644 }
645 
646 void MH5_DisplayText( MHEG5Text *txt, S_REGION *overlap )
647 {
648  OSDColor bg_col;
649  if (txt->backgroundColour.type == MHEG5NONE)
650  {
651  /* Use application default background colour */
652  bg_col = MHEG5displayColour( &MHEG5getCurrentApplication()->backgroundColour );
653  }
654  else
655  {
656  /* Retreive the background colour from the text object */
657  bg_col = MHEG5displayColour( &txt->backgroundColour );
658  }
659  MG_OSDdisplayRectangle( overlap, txt->visible.position[0], txt->visible.position[1],
660  txt->visible.boxSize[0], txt->visible.boxSize[1],
661  0, /*MHEG_LINE_STYLE_SOLID,*/ 0, /* <- no line, so all zero */
662  bg_col );
663 
664  if (txt->visible.graphic_data)
665  {
666  MG_OSDdisplayImage( txt->visible.graphic_data, overlap,
667  txt->visible.position[0], txt->visible.position[1] );
668  }
669 }
670 
671 void MH5_DisplayEntry( MHEG5Entryfield *entry, S_REGION *overlap )
672 {
673  OSDColor borderColour;
674  OSDColor backgroundColour;
675  S16BIT left = (S16BIT)entry->text.visible.position[0];
676  S16BIT top = (S16BIT)entry->text.visible.position[1];
677  U16BIT width = (U16BIT)entry->text.visible.boxSize[0];
678  U16BIT height = (U16BIT)entry->text.visible.boxSize[1];
679 
680  /* Entryfields have a 4 pixel border for "manufacturer defined decoration".
681  * We use this to indicate highlight and interaction status.
682  */
683 
685  {
687  {
688  borderColour = MHEG5displayColour( &MHEG5getCurrentApplication()->highlightRefColour );
689  }
690  else
691  {
692  borderColour = MHEG5displayColour( &entry->interactible.highlightRefColour );
693  }
694  }
695  else
696  {
697  if (entry->text.backgroundColour.type == MHEG5NONE)
698  {
699  /* Use application default background colour */
700  borderColour = MHEG5displayColour( &MHEG5getCurrentApplication()->backgroundColour );
701  }
702  else
703  {
704  /* Retreive the background colour from the text object */
705  borderColour = MHEG5displayColour( &entry->text.backgroundColour );
706  }
707  }
708 
709  if (entry->text.backgroundColour.type == MHEG5NONE)
710  {
711  /* Use application default background colour */
712  backgroundColour = MHEG5displayColour( &MHEG5getCurrentApplication()->backgroundColour );
713  }
714  else
715  {
716  /* Retreive the background colour from the text object */
717  backgroundColour = MHEG5displayColour( &entry->text.backgroundColour );
718  }
719  MG_OSDdisplayRectangle( overlap, left, top, width, height, 4, /*MHEG_LINE_STYLE_SOLID,*/ borderColour, backgroundColour );
720  if (entry->text.visible.graphic_data)
721  {
722  MG_OSDdisplayImage( entry->text.visible.graphic_data, overlap, left, top );
723  }
724 }
725 
S16BIT left
Definition: mg_drawtext.h:67
MHEG5Visible visible
Definition: mh5text.h:62
MHEG5Byte * data
Definition: mh5ingredient.h:80
MHEG5Interactible interactible
Definition: mh5hypertext.h:49
MHEG5String fontAttributes
void MG_OSDdisplayImage(void *data, S_REGION *overlap, int x, int y)
Definition: mg_osd.c:1453
S16BIT letter_space
Definition: mg_drawtext.h:109
void MHEG5drawEntry(MHEG5Entryfield *entry, entryfieldCursor_t cursor)
Definition: mh5drawtext.c:502
MHEG5Int boxSize[2]
Definition: mh5visible.h:58
S16BIT index
Definition: mg_drawtext.h:97
#define WRAP_VERTICAL
Definition: mg_drawtext.h:44
#define FONT_STYLE_PLAIN
Definition: mg_drawtext.h:32
#define FONT_ATTRIBUTES_DEFAULT_LINESPACE
Definition: mh5drawtext.c:43
#define DEFAULT_VISITED_LINK_COLOUR
Definition: mh5drawtext.c:52
MHEG5Bool MHEG5stringEqual(MHEG5String *s1, MHEG5String *s2)
Compare two Strings (case sensitive!)
Definition: mh5base.c:710
MHEG5Int verticalJustification
Definition: mh5text.h:71
MHEG5Bool MH5_SupportHDGraphics(void)
Returns whether supporting HD Graphics extension.
Definition: mh5support.c:465
MHEG5Int horizontalJustification
Definition: mh5text.h:70
pHyperAttribs p_ha
Definition: mg_drawtext.h:104
#define JUSTIFY_H_JUSTIFIED
Definition: mg_drawtext.h:40
U16BIT type
Definition: mh5base.h:151
MHEG5Root * MHEG5findObject(MH5GroupRef gid, MHEG5Int id)
Definition: mh5object.c:65
MHEG5String value
Definition: mh5cookies.c:52
U32BIT OSDColor
Definition: osdtypes.h:41
OSDColor link_colour
Definition: mg_drawtext.h:83
H_FontSize MG_AllocateFont(S16BIT fnt_index, U8BIT fnt_size, U8BIT fnt_style)
Allocate font of particular size from font file.
Definition: mg_font.c:485
MHEG5Final clazz
Definition: mh5root.h:55
#define WRAP_WORDS
Definition: mg_drawtext.h:42
MHEG5Bool characterSetEncoded
Definition: mh5text.h:94
MHEG5Bool highlightStatus
void MG_FreeData(void *data)
free surface buffer
Definition: mg_osd.c:1536
#define DEFAULT_LINK_COLOUR
Definition: mh5drawtext.c:50
MHEG5Int numberOfLinks
Definition: mh5hypertext.h:58
OSDColor fore_colour
Definition: mg_drawtext.h:105
MHEG5Int characterSet
Definition: mh5text.h:69
U8BIT * zptr
Definition: dtvstring.h:31
int16_t S16BIT
Definition: techtype.h:85
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
MHEG5FontBody font
Definition: mh5text.h:88
#define ENTRY_INSERT_CHAR
Definition: mg_drawtext.h:60
MHEG5Bool obscuredInput
Definition: mh5entryfield.h:53
MHEG5Colour textColour
Definition: mh5text.h:90
U8BIT style
Definition: mg_drawtext.h:99
void * graphic_data
Definition: mh5visible.h:64
MHEG5String fontAttributes
Definition: mh5text.h:89
uint8_t U8BIT
Definition: techtype.h:82
U16BIT * data
Definition: mg_drawtext.h:77
U8BIT size
Definition: mg_drawtext.h:98
MHEG5Bool textWrapping
Definition: mh5text.h:74
MHEG5Colour backgroundColour
MHEG5Colour backgroundColour
Definition: mh5text.h:91
MHEG5Int entryPoint
Definition: mh5entryfield.h:57
S_FontProp fp
Definition: mg_drawtext.h:116
U32BIT character_set
Definition: mg_drawtext.h:107
MHEG5Bool referenced
Definition: mh5base.h:242
S16BIT entry_point
Definition: mg_drawtext.h:108
void MHEG5drawText(MHEG5Text *txt)
Definition: mh5drawtext.c:485
Implement the MHEG5 Font Class Font Class Defines a class to represent a character font used for rend...
void MHEG5drawHypertext(MHEG5Hypertext *hypertxt)
Definition: mh5drawtext.c:578
#define JFY_HZ_MASK
Definition: mg_drawtext.h:46
S16BIT right
Definition: osdtypes.h:47
Event handling. Implementation of a combined queue for events and actions. This is the eventsystem wh...
#define FONT_STYLE_SQUARE
Definition: mg_drawtext.h:33
S16BIT top
Definition: mg_drawtext.h:68
union sMHEG5FontBody::@7 ref
MHEG5Text text
Definition: mh5hypertext.h:48
#define FONT_ATTRIBUTES_DEFAULT_LETTERSPACE
Definition: mh5drawtext.c:44
U8BIT anchor_wrap
Definition: mg_drawtext.h:90
MHEG5Byte * data
Definition: mh5base.h:85
#define FONT_ATTRIBUTES_DEFAULT_SIZE
Definition: mh5drawtext.c:42
void MH5_DisplayText(MHEG5Text *txt, S_REGION *overlap)
Definition: mh5drawtext.c:646
int len
Definition: mh5gate.c:57
#define OBSCURED_INPUT_CHAR
Definition: mh5drawtext.c:55
MHEG5Bool interactionStatus
#define MHEG5TRUE
Definition: mh5base.h:49
S16BIT bottom
Definition: osdtypes.h:48
MHEG5Bool anchorWrappingFlag
Definition: mh5hypertext.h:60
OSDColor active_colour
Definition: mg_drawtext.h:84
#define MHEG5strncmp(a, b, n)
Definition: mh5base.h:52
MHEG5Int characterSet
uint16_t U16BIT
Definition: techtype.h:84
Implement functions to retrieve MHEG5objects by GroupID and ID.
MHEG5Text text
Definition: mh5entryfield.h:47
Implementation of the MHEG5 Application Class Defines a set of Ingredient objects, which are shared within an application scope. Base class: Group Subclasses: None Status: Concrete class.
Mheg5 logging and debug printing.
S_STRING font_name
Definition: mg_drawtext.h:118
void MG_OSDdisplayRectangle(S_REGION *overlap, int x, int y, int width, int height, int lineWidth, OSDColor lineColour, OSDColor fillColour)
Draw rectangle.
Definition: mg_osd.c:566
MHEG class interface to graphics text render.
void MH5_DisplayEntry(MHEG5Entryfield *entry, S_REGION *overlap)
Definition: mh5drawtext.c:671
U16BIT len
Definition: mg_drawtext.h:76
BOOLEAN restricted
Definition: mh5visible.h:66
#define ENTRY_OVERWRITE_CHAR
Definition: mg_drawtext.h:61
U16BIT height
Definition: mg_drawtext.h:70
MHEG5Ingredient ingredient
Definition: mh5visible.h:49
MHEG5Int lastFocusPosition
Definition: mh5hypertext.h:59
OSDColor visit_colour
Definition: mg_drawtext.h:85
S16BIT focus_position
Definition: mg_drawtext.h:86
void * MG_DrawText(const TextString unistr, pDrawTextAttrib attrib, const VRect txt_box)
Create Surface and draw text string on it and terminate freetype library.
Definition: mg_drawtext.c:2275
#define MINIMUM_BOX_DIMENSION
Definition: mh5drawtext.c:47
void MHEG5sendEvent(MHEG5Root *source, MHEG5EventType event, MHEG5Int data)
Store an event in the asynchronous event queue.
Definition: mh5queue.c:1540
#define FALSE
Definition: techtype.h:68
MHEG5Bool MH5_SupportInteractionChannel(void)
Return whether Interaction channel is supported by current profile.
Definition: mh5support.c:423
entryfieldCursor_t
Definition: mh5entryfield.h:61
MHEG5Int len
Definition: mh5base.h:84
MHEG5Colour textColour
S16BIT number_of_links
Definition: mg_drawtext.h:87
MHEG5FontBody fontBody
U16BIT width
Definition: mg_drawtext.h:69
Definition of colour type for MHEG5 - settings and conversions.
U8BIT BOOLEAN
Definition: techtype.h:99
U32BIT zlen
Definition: dtvstring.h:30
#define TRUE
Definition: techtype.h:69
MHEG5Int focusPosition
Definition: mh5hypertext.h:55
#define INVALID_MG_FNT_INDEX
Definition: mh5font.h:40
MHEG5String included
Definition: mh5base.h:245
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
U8BIT markup_state
Definition: mg_drawtext.h:89
#define HK_FNT_MAGIC
Definition: mg_drawtext.h:63
OSDColor back_colour
Definition: mg_drawtext.h:106
S_REGION rect
Definition: mh5visible.h:65
MHEG5Int position[2]
Definition: mh5visible.h:59
MHEG5Interactible interactible
Definition: mh5entryfield.h:48
Interface to the MHEG text render that uses Freetype font library.
uint32_t U32BIT
Definition: techtype.h:86
MHEG5Colour highlightRefColour
Engine support utility functions for MHEG5.
H_FontSize hdl
Definition: mg_drawtext.h:115
#define DEFAULT_ACTIVE_LINK_COLOUR
Definition: mh5drawtext.c:51
MHEG5Application * MHEG5getCurrentApplication(void)
<Function description>="">
#define TRACE(t, x)
Definition: glue_debug.h:118
union _DrawTextAttrib::@14 font