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  foreach (auto & item, 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  foreach (auto item, 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  foreach (auto item, 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  foreach (auto & item, 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 }
bool m_fMultipleSelection
Definition: TokenGroup.h:141
#define C_MOVEMENT_TABLE
Definition: ASN1Codes.h:103
void Preparation(MHEngine *engine) override
void Initialise(MHParseNode *p, MHEngine *engine)
void GetCellItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:635
void Activation(MHEngine *engine) override
Definition: TokenGroup.cpp:232
void PrintMe(FILE *fd, int nTabs) const override
int m_nFirstItem
Definition: TokenGroup.h:144
bool IsSet() const
Definition: BaseClasses.h:162
void PrintMe(FILE *fd, int nTabs) const
void Destruction(MHEngine *engine) override
Definition: TokenGroup.cpp:429
void TransferToken(int newPos, MHEngine *engine)
Definition: TokenGroup.cpp:278
void SelectItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:710
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:108
void PrintArgs(FILE *fd, int) const override
Definition: TokenGroup.cpp:826
#define C_NO_TOKEN_ACTION_SLOTS
Definition: ASN1Codes.h:105
void PrintMe(FILE *fd, int nTabs) const override
Definition: TokenGroup.cpp:222
MHRoot * Target(MHEngine *engine)
Definition: BaseActions.cpp:46
MHObjectRef m_Result
Definition: TokenGroup.h:212
BASE GetAt(int i) const
Definition: BaseClasses.h:48
void AddItem(int nIndex, MHRoot *pItem, MHEngine *engine) override
Definition: TokenGroup.cpp:545
enum NodeType m_nNodeType
Definition: ParseNode.h:46
void Initialise(MHParseNode *p, MHEngine *engine)
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:819
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:69
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: TokenGroup.cpp:32
virtual bool GetRunningStatus()
Definition: Root.h:76
MHOwnPtrSequence< MHMovement > m_MovementTable
Definition: TokenGroup.h:83
virtual void Deactivation(MHEngine *engine)
Definition: Root.cpp:85
int GetValue(MHEngine *engine) const
virtual void SetPosition(int, int, MHEngine *)
Definition: Root.h:157
MHGenericInteger m_Index
Definition: TokenGroup.h:192
bool m_fFirstItemDisplayed
Definition: TokenGroup.h:145
void GetValue(MHObjectRef &ref, MHEngine *engine) const
virtual void AddItem(int, MHRoot *, MHEngine *)
Definition: Root.h:138
void ScrollItems(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:762
void PrintTabs(FILE *fd, int n)
Definition: ParseNode.cpp:34
MHOwnPtrSequence< MHTokenGroupItem > m_TokenGrpItems
Definition: TokenGroup.h:84
MHParseNode * GetSeqN(int n)
Definition: ParseNode.cpp:152
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Ingredients.cpp:49
int GetIntValue()
Definition: ParseNode.cpp:170
MHOwnPtrSequence< MHActionSequence > m_NoTokenActionSlots
Definition: TokenGroup.h:85
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:335
void Perform(MHEngine *engine) override
Definition: TokenGroup.cpp:812
void EventTriggered(MHRoot *pSource, enum EventType ev)
Definition: Engine.h:93
int m_nLastCount
Definition: TokenGroup.h:147
void DeselectItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:725
~MHListGroup() override
Definition: TokenGroup.cpp:327
void Deselect(int nIndex, MHEngine *engine)
Definition: TokenGroup.cpp:621
void ToggleItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:740
MHGenericObjectRef m_Item
Definition: TokenGroup.h:193
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:117
#define C_WRAP_AROUND
Definition: ASN1Codes.h:107
Definition: Root.h:43
bool m_fRunning
Definition: Root.h:252
MHObjectRef m_ObjectReference
Definition: Root.h:247
int FILE
Definition: mythburn.py:139
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: TokenGroup.cpp:96
void Destruction(MHEngine *engine) override
MHSequence< QPoint > m_Positions
Definition: TokenGroup.h:139
void Deactivation(MHEngine *engine) override
Definition: TokenGroup.cpp:446
void DelItem(MHRoot *pItem, MHEngine *engine) override
Definition: TokenGroup.cpp:574
void GetListItem(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:680
void GetItemStatus(int nCell, const MHObjectRef &itemDest, MHEngine *engine) override
Definition: TokenGroup.cpp:695
void CallActionSlot(int n, MHEngine *engine) override
Definition: TokenGroup.cpp:289
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:574
bool m_fWrapAround
Definition: TokenGroup.h:140
void Update(MHEngine *engine)
Definition: TokenGroup.cpp:457
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
int GetSeqCount()
Definition: ParseNode.cpp:141
QList< MHListItem * > m_ItemList
Definition: TokenGroup.h:143
bool m_fLastItemDisplayed
Definition: TokenGroup.h:146
int GetArgCount()
Definition: ParseNode.cpp:60
bool GetBoolValue()
Definition: ParseNode.cpp:192
int AdjustIndex(int nIndex)
Definition: TokenGroup.cpp:660
virtual void ResetPosition()
Definition: Root.h:171
void Initialise(MHParseNode *p, MHEngine *engine)
MHObjectRef m_Object
Definition: TokenGroup.h:45
bool m_fSelected
Definition: TokenGroup.h:98
void Preparation(MHEngine *engine) override
Definition: TokenGroup.cpp:396
MHSequence< int > m_Movement
Definition: TokenGroup.h:54
virtual void PrintMe(FILE *fd, int nTabs) const
Definition: Actions.cpp:456
MHOwnPtrSequence< MHActionSequence > m_ActionSlots
Definition: TokenGroup.h:46
#define C_TOKEN_GROUP_ITEMS
Definition: ASN1Codes.h:104
void PrintMe(FILE *fd, int nTabs) const
Definition: TokenGroup.cpp:104
MHParseNode * GetArgN(int n)
Definition: ParseNode.cpp:78
int m_nLastFirstItem
Definition: TokenGroup.h:148
void PrintArgs(FILE *fd, int) const override
Definition: TokenGroup.cpp:806
void SetFirstItem(int nCell, MHEngine *engine) override
Definition: TokenGroup.cpp:780
void Append(BASE b)
Definition: BaseClasses.h:63
void Select(int nIndex, MHEngine *engine)
Definition: TokenGroup.cpp:595
int m_nTokenPosition
Definition: TokenGroup.h:88
int Size() const
Definition: BaseClasses.h:46
MHGenericInteger m_Index
Definition: TokenGroup.h:211
void AddActions(const MHActionSequence &actions)
Definition: Engine.cpp:724
void PrintMe(FILE *fd, int nTabs) const
void PrintMe(FILE *fd, int nTabs) const override
Definition: TokenGroup.cpp:365
void PrintMe(FILE *fd, int nTabs) const
void Move(int n, MHEngine *engine) override
Definition: TokenGroup.cpp:312
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: TokenGroup.cpp:799
void Activation(MHEngine *engine) override
Definition: TokenGroup.cpp:438
#define C_POSITIONS
Definition: ASN1Codes.h:106
void Deactivation(MHEngine *engine) override
Definition: TokenGroup.cpp:266
void PrintContents(FILE *fd, int nTabs) const
Definition: TokenGroup.cpp:164
void PrintMe(FILE *fd, int nTabs) const
Definition: TokenGroup.cpp:56
static MHObjectRef Null
Definition: BaseClasses.h:157