46 #define UNICODE_BOM_LITTLE_ENDIAN 0xFFFE 47 #define UNICODE_BOM_BIG_ENDIAN 0xFEFF 60 void MHEG5textPrint(
MHEG5Text *text,
char *out)
63 MHEG5visiblePrint(&text->
visible, out);
69 MHEG_PRINT(out,
":OrigFont ");
77 MHEG_PRINT(out,
":FontAttributes ");
102 MHEG_PRINT(out,
":CharacterSet ");
110 MHEG_PRINT(out,
":HJustification ");
124 MHEG_PRINT(out,
":VJustification ");
138 MHEG_PRINT(out,
":LineOrientation vertical");
145 MHEG_PRINT(out,
":StartCorner ");
148 case 1: MHEG_PRINT(out,
"upper-right");
break;
149 case 2: MHEG_PRINT(out,
"lower-left");
break;
150 case 3: MHEG_PRINT(out,
"lower-right");
break;
159 MHEG_PRINT(out,
":TextColour ");
167 MHEG_PRINT(out,
":BackgroundColour ");
175 MHEG_PRINT(out,
":TextWrapping TRUE");
238 if (destination != NULL)
240 memset( destination, 0,
sizeof(
MHEG5Text));
508 if (mheg_trace_debug & TACTIONS)
511 strcpy(buff, T_NL
"MHEG5getTextData ");
512 MHEG5stringTrace(((
MHEG5Text *) target)->textDataRaw, buff, 0, 120 );
732 paramLength =
data[1];
742 return paramLength + 2;
769 unsigned short *adaptedData;
776 adaptedData =
MHEG5getMem(len *
sizeof(
unsigned short));
778 if (adaptedData == NULL)
780 ERROR_PRINT((
"ERROR : MHEG5textContentAdapt out of memory\n"));
788 if (data[pos] == 0x1b)
791 unsigned int markupLength;
793 adaptedData[adaptedDataLen] = data[pos];
797 markupLength = getMarkupLength(&data[pos], len - pos);
799 while (markupLength > 0)
801 adaptedData[adaptedDataLen] = data[pos];
828 if ((data[pos] & 0x80) == 0x00)
831 adaptedData[adaptedDataLen] = data[pos];
833 else if ((data[pos] & 0xe0) == 0xc0)
842 adaptedData[adaptedDataLen] = (data[pos] & 0x1F) << 6;
844 adaptedData[adaptedDataLen] |= (data[pos] & 0x3F);
846 else if ((data[pos] & 0xf0) == 0xe0)
855 adaptedData[adaptedDataLen] = (data[pos] & 0x0F) << 12;
857 adaptedData[adaptedDataLen] |= (data[pos] & 0x3F) << 6;
859 adaptedData[adaptedDataLen] |= (data[pos] & 0x3F);
861 else if ((data[pos] & 0xf8) == 0xf0)
870 adaptedData[adaptedDataLen] = 0;
876 adaptedData[adaptedDataLen] = 0;
892 if (adaptedDataLen == len)
909 adaptedDataLen *
sizeof(
unsigned short));
930 ERROR_PRINT((
"ERROR : MHEG5textContentAdapt out of memory\n"));
937 #ifdef DRAW_IN_ADVANCE 963 unsigned char *p_data, *p_end;
964 int is_little_endian;
966 unsigned short *p_adpt, tmp_adpt;
968 tmp_adpt = (data[0] << 8) | data[1];
973 is_little_endian = 1;
986 is_little_endian = 0;
992 if (is_little_endian)
994 while (p_data < p_end)
998 tmp_adpt |= *p_data << 8;
1001 if (tmp_adpt == 0x001B)
1003 m_len = getMarkupLength(p_data, p_end - p_data);
1011 while (p_data < p_end)
1013 tmp_adpt = *p_data << 8;
1015 tmp_adpt |= *p_data;
1018 if (tmp_adpt == 0x001B)
1020 m_len = getMarkupLength(p_data, p_end - p_data);
1028 p_adpt =
MHEG5getMem(adpt_len *
sizeof(
unsigned short));
1032 ERROR_PRINT((
"ERROR : MHEG5textContentAdapt out of memory\n"));
1040 if (is_little_endian)
1042 while (p_data < p_end)
1046 *p_adpt |= *p_data << 8;
1048 if (*p_adpt == 0x001B)
1051 m_len = getMarkupLength(p_data, p_end - p_data);
1054 *p_adpt++ = *p_data++;
1065 while (p_data < p_end)
1067 *p_adpt = *p_data << 8;
1071 if (*p_adpt == 0x001B)
1074 m_len = getMarkupLength(p_data, p_end - p_data);
1078 *p_adpt++ = *p_data++;
1111 ERROR_PRINT((
"ERROR : MHEG5textContentAdapt out of memory\n"));
1118 #ifdef DRAW_IN_ADVANCE 1147 unsigned char *unadaptedData;
1148 unsigned short *
data;
1157 if ((data == 0) || (dataLen == 0))
1169 if (unadaptedData == NULL)
1172 ERROR_PRINT((
"ERROR: MHEG5textContentUnadapt out of memory\n"));
1178 while (pos < dataLen)
1180 if (data[pos] == 0x1b)
1183 unsigned int markupLength;
1185 if ((data[pos + 1] >= 0x40) && (data[pos + 1] <= 0x5e))
1187 markupLength = data[pos + 2] + 3;
1189 else if ((data[pos + 1] >= 0x60) && (data[pos + 1] <= 0x7e))
1198 while (markupLength > 0)
1200 assert(data[pos] <= 0xff);
1201 unadaptedData[unadaptedLen] = (
unsigned char)data[pos];
1210 if (data[pos] <= 0x7f)
1215 unadaptedData[unadaptedLen++] = (
unsigned char)data[pos];
1217 else if (data[pos] <= 0x7ff)
1222 unadaptedData[unadaptedLen++] = (
unsigned char)((data[pos] & 0x07c0) >> 6) | 0xc0;
1223 unadaptedData[unadaptedLen++] = (
unsigned char)(data[pos] & 0x003f) | 0x80;
1230 unadaptedData[unadaptedLen++] = ((data[pos] & 0xf000) >> 12) | 0xe0;
1231 unadaptedData[unadaptedLen++] = ((data[pos] & 0x0fc0) >> 6) | 0x80;
1232 unadaptedData[unadaptedLen++] = (data[pos] & 0x003f) | 0x80;
1245 memcpy(*utf8Data, unadaptedData, unadaptedLen);
1246 *utf8Len = unadaptedLen;
1265 unsigned char *unadaptedData;
1266 unsigned short *
data;
1275 if ((data == 0) || (dataLen == 0))
1287 if (unadaptedData == NULL)
1290 ERROR_PRINT((
"ERROR: MHEG5textContentUnadapt out of memory\n"));
1298 unadaptedData[0] = 0xFF;
1299 unadaptedData[1] = 0xFE;
1304 unadaptedData[0] = 0xFE;
1305 unadaptedData[1] = 0xFF;
1313 while (pos < dataLen)
1315 if (data[pos] == 0x1b)
1318 unsigned int markupLength;
1320 if ((data[pos + 1] >= 0x40) && (data[pos + 1] <= 0x5e))
1322 markupLength = data[pos + 2] + 3;
1324 else if ((data[pos + 1] >= 0x60) && (data[pos + 1] <= 0x7e))
1333 while (markupLength > 0)
1335 assert(data[pos] <= 0xff);
1336 unadaptedData[unadaptedLen] = (
unsigned char)data[pos];
1347 unadaptedData[unadaptedLen++] = data[pos] & 0xff;
1348 unadaptedData[unadaptedLen++] = (data[pos] >> 8) & 0xff;
1352 unadaptedData[unadaptedLen++] = (data[pos] >> 8) & 0xff;
1353 unadaptedData[unadaptedLen++] = data[pos] & 0xff;
1362 if (*utf16Data != 0)
1364 memcpy(*utf16Data, unadaptedData, unadaptedLen);
1365 *utf16Len = unadaptedLen;
MHEG5Bool availabilityStatus
#define BOM_LITTLE_ENDIAN
void MHEG5textUtf8Content(MHEG5Text *text, unsigned char *data, int len)
Adapt new content for Text objects. Content is encoded using UTF8 - this is converted to 16 bit unico...
void MHEG5visibleActivate(MHEG5Visible *visible)
Apply the activation behaviour of the visible class. Apply the activation behaviour off the visible c...
void MHEG5textUtf16Content(MHEG5Text *text, unsigned char *data, int len)
Content for Text objects is encoded using UTF16.
#define HJUSTIFICATION_JUSTIFIED
MHEG5Int verticalJustification
void MHEG5drawHypertext(MHEG5Hypertext *hypertxt)
#define HJUSTIFICATION_START
MHEG5Int horizontalJustification
MHEG5Text * MHEG5textClone(MHEG5Text *source)
Copy a text object with original values.
void MHEG5textActivate(MHEG5Text *text)
Apply the activation behaviour of the text class. As this class has no own activation behaviour this ...
unsigned char * STR_DataAlloc(unsigned int size)
void MHEG5textRedraw(MHEG5Text *text)
Implement the MHEG5 Text Class 36 Text Class Defines attributes and behaviour of pieces of textual in...
void MHEG5visibleFree(MHEG5Visible *visible)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
void MG_FreeData(void *data)
free surface buffer
union sMH5GroupRef::@5 ptr
#define VJUSTIFICATION_JUSTIFIED
void MHEG5genericCopy(MHEG5Generic *dest, MHEG5Generic *src)
Copy a MHEG5Generic.
MHEG5ErrorCode MHEG5setBackgroundColour(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to set the BackgroundColour to the given colour. Implementation of the M...
void MHEG5drawEntry(MHEG5Entryfield *entry, entryfieldCursor_t cursor)
union MHEG5Generic::@6 value
MHEG5ErrorCode MHEG5setTextColour(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to set the TextColour to the given colour. Implementation of the MHEG5se...
void MHEG5visiblePrepare(MHEG5Visible *visible)
Apply the preparation behaviour off the visible class Apply the preparation behaviour of the visible ...
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.
MHEG5String fontAttributes
#define VJUSTIFICATION_CENTRE
void MHEG5visibleDestruct(MHEG5Visible *visible)
Destruct a visible object.
void MHEG5textFree(MHEG5Text *text)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
#define HJUSTIFICATION_CENTRE
MHEG5Colour backgroundColour
MHEG5ErrorCode MHEG5setFontAttributes(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to set the FontAttributes to the given attributes. Implementation of the...
MHEG5String originalFontAttributes
void MHEG5textPrepare(MHEG5Text *text)
Apply the preparation behaviour of the text class Apply the preparation behaviour of the text class...
This file defines the profile for the MHEG engine.
MHEG5GList * MHEG5resolveGenericOctetString(MHEG5GList *params, MHEG5String *value, MHEG5Bool *invalidString)
Resolve a parameter reference to a generic octet string. The reference can be either direct or indire...
MHEG5FontBody originalFont
#define MHEG5displayRedraw(v)
MHEG5Colour originalTextColour
#define UNICODE_BOM_LITTLE_ENDIAN
MHEG5ErrorCode MHEG5getTextContent(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to transfer the data of the content attribute of the text to the variabl...
#define MHEG5colourDestruct
void MHEG5textInit(MHEG5Text *text)
Initialise a text object with default values.
#define VJUSTIFICATION_END
union sMHEG5FontBody::@7 ref
#define UNICODE_BOM_BIG_ENDIAN
void MHEG5textContentUnadaptUTF16(MHEG5Text *text, MHEG5Byte **utf16Data, MHEG5Int *utf16Len)
Undo the adaption of content for Text objects. Adapted content is stored as 16 bit unicode - this is ...
Implement functions to retrieve MHEG5objects by GroupID and ID.
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.
MHEG class interface to graphics text render.
void MHEG5textContentUnadapt(MHEG5Text *text, MHEG5Byte **utf8Data, MHEG5Int *utf8Len)
Undo the adaption of content for Text objects. Adapted content is stored as 16 bit unicode - this is ...
MHEG5Ingredient ingredient
void MHEG5visibleClone(MHEG5Visible *destination, MHEG5Visible *source)
Copy a visible object with original values.
MHEG5ErrorCode MHEG5getTextData(MHEG5Root *target, MHEG5GList *params)
Set the Variable referenced by TextDataVar to the value of the TextData attribute. Implementation of the GetTextData (Target, TextDataVar) action of the text class.
MHEG5Bool verticalLineOrientation
MHEG5GList * MHEG5resolveORef(MHEG5GList *params, MHEG5Root **object)
MHEG5GList * MHEG5resolveGenericGeneric(MHEG5GList *params, MHEG5Generic *value)
#define HJUSTIFICATION_END
#define VJUSTIFICATION_START
Implement generic MHEG5-display functions - independent from the OSD These are generic functions used...
void MHEG5visibleDeactivate(MHEG5Visible *visible)
Apply the deactivation behaviour of the visible class. As this class has no own deactivation behaviou...
void MHEG5textDestruct(MHEG5Text *text)
Destruct a text object.
void MHEG5textDeactivate(MHEG5Text *text)
Apply the deactivation behaviour of the text class. As this class has no own deactivation behaviour t...
MHEG5ErrorCode MHEG5setFontRef(MHEG5Root *target, MHEG5GList *params)
The effect of this action is to change the character font used to preset a text. Implementation of th...
MHEG5Colour originalBackgroundColour
void MHEG5drawText(MHEG5Text *txt)
void MHEG5visibleInit(MHEG5Visible *visible)
Initialise a visible object with default values.
void MHEG5textClearTextData(MHEG5Text *text)
Clear text data.
Implement the MHEG5 EntryField Class. Defines an interaction widget used by the final user to edit an...