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.
388 {
389  QTime currentTime = QTime::currentTime(); // Get current time
390  QList<MHTimer *>::iterator it = m_Timers.begin();
391  int nMSecs = 0;
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  int nMSecsToGo = currentTime.msecsTo(pTimer->m_Time);
408 
409  if (nMSecs == 0 || 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  [[clang::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.
1043  MHOctetString feature;
1044  m_Feature.GetValue(feature, engine);
1045  engine->FindObject(m_Answer)->SetVariableValue(engine->GetEngineSupport(feature));
1046 }
MHTransitionTo::MHTransitionTo
MHTransitionTo()
Definition: Groups.cpp:954
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:69
MHRemoteProgram
Definition: Programs.h:67
MHGroup::m_CloseDown
MHActionSequence m_CloseDown
Definition: Groups.h:70
MHObjectRef
Definition: BaseClasses.h:152
C_CURSOR_SHAPE
#define C_CURSOR_SHAPE
Definition: ASN1Codes.h:47
MHParseNode::m_nNodeType
enum NodeType m_nNodeType
Definition: ParseNode.h:46
MHApplication::m_nIPCHook
int m_nIPCHook
Definition: Groups.h:135
MHScene::SetInputRegister
void SetInputRegister(int nReg, MHEngine *engine) override
Definition: Groups.cpp:798
Presentable.h
MHGroup::CheckTimers
int CheckTimers(MHEngine *engine)
Definition: Groups.cpp:387
MHObjectRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:278
C_CHARACTER_SET
#define C_CHARACTER_SET
Definition: ASN1Codes.h:71
MHInterChgProgram
Definition: Programs.h:79
Groups.h
MHCursorShape
Definition: Ingredients.h:99
C_SWITCH_BUTTON
#define C_SWITCH_BUTTON
Definition: ASN1Codes.h:60
MHPushButton
Definition: Visible.h:293
MHRoot::Deactivation
virtual void Deactivation(MHEngine *engine)
Definition: Root.cpp:85
MHIngredient::Preparation
void Preparation(MHEngine *engine) override
Definition: Ingredients.cpp:159
MHStream
Definition: Stream.h:32
MHTransitionTo::m_nConnectionTag
int m_nConnectionTag
Definition: Groups.h:240
C_FONT
#define C_FONT
Definition: ASN1Codes.h:46
MHSendEvent::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:805
MHApplication::m_fRestarting
bool m_fRestarting
Definition: Groups.h:151
MHScene::m_nEventReg
int m_nEventReg
Definition: Groups.h:101
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:739
ASN1Codes.h
MHLineArt
Definition: Visible.h:89
MHEngine
Definition: Engine.h:72
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
MHGroup::m_Timers
QList< MHTimer * > m_Timers
Definition: Groups.h:79
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:168
MHEntryField
Definition: Visible.h:244
MHTimer::m_nTimerId
int m_nTimerId
Definition: Groups.h:42
MHApplication::m_OnRestart
MHActionSequence m_OnRestart
Definition: Groups.h:130
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
MHPersistent::m_Variables
MHOwnPtrSequence< MHObjectRef > m_Variables
Definition: Groups.h:225
C_LINE_ART_CONTENT_HOOK
#define C_LINE_ART_CONTENT_HOOK
Definition: ASN1Codes.h:80
Bitmap.h
MHGroup::Preparation
void Preparation(MHEngine *engine) override
Definition: Groups.cpp:258
C_PUSH_BUTTON
#define C_PUSH_BUTTON
Definition: ASN1Codes.h:61
MHUnlockScreen::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1028
MHSetTimer::m_TimerId
MHGenericInteger m_TimerId
Definition: Groups.h:195
MHGenericInteger::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:397
arg
arg(title).arg(filename).arg(doDelete))
C_DEFAULT_ATTRIBUTES
#define C_DEFAULT_ATTRIBUTES
Definition: ASN1Codes.h:70
C_REMOTE_PROGRAM
#define C_REMOTE_PROGRAM
Definition: ASN1Codes.h:43
C_PALETTE
#define C_PALETTE
Definition: ASN1Codes.h:45
C_STREAM_CONTENT_HOOK
#define C_STREAM_CONTENT_HOOK
Definition: ASN1Codes.h:78
MHPersistent::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Groups.cpp:930
MHApplication::m_DisplayStack
MHSequence< MHVisible * > m_DisplayStack
Definition: Groups.h:147
MHScene::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Groups.cpp:761
C_TEXT_CONTENT_HOOK
#define C_TEXT_CONTENT_HOOK
Definition: ASN1Codes.h:73
C_LINE_ART
#define C_LINE_ART
Definition: ASN1Codes.h:56
C_SCENE_COORDINATE_SYSTEM
#define C_SCENE_COORDINATE_SYSTEM
Definition: ASN1Codes.h:85
Visible.h
C_ASPECT_RATIO
#define C_ASPECT_RATIO
Definition: ASN1Codes.h:86
MHRoot::SetVariableValue
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:108
MHElemAction::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
MHApplication::m_HighlightRefColour
MHColour m_HighlightRefColour
Definition: Groups.h:133
EventIsRunning
@ EventIsRunning
Definition: Root.h:33
MHApplication::m_pCurrentScene
MHScene * m_pCurrentScene
Definition: Groups.h:150
MHGetEngineSupport::m_Answer
MHObjectRef m_Answer
Definition: Groups.h:269
MHGenericBoolean::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:343
MHOctetString
Definition: BaseClasses.h:106
MHTimer
Definition: Groups.h:40
MHFontBody::IsSet
bool IsSet() const
Definition: BaseClasses.h:314
MHFontBody::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:815
mythburn.FILE
int FILE
Definition: mythburn.py:139
MHOctetString::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:154
MHGroup::Destruction
void Destruction(MHEngine *engine) override
Definition: Groups.cpp:319
tmp
static guint32 * tmp
Definition: goom_core.cpp:30
MHGroup::Deactivation
void Deactivation(MHEngine *engine) override
Definition: Groups.cpp:305
MHApplication::m_ButtonRefColour
MHColour m_ButtonRefColour
Definition: Groups.h:133
C_IP_CONTENT_HOOK
#define C_IP_CONTENT_HOOK
Definition: ASN1Codes.h:77
MHTransitionTo::m_nTransitionEffect
int m_nTransitionEffect
Definition: Groups.h:241
MHRoot::m_fRunning
bool m_fRunning
Definition: Root.h:252
MHRoot::m_ObjectReference
MHObjectRef m_ObjectReference
Definition: Root.h:247
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:539
MHRoot::FindByObjectNo
virtual MHRoot * FindByObjectNo(int n)
Definition: Root.cpp:115
C_MOVING_CURSOR
#define C_MOVING_CURSOR
Definition: ASN1Codes.h:87
MHEngine::EventTriggered
void EventTriggered(MHRoot *pSource, enum EventType ev)
Definition: Engine.h:94
C_RECTANGLE
#define C_RECTANGLE
Definition: ASN1Codes.h:58
MHOctetStrVar
Definition: Variables.h:86
MHApplication::m_nBitmapCHook
int m_nBitmapCHook
Definition: Groups.h:137
MHApplication::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Groups.cpp:569
MHScene::m_nSceneCoordY
int m_nSceneCoordY
Definition: Groups.h:103
MHApplication::m_nLineArtCHook
int m_nLineArtCHook
Definition: Groups.h:138
MHPersistent::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:944
C_HOTSPOT
#define C_HOTSPOT
Definition: ASN1Codes.h:59
C_ON_RESTART
#define C_ON_RESTART
Definition: ASN1Codes.h:69
MHUnion
Definition: BaseClasses.h:282
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
MHPalette
Definition: Ingredients.h:113
MHScene::m_fMovingCursor
bool m_fMovingCursor
Definition: Groups.h:109
hardwareprofile.config.p
p
Definition: config.py:33
C_STREAM
#define C_STREAM
Definition: ASN1Codes.h:54
Variables.h
MHIngredient::InitiallyAvailable
virtual bool InitiallyAvailable()
Definition: Ingredients.h:43
MHParseNode::GetSeqCount
int GetSeqCount()
Definition: ParseNode.cpp:141
MHBooleanVar
Definition: Variables.h:41
ParseNode.h
C_RESIDENT_PROGRAM
#define C_RESIDENT_PROGRAM
Definition: ASN1Codes.h:42
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:803
MHScene::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:720
MHApplication::m_OnSpawnCloseDown
MHActionSequence m_OnSpawnCloseDown
Definition: Groups.h:130
EventType
EventType
Definition: Root.h:33
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
C_SLIDER
#define C_SLIDER
Definition: ASN1Codes.h:65
C_ORIGINAL_GC_PRIORITY
#define C_ORIGINAL_GC_PRIORITY
Definition: ASN1Codes.h:40
MHEngine::FindObject
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:574
MHParseNode::GetTagNo
int GetTagNo()
Definition: ParseNode.cpp:49
MHGroup::m_nLastId
int m_nLastId
Definition: Groups.h:82
C_ON_SPAWN_CLOSE_DOWN
#define C_ON_SPAWN_CLOSE_DOWN
Definition: ASN1Codes.h:68
MHSetTimer::m_AbsFlag
MHGenericBoolean m_AbsFlag
Definition: Groups.h:204
MHRoot::SetTimer
virtual void SetTimer(int, bool, int, MHEngine *)
Definition: Root.h:79
C_ITEMS
#define C_ITEMS
Definition: ASN1Codes.h:41
MHSetTimer::ST_NoNewTimer
enum MHSetTimer::@9 ST_NoNewTimer
C_BOOLEAN_VARIABLE
#define C_BOOLEAN_VARIABLE
Definition: ASN1Codes.h:48
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
MHSetTimer::ST_TimerAbsolute
@ ST_TimerAbsolute
Definition: Groups.h:200
MHGroup::m_StartUp
MHActionSequence m_StartUp
Definition: Groups.h:70
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:102
MHLockScreen::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1024
Engine.h
MHElemAction::m_Target
MHGenericObjectRef m_Target
Definition: BaseActions.h:46
MHScene::m_nAspectRatioW
int m_nAspectRatioW
Definition: Groups.h:107
MHLogWarning
@ MHLogWarning
Definition: freemheg.h:66
C_HYPER_TEXT
#define C_HYPER_TEXT
Definition: ASN1Codes.h:64
MHGroup::m_Items
MHOwnPtrSequence< MHIngredient > m_Items
Definition: Groups.h:71
MHLogError
@ MHLogError
Definition: freemheg.h:65
MHApplication::m_nTextCHook
int m_nTextCHook
Definition: Groups.h:134
MHPersistent::m_fIsLoad
bool m_fIsLoad
Definition: Groups.h:223
MHGroup::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Groups.cpp:217
MHGenericBoolean::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:358
gMHLogStream
FILE * gMHLogStream
Definition: Engine.cpp:1482
Ingredients.h
MHApplication::m_SliderRefColour
MHColour m_SliderRefColour
Definition: Groups.h:133
C_TOKEN_GROUP
#define C_TOKEN_GROUP
Definition: ASN1Codes.h:66
MHEngine::TransitionToScene
void TransitionToScene(const MHObjectRef &target)
Definition: Engine.cpp:419
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:636
C_TEXT
#define C_TEXT
Definition: ASN1Codes.h:62
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_TEXT_COLOUR
#define C_TEXT_COLOUR
Definition: ASN1Codes.h:74
C_ON_START_UP
#define C_ON_START_UP
Definition: ASN1Codes.h:38
MHEngine::AddActions
void AddActions(const MHActionSequence &actions)
Definition: Engine.cpp:724
MHGroup::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:48
MHScene::m_nAspectRatioH
int m_nAspectRatioH
Definition: Groups.h:108
C_OBJECT_REF_VARIABLE
#define C_OBJECT_REF_VARIABLE
Definition: ASN1Codes.h:51
MHBitmap
Definition: Bitmap.h:36
MHParseNode::GetBoolValue
bool GetBoolValue()
Definition: ParseNode.cpp:192
Root.h
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:119
MHSlider
Definition: Visible.h:174
MHApplication::m_Font
MHFontBody m_Font
Definition: Groups.h:139
MHActionSequence::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: Actions.cpp:67
MHApplication::m_BGColour
MHColour m_BGColour
Definition: Groups.h:133
MHSetTimer::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Groups.cpp:874
MHPersistent::m_Succeeded
MHObjectRef m_Succeeded
Definition: Groups.h:224
MHParseNode::Failure
static void Failure(const char *p)
Definition: ParseNode.cpp:43
MHRoot::Preparation
virtual void Preparation(MHEngine *engine)
Definition: Root.cpp:52
TokenGroup.h
C_DYNAMIC_LINE_ART
#define C_DYNAMIC_LINE_ART
Definition: ASN1Codes.h:57
MHEngine::UnlockScreen
void UnlockScreen()
Definition: Engine.cpp:905
MHColour::IsSet
bool IsSet() const
Definition: BaseClasses.h:143
C_INTEGER_VARIABLE
#define C_INTEGER_VARIABLE
Definition: ASN1Codes.h:49
MHApplication::m_TextColour
MHColour m_TextColour
Definition: Groups.h:133
MHGetEngineSupport::m_Feature
MHGenericOctetString m_Feature
Definition: Groups.h:268
MHParameter::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:710
C_LINK
#define C_LINK
Definition: ASN1Codes.h:53
MHTimer::m_Time
QTime m_Time
Definition: Groups.h:43
MHEngine::Spawn
void Spawn(const MHObjectRef &target)
Definition: Engine.h:85
C_FONT_ATTRIBUTES
#define C_FONT_ATTRIBUTES
Definition: ASN1Codes.h:76
MHDynamicLineArt
Definition: DynamicLineArt.h:32
MHTransitionTo::m_fIsTagged
bool m_fIsTagged
Definition: Groups.h:239
MHSequence::Size
int Size() const
Definition: BaseClasses.h:46
C_FONT2
#define C_FONT2
Definition: ASN1Codes.h:75
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
DynamicLineArt.h
C_HIGHLIGHT_REF_COLOUR
#define C_HIGHLIGHT_REF_COLOUR
Definition: ASN1Codes.h:82
C_ENTRY_FIELD
#define C_ENTRY_FIELD
Definition: ASN1Codes.h:63
MHApplication::~MHApplication
~MHApplication() override
Definition: Groups.cpp:433
MHSequence::GetAt
BASE GetAt(int i) const
Definition: BaseClasses.h:48
MHSendEvent::m_EventData
MHParameter m_EventData
Definition: Groups.h:184
MHEngine::SetInputRegister
void SetInputRegister(int nReg)
Definition: Engine.cpp:518
MHEngine::LoadStorePersistent
bool LoadStorePersistent(bool fIsLoad, const MHOctetString &fileName, const MHSequence< MHObjectRef * > &variables)
Definition: Engine.cpp:1110
MHParameter::P_Null
enum MHParameter::ParamTypes P_Null
MHParseNode::GetStringValue
void GetStringValue(MHOctetString &str)
Definition: ParseNode.cpp:203
MHSequence::Append
void Append(BASE b)
Definition: BaseClasses.h:63
C_BUTTON_REF_COLOUR
#define C_BUTTON_REF_COLOUR
Definition: ASN1Codes.h:81
MHGenericInteger::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:412
C_INPUT_EVENT_REGISTER
#define C_INPUT_EVENT_REGISTER
Definition: ASN1Codes.h:84
MHPersistent::m_FileName
MHGenericOctetString m_FileName
Definition: Groups.h:226
MHERROR
#define MHERROR(__text)
Definition: Logging.h:42
Logging.h
MHGenericObjectRef::GetValue
void GetValue(MHObjectRef &ref, MHEngine *engine) const
Definition: BaseClasses.cpp:568
MHApplication::m_nStrCHook
int m_nStrCHook
Definition: Groups.h:136
MHListGroup
Definition: TokenGroup.h:101
C_CONTENT_REF_VARIABLE
#define C_CONTENT_REF_VARIABLE
Definition: ASN1Codes.h:52
Stream.h
MHElemAction
Definition: BaseActions.h:34
MHResidentProgram
Definition: Programs.h:55
MHObjectRefVar
Definition: Variables.h:107
C_ON_CLOSE_DOWN
#define C_ON_CLOSE_DOWN
Definition: ASN1Codes.h:39
MHScene::Activation
void Activation(MHEngine *engine) override
Definition: Groups.cpp:786
MHPersistent::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:914
C_OCTET_STRING_VARIABLE
#define C_OCTET_STRING_VARIABLE
Definition: ASN1Codes.h:50
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
C_BITMAP_CONTENT_HOOK
#define C_BITMAP_CONTENT_HOOK
Definition: ASN1Codes.h:79
MHEngine::Quit
void Quit()
Definition: Engine.cpp:378
MHRoot::Destruction
virtual void Destruction(MHEngine *engine)
Definition: Root.cpp:97
MHParseNode::PNInt
@ PNInt
Definition: ParseNode.h:41
MHGenericObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:554
MHSetTimer::ST_TimerRelative
@ ST_TimerRelative
Definition: Groups.h:201
MHApplication::m_nCharSet
int m_nCharSet
Definition: Groups.h:132
MHObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:299
MHEngine::RunActions
void RunActions()
Definition: Engine.cpp:614
C_BACKGROUND_COLOUR
#define C_BACKGROUND_COLOUR
Definition: ASN1Codes.h:72
MHGetEngineSupport::Perform
void Perform(MHEngine *engine) override
Definition: Groups.cpp:1040
MHHotSpot
Definition: Visible.h:280
C_SLIDER_REF_COLOUR
#define C_SLIDER_REF_COLOUR
Definition: ASN1Codes.h:83
MHSetTimer::m_TimerValue
MHGenericInteger m_TimerValue
Definition: Groups.h:203
MHEngine::GetEngineSupport
bool GetEngineSupport(const MHOctetString &feature)
Definition: Engine.cpp:1192
C_INTERCHANGED_PROGRAM
#define C_INTERCHANGED_PROGRAM
Definition: ASN1Codes.h:44
MHSendEvent::m_EventSource
MHGenericObjectRef m_EventSource
Definition: Groups.h:182
MHObjectRef::m_GroupId
MHOctetString m_GroupId
Definition: BaseClasses.h:169
MHGroup::m_RunTime
QElapsedTimer m_RunTime
Definition: Groups.h:78
MHOctetString::Copy
void Copy(const MHOctetString &str)
Definition: BaseClasses.cpp:131
MHSetTimer::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Groups.cpp:852
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_LIST_GROUP
#define C_LIST_GROUP
Definition: ASN1Codes.h:67
C_BITMAP
#define C_BITMAP
Definition: ASN1Codes.h:55
MHGenericBoolean::GetValue
bool GetValue(MHEngine *engine) const
Definition: BaseClasses.cpp:372
MHApplication::m_FontAttrs
MHOctetString m_FontAttrs
Definition: Groups.h:140
MHGroup::SetTimer
void SetTimer(int nTimerId, bool fAbsolute, int nMilliSecs, MHEngine *engine) override
Definition: Groups.cpp:351