63 MHEG_PRINT(out,
"( ");
64 while (currIntList != NULL)
66 MHEG5intPrint(currIntList->number, out);
68 currIntList = currIntList->next;
86 while (currMovementTable != NULL)
89 MHEG5intListPrint(currMovementTable->row, out);
90 currMovementTable = currMovementTable->next;
108 MHEG_PRINT(out,
":movementTable: ");
109 MHEG5movementTablePrint(tokenManager->movementTable, out);
113 MHEG_PRINT(out,
"// TokenPosition:\t");
114 MHEG5intPrint(tokenManager->tokenPosition, out);
129 assert(tokenManager);
131 assert(tokenManager->movementTable == 0);
142 assert(tokenManager);
144 tokenManager->tokenPosition = 1;
159 assert(tokenManager);
161 mtEntry = tokenManager->movementTable;
164 ilEntry = mtEntry->row;
167 lastILEntry = ilEntry;
168 ilEntry = ilEntry->next;
169 MHEG5freeMem(lastILEntry);
171 lastMTEntry = mtEntry;
172 mtEntry = mtEntry->next;
173 MHEG5freeMem(lastMTEntry);
187 assert(tokenManager);
194 find = tokenManager->movementTable;
198 tokenManager->movementTable = row;
219 assert(tokenManager);
220 find = tokenManager->movementTable;
229 newItem->number = number;
257 item->number = source->number;
260 source = source->next;
278 table->row = MHEG5rowCopy(source->row);
281 source = source->next;
297 destination->tokenPosition = source->tokenPosition;
298 destination->movementTable = MHEG5movementTableCopy(source->movementTable);
312 assert(tokenManager);
345 static void MHEG5tokenManagerTransferToken(
MHEG5Root *source, MHEG5Int targetElement )
349 if ((source->clazz != MHEG5LISTGROUP) ||
352 MHEG5sendSync(source, MHEG5TOKENMOVEDFROM, tokenManager->tokenPosition );
353 tokenManager->tokenPosition = targetElement;
385 MHEG5Int movementId = 0, row = 1, col = 1;
392 return MHEG5ERR_WRONGNUMBEROFPARAMS;
394 if ((target->clazz != MHEG5TOKENGROUP) &&
395 (target->clazz != MHEG5LISTGROUP))
396 return MHEG5ERR_WRONGTARGET;
399 return MHEG5ERR_NOERROR;
401 MHEG5resolveGenericInteger(params, &movementId);
402 movementTable = ((
MHEG5TokenGroup *) target)->tokenManager.movementTable;
404 while ((movementTable) && (row < movementId))
406 movementTable = movementTable->next;
409 if ((movementTable) && (row == movementId))
411 oneRow = movementTable->row;
412 while ((oneRow) && (col != ((
MHEG5TokenGroup *) target)->tokenManager.tokenPosition))
414 oneRow = oneRow->next;
417 if ((oneRow) && (col == ((
MHEG5TokenGroup *) target)->tokenManager.tokenPosition))
419 if (((
MHEG5TokenGroup *) target)->tokenManager.tokenPosition != oneRow->number)
421 MHEG5tokenManagerTransferToken( target, oneRow->number );
425 return MHEG5ERR_NOERROR;
453 MHEG5Int movementId = 0;
458 return MHEG5ERR_WRONGNUMBEROFPARAMS;
459 if ((target->clazz != MHEG5TOKENGROUP) && (target->clazz != MHEG5LISTGROUP))
460 return MHEG5ERR_WRONGTARGET;
461 MHEG5resolveGenericInteger(params, &movementId);
462 if (((
MHEG5TokenGroup *) target)->tokenManager.tokenPosition != movementId)
464 MHEG5tokenManagerTransferToken( target, movementId );
466 return MHEG5ERR_NOERROR;
494 return MHEG5ERR_WRONGNUMBEROFPARAMS;
495 if ((target->clazz != MHEG5TOKENGROUP) && (target->clazz != MHEG5LISTGROUP))
496 return MHEG5ERR_WRONGTARGET;
498 MHEG5resolveORef(params, &tpVar);
501 return MHEG5ERR_WRONGNUMBEROFPARAMS;
502 if (tpVar->clazz != MHEG5INTEGERVARIABLE)
503 return MHEG5ERR_WRONGPARAM;
506 return MHEG5ERR_NOERROR;
void MHEG5tokenManagerInit(MHEG5TokenManager *tokenManager)
Initialise a tokenManager object with default values.
Implement the MHEG5 TokenManager Class 28 TokenManager Class Mix-in class that defines functions to m...
void MHEG5tokenManagerAddRow(MHEG5TokenManager *tokenManager)
Add a new row to a TokenManager.
Implement the MHEG5 Variable Class 21 Variable Class Defines a variable within the context of a Group...
void MHEG5tokenManagerAddNumber(MHEG5TokenManager *tokenManager, MHEG5Int number)
Insert a number into the last element of the movement table.
Implement the MHEG5 ListGroup Class Defines the location of list elements on the screen and theire in...
Implement the MHEG5 Tokengroup Class 29 TokenGroup Class. Defines a group of Visible objects for navi...
void MHEG5tokenManagerPrepare(MHEG5TokenManager *tokenManager)
Sets all internal attributes for the specified object to their default values.
MHEG5ErrorCode MHEG5getTokenPosition(MHEG5Root *target, MHEG5GList *params)
Set the Variable referenced by TokenPositionVar to the value of the TokenPosition attribute...
Event handling. Implementation of a combined queue for events and actions. This is the eventsystem wh...
MHEG5ErrorCode MHEG5move(MHEG5Root *target, MHEG5GList *params)
Move the token between elements of the group. The movement to apply from any particular element locat...
Implement functions to retrieve MHEG5objects by GroupID and ID.
void MHEG5tokenManagerFree(MHEG5TokenManager *tokenManager)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
void MHEG5tokenManagerCopy(MHEG5TokenManager *destination, MHEG5TokenManager *source)
Copy a TokenManager object. The movement table of the TokenManager object is copied as well...
void MHEG5tokenManagerDestruct(MHEG5TokenManager *tokenManager)
Destruct a TokenManager object.
MHEG5ErrorCode MHEG5moveTo(MHEG5Root *target, MHEG5GList *params)
Move the token to a specific element of the group. Implementation of the MoveTo (Target, Index) action of the TokenManager class.
void MHEG5sendSync(MHEG5Root *source, MHEG5EventType event, MHEG5Int data)
Store an event in the synchronous event queue.