MythTV  master
Groups.cpp
Go to the documentation of this file.
1 /* Groups.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 #include "Root.h"
23 #include "Groups.h"
24 #include "ASN1Codes.h"
25 #include "ParseNode.h"
26 #include "Ingredients.h"
27 #include "Programs.h"
28 #include "Variables.h"
29 #include "Presentable.h"
30 #include "Visible.h"
31 #include "Engine.h"
32 #include "Text.h"
33 #include "Bitmap.h"
34 #include "Stream.h"
35 #include "DynamicLineArt.h"
36 #include "Link.h"
37 #include "TokenGroup.h"
38 #include "Logging.h"
39 
41 {
42  while (!m_timers.isEmpty())
43  {
44  delete m_timers.takeFirst();
45  }
46 }
47 
49 {
50  engine->GetGroupId().Copy(""); // Set to empty before we start (just in case).
51  MHRoot::Initialise(p, engine);
52 
53  // Must be an external reference with an object number of zero.
55  {
56  MHERROR("Object reference for a group object must be zero and external");
57  }
58 
59  // Set the group id for the rest of the group to this.
61  // Some of the information is irrelevant.
62  // MHParseNode *pStdId = p->GetNamedArg(C_STANDARD_IDENTIFIER);
63  // MHParseNode *pStdVersion = p->GetNamedArg(C_STANDARD_VERSION);
64  // MHParseNode *pObjectInfo = p->GetNamedArg(C_OBJECT_INFORMATION);
65 
66  MHParseNode *pOnStartUp = p->GetNamedArg(C_ON_START_UP);
67 
68  if (pOnStartUp)
69  {
70  m_startUp.Initialise(pOnStartUp, engine);
71  }
72 
73  MHParseNode *pOnCloseDown = p->GetNamedArg(C_ON_CLOSE_DOWN);
74 
75  if (pOnCloseDown)
76  {
77  m_closeDown.Initialise(pOnCloseDown, engine);
78  }
79 
80  MHParseNode *pOriginalGCPrio = p->GetNamedArg(C_ORIGINAL_GC_PRIORITY);
81 
82  if (pOriginalGCPrio)
83  {
84  m_nOrigGCPriority = pOriginalGCPrio->GetArgN(0)->GetIntValue();
85  }
86 
87  // Ignore the other stuff at the moment.
88  MHParseNode *pItems = p->GetNamedArg(C_ITEMS);
89 
90  if (pItems == nullptr)
91  {
92  MHParseNode::Failure("Missing :Items block");
93  return;
94  }
95 
96  for (int i = 0; i < pItems->GetArgCount(); i++)
97  {
98  MHParseNode *pItem = pItems->GetArgN(i);
99  MHIngredient *pIngredient = nullptr;
100 
101  try
102  {
103  // Generate the particular kind of ingredient.
104  switch (pItem->GetTagNo())
105  {
106  case C_RESIDENT_PROGRAM:
107  pIngredient = new MHResidentProgram;
108  break;
109  case C_REMOTE_PROGRAM:
110  pIngredient = new MHRemoteProgram;
111  break;
113  pIngredient = new MHInterChgProgram;
114  break;
115  case C_PALETTE:
116  pIngredient = new MHPalette;
117  break;
118  case C_FONT:
119  pIngredient = new MHFont;
120  break;
121  case C_CURSOR_SHAPE:
122  pIngredient = new MHCursorShape;
123  break;
124  case C_BOOLEAN_VARIABLE:
125  pIngredient = new MHBooleanVar;
126  break;
127  case C_INTEGER_VARIABLE:
128  pIngredient = new MHIntegerVar;
129  break;
131  pIngredient = new MHOctetStrVar;
132  break;
134  pIngredient = new MHObjectRefVar;
135  break;
137  pIngredient = new MHContentRefVar;
138  break;
139  case C_LINK:
140  pIngredient = new MHLink;
141  break;
142  case C_STREAM:
143  pIngredient = new MHStream;
144  break;
145  case C_BITMAP:
146  pIngredient = new MHBitmap;
147  break;
148  case C_LINE_ART:
149  pIngredient = new MHLineArt;
150  break;
151  case C_DYNAMIC_LINE_ART:
152  pIngredient = new MHDynamicLineArt;
153  break;
154  case C_RECTANGLE:
155  pIngredient = new MHRectangle;
156  break;
157  case C_HOTSPOT:
158  pIngredient = new MHHotSpot;
159  break;
160  case C_SWITCH_BUTTON:
161  pIngredient = new MHSwitchButton;
162  break;
163  case C_PUSH_BUTTON:
164  pIngredient = new MHPushButton;
165  break;
166  case C_TEXT:
167  pIngredient = new MHText;
168  break;
169  case C_ENTRY_FIELD:
170  pIngredient = new MHEntryField;
171  break;
172  case C_HYPER_TEXT:
173  pIngredient = new MHHyperText;
174  break;
175  case C_SLIDER:
176  pIngredient = new MHSlider;
177  break;
178  case C_TOKEN_GROUP:
179  pIngredient = new MHTokenGroup;
180  break;
181  case C_LIST_GROUP:
182  pIngredient = new MHListGroup;
183  break;
184  default:
185  MHLOG(MHLogWarning, QString("Unknown ingredient %1").arg(pItem->GetTagNo()));
186  // Future proofing: ignore any ingredients that we don't know about.
187  // Obviously these can only arise in the binary coding.
188  }
189 
190  if (pIngredient)
191  {
192  // Initialise it from its argments.
193  pIngredient->Initialise(pItem, engine);
194 
195  // Remember the highest numbered ingredient
196  if (pIngredient->m_ObjectReference.m_nObjectNo > m_nLastId)
197  {
198  m_nLastId = pIngredient->m_ObjectReference.m_nObjectNo;
199  }
200 
201  // Add it to the ingedients of this group.
202  m_items.Append(pIngredient);
203  }
204  }
205  catch (...)
206  {
207  MHLOG(MHLogError, "ERROR in MHGroup::Initialise ingredient");
208  if (pIngredient && gMHLogStream)
209  pIngredient->PrintMe(gMHLogStream, 0);
210 
211  delete(pIngredient);
212  throw;
213  }
214  }
215 }
216 
217 void MHGroup::PrintMe(FILE *fd, int nTabs) const
218 {
219  MHRoot::PrintMe(fd, nTabs);
220 
221  if (m_startUp.Size() != 0)
222  {
223  PrintTabs(fd, nTabs + 1);
224  fprintf(fd, ":OnStartUp (\n");
225  m_startUp.PrintMe(fd, nTabs + 2);
226  PrintTabs(fd, nTabs + 2);
227  fprintf(fd, ")\n");
228  }
229 
230  if (m_closeDown.Size() != 0)
231  {
232  PrintTabs(fd, nTabs + 1);
233  fprintf(fd, ":OnCloseDown (\n");
234  m_closeDown.PrintMe(fd, nTabs + 2);
235  PrintTabs(fd, nTabs + 2);
236  fprintf(fd, ")\n");
237  }
238 
239  if (m_nOrigGCPriority != 127)
240  {
241  PrintTabs(fd, nTabs + 1);
242  fprintf(fd, ":OrigGCPriority %d\n", m_nOrigGCPriority);
243  }
244 
245  PrintTabs(fd, nTabs + 1);
246  fprintf(fd, ":Items ( \n");
247 
248  for (int i = 0; i < m_items.Size(); i++)
249  {
250  m_items.GetAt(i)->PrintMe(fd, nTabs + 2);
251  }
252 
253  PrintTabs(fd, nTabs + 1);
254  fprintf(fd, ")\n");
255 }
256 
257 // Preparation - sets up the run-time representation. Sets m_fAvailable and generates IsAvailable event.
259 {
260  // Prepare the ingredients first if they are initially active or are initially available programs.
261  for (int i = 0; i < m_items.Size(); i++)
262  {
263  MHIngredient *pIngredient = m_items.GetAt(i);
264 
265  if (pIngredient->InitiallyActive() || pIngredient->InitiallyAvailable())
266  {
267  pIngredient->Preparation(engine);
268  }
269  }
270 
271  MHRoot::Preparation(engine); // Prepare the root object and send the IsAvailable event.
272 }
273 
274 // Activation - starts running the object. Sets m_fRunning and generates IsRunning event.
276 {
277  if (m_fRunning)
278  {
279  return;
280  }
281 
282  MHRoot::Activation(engine);
283  // Run any start-up actions.
284  engine->AddActions(m_startUp);
285  engine->RunActions();
286 
287  // Activate the ingredients in order.
288  for (int i = 0; i < m_items.Size(); i++)
289  {
290  MHIngredient *pIngredient = m_items.GetAt(i);
291 
292  if (pIngredient->InitiallyActive())
293  {
294  pIngredient->Activation(engine);
295  }
296  }
297 
298  m_fRunning = true;
299  // Start the timer here. This is the basis for expiration..
300  m_runTime.start();
301  // Don't generate IsRunning here - that's done by the sub-classes.
302 }
303 
304 // Deactivation - stops running the object. Clears m_fRunning
306 {
307  if (! m_fRunning)
308  {
309  return;
310  }
311 
312  // Run any close-down actions.
313  engine->AddActions(m_closeDown);
314  engine->RunActions();
315  MHRoot::Deactivation(engine);
316 }
317 
318 // Destruction - deletes the run-time representation. Clears m_fAvailable.
320 {
321  for (int i = m_items.Size(); i > 0; i--)
322  {
323  m_items.GetAt(i - 1)->Destruction(engine);
324  }
325 
326  MHRoot::Destruction(engine);
327 }
328 
329 // Return an object if its object ID matches (or if it's a stream, if it has a matching component).
331 {
333  {
334  return this;
335  }
336 
337  for (int i = m_items.Size(); i > 0; i--)
338  {
339  MHRoot *pResult = m_items.GetAt(i - 1)->FindByObjectNo(n);
340 
341  if (pResult)
342  {
343  return pResult;
344  }
345  }
346 
347  return nullptr;
348 }
349 
350 // Set up a timer or cancel a timer.
351 void MHGroup::SetTimer(int nTimerId, bool fAbsolute, int nMilliSecs, MHEngine * /*engine*/)
352 {
353  // First remove any existing timer with the same Id.
354  for (int i = 0; i < m_timers.size(); i++)
355  {
356  MHTimer *pTimer = m_timers.at(i);
357 
358  if (pTimer->m_nTimerId == nTimerId)
359  {
360  delete m_timers.takeAt(i);
361  break;
362  }
363  }
364 
365  // If the time has passed we don't set up a timer.
366  if (nMilliSecs < 0 || (fAbsolute && m_runTime.hasExpired(nMilliSecs)))
367  {
368  return;
369  }
370 
371  auto *pTimer = new MHTimer;
372  m_timers.append(pTimer);
373  pTimer->m_nTimerId = nTimerId;
374 
375  if (fAbsolute)
376  {
377  QTime startTime = QTime::currentTime().addMSecs(-m_runTime.elapsed());
378  pTimer->m_Time = startTime.addMSecs(nMilliSecs);
379  }
380  else
381  {
382  pTimer->m_Time = QTime::currentTime().addMSecs(nMilliSecs);
383  }
384 }
385 
386 // Fire any timers that have passed.
387 std::chrono::milliseconds MHGroup::CheckTimers(MHEngine *engine)
388 {
389  QTime currentTime = QTime::currentTime(); // Get current time
390  QList<MHTimer *>::iterator it = m_timers.begin();
391  std::chrono::milliseconds nMSecs = 0ms;
392 
393  while (it != m_timers.end())
394  {
395  MHTimer *pTimer = *it;
396 
397  if (pTimer->m_Time <= currentTime) // Use <= rather than < here so we fire timers with zero time immediately.
398  {
399  // If the time has passed trigger the event and remove the timer from the queue.
400  engine->EventTriggered(this, EventTimerFired, pTimer->m_nTimerId);
401  delete pTimer;
402  it = m_timers.erase(it);
403  }
404  else
405  {
406  // This has not yet expired. Set "nMSecs" to the earliest time we have.
407  auto nMSecsToGo = std::chrono::milliseconds(currentTime.msecsTo(pTimer->m_Time));
408 
409  if (nMSecs == 0ms || nMSecsToGo < nMSecs)
410  {
411  nMSecs = nMSecsToGo;
412  }
413 
414  ++it;
415  }
416  }
417 
418  return nMSecs;
419 }
420 
421 // Create a clone of the target and add it to the ingredients.
422 void MHGroup::MakeClone(MHRoot *pTarget, MHRoot *pRef, MHEngine *engine)
423 {
424  MHIngredient *pClone = pTarget->Clone(engine); // Clone it.
425  pClone->m_ObjectReference.m_groupId.Copy(m_ObjectReference.m_groupId); // Group id is the same as this.
426  pClone->m_ObjectReference.m_nObjectNo = ++m_nLastId; // Create a new object id.
427  m_items.Append(pClone);
428  // Set the object reference result to the newly constructed ref.
429  pRef->SetVariableValue(pClone->m_ObjectReference);
430  pClone->Preparation(engine); // Prepare the clone.
431 }
432 
434 {
435  delete(m_pCurrentScene);
436 }
437 
439 {
440  MHGroup::Initialise(p, engine);
441  // OnSpawnCloseDown
442  MHParseNode *pOnSpawn = p->GetNamedArg(C_ON_SPAWN_CLOSE_DOWN);
443 
444  if (pOnSpawn)
445  {
446  m_onSpawnCloseDown.Initialise(pOnSpawn, engine);
447  }
448 
449  // OnRestart
450  MHParseNode *pOnRestart = p->GetNamedArg(C_ON_RESTART);
451 
452  if (pOnRestart)
453  {
454  m_onRestart.Initialise(pOnRestart, engine);
455  }
456 
457  // Default attributes. These are encoded in a group in binary.
458  MHParseNode *pDefattrs = p->GetNamedArg(C_DEFAULT_ATTRIBUTES);
459 
460  // but in the text form they're encoded in the Application block.
461  if (pDefattrs == nullptr)
462  {
463  pDefattrs = p;
464  }
465 
466  MHParseNode *pCharSet = pDefattrs->GetNamedArg(C_CHARACTER_SET);
467 
468  if (pCharSet)
469  {
470  m_nCharSet = pCharSet->GetArgN(0)->GetIntValue();
471  }
472 
473  // Colours
474  MHParseNode *pBGColour = pDefattrs->GetNamedArg(C_BACKGROUND_COLOUR);
475 
476  if (pBGColour)
477  {
478  m_bgColour.Initialise(pBGColour->GetArgN(0), engine);
479  }
480 
481  MHParseNode *pTextColour = pDefattrs->GetNamedArg(C_TEXT_COLOUR);
482 
483  if (pTextColour)
484  {
485  m_textColour.Initialise(pTextColour->GetArgN(0), engine);
486  }
487 
488  MHParseNode *pButtonRefColour = pDefattrs->GetNamedArg(C_BUTTON_REF_COLOUR);
489 
490  if (pButtonRefColour)
491  {
492  m_buttonRefColour.Initialise(pButtonRefColour->GetArgN(0), engine);
493  }
494 
495  MHParseNode *pHighlightRefColour = pDefattrs->GetNamedArg(C_HIGHLIGHT_REF_COLOUR);
496 
497  if (pHighlightRefColour)
498  {
499  m_highlightRefColour.Initialise(pHighlightRefColour->GetArgN(0), engine);
500  }
501 
502  MHParseNode *pSliderRefColour = pDefattrs->GetNamedArg(C_SLIDER_REF_COLOUR);
503 
504  if (pSliderRefColour)
505  {
506  m_sliderRefColour.Initialise(pSliderRefColour->GetArgN(0), engine);
507  }
508 
509  // Content hooks
510  MHParseNode *pTextCHook = pDefattrs->GetNamedArg(C_TEXT_CONTENT_HOOK);
511 
512  if (pTextCHook)
513  {
514  m_nTextCHook = pTextCHook->GetArgN(0)->GetIntValue();
515  }
516 
517  MHParseNode *pIPCHook = pDefattrs->GetNamedArg(C_IP_CONTENT_HOOK);
518 
519  if (pIPCHook)
520  {
521  m_nIPCHook = pIPCHook->GetArgN(0)->GetIntValue();
522  }
523 
524  MHParseNode *pStrCHook = pDefattrs->GetNamedArg(C_STREAM_CONTENT_HOOK);
525 
526  if (pStrCHook)
527  {
528  m_nStrCHook = pStrCHook->GetArgN(0)->GetIntValue();
529  }
530 
531  MHParseNode *pBitmapCHook = pDefattrs->GetNamedArg(C_BITMAP_CONTENT_HOOK);
532 
533  if (pBitmapCHook)
534  {
535  m_nBitmapCHook = pBitmapCHook->GetArgN(0)->GetIntValue();
536  }
537 
538  MHParseNode *pLineArtCHook = pDefattrs->GetNamedArg(C_LINE_ART_CONTENT_HOOK);
539 
540  if (pLineArtCHook)
541  {
542  m_nLineArtCHook = pLineArtCHook->GetArgN(0)->GetIntValue();
543  }
544 
545  // Font. This is a little tricky. There are two attributes both called Font.
546  // In the binary notation the font here is encoded as 42 whereas the text form
547  // finds the first occurrence of :Font in the table and returns 13.
548  MHParseNode *pFont = pDefattrs->GetNamedArg(C_FONT2);
549 
550  if (pFont == nullptr)
551  {
552  pFont = pDefattrs->GetNamedArg(C_FONT);
553  }
554 
555  if (pFont)
556  {
557  m_font.Initialise(pFont->GetArgN(0), engine);
558  }
559 
560  // Font attributes.
561  MHParseNode *pFontAttrs = pDefattrs->GetNamedArg(C_FONT_ATTRIBUTES);
562 
563  if (pFontAttrs)
564  {
565  pFontAttrs->GetArgN(0)->GetStringValue(m_fontAttrs);
566  }
567 }
568 
569 void MHApplication::PrintMe(FILE *fd, int nTabs) const
570 {
571  PrintTabs(fd, nTabs);
572  fprintf(fd, "{:Application ");
573  MHGroup::PrintMe(fd, nTabs);
574 
575  if (m_onSpawnCloseDown.Size() != 0)
576  {
577  PrintTabs(fd, nTabs + 1);
578  fprintf(fd, ":OnSpawnCloseDown");
579  m_onSpawnCloseDown.PrintMe(fd, nTabs + 1);
580  fprintf(fd, "\n");
581  }
582 
583  if (m_onRestart.Size() != 0)
584  {
585  PrintTabs(fd, nTabs + 1);
586  fprintf(fd, ":OnRestart");
587  m_onRestart.PrintMe(fd, nTabs + 1);
588  fprintf(fd, "\n");
589  }
590 
591  if (m_nCharSet > 0)
592  {
593  PrintTabs(fd, nTabs + 1);
594  fprintf(fd, ":CharacterSet %d\n", m_nCharSet);
595  }
596 
597  if (m_bgColour.IsSet())
598  {
599  PrintTabs(fd, nTabs + 1);
600  fprintf(fd, ":BackgroundColour ");
601  m_bgColour.PrintMe(fd, nTabs + 1);
602  fprintf(fd, "\n");
603  }
604 
605  if (m_nTextCHook > 0)
606  {
607  PrintTabs(fd, nTabs + 1);
608  fprintf(fd, ":TextCHook %d\n", m_nTextCHook);
609  }
610 
611  if (m_textColour.IsSet())
612  {
613  PrintTabs(fd, nTabs + 1);
614  fprintf(fd, ":TextColour");
615  m_textColour.PrintMe(fd, nTabs + 1);
616  fprintf(fd, "\n");
617  }
618 
619  if (m_font.IsSet())
620  {
621  PrintTabs(fd, nTabs + 1);
622  fprintf(fd, ":Font ");
623  m_font.PrintMe(fd, nTabs + 1);
624  fprintf(fd, "\n");
625  }
626 
627  if (m_fontAttrs.Size() > 0)
628  {
629  PrintTabs(fd, nTabs + 1);
630  fprintf(fd, ":FontAttributes ");
631  m_fontAttrs.PrintMe(fd, nTabs + 1);
632  fprintf(fd, "\n");
633  }
634 
635  if (m_nIPCHook > 0)
636  {
637  PrintTabs(fd, nTabs + 1);
638  fprintf(fd, ":InterchgPrgCHook %d\n", m_nIPCHook);
639  }
640 
641  if (m_nStrCHook > 0)
642  {
643  PrintTabs(fd, nTabs + 1);
644  fprintf(fd, ":StreamCHook %d\n", m_nStrCHook);
645  }
646 
647  if (m_nBitmapCHook > 0)
648  {
649  PrintTabs(fd, nTabs + 1);
650  fprintf(fd, ":BitmapCHook %d\n", m_nBitmapCHook);
651  }
652 
653  if (m_nLineArtCHook > 0)
654  {
655  PrintTabs(fd, nTabs + 1);
656  fprintf(fd, ":LineArtCHook %d\n", m_nLineArtCHook);
657  }
658 
659  if (m_buttonRefColour.IsSet())
660  {
661  PrintTabs(fd, nTabs + 1);
662  fprintf(fd, ":ButtonRefColour ");
663  m_buttonRefColour.PrintMe(fd, nTabs + 1);
664  fprintf(fd, "\n");
665  }
666 
668  {
669  PrintTabs(fd, nTabs + 1);
670  fprintf(fd, ":HighlightRefColour ");
671  m_highlightRefColour.PrintMe(fd, nTabs + 1);
672  fprintf(fd, "\n");
673  }
674 
675  if (m_sliderRefColour.IsSet())
676  {
677  PrintTabs(fd, nTabs + 1);
678  fprintf(fd, ":SliderRefColour ");
679  m_sliderRefColour.PrintMe(fd, nTabs + 1);
680  fprintf(fd, "\n");
681  }
682 
683  fprintf(fd, "}\n");
684 }
685 
686 // This is a bit messy. The MHEG corrigendum says that we need to process OnRestart actions
687 // BEFORE generating IsRunning. That's important because TransitionTo etc are ignored during
688 // OnRestart but allowed in events triggered by IsRunning.
690 {
691  if (m_fRunning)
692  {
693  return;
694  }
695 
696  MHGroup::Activation(engine);
697 
698  if (m_fRestarting) // Set by Quit
699  {
700  engine->AddActions(m_onRestart);
701  engine->RunActions();
702  }
703 
704  engine->EventTriggered(this, EventIsRunning);
705 }
706 
707 int MHApplication::FindOnStack(const MHRoot *pVis) // Returns the index on the stack or -1 if it's not there.
708 {
709  for (int i = 0; i < m_displayStack.Size(); i++)
710  {
711  if (m_displayStack.GetAt(i) == pVis)
712  {
713  return i;
714  }
715  }
716 
717  return -1; // Not there
718 }
719 
721 {
722  MHGroup::Initialise(p, engine);
723  // Event register.
724  MHParseNode *pInputEventReg = p->GetNamedArg(C_INPUT_EVENT_REGISTER);
725 
726  if (pInputEventReg)
727  {
728  m_nEventReg = pInputEventReg->GetArgN(0)->GetIntValue();
729  }
730 
731  // Co-ordinate system
732  MHParseNode *pSceneCoords = p->GetNamedArg(C_SCENE_COORDINATE_SYSTEM);
733 
734  if (pSceneCoords)
735  {
736  m_nSceneCoordX = pSceneCoords->GetArgN(0)->GetIntValue();
737  m_nSceneCoordY = pSceneCoords->GetArgN(1)->GetIntValue();
738  }
739 
740  // Aspect ratio
741  MHParseNode *pAspectRatio = p->GetNamedArg(C_ASPECT_RATIO);
742 
743  if (pAspectRatio)
744  {
745  // Is the binary encoded as a sequence or a pair of arguments?
746  m_nAspectRatioW = pAspectRatio->GetArgN(0)->GetIntValue();
747  m_nAspectRatioH = pAspectRatio->GetArgN(1)->GetIntValue();
748  }
749 
750  // Moving cursor
751  MHParseNode *pMovingCursor = p->GetNamedArg(C_MOVING_CURSOR);
752 
753  if (pMovingCursor)
754  {
755  pMovingCursor->GetArgN(0)->GetBoolValue();
756  }
757 
758  // Next scene sequence: this is just a hint and isn't implemented
759 }
760 
761 void MHScene::PrintMe(FILE *fd, int nTabs) const
762 {
763  PrintTabs(fd, nTabs);
764  fprintf(fd, "{:Scene ");
765  MHGroup::PrintMe(fd, nTabs);
766  PrintTabs(fd, nTabs + 1);
767  fprintf(fd, ":InputEventReg %d\n", m_nEventReg);
768  PrintTabs(fd, nTabs + 1);
769  fprintf(fd, ":SceneCS %d %d\n", m_nSceneCoordX, m_nSceneCoordY);
770 
771  if (m_nAspectRatioW != 4 || m_nAspectRatioH != 3)
772  {
773  PrintTabs(fd, nTabs + 1);
774  fprintf(fd, ":AspectRatio %d %d\n", m_nAspectRatioW, m_nAspectRatioH);
775  }
776 
777  if (m_fMovingCursor)
778  {
779  PrintTabs(fd, nTabs + 1);
780  fprintf(fd, ":MovingCursor true\n");
781  }
782 
783  fprintf(fd, "}\n");
784 }
785 
787 {
788  if (m_fRunning)
789  {
790  return;
791  }
792 
793  MHGroup::Activation(engine);
794  engine->EventTriggered(this, EventIsRunning);
795 }
796 
797 // Action added in UK MHEG profile. It doesn't define a new internal attribute for this.
798 void MHScene::SetInputRegister(int nReg, MHEngine *engine)
799 {
800  m_nEventReg = nReg;
801  engine->SetInputRegister(nReg);
802 }
803 
804 
806 {
807  MHElemAction::Initialise(p, engine); // Target
808  m_eventSource.Initialise(p->GetArgN(1), engine);
809  m_eventType = (enum EventType)p->GetArgN(2)->GetEnumValue();
810 
811  if (p->GetArgCount() >= 4)
812  {
813  // TODO: We could check here that we only have bool, int or string and not object ref or content ref.
814  m_eventData.Initialise(p->GetArgN(3), engine);
815  }
816 }
817 
818 void MHSendEvent::PrintArgs(FILE *fd, int /*nTabs*/) const
819 {
820  m_eventSource.PrintMe(fd, 0);
821  QByteArray tmp = MHLink::EventTypeToString(m_eventType).toLatin1();
822  fprintf(fd, "%s", tmp.constData());
823  fprintf(fd, " ");
824 
825  if (m_eventData.m_Type != MHParameter::P_Null)
826  {
827  m_eventData.PrintMe(fd, 0);
828  }
829 }
830 
832 {
833  // The target is always the current scene so we ignore it here.
834  MHObjectRef target;
835  MHObjectRef source;
836  m_target.GetValue(target, engine); // TODO: Check this is the scene?
837  m_eventSource.GetValue(source, engine);
838 
839  // Generate the event.
840  if (m_eventData.m_Type == MHParameter::P_Null)
841  {
842  engine->EventTriggered(engine->FindObject(source), m_eventType);
843  }
844  else
845  {
846  MHUnion data;
847  data.GetValueFrom(m_eventData, engine);
848  engine->EventTriggered(engine->FindObject(source), m_eventType, data);
849  }
850 }
851 
853 {
854  MHElemAction::Initialise(p, engine);
855  m_timerId.Initialise(p->GetArgN(1), engine); // The timer id
856 
857  if (p->GetArgCount() > 2)
858  {
859  MHParseNode *pNewTimer = p->GetArgN(2);
860  m_timerValue.Initialise(pNewTimer->GetSeqN(0), engine);
861 
862  if (pNewTimer->GetSeqCount() > 1)
863  {
864  m_timerType = ST_TimerAbsolute; // May be absolute - depends on the value.
865  m_absFlag.Initialise(pNewTimer->GetSeqN(1), engine);
866  }
867  else
868  {
869  m_timerType = ST_TimerRelative;
870  }
871  }
872 }
873 
874 void MHSetTimer::PrintArgs(FILE *fd, int /*nTabs*/) const
875 {
876  m_timerId.PrintMe(fd, 0);
877 
878  if (m_timerType != ST_NoNewTimer)
879  {
880  fprintf(fd, "( ");
881  m_timerValue.PrintMe(fd, 0);
882 
883  if (m_timerType == ST_TimerAbsolute)
884  {
885  m_absFlag.PrintMe(fd, 0);
886  }
887 
888  fprintf(fd, ") ");
889  }
890 }
891 
893 {
894  int nTimerId = m_timerId.GetValue(engine);
895  bool fAbsolute = false; // Defaults to relative time.
896  int newTime = -1;
897 
898  switch (m_timerType)
899  {
900  case ST_NoNewTimer:
901  fAbsolute = true;
902  newTime = -1;
903  break; // We treat an absolute time of -1 as "cancel"
904  case ST_TimerAbsolute:
905  fAbsolute = m_absFlag.GetValue(engine);
906  [[fallthrough]];
907  case ST_TimerRelative:
908  newTime = m_timerValue.GetValue(engine);
909  }
910 
911  Target(engine)->SetTimer(nTimerId, fAbsolute, newTime, engine);
912 }
913 
915 {
916  MHElemAction::Initialise(p, engine); // Target
917  m_succeeded.Initialise(p->GetArgN(1), engine);
918  MHParseNode *pVarSeq = p->GetArgN(2);
919 
920  for (int i = 0; i < pVarSeq->GetSeqCount(); i++)
921  {
922  auto *pVar = new MHObjectRef;
923  m_variables.Append(pVar);
924  pVar->Initialise(pVarSeq->GetSeqN(i), engine);
925  }
926 
927  m_fileName.Initialise(p->GetArgN(3), engine);
928 }
929 
930 void MHPersistent::PrintArgs(FILE *fd, int nTabs) const
931 {
932  m_succeeded.PrintMe(fd, nTabs);
933  fprintf(fd, " ( ");
934 
935  for (int i = 0; i < m_variables.Size(); i++)
936  {
937  m_variables.GetAt(i)->PrintMe(fd, 0);
938  }
939 
940  fprintf(fd, " ) ");
941  m_fileName.PrintMe(fd, nTabs);
942 }
943 
945 {
946  MHObjectRef target;
947  m_target.GetValue(target, engine); // Get the target - this should always be the application
948  MHOctetString fileName;
949  m_fileName.GetValue(fileName, engine);
950  bool fResult = engine->LoadStorePersistent(m_fIsLoad, fileName, m_variables);
951  engine->FindObject(m_succeeded)->SetVariableValue(fResult);
952 }
953 
955 {
956  m_fIsTagged = false;
957  m_nConnectionTag = 0;
958  m_nTransitionEffect = -1;
959 }
960 
962 {
963  MHElemAction::Initialise(p, engine); // Target
964  // The next one may be present but NULL in binary.
965  if (p->GetArgCount() > 1)
966  {
967  MHParseNode *pCtag = p->GetArgN(1);
968 
969  if (pCtag->m_nNodeType == MHParseNode::PNInt)
970  {
971  m_fIsTagged = true;
972  m_nConnectionTag = pCtag->GetIntValue();
973  }
974  }
975 
976  if (p->GetArgCount() > 2)
977  {
978  MHParseNode *pTrEff = p->GetArgN(2);
979  m_nTransitionEffect = pTrEff->GetIntValue();
980  }
981 }
982 
983 void MHTransitionTo::PrintArgs(FILE *fd, int /*nTabs*/) const
984 {
985  if (m_fIsTagged)
986  {
987  fprintf(fd, " %d ", m_nConnectionTag);
988  }
989  else if (m_nTransitionEffect >= 0)
990  {
991  fprintf(fd, " NULL ");
992  }
993 
994  if (m_nTransitionEffect >= 0)
995  {
996  fprintf(fd, " %d", m_nTransitionEffect);
997  }
998 }
999 
1000 // Do the action - Transition to a new scene.
1002 {
1003  MHObjectRef target;
1004  m_target.GetValue(target, engine); // Get the target
1005  engine->TransitionToScene(target);
1006 }
1007 
1009 {
1010  MHObjectRef target;
1011  m_target.GetValue(target, engine);
1012  engine->Launch(target);
1013 }
1015 {
1016  engine->Quit();
1017 }
1019 {
1020  MHObjectRef target;
1021  m_target.GetValue(target, engine);
1022  engine->Spawn(target);
1023 }
1025 {
1026  engine->LockScreen();
1027 }
1029 {
1030  engine->UnlockScreen();
1031 }
1032 
1034 {
1035  MHElemAction::Initialise(p, engine);
1036  m_feature.Initialise(p->GetArgN(1), engine);
1037  m_answer.Initialise(p->GetArgN(2), engine);
1038 }
1039 
1041 {
1042  // Ignore the target which isn't used.
1044  m_feature.GetValue(feature, engine);
1046 }
MHTransitionTo::MHTransitionTo
MHTransitionTo()
Definition: Groups.cpp:954
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:70
MHRemoteProgram
Definition: Programs.h:67
C_FONT2
@ C_FONT2
Definition: ASN1Codes.h:78
MHObjectRef
Definition: BaseClasses.h:153
MHParseNode::m_nNodeType
enum NodeType m_nNodeType
Definition: ParseNode.h:46
MHGetEngineSupport::m_answer
MHObjectRef m_answer
Definition: Groups.h:270
MHApplication::m_nIPCHook
int m_nIPCHook
Definition: Groups.h:136
MHScene::SetInputRegister
void SetInputRegister(int nReg, MHEngine *engine) override
Definition: Groups.cpp:798
Presentable.h
MHObjectRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:278
MHInterChgProgram
Definition: Programs.h:79
Groups.h
MHCursorShape
Definition: Ingredients.h:99
MHPushButton
Definition: Visible.h:293
MHRoot::Deactivation
virtual void Deactivation(MHEngine *engine)
Definition: Root.cpp:86
MHIngredient::Preparation
void Preparation(MHEngine *engine) override
Definition: Ingredients.cpp:159
MHStream
Definition: Stream.h:32
C_HYPER_TEXT
@ C_HYPER_TEXT
Definition: ASN1Codes.h:67
MHTransitionTo::m_nConnectionTag
int m_nConnectionTag
Definition: Groups.h:241
MHGetEngineSupport::m_feature
MHGenericOctetString m_feature
Definition: Groups.h:269
MHSendEvent::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:805
MHApplication::m_fRestarting
bool m_fRestarting
Definition: Groups.h:152
MHScene::m_nEventReg
int m_nEventReg
Definition: Groups.h:102
C_TEXT_CONTENT_HOOK
@ C_TEXT_CONTENT_HOOK
Definition: ASN1Codes.h:76
Programs.h
MHSetTimer::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:892
MHParameter::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:734
ASN1Codes.h
MHLineArt
Definition: Visible.h:89
MHEngine
Definition: Engine.h:72
C_TOKEN_GROUP
@ C_TOKEN_GROUP
Definition: ASN1Codes.h:69
MHGroup::~MHGroup
~MHGroup() override
Definition: Groups.cpp:40
MHFont
Definition: Ingredients.h:85
MHApplication::Activation
void Activation(MHEngine *engine) override
Definition: Groups.cpp:689
MHParseNode::GetIntValue
int GetIntValue()
Definition: ParseNode.cpp:170
MHObjectRef::m_groupId
MHOctetString m_groupId
Definition: BaseClasses.h:170
C_BOOLEAN_VARIABLE
@ C_BOOLEAN_VARIABLE
Definition: ASN1Codes.h:51
MHApplication::FindOnStack
int FindOnStack(const MHRoot *pVis)
Definition: Groups.cpp:707
MHSpawn::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1018
MHObjectRef::m_nObjectNo
int m_nObjectNo
Definition: BaseClasses.h:169
MHEntryField
Definition: Visible.h:244
C_BITMAP_CONTENT_HOOK
@ C_BITMAP_CONTENT_HOOK
Definition: ASN1Codes.h:82
MHTimer::m_nTimerId
int m_nTimerId
Definition: Groups.h:42
C_SLIDER_REF_COLOUR
@ C_SLIDER_REF_COLOUR
Definition: ASN1Codes.h:86
MHRoot::Clone
virtual MHIngredient * Clone(MHEngine *)
Definition: Root.h:96
MHParseNode::GetSeqN
MHParseNode * GetSeqN(int n)
Definition: ParseNode.cpp:152
MHGroup::Activation
void Activation(MHEngine *engine) override
Definition: Groups.cpp:275
MHTransitionTo::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1001
MHIngredient::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Ingredients.cpp:49
MHText
Definition: Text.h:37
C_ASPECT_RATIO
@ C_ASPECT_RATIO
Definition: ASN1Codes.h:89
Bitmap.h
MHApplication::m_onRestart
MHActionSequence m_onRestart
Definition: Groups.h:131
MHGroup::Preparation
void Preparation(MHEngine *engine) override
Definition: Groups.cpp:258
MHUnlockScreen::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1028
MHGenericInteger::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:397
MHApplication::m_onSpawnCloseDown
MHActionSequence m_onSpawnCloseDown
Definition: Groups.h:131
MHPersistent::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Groups.cpp:930
MHPersistent::m_succeeded
MHObjectRef m_succeeded
Definition: Groups.h:225
MHScene::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Groups.cpp:761
Visible.h
C_ORIGINAL_GC_PRIORITY
@ C_ORIGINAL_GC_PRIORITY
Definition: ASN1Codes.h:43
MHRoot::SetVariableValue
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:108
MHElemAction::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
MHSetTimer::m_timerValue
MHGenericInteger m_timerValue
Definition: Groups.h:204
EventIsRunning
@ EventIsRunning
Definition: Root.h:33
MHApplication::m_pCurrentScene
MHScene * m_pCurrentScene
Definition: Groups.h:151
C_PUSH_BUTTON
@ C_PUSH_BUTTON
Definition: ASN1Codes.h:64
MHApplication::m_buttonRefColour
MHColour m_buttonRefColour
Definition: Groups.h:134
MHGenericBoolean::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:343
MHOctetString
Definition: BaseClasses.h:107
MHTimer
Definition: Groups.h:40
C_RECTANGLE
@ C_RECTANGLE
Definition: ASN1Codes.h:61
C_INPUT_EVENT_REGISTER
@ C_INPUT_EVENT_REGISTER
Definition: ASN1Codes.h:87
MHFontBody::IsSet
bool IsSet() const
Definition: BaseClasses.h:315
MHFontBody::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:810
mythburn.FILE
int FILE
Definition: mythburn.py:139
MHOctetString::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:154
MHSetTimer::m_timerId
MHGenericInteger m_timerId
Definition: Groups.h:196
C_INTEGER_VARIABLE
@ C_INTEGER_VARIABLE
Definition: ASN1Codes.h:52
MHGroup::Destruction
void Destruction(MHEngine *engine) override
Definition: Groups.cpp:319
MHApplication::m_bgColour
MHColour m_bgColour
Definition: Groups.h:134
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
C_HIGHLIGHT_REF_COLOUR
@ C_HIGHLIGHT_REF_COLOUR
Definition: ASN1Codes.h:85
MHGroup::Deactivation
void Deactivation(MHEngine *engine) override
Definition: Groups.cpp:305
MHApplication::m_sliderRefColour
MHColour m_sliderRefColour
Definition: Groups.h:134
MHTransitionTo::m_nTransitionEffect
int m_nTransitionEffect
Definition: Groups.h:242
MHRoot::m_fRunning
bool m_fRunning
Definition: Root.h:252
MHRoot::m_ObjectReference
MHObjectRef m_ObjectReference
Definition: Root.h:247
MHSendEvent::m_eventSource
MHGenericObjectRef m_eventSource
Definition: Groups.h:183
MHSendEvent::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:831
MHEngine::GetGroupId
MHOctetString & GetGroupId()
Definition: Engine.h:153
MHGenericObjectRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:533
MHRoot::FindByObjectNo
virtual MHRoot * FindByObjectNo(int n)
Definition: Root.cpp:116
MHSetTimer::m_absFlag
MHGenericBoolean m_absFlag
Definition: Groups.h:205
MHGroup::m_items
MHOwnPtrSequence< MHIngredient > m_items
Definition: Groups.h:71
C_REMOTE_PROGRAM
@ C_REMOTE_PROGRAM
Definition: ASN1Codes.h:46
MHEngine::EventTriggered
void EventTriggered(MHRoot *pSource, enum EventType ev)
Definition: Engine.h:94
MHOctetStrVar
Definition: Variables.h:86
C_ENTRY_FIELD
@ C_ENTRY_FIELD
Definition: ASN1Codes.h:66
MHApplication::m_nBitmapCHook
int m_nBitmapCHook
Definition: Groups.h:138
MHApplication::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Groups.cpp:569
MHScene::m_nSceneCoordY
int m_nSceneCoordY
Definition: Groups.h:104
MHApplication::m_nLineArtCHook
int m_nLineArtCHook
Definition: Groups.h:139
MHPersistent::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:944
MHApplication::m_fontAttrs
MHOctetString m_fontAttrs
Definition: Groups.h:141
MHUnion
Definition: BaseClasses.h:283
C_IP_CONTENT_HOOK
@ C_IP_CONTENT_HOOK
Definition: ASN1Codes.h:80
MHTransitionTo::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:961
MHColour::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:236
feature
static const std::array< featureStruct, 7 > feature
Definition: audiooutputsettings.cpp:435
C_SLIDER
@ C_SLIDER
Definition: ASN1Codes.h:68
MHPalette
Definition: Ingredients.h:113
MHScene::m_fMovingCursor
bool m_fMovingCursor
Definition: Groups.h:110
hardwareprofile.config.p
p
Definition: config.py:33
C_FONT
@ C_FONT
Definition: ASN1Codes.h:49
C_CONTENT_REF_VARIABLE
@ C_CONTENT_REF_VARIABLE
Definition: ASN1Codes.h:55
Variables.h
MHIngredient::InitiallyAvailable
virtual bool InitiallyAvailable()
Definition: Ingredients.h:43
MHParseNode::GetSeqCount
int GetSeqCount()
Definition: ParseNode.cpp:141
MHBooleanVar
Definition: Variables.h:41
C_ON_CLOSE_DOWN
@ C_ON_CLOSE_DOWN
Definition: ASN1Codes.h:42
C_FONT_ATTRIBUTES
@ C_FONT_ATTRIBUTES
Definition: ASN1Codes.h:79
ParseNode.h
MHEngine::LockScreen
void LockScreen()
Definition: Engine.h:110
MHApplication::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:438
MHFontBody::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:798
C_TEXT
@ C_TEXT
Definition: ASN1Codes.h:65
MHScene::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:720
EventType
EventType
Definition: Root.h:33
MHLogWarning
@ MHLogWarning
Definition: freemheg.h:72
EventTimerFired
@ EventTimerFired
Definition: Root.h:34
PrintTabs
void PrintTabs(FILE *fd, int n)
Definition: ParseNode.cpp:34
MHGenericOctetString::GetValue
void GetValue(MHOctetString &str, MHEngine *engine) const
Definition: BaseClasses.cpp:505
MHParseNode::GetArgN
MHParseNode * GetArgN(int n)
Definition: ParseNode.cpp:78
MHHyperText
Definition: Text.h:101
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
MHParseNode::GetTagNo
int GetTagNo()
Definition: ParseNode.cpp:49
MHGroup::m_nLastId
int m_nLastId
Definition: Groups.h:83
MHSetTimer::ST_NoNewTimer
enum MHSetTimer::@10 ST_NoNewTimer
MHRoot::SetTimer
virtual void SetTimer(int, bool, int, MHEngine *)
Definition: Root.h:79
C_INTERCHANGED_PROGRAM
@ C_INTERCHANGED_PROGRAM
Definition: ASN1Codes.h:47
MHLOG
#define MHLOG(__level, __text)
Definition: Logging.h:36
MHQuit::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1014
MHGroup::FindByObjectNo
MHRoot * FindByObjectNo(int n) override
Definition: Groups.cpp:330
MHApplication::m_displayStack
MHSequence< MHVisible * > m_displayStack
Definition: Groups.h:148
MHPersistent::m_variables
MHOwnPtrSequence< MHObjectRef > m_variables
Definition: Groups.h:226
MHGenericOctetString::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:491
MHTransitionTo::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Groups.cpp:983
MHScene::m_nSceneCoordX
int m_nSceneCoordX
Definition: Groups.h:103
MHGroup::m_closeDown
MHActionSequence m_closeDown
Definition: Groups.h:70
C_BITMAP
@ C_BITMAP
Definition: ASN1Codes.h:58
C_MOVING_CURSOR
@ C_MOVING_CURSOR
Definition: ASN1Codes.h:90
MHLockScreen::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1024
Engine.h
C_PALETTE
@ C_PALETTE
Definition: ASN1Codes.h:48
MHScene::m_nAspectRatioW
int m_nAspectRatioW
Definition: Groups.h:108
C_OCTET_STRING_VARIABLE
@ C_OCTET_STRING_VARIABLE
Definition: ASN1Codes.h:53
MHGroup::CheckTimers
std::chrono::milliseconds CheckTimers(MHEngine *engine)
Definition: Groups.cpp:387
MHApplication::m_nTextCHook
int m_nTextCHook
Definition: Groups.h:135
MHPersistent::m_fIsLoad
bool m_fIsLoad
Definition: Groups.h:224
MHGroup::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Groups.cpp:217
C_ON_START_UP
@ C_ON_START_UP
Definition: ASN1Codes.h:41
MHGenericBoolean::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:358
gMHLogStream
FILE * gMHLogStream
Definition: Engine.cpp:1482
Ingredients.h
C_SWITCH_BUTTON
@ C_SWITCH_BUTTON
Definition: ASN1Codes.h:63
MHEngine::TransitionToScene
void TransitionToScene(const MHObjectRef &target)
Definition: Engine.cpp:418
C_LIST_GROUP
@ C_LIST_GROUP
Definition: ASN1Codes.h:70
MHIngredient
Definition: Ingredients.h:33
MHGetEngineSupport::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:1033
MHRoot::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: Root.cpp:30
MHSwitchButton
Definition: Visible.h:306
Text.h
MHTokenGroup
Definition: TokenGroup.h:59
MHUnion::GetValueFrom
void GetValueFrom(const MHParameter &value, MHEngine *engine)
Definition: BaseClasses.cpp:630
C_ITEMS
@ C_ITEMS
Definition: ASN1Codes.h:44
MHGenericOctetString::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:476
MHElemAction::Target
MHRoot * Target(MHEngine *engine)
Definition: BaseActions.cpp:46
MHParseNode::GetArgCount
int GetArgCount()
Definition: ParseNode.cpp:60
MHParseNode::GetNamedArg
MHParseNode * GetNamedArg(int nTag)
Definition: ParseNode.cpp:110
C_LINE_ART_CONTENT_HOOK
@ C_LINE_ART_CONTENT_HOOK
Definition: ASN1Codes.h:83
MHEngine::AddActions
void AddActions(const MHActionSequence &actions)
Definition: Engine.cpp:723
C_BUTTON_REF_COLOUR
@ C_BUTTON_REF_COLOUR
Definition: ASN1Codes.h:84
C_RESIDENT_PROGRAM
@ C_RESIDENT_PROGRAM
Definition: ASN1Codes.h:45
MHGroup::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:48
MHScene::m_nAspectRatioH
int m_nAspectRatioH
Definition: Groups.h:109
MHBitmap
Definition: Bitmap.h:36
MHParseNode::GetBoolValue
bool GetBoolValue()
Definition: ParseNode.cpp:192
Root.h
MHSetTimer::ST_TimerRelative
@ ST_TimerRelative
Definition: Groups.h:202
MHGroup::m_runTime
QElapsedTimer m_runTime
Definition: Groups.h:78
MHSendEvent::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Groups.cpp:818
MHRoot::PrintMe
virtual void PrintMe(FILE *fd, int nTabs) const
Definition: Root.cpp:38
MHOctetString::Size
int Size() const
Definition: BaseClasses.h:120
MHSlider
Definition: Visible.h:174
MHActionSequence::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: Actions.cpp:67
MHSendEvent::m_eventData
MHParameter m_eventData
Definition: Groups.h:185
C_LINK
@ C_LINK
Definition: ASN1Codes.h:56
MHSetTimer::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Groups.cpp:874
MHParseNode::Failure
static void Failure(const char *p)
Definition: ParseNode.cpp:43
C_ON_SPAWN_CLOSE_DOWN
@ C_ON_SPAWN_CLOSE_DOWN
Definition: ASN1Codes.h:71
C_TEXT_COLOUR
@ C_TEXT_COLOUR
Definition: ASN1Codes.h:77
C_CHARACTER_SET
@ C_CHARACTER_SET
Definition: ASN1Codes.h:74
MHRoot::Preparation
virtual void Preparation(MHEngine *engine)
Definition: Root.cpp:53
TokenGroup.h
MHEngine::UnlockScreen
void UnlockScreen()
Definition: Engine.cpp:904
MHColour::IsSet
bool IsSet() const
Definition: BaseClasses.h:144
MHParameter::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:705
C_HOTSPOT
@ C_HOTSPOT
Definition: ASN1Codes.h:62
MHTimer::m_Time
QTime m_Time
Definition: Groups.h:43
MHEngine::Spawn
void Spawn(const MHObjectRef &target)
Definition: Engine.h:85
MHLogError
@ MHLogError
Definition: freemheg.h:71
MHApplication::m_font
MHFontBody m_font
Definition: Groups.h:140
MHDynamicLineArt
Definition: DynamicLineArt.h:32
MHTransitionTo::m_fIsTagged
bool m_fIsTagged
Definition: Groups.h:240
MHSequence::Size
int Size() const
Definition: BaseClasses.h:47
MHIngredient::InitiallyActive
virtual bool InitiallyActive()
Definition: Ingredients.h:42
MHLaunch::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1008
MHContentRefVar
Definition: Variables.h:128
MHParseNode
Definition: ParseNode.h:38
MHActionSequence::PrintMe
virtual void PrintMe(FILE *fd, int nTabs) const
Definition: Actions.cpp:456
MHGroup::MakeClone
void MakeClone(MHRoot *pTarget, MHRoot *pRef, MHEngine *engine) override
Definition: Groups.cpp:422
MHIngredient::Destruction
void Destruction(MHEngine *engine) override
Definition: Ingredients.cpp:175
MHGenericInteger::GetValue
int GetValue(MHEngine *engine) const
Definition: BaseClasses.cpp:426
C_SCENE_COORDINATE_SYSTEM
@ C_SCENE_COORDINATE_SYSTEM
Definition: ASN1Codes.h:88
C_OBJECT_REF_VARIABLE
@ C_OBJECT_REF_VARIABLE
Definition: ASN1Codes.h:54
DynamicLineArt.h
MHGroup::m_timers
QList< MHTimer * > m_timers
Definition: Groups.h:79
MHGroup::m_startUp
MHActionSequence m_startUp
Definition: Groups.h:70
MHApplication::~MHApplication
~MHApplication() override
Definition: Groups.cpp:433
MHSequence::GetAt
BASE GetAt(int i) const
Definition: BaseClasses.h:49
MHElemAction::m_target
MHGenericObjectRef m_target
Definition: BaseActions.h:46
MHEngine::SetInputRegister
void SetInputRegister(int nReg)
Definition: Engine.cpp:517
MHEngine::LoadStorePersistent
bool LoadStorePersistent(bool fIsLoad, const MHOctetString &fileName, const MHSequence< MHObjectRef * > &variables)
Definition: Engine.cpp:1109
MHParameter::P_Null
enum MHParameter::ParamTypes P_Null
C_DEFAULT_ATTRIBUTES
@ C_DEFAULT_ATTRIBUTES
Definition: ASN1Codes.h:73
MHParseNode::GetStringValue
void GetStringValue(MHOctetString &str)
Definition: ParseNode.cpp:203
MHSequence::Append
void Append(BASE b)
Definition: BaseClasses.h:64
MHGenericInteger::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:412
MHERROR
#define MHERROR(__text)
Definition: Logging.h:42
Logging.h
MHGenericObjectRef::GetValue
void GetValue(MHObjectRef &ref, MHEngine *engine) const
Definition: BaseClasses.cpp:562
MHApplication::m_nStrCHook
int m_nStrCHook
Definition: Groups.h:137
C_STREAM
@ C_STREAM
Definition: ASN1Codes.h:57
MHListGroup
Definition: TokenGroup.h:101
Stream.h
MHElemAction
Definition: BaseActions.h:34
MHResidentProgram
Definition: Programs.h:55
MHObjectRefVar
Definition: Variables.h:107
MHScene::Activation
void Activation(MHEngine *engine) override
Definition: Groups.cpp:786
C_BACKGROUND_COLOUR
@ C_BACKGROUND_COLOUR
Definition: ASN1Codes.h:75
MHPersistent::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:914
MHGroup::m_nOrigGCPriority
int m_nOrigGCPriority
Definition: Groups.h:69
MHColour::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:248
MHRectangle
Definition: Visible.h:121
MHEngine::Quit
void Quit()
Definition: Engine.cpp:378
MHRoot::Destruction
virtual void Destruction(MHEngine *engine)
Definition: Root.cpp:98
MHParseNode::PNInt
@ PNInt
Definition: ParseNode.h:41
MHPersistent::m_fileName
MHGenericOctetString m_fileName
Definition: Groups.h:227
C_ON_RESTART
@ C_ON_RESTART
Definition: ASN1Codes.h:72
MHGenericObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:548
MHApplication::m_nCharSet
int m_nCharSet
Definition: Groups.h:133
MHObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:299
MHApplication::m_highlightRefColour
MHColour m_highlightRefColour
Definition: Groups.h:134
MHApplication::m_textColour
MHColour m_textColour
Definition: Groups.h:134
MHEngine::RunActions
void RunActions()
Definition: Engine.cpp:613
MHGetEngineSupport::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1040
MHHotSpot
Definition: Visible.h:280
MHEngine::GetEngineSupport
bool GetEngineSupport(const MHOctetString &feature)
Definition: Engine.cpp:1191
MHSetTimer::ST_TimerAbsolute
@ ST_TimerAbsolute
Definition: Groups.h:201
MHOctetString::Copy
void Copy(const MHOctetString &str)
Definition: BaseClasses.cpp:131
MHSetTimer::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:852
C_LINE_ART
@ C_LINE_ART
Definition: ASN1Codes.h:59
MHRoot
Definition: Root.h:43
MHEngine::Launch
bool Launch(const MHObjectRef &target, bool fIsSpawn=false)
Definition: Engine.cpp:274
MHIntegerVar
Definition: Variables.h:64
C_DYNAMIC_LINE_ART
@ C_DYNAMIC_LINE_ART
Definition: ASN1Codes.h:60
C_CURSOR_SHAPE
@ C_CURSOR_SHAPE
Definition: ASN1Codes.h:50
MHGenericBoolean::GetValue
bool GetValue(MHEngine *engine) const
Definition: BaseClasses.cpp:372
C_STREAM_CONTENT_HOOK
@ C_STREAM_CONTENT_HOOK
Definition: ASN1Codes.h:81
MHGroup::SetTimer
void SetTimer(int nTimerId, bool fAbsolute, int nMilliSecs, MHEngine *engine) override
Definition: Groups.cpp:351