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,
538  static_cast<int>(m_itemList.size()) - m_nFirstItem);
539  }
540 
541  m_nLastCount = m_itemList.size();
543 }
544 
545 // Add an item to the list
546 void MHListGroup::AddItem(int nIndex, MHRoot *pItem, MHEngine *engine)
547 {
548  // See if the item is already there and ignore this if it is.
549  for (auto *item : qAsConst(m_itemList))
550  {
551  if (item->m_pVisible == pItem)
552  {
553  return;
554  }
555  }
556 
557  // Ignore this if the index is out of range
558  if (nIndex < 1 || nIndex > m_itemList.size() + 1)
559  {
560  return;
561  }
562 
563  // Insert it at the appropriate position (MHEG indexes count from 1).
564  m_itemList.insert(nIndex - 1, new MHListItem(pItem));
565 
566  if (nIndex <= m_nFirstItem && m_nFirstItem < m_itemList.size())
567  {
568  m_nFirstItem++;
569  }
570 
571  Update(engine); // Apply the update behaviour
572 }
573 
574 // Remove an item from the list
575 void MHListGroup::DelItem(MHRoot *pItem, MHEngine * /*engine*/)
576 {
577  // See if the item is already there and ignore this if it is.
578  for (int i = 0; i < m_itemList.size(); i++)
579  {
580  if (m_itemList.at(i)->m_pVisible == pItem) // Found it - remove it from the list and reset the posn.
581  {
582  delete m_itemList.takeAt(i);
583  pItem->ResetPosition();
584 
585  if (i + 1 < m_nFirstItem && m_nFirstItem > 1)
586  {
587  m_nFirstItem--;
588  }
589 
590  return;
591  }
592  }
593 }
594 
595 // Set the selection status of the item to true
596 void MHListGroup::Select(int nIndex, MHEngine *engine)
597 {
598  MHListItem *pListItem = m_itemList.at(nIndex - 1);
599 
600  if (pListItem == nullptr || pListItem->m_fSelected)
601  {
602  return; // Ignore if already selected.
603  }
604 
605  if (! m_fMultipleSelection)
606  {
607  // Deselect any existing selections.
608  for (int i = 0; i < m_itemList.size(); i++)
609  {
610  if (m_itemList.at(i)->m_fSelected)
611  {
612  Deselect(i + 1, engine);
613  }
614  }
615  }
616 
617  pListItem->m_fSelected = true;
618  engine->EventTriggered(this, EventItemSelected, nIndex);
619 }
620 
621 // Set the selection status of the item to false
622 void MHListGroup::Deselect(int nIndex, MHEngine *engine)
623 {
624  MHListItem *pListItem = m_itemList.at(nIndex - 1);
625 
626  if (pListItem == nullptr || ! pListItem->m_fSelected)
627  {
628  return; // Ignore if not selected.
629  }
630 
631  pListItem->m_fSelected = false;
632  engine->EventTriggered(this, EventItemDeselected, nIndex);
633 }
634 
635 // Return the reference to the visible at the particular position.
636 void MHListGroup::GetCellItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine)
637 {
638  if (nCell < 1)
639  {
640  nCell = 1; // First cell
641  }
642 
643  if (nCell > m_positions.Size())
644  {
645  nCell = m_positions.Size(); // Last cell.
646  }
647 
648  int nVisIndex = nCell + m_nFirstItem - 2;
649 
650  if (nVisIndex >= 0 && nVisIndex < m_itemList.size())
651  {
652  MHRoot *pVis = m_itemList.at(nVisIndex)->m_pVisible;
653  engine->FindObject(itemDest)->SetVariableValue(pVis->m_ObjectReference);
654  }
655  else
656  {
657  engine->FindObject(itemDest)->SetVariableValue(MHObjectRef::Null);
658  }
659 }
660 
661 int MHListGroup::AdjustIndex(int nIndex) // Added in the MHEG corrigendum
662 {
663  int nItems = m_itemList.size();
664 
665  if (nItems == 0)
666  {
667  return 1;
668  }
669 
670  if (nIndex > nItems)
671  {
672  return ((nIndex - 1) % nItems) + 1;
673  }
674  if (nIndex < 0)
675  {
676  return nItems - ((-nIndex) % nItems);
677  }
678  return nIndex;
679 }
680 
681 void MHListGroup::GetListItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine)
682 {
683  if (m_fWrapAround)
684  {
685  nCell = AdjustIndex(nCell);
686  }
687 
688  if (nCell < 1 || nCell > m_itemList.size())
689  {
690  return; // Ignore it if it's out of range and not wrapping
691  }
692 
693  engine->FindObject(itemDest)->SetVariableValue(m_itemList.at(nCell - 1)->m_pVisible->m_ObjectReference);
694 }
695 
696 void MHListGroup::GetItemStatus(int nCell, const MHObjectRef &itemDest, MHEngine *engine)
697 {
698  if (m_fWrapAround)
699  {
700  nCell = AdjustIndex(nCell);
701  }
702 
703  if (nCell < 1 || nCell > m_itemList.size())
704  {
705  return;
706  }
707 
708  engine->FindObject(itemDest)->SetVariableValue(m_itemList.at(nCell - 1)->m_fSelected);
709 }
710 
711 void MHListGroup::SelectItem(int nCell, MHEngine *engine)
712 {
713  if (m_fWrapAround)
714  {
715  nCell = AdjustIndex(nCell);
716  }
717 
718  if (nCell < 1 || nCell > m_itemList.size())
719  {
720  return;
721  }
722 
723  Select(nCell, engine);
724 }
725 
726 void MHListGroup::DeselectItem(int nCell, MHEngine *engine)
727 {
728  if (m_fWrapAround)
729  {
730  nCell = AdjustIndex(nCell);
731  }
732 
733  if (nCell < 1 || nCell > m_itemList.size())
734  {
735  return;
736  }
737 
738  Deselect(nCell, engine);
739 }
740 
741 void MHListGroup::ToggleItem(int nCell, MHEngine *engine)
742 {
743  if (m_fWrapAround)
744  {
745  nCell = AdjustIndex(nCell);
746  }
747 
748  if (nCell < 1 || nCell > m_itemList.size())
749  {
750  return;
751  }
752 
753  if (m_itemList.at(nCell - 1)->m_fSelected)
754  {
755  Deselect(nCell, engine);
756  }
757  else
758  {
759  Select(nCell, engine);
760  }
761 }
762 
763 void MHListGroup::ScrollItems(int nCell, MHEngine *engine)
764 {
765  nCell += m_nFirstItem;
766 
767  if (m_fWrapAround)
768  {
769  nCell = AdjustIndex(nCell);
770  }
771 
772  if (nCell < 1 || nCell > m_itemList.size())
773  {
774  return;
775  }
776 
777  m_nFirstItem = nCell;
778  Update(engine);
779 }
780 
781 void MHListGroup::SetFirstItem(int nCell, MHEngine *engine)
782 {
783  if (m_fWrapAround)
784  {
785  nCell = AdjustIndex(nCell);
786  }
787 
788  if (nCell < 1 || nCell > m_itemList.size())
789  {
790  return;
791  }
792 
793  m_nFirstItem = nCell;
794  Update(engine);
795 }
796 
797 
798 
799 // Actions
801 {
802  MHElemAction::Initialise(p, engine);
803  m_index.Initialise(p->GetArgN(1), engine);
804  m_item.Initialise(p->GetArgN(2), engine);
805 }
806 
807 void MHAddItem::PrintArgs(FILE *fd, int /*nTabs*/) const
808 {
809  m_index.PrintMe(fd, 0);
810  m_item.PrintMe(fd, 0);
811 }
812 
814 {
815  MHObjectRef item;
816  m_item.GetValue(item, engine);
817  Target(engine)->AddItem(m_index.GetValue(engine), engine->FindObject(item), engine);
818 }
819 
821 {
822  MHElemAction::Initialise(p, engine);
823  m_index.Initialise(p->GetArgN(1), engine);
824  m_result.Initialise(p->GetArgN(2), engine);
825 }
826 
827 void MHGetListActionData::PrintArgs(FILE *fd, int /*nTabs*/) const
828 {
829  m_index.PrintMe(fd, 0);
830  m_result.PrintMe(fd, 0);
831 }
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:70
MHObjectRef
Definition: BaseClasses.h:156
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:596
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:86
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:807
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:49
MHListGroup::ScrollItems
void ScrollItems(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:763
MHObjectRef::Null
static MHObjectRef Null
Definition: BaseClasses.h:162
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:800
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:726
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:711
MHListGroup::Deselect
void Deselect(int nIndex, MHEngine *engine)
Definition: TokenGroup.cpp:622
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:636
MHParseNode::PNNull
@ PNNull
Definition: ParseNode.h:41
mythburn.FILE
int FILE
Definition: mythburn.py:139
MHObjectRef::IsSet
bool IsSet() const
Definition: BaseClasses.h:167
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:533
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:741
MHGetListActionData::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:820
hardwareprofile.config.p
p
Definition: config.py:33
MHAddItem::Perform
void Perform(MHEngine *engine) override
Definition: TokenGroup.cpp:813
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:573
MHListGroup::GetListItem
void GetListItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:681
MHListGroup::m_fLastItemDisplayed
bool m_fLastItemDisplayed
Definition: TokenGroup.h:146
MHListGroup::AdjustIndex
int AdjustIndex(int nIndex)
Definition: TokenGroup.cpp:661
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:39
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:781
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:723
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:827
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:28
MHListGroup::m_nLastCount
int m_nLastCount
Definition: TokenGroup.h:147
MHSequence::Size
int Size() const
Definition: BaseClasses.h:50
MHListGroup::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: TokenGroup.cpp:365
MHParseNode
Definition: ParseNode.h:38
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:52
MHSequence::Append
void Append(BASE b)
Definition: BaseClasses.h:67
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:562
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:546
MHListGroup::m_nFirstItem
int m_nFirstItem
Definition: TokenGroup.h:144
MHListGroup::DelItem
void DelItem(MHRoot *pItem, MHEngine *engine) override
Definition: TokenGroup.cpp:575
MHGenericObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:548
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:696
MHRoot
Definition: Root.h:43