MythTV  master
TokenGroup.cpp
Go to the documentation of this file.
1 /* TokenGroup.cpp
2 
3  Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation; either version 2
8  of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18  Or, point your browser to http://www.gnu.org/copyleft/gpl.html
19 
20 */
21 
22 
23 #include "TokenGroup.h"
24 #include "Presentable.h"
25 #include "Ingredients.h"
26 #include "Root.h"
27 #include "BaseClasses.h"
28 #include "ParseNode.h"
29 #include "ASN1Codes.h"
30 #include "Engine.h"
31 
33 {
34  // A pair consisting of an object reference and an optional action slot sequence.
35  m_Object.Initialise(p->GetSeqN(0), engine);
36 
37  if (p->GetSeqCount() > 1)
38  {
39  MHParseNode *pSlots = p->GetSeqN(1);
40 
41  for (int i = 0; i < pSlots->GetSeqCount(); i++)
42  {
43  MHParseNode *pAct = pSlots->GetSeqN(i);
44  auto *pActions = new MHActionSequence;
45  m_ActionSlots.Append(pActions);
46 
47  // The action slot entry may be NULL.
48  if (pAct->m_nNodeType != MHParseNode::PNNull)
49  {
50  pActions->Initialise(pAct, engine);
51  }
52  }
53  }
54 }
55 
56 void MHTokenGroupItem::PrintMe(FILE *fd, int nTabs) const
57 {
58  PrintTabs(fd, nTabs);
59  fprintf(fd, "( ");
60  m_Object.PrintMe(fd, nTabs + 1);
61  fprintf(fd, "\n");
62 
63  if (m_ActionSlots.Size() != 0)
64  {
65  PrintTabs(fd, nTabs + 1);
66  fprintf(fd, ":ActionSlots (\n");
67 
68  for (int i = 0; i < m_ActionSlots.Size(); i++)
69  {
70  PrintTabs(fd, nTabs + 2);
71  fprintf(fd, "( // slot %d\n", i);
72  MHActionSequence *pActions = m_ActionSlots.GetAt(i);
73 
74  if (pActions->Size() == 0)
75  {
76  PrintTabs(fd, nTabs + 2);
77  fprintf(fd, "NULL\n");
78  }
79  else
80  {
81  pActions->PrintMe(fd, nTabs + 2);
82  }
83 
84  PrintTabs(fd, nTabs + 2);
85  fprintf(fd, ")\n");
86  }
87 
88  PrintTabs(fd, nTabs + 1);
89  fprintf(fd, ")\n");
90  }
91 
92  PrintTabs(fd, nTabs);
93  fprintf(fd, ")\n");
94 }
95 
97 {
98  for (int i = 0; i < p->GetSeqCount(); i++)
99  {
100  m_movement.Append(p->GetSeqN(i)->GetIntValue());
101  }
102 }
103 
104 void MHMovement::PrintMe(FILE *fd, int nTabs) const
105 {
106  PrintTabs(fd, nTabs);
107  fprintf(fd, "( ");
108 
109  for (int i = 0; i < m_movement.Size(); i++)
110  {
111  fprintf(fd, "%d ", m_movement.GetAt(i));
112  }
113 
114  fprintf(fd, ")\n");
115 }
116 
118 {
119  MHPresentable::Initialise(p, engine);
120  MHParseNode *pMovements = p->GetNamedArg(C_MOVEMENT_TABLE);
121 
122  if (pMovements)
123  {
124  for (int i = 0; i < pMovements->GetArgCount(); i++)
125  {
126  auto *pMove = new MHMovement;
127  m_movementTable.Append(pMove);
128  pMove->Initialise(pMovements->GetArgN(i), engine);
129  }
130  }
131 
132  MHParseNode *pTokenGrp = p->GetNamedArg(C_TOKEN_GROUP_ITEMS);
133 
134  if (pTokenGrp)
135  {
136  for (int i = 0; i < pTokenGrp->GetArgCount(); i++)
137  {
138  auto *pToken = new MHTokenGroupItem;
139  m_tokenGrpItems.Append(pToken);
140  pToken->Initialise(pTokenGrp->GetArgN(i), engine);
141  }
142  }
143 
144  MHParseNode *pNoToken = p->GetNamedArg(C_NO_TOKEN_ACTION_SLOTS);
145 
146  if (pNoToken)
147  {
148  for (int i = 0; i < pNoToken->GetArgCount(); i++)
149  {
150  MHParseNode *pAct = pNoToken->GetArgN(i);
151  auto *pActions = new MHActionSequence;
152  m_noTokenActionSlots.Append(pActions);
153 
154  // The action slot entry may be NULL.
155  if (pAct->m_nNodeType != MHParseNode::PNNull)
156  {
157  pActions->Initialise(pAct, engine);
158  }
159  }
160  }
161 }
162 
163 // This is used to print the contents of the token group.
164 void MHTokenGroup::PrintContents(FILE *fd, int nTabs) const
165 {
166  MHPresentable::PrintMe(fd, nTabs + 1);
167 
168  if (m_movementTable.Size() != 0)
169  {
170  PrintTabs(fd, nTabs + 1);
171  fprintf(fd, ":MovementTable (\n");
172 
173  for (int i = 0; i < m_movementTable.Size(); i++)
174  {
175  m_movementTable.GetAt(i)->PrintMe(fd, nTabs + 2);
176  }
177 
178  PrintTabs(fd, nTabs + 1);
179  fprintf(fd, ")\n");
180  }
181 
182  if (m_tokenGrpItems.Size() != 0)
183  {
184  PrintTabs(fd, nTabs + 1);
185  fprintf(fd, ":TokenGroupItems (\n");
186 
187  for (int i = 0; i < m_tokenGrpItems.Size(); i++)
188  {
189  m_tokenGrpItems.GetAt(i)->PrintMe(fd, nTabs + 2);
190  }
191 
192  PrintTabs(fd, nTabs + 1);
193  fprintf(fd, ")\n");
194  }
195 
196  if (m_noTokenActionSlots.Size() != 0)
197  {
198  PrintTabs(fd, nTabs + 1);
199  fprintf(fd, ":NoTokenActionSlots (\n");
200 
201  for (int i = 0; i < m_noTokenActionSlots.Size(); i++)
202  {
204 
205  if (pActions->Size() == 0)
206  {
207  PrintTabs(fd, nTabs + 2);
208  fprintf(fd, "NULL ");
209  }
210  else
211  {
212  pActions->PrintMe(fd, nTabs + 2);
213  }
214  }
215 
216  PrintTabs(fd, nTabs + 1);
217  fprintf(fd, ")\n");
218  }
219 
220 }
221 
222 void MHTokenGroup::PrintMe(FILE *fd, int nTabs) const
223 {
224  PrintTabs(fd, nTabs);
225  fprintf(fd, "{:TokenGroup ");
226  PrintContents(fd, nTabs);
227  PrintTabs(fd, nTabs);
228  fprintf(fd, "}\n");
229 }
230 
231 // Activate the token group following the standard.
233 {
234  if (m_fRunning)
235  {
236  return;
237  }
238 
240 
241  // We're supposed to apply Activation to each of the "items" but it isn't clear
242  // exactly what that means. Assume it means each of the visibles.
243  for (int i = 0; i < m_tokenGrpItems.Size(); i++)
244  {
245  MHObjectRef *pObject = &m_tokenGrpItems.GetAt(i)->m_Object;
246 
247  // The object reference may be the null reference.
248  // Worse: it seems that sometimes in BBC's MHEG the reference simply doesn't exist.
249  if (pObject->IsSet())
250  {
251  try
252  {
253  engine->FindObject(m_tokenGrpItems.GetAt(i)->m_Object)->Activation(engine);
254  }
255  catch (...)
256  {
257  }
258  }
259  }
260 
262  m_fRunning = true;
263  engine->EventTriggered(this, EventIsRunning);
264 }
265 
267 {
268  if (! m_fRunning)
269  {
270  return;
271  }
272 
275 }
276 
277 // Internal function to generate the appropriate events.
278 void MHTokenGroup::TransferToken(int newPos, MHEngine *engine)
279 {
280  if (newPos != m_nTokenPosition)
281  {
283  m_nTokenPosition = newPos;
285  }
286 }
287 
288 // Perform the actions depending on where the token is.
290 {
291  if (m_nTokenPosition == 0) // No slot has the token.
292  {
293  if (n > 0 && n <= m_noTokenActionSlots.Size())
294  {
295  engine->AddActions(*(m_noTokenActionSlots.GetAt(n - 1)));
296  }
297  }
298  else
299  {
301  {
303 
304  if (n > 0 && n <= pGroup->m_ActionSlots.Size())
305  {
306  engine->AddActions(*(pGroup->m_ActionSlots.GetAt(n - 1)));
307  }
308  }
309  }
310 }
311 
312 void MHTokenGroup::Move(int n, MHEngine *engine)
313 {
314  if (m_nTokenPosition == 0 || n < 1 || n > m_movementTable.Size())
315  {
316  TransferToken(0, engine); // Not in the standard
317  }
318  else
319  {
321  }
322 }
323 
324 // ListGroup. This is a complex class and the description was extensively revised in the MHEG corrigendum.
325 // It doesn't seem to be used a great deal in practice and quite a few of the actions haven't been tested.
326 
328 {
329  while (!m_itemList.isEmpty())
330  {
331  delete m_itemList.takeFirst();
332  }
333 }
334 
336 {
337  MHTokenGroup::Initialise(p, engine);
338  MHParseNode *pPositions = p->GetNamedArg(C_POSITIONS);
339 
340  if (pPositions)
341  {
342  for (int i = 0; i < pPositions->GetArgCount(); i++)
343  {
344  MHParseNode *pPos = pPositions->GetArgN(i);
345  QPoint pos(pPos->GetSeqN(0)->GetIntValue(), pPos->GetSeqN(1)->GetIntValue());
346  m_positions.Append(pos);
347  }
348  }
349 
350  MHParseNode *pWrap = p->GetNamedArg(C_WRAP_AROUND);
351 
352  if (pWrap)
353  {
354  m_fWrapAround = pWrap->GetArgN(0)->GetBoolValue();
355  }
356 
357  MHParseNode *pMultiple = p->GetNamedArg(C_WRAP_AROUND);
358 
359  if (pMultiple)
360  {
361  m_fMultipleSelection = pMultiple->GetArgN(0)->GetBoolValue();
362  }
363 }
364 
365 void MHListGroup::PrintMe(FILE *fd, int nTabs) const
366 {
367  PrintTabs(fd, nTabs);
368  fprintf(fd, "{:ListGroup ");
369  MHTokenGroup::PrintContents(fd, nTabs);
370  PrintTabs(fd, nTabs + 1);
371  fprintf(fd, ":Positions (");
372 
373  for (int i = 0; i < m_positions.Size(); i++)
374  {
375  fprintf(fd, " ( %d %d )", m_positions.GetAt(i).x(), m_positions.GetAt(i).y());
376  }
377 
378  fprintf(fd, ")\n");
379 
380  if (m_fWrapAround)
381  {
382  PrintTabs(fd, nTabs + 1);
383  fprintf(fd, ":WrapAround true\n");
384  }
385 
387  {
388  PrintTabs(fd, nTabs + 1);
389  fprintf(fd, ":MultipleSelection true\n");
390  }
391 
392  PrintTabs(fd, nTabs);
393  fprintf(fd, "}\n");
394 }
395 
397 {
399 
400  for (int i = 0; i < m_tokenGrpItems.Size(); i++)
401  {
402  // Find the item and add it to the list if it isn't already there.
403  try
404  {
405  MHRoot *pItem = engine->FindObject(m_tokenGrpItems.GetAt(i)->m_Object);
406  MHListItem *p = nullptr;
407 
408  for (auto *item : qAsConst(m_itemList))
409  {
410  p = item;
411 
412  if (p->m_pVisible == pItem)
413  {
414  break;
415  }
416  }
417 
418  if (!p)
419  {
420  m_itemList.append(new MHListItem(pItem));
421  }
422  }
423  catch (...) // Ignore invalid or null objects.
424  {
425  }
426  }
427 }
428 
430 {
431  // Reset the positions of the visibles.
432  for (auto *item : qAsConst(m_itemList))
433  item->m_pVisible->ResetPosition();
434 
436 }
437 
439 {
441  MHTokenGroup::Activation(engine);
442  Update(engine);
443 }
444 
445 
447 {
448  // Deactivate the visibles.
449  for (auto *item : qAsConst(m_itemList))
450  item->m_pVisible->Deactivation(engine);
451 
453 }
454 
455 // Update action - set the position of the cells to be displayed and deactivate those
456 // which aren't.
458 {
459  if (m_itemList.isEmpty()) // Special cases when the list becomes empty
460  {
462  {
463  m_fFirstItemDisplayed = false;
464  engine->EventTriggered(this, EventFirstItemPresented, false);
465  }
466 
468  {
469  m_fLastItemDisplayed = false;
470  engine->EventTriggered(this, EventLastItemPresented, false);
471  }
472  }
473  else // Usual case.
474  {
475  for (int i = 0; i < m_itemList.size(); i++)
476  {
477  MHRoot *pVis = m_itemList.at(i)->m_pVisible;
478  int nCell = i + 1 - m_nFirstItem; // Which cell does this item map onto?
479 
480  if (nCell >= 0 && nCell < m_positions.Size())
481  {
482  if (i == 0 && ! m_fFirstItemDisplayed)
483  {
484  m_fFirstItemDisplayed = true;
485  engine->EventTriggered(this, EventFirstItemPresented, true);
486  }
487 
488  if (i == m_itemList.size() - 1 && ! m_fLastItemDisplayed)
489  {
490  m_fLastItemDisplayed = true;
491  engine->EventTriggered(this, EventLastItemPresented, true);
492  }
493 
494  try
495  {
496  pVis->SetPosition(m_positions.GetAt(i - m_nFirstItem + 1).x(), m_positions.GetAt(i - m_nFirstItem + 1).y(), engine);
497  }
498  catch (...) {}
499 
500  if (! pVis->GetRunningStatus())
501  {
502  pVis->Activation(engine);
503  }
504  }
505  else
506  {
507  if (i == 0 && m_fFirstItemDisplayed)
508  {
509  m_fFirstItemDisplayed = false;
510  engine->EventTriggered(this, EventFirstItemPresented, false);
511  }
512 
513  if (i == m_itemList.size() - 1 && m_fLastItemDisplayed)
514  {
515  m_fLastItemDisplayed = false;
516  engine->EventTriggered(this, EventLastItemPresented, false);
517  }
518 
519  if (pVis->GetRunningStatus())
520  {
521  pVis->Deactivation(engine);
522  pVis->ResetPosition();
523  }
524  }
525  }
526  }
527 
528  // Generate the HeadItems and TailItems events. Even in the MHEG corrigendum this is unclear.
529  // I'm not at all sure this is right.
531  {
533  }
534 
536  {
537  engine->EventTriggered(this, EventTailItems, m_itemList.size() - m_nFirstItem);
538  }
539 
540  m_nLastCount = m_itemList.size();
542 }
543 
544 // Add an item to the list
545 void MHListGroup::AddItem(int nIndex, MHRoot *pItem, MHEngine *engine)
546 {
547  // See if the item is already there and ignore this if it is.
548  for (auto *item : qAsConst(m_itemList))
549  {
550  if (item->m_pVisible == pItem)
551  {
552  return;
553  }
554  }
555 
556  // Ignore this if the index is out of range
557  if (nIndex < 1 || nIndex > m_itemList.size() + 1)
558  {
559  return;
560  }
561 
562  // Insert it at the appropriate position (MHEG indexes count from 1).
563  m_itemList.insert(nIndex - 1, new MHListItem(pItem));
564 
565  if (nIndex <= m_nFirstItem && m_nFirstItem < m_itemList.size())
566  {
567  m_nFirstItem++;
568  }
569 
570  Update(engine); // Apply the update behaviour
571 }
572 
573 // Remove an item from the list
574 void MHListGroup::DelItem(MHRoot *pItem, MHEngine * /*engine*/)
575 {
576  // See if the item is already there and ignore this if it is.
577  for (int i = 0; i < m_itemList.size(); i++)
578  {
579  if (m_itemList.at(i)->m_pVisible == pItem) // Found it - remove it from the list and reset the posn.
580  {
581  delete m_itemList.takeAt(i);
582  pItem->ResetPosition();
583 
584  if (i + 1 < m_nFirstItem && m_nFirstItem > 1)
585  {
586  m_nFirstItem--;
587  }
588 
589  return;
590  }
591  }
592 }
593 
594 // Set the selection status of the item to true
595 void MHListGroup::Select(int nIndex, MHEngine *engine)
596 {
597  MHListItem *pListItem = m_itemList.at(nIndex - 1);
598 
599  if (pListItem == nullptr || pListItem->m_fSelected)
600  {
601  return; // Ignore if already selected.
602  }
603 
604  if (! m_fMultipleSelection)
605  {
606  // Deselect any existing selections.
607  for (int i = 0; i < m_itemList.size(); i++)
608  {
609  if (m_itemList.at(i)->m_fSelected)
610  {
611  Deselect(i + 1, engine);
612  }
613  }
614  }
615 
616  pListItem->m_fSelected = true;
617  engine->EventTriggered(this, EventItemSelected, nIndex);
618 }
619 
620 // Set the selection status of the item to false
621 void MHListGroup::Deselect(int nIndex, MHEngine *engine)
622 {
623  MHListItem *pListItem = m_itemList.at(nIndex - 1);
624 
625  if (pListItem == nullptr || ! pListItem->m_fSelected)
626  {
627  return; // Ignore if not selected.
628  }
629 
630  pListItem->m_fSelected = false;
631  engine->EventTriggered(this, EventItemDeselected, nIndex);
632 }
633 
634 // Return the reference to the visible at the particular position.
635 void MHListGroup::GetCellItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine)
636 {
637  if (nCell < 1)
638  {
639  nCell = 1; // First cell
640  }
641 
642  if (nCell > m_positions.Size())
643  {
644  nCell = m_positions.Size(); // Last cell.
645  }
646 
647  int nVisIndex = nCell + m_nFirstItem - 2;
648 
649  if (nVisIndex >= 0 && nVisIndex < m_itemList.size())
650  {
651  MHRoot *pVis = m_itemList.at(nVisIndex)->m_pVisible;
652  engine->FindObject(itemDest)->SetVariableValue(pVis->m_ObjectReference);
653  }
654  else
655  {
656  engine->FindObject(itemDest)->SetVariableValue(MHObjectRef::Null);
657  }
658 }
659 
660 int MHListGroup::AdjustIndex(int nIndex) // Added in the MHEG corrigendum
661 {
662  int nItems = m_itemList.size();
663 
664  if (nItems == 0)
665  {
666  return 1;
667  }
668 
669  if (nIndex > nItems)
670  {
671  return ((nIndex - 1) % nItems) + 1;
672  }
673  if (nIndex < 0)
674  {
675  return nItems - ((-nIndex) % nItems);
676  }
677  return nIndex;
678 }
679 
680 void MHListGroup::GetListItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine)
681 {
682  if (m_fWrapAround)
683  {
684  nCell = AdjustIndex(nCell);
685  }
686 
687  if (nCell < 1 || nCell > m_itemList.size())
688  {
689  return; // Ignore it if it's out of range and not wrapping
690  }
691 
692  engine->FindObject(itemDest)->SetVariableValue(m_itemList.at(nCell - 1)->m_pVisible->m_ObjectReference);
693 }
694 
695 void MHListGroup::GetItemStatus(int nCell, const MHObjectRef &itemDest, MHEngine *engine)
696 {
697  if (m_fWrapAround)
698  {
699  nCell = AdjustIndex(nCell);
700  }
701 
702  if (nCell < 1 || nCell > m_itemList.size())
703  {
704  return;
705  }
706 
707  engine->FindObject(itemDest)->SetVariableValue(m_itemList.at(nCell - 1)->m_fSelected);
708 }
709 
710 void MHListGroup::SelectItem(int nCell, MHEngine *engine)
711 {
712  if (m_fWrapAround)
713  {
714  nCell = AdjustIndex(nCell);
715  }
716 
717  if (nCell < 1 || nCell > m_itemList.size())
718  {
719  return;
720  }
721 
722  Select(nCell, engine);
723 }
724 
725 void MHListGroup::DeselectItem(int nCell, MHEngine *engine)
726 {
727  if (m_fWrapAround)
728  {
729  nCell = AdjustIndex(nCell);
730  }
731 
732  if (nCell < 1 || nCell > m_itemList.size())
733  {
734  return;
735  }
736 
737  Deselect(nCell, engine);
738 }
739 
740 void MHListGroup::ToggleItem(int nCell, MHEngine *engine)
741 {
742  if (m_fWrapAround)
743  {
744  nCell = AdjustIndex(nCell);
745  }
746 
747  if (nCell < 1 || nCell > m_itemList.size())
748  {
749  return;
750  }
751 
752  if (m_itemList.at(nCell - 1)->m_fSelected)
753  {
754  Deselect(nCell, engine);
755  }
756  else
757  {
758  Select(nCell, engine);
759  }
760 }
761 
762 void MHListGroup::ScrollItems(int nCell, MHEngine *engine)
763 {
764  nCell += m_nFirstItem;
765 
766  if (m_fWrapAround)
767  {
768  nCell = AdjustIndex(nCell);
769  }
770 
771  if (nCell < 1 || nCell > m_itemList.size())
772  {
773  return;
774  }
775 
776  m_nFirstItem = nCell;
777  Update(engine);
778 }
779 
780 void MHListGroup::SetFirstItem(int nCell, MHEngine *engine)
781 {
782  if (m_fWrapAround)
783  {
784  nCell = AdjustIndex(nCell);
785  }
786 
787  if (nCell < 1 || nCell > m_itemList.size())
788  {
789  return;
790  }
791 
792  m_nFirstItem = nCell;
793  Update(engine);
794 }
795 
796 
797 
798 // Actions
800 {
801  MHElemAction::Initialise(p, engine);
802  m_index.Initialise(p->GetArgN(1), engine);
803  m_item.Initialise(p->GetArgN(2), engine);
804 }
805 
806 void MHAddItem::PrintArgs(FILE *fd, int /*nTabs*/) const
807 {
808  m_index.PrintMe(fd, 0);
809  m_item.PrintMe(fd, 0);
810 }
811 
813 {
814  MHObjectRef item;
815  m_item.GetValue(item, engine);
816  Target(engine)->AddItem(m_index.GetValue(engine), engine->FindObject(item), engine);
817 }
818 
820 {
821  MHElemAction::Initialise(p, engine);
822  m_index.Initialise(p->GetArgN(1), engine);
823  m_result.Initialise(p->GetArgN(2), engine);
824 }
825 
826 void MHGetListActionData::PrintArgs(FILE *fd, int /*nTabs*/) const
827 {
828  m_index.PrintMe(fd, 0);
829  m_result.PrintMe(fd, 0);
830 }
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:69
MHObjectRef
Definition: BaseClasses.h:153
MHParseNode::m_nNodeType
enum NodeType m_nNodeType
Definition: ParseNode.h:46
MHListGroup::m_positions
MHSequence< QPoint > m_positions
Definition: TokenGroup.h:139
MHListGroup::Select
void Select(int nIndex, MHEngine *engine)
Definition: TokenGroup.cpp:595
MHTokenGroup::Deactivation
void Deactivation(MHEngine *engine) override
Definition: TokenGroup.cpp:266
Presentable.h
MHObjectRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:278
MHTokenGroup::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: TokenGroup.cpp:222
MHRoot::GetRunningStatus
virtual bool GetRunningStatus()
Definition: Root.h:76
MHMovement::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: TokenGroup.cpp:96
MHRoot::ResetPosition
virtual void ResetPosition()
Definition: Root.h:171
EventHeadItems
@ EventHeadItems
Definition: Root.h:38
MHRoot::Deactivation
virtual void Deactivation(MHEngine *engine)
Definition: Root.cpp:85
MHIngredient::Preparation
void Preparation(MHEngine *engine) override
Definition: Ingredients.cpp:159
MHTokenGroup::m_noTokenActionSlots
MHOwnPtrSequence< MHActionSequence > m_noTokenActionSlots
Definition: TokenGroup.h:85
C_TOKEN_GROUP_ITEMS
#define C_TOKEN_GROUP_ITEMS
Definition: ASN1Codes.h:104
ASN1Codes.h
MHEngine
Definition: Engine.h:72
MHListGroup::m_fFirstItemDisplayed
bool m_fFirstItemDisplayed
Definition: TokenGroup.h:145
MHParseNode::GetIntValue
int GetIntValue()
Definition: ParseNode.cpp:170
MHTokenGroup::Activation
void Activation(MHEngine *engine) override
Definition: TokenGroup.cpp:232
MHParseNode::GetSeqN
MHParseNode * GetSeqN(int n)
Definition: ParseNode.cpp:152
MHListItem::m_fSelected
bool m_fSelected
Definition: TokenGroup.h:98
MHListGroup::m_fMultipleSelection
bool m_fMultipleSelection
Definition: TokenGroup.h:141
MHIngredient::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Ingredients.cpp:49
MHRoot::SetPosition
virtual void SetPosition(int, int, MHEngine *)
Definition: Root.h:157
EventTokenMovedTo
@ EventTokenMovedTo
Definition: Root.h:35
MHTokenGroup::TransferToken
void TransferToken(int newPos, MHEngine *engine)
Definition: TokenGroup.cpp:278
MHAddItem::PrintArgs
void PrintArgs(FILE *fd, int) const override
Definition: TokenGroup.cpp:806
MHTokenGroup::Move
void Move(int n, MHEngine *engine) override
Definition: TokenGroup.cpp:312
MHGenericInteger::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:397
MHListGroup::Activation
void Activation(MHEngine *engine) override
Definition: TokenGroup.cpp:438
EventLastItemPresented
@ EventLastItemPresented
Definition: Root.h:37
MHMovement
Definition: TokenGroup.h:50
MHListGroup::ScrollItems
void ScrollItems(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:762
MHObjectRef::Null
static MHObjectRef Null
Definition: BaseClasses.h:158
C_POSITIONS
#define C_POSITIONS
Definition: ASN1Codes.h:106
MHTokenGroup::CallActionSlot
void CallActionSlot(int n, MHEngine *engine) override
Definition: TokenGroup.cpp:289
MHRoot::SetVariableValue
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:108
MHAddItem::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:799
MHTokenGroup::m_movementTable
MHOwnPtrSequence< MHMovement > m_movementTable
Definition: TokenGroup.h:83
MHElemAction::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
EventIsRunning
@ EventIsRunning
Definition: Root.h:33
MHListGroup::DeselectItem
void DeselectItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:725
MHListGroup::Destruction
void Destruction(MHEngine *engine) override
Definition: TokenGroup.cpp:429
MHListGroup::~MHListGroup
~MHListGroup() override
Definition: TokenGroup.cpp:327
MHListGroup::SelectItem
void SelectItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:710
MHListGroup::Deselect
void Deselect(int nIndex, MHEngine *engine)
Definition: TokenGroup.cpp:621
C_WRAP_AROUND
#define C_WRAP_AROUND
Definition: ASN1Codes.h:107
MHListGroup::GetCellItem
void GetCellItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:635
MHParseNode::PNNull
@ PNNull
Definition: ParseNode.h:41
mythburn.FILE
int FILE
Definition: mythburn.py:139
MHObjectRef::IsSet
bool IsSet() const
Definition: BaseClasses.h:163
MHRoot::m_fRunning
bool m_fRunning
Definition: Root.h:252
MHRoot::m_ObjectReference
MHObjectRef m_ObjectReference
Definition: Root.h:247
MHGenericObjectRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:539
C_MOVEMENT_TABLE
#define C_MOVEMENT_TABLE
Definition: ASN1Codes.h:103
MHTokenGroupItem::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: TokenGroup.cpp:32
MHListGroup::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:335
MHListItem
Definition: TokenGroup.h:94
MHEngine::EventTriggered
void EventTriggered(MHRoot *pSource, enum EventType ev)
Definition: Engine.h:94
MHTokenGroupItem::m_ActionSlots
MHOwnPtrSequence< MHActionSequence > m_ActionSlots
Definition: TokenGroup.h:46
MHListGroup::ToggleItem
void ToggleItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:740
MHGetListActionData::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:819
hardwareprofile.config.p
p
Definition: config.py:33
MHAddItem::Perform
void Perform(MHEngine *engine) override
Definition: TokenGroup.cpp:812
EventFirstItemPresented
@ EventFirstItemPresented
Definition: Root.h:37
MHParseNode::GetSeqCount
int GetSeqCount()
Definition: ParseNode.cpp:141
ParseNode.h
MHListGroup::m_fWrapAround
bool m_fWrapAround
Definition: TokenGroup.h:140
PrintTabs
void PrintTabs(FILE *fd, int n)
Definition: ParseNode.cpp:34
MHMovement::m_movement
MHSequence< int > m_movement
Definition: TokenGroup.h:54
MHParseNode::GetArgN
MHParseNode * GetArgN(int n)
Definition: ParseNode.cpp:78
EventItemSelected
@ EventItemSelected
Definition: Root.h:38
MHIngredient::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Ingredients.cpp:107
MHEngine::FindObject
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:574
MHListGroup::GetListItem
void GetListItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:680
MHListGroup::m_fLastItemDisplayed
bool m_fLastItemDisplayed
Definition: TokenGroup.h:146
MHListGroup::AdjustIndex
int AdjustIndex(int nIndex)
Definition: TokenGroup.cpp:660
MHGetListActionData::m_result
MHObjectRef m_result
Definition: TokenGroup.h:212
MHTokenGroup::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:117
MHListGroup::m_itemList
QList< MHListItem * > m_itemList
Definition: TokenGroup.h:143
Engine.h
MHListGroup::Update
void Update(MHEngine *engine)
Definition: TokenGroup.cpp:457
MHTokenGroupItem
Definition: TokenGroup.h:40
MHGetListActionData::m_index
MHGenericInteger m_index
Definition: TokenGroup.h:211
MHListGroup::m_nLastFirstItem
int m_nLastFirstItem
Definition: TokenGroup.h:148
Ingredients.h
MHListGroup::SetFirstItem
void SetFirstItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:780
C_NO_TOKEN_ACTION_SLOTS
#define C_NO_TOKEN_ACTION_SLOTS
Definition: ASN1Codes.h:105
MHElemAction::Target
MHRoot * Target(MHEngine *engine)
Definition: BaseActions.cpp:46
MHParseNode::GetArgCount
int GetArgCount()
Definition: ParseNode.cpp:60
EventTokenMovedFrom
@ EventTokenMovedFrom
Definition: Root.h:35
MHTokenGroup::m_tokenGrpItems
MHOwnPtrSequence< MHTokenGroupItem > m_tokenGrpItems
Definition: TokenGroup.h:84
MHEngine::AddActions
void AddActions(const MHActionSequence &actions)
Definition: Engine.cpp:724
MHListGroup::Preparation
void Preparation(MHEngine *engine) override
Definition: TokenGroup.cpp:396
MHParseNode::GetBoolValue
bool GetBoolValue()
Definition: ParseNode.cpp:192
Root.h
MHTokenGroup::PrintContents
void PrintContents(FILE *fd, int nTabs) const
Definition: TokenGroup.cpp:164
MHMovement::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: TokenGroup.cpp:104
MHGetListActionData::PrintArgs
void PrintArgs(FILE *fd, int) const override
Definition: TokenGroup.cpp:826
MHAddItem::m_item
MHGenericObjectRef m_item
Definition: TokenGroup.h:193
MHAddItem::m_index
MHGenericInteger m_index
Definition: TokenGroup.h:192
TokenGroup.h
BaseClasses.h
MHActionSequence
Definition: Actions.h:29
MHListGroup::m_nLastCount
int m_nLastCount
Definition: TokenGroup.h:147
MHSequence::Size
int Size() const
Definition: BaseClasses.h:46
MHListGroup::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: TokenGroup.cpp:365
MHParseNode
Definition: ParseNode.h:39
MHActionSequence::PrintMe
virtual void PrintMe(FILE *fd, int nTabs) const
Definition: Actions.cpp:456
MHIngredient::Destruction
void Destruction(MHEngine *engine) override
Definition: Ingredients.cpp:175
MHGenericInteger::GetValue
int GetValue(MHEngine *engine) const
Definition: BaseClasses.cpp:426
EventItemDeselected
@ EventItemDeselected
Definition: Root.h:38
MHListGroup::Deactivation
void Deactivation(MHEngine *engine) override
Definition: TokenGroup.cpp:446
MHRoot::AddItem
virtual void AddItem(int, MHRoot *, MHEngine *)
Definition: Root.h:138
MHSequence::GetAt
BASE GetAt(int i) const
Definition: BaseClasses.h:48
MHSequence::Append
void Append(BASE b)
Definition: BaseClasses.h:63
MHGenericInteger::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:412
MHGenericObjectRef::GetValue
void GetValue(MHObjectRef &ref, MHEngine *engine) const
Definition: BaseClasses.cpp:568
EventTailItems
@ EventTailItems
Definition: Root.h:38
MHTokenGroup::m_nTokenPosition
int m_nTokenPosition
Definition: TokenGroup.h:88
MHTokenGroupItem::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: TokenGroup.cpp:56
MHListGroup::AddItem
void AddItem(int nIndex, MHRoot *pItem, MHEngine *engine) override
Definition: TokenGroup.cpp:545
MHListGroup::m_nFirstItem
int m_nFirstItem
Definition: TokenGroup.h:144
MHListGroup::DelItem
void DelItem(MHRoot *pItem, MHEngine *engine) override
Definition: TokenGroup.cpp:574
MHGenericObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:554
MHObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:299
MHTokenGroupItem::m_Object
MHObjectRef m_Object
Definition: TokenGroup.h:45
MHListGroup::GetItemStatus
void GetItemStatus(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:695
MHRoot
Definition: Root.h:44