示例#1
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine);
     m_Argument1.Initialise(p.GetArgN(1), engine);
     m_Argument2.Initialise(p.GetArgN(2), engine);
     m_Argument3.Initialise(p.GetArgN(3), engine);
     m_Argument4.Initialise(p.GetArgN(4), engine);
 }
示例#2
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine); // Target
     m_EventSource.Initialise(p.GetArgN(1), engine);
     m_EventType = p.GetArgN(2).GetEnumValue();
     if (p.GetArgCount() >= 4)
     {
         // TODO: We could check here that we only have bool, int or string and not object ref or content ref.
         m_EventData.Initialise(p.GetArgN(3), engine);
     }
 }
示例#3
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);                   // Target
            m_Succeeded.Initialise(p.GetArgN(1), engine); // Call/fork succeeded flag
            // Arguments.
            MHParseNode args = p.GetArgN(2);

            for (int i = 0; i < args.GetSeqCount(); i++)
            {
                MHParameter pParm = new MHParameter();
                m_Parameters.Append(pParm);
                pParm.Initialise(args.GetSeqN(i), engine);
            }
        }
示例#4
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine); // Target
            m_Succeeded.Initialise(p.GetArgN(1), engine);
            MHParseNode pVarSeq = p.GetArgN(2);

            for (int i = 0; i < pVarSeq.GetSeqCount(); i++)
            {
                MHObjectRef pVar = new MHObjectRef();
                m_Variables.Append(pVar);
                pVar.Initialise(pVarSeq.GetSeqN(i), engine);
            }
            m_FileName.Initialise(p.GetArgN(3), engine);
        }
示例#5
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine); // Target
            MHParseNode pOp = p.GetArgN(1);

            m_Operand.Initialise(pOp, engine); // Operand to add, subtract etc.
        }
示例#6
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // Original value should be an int.
            MHParseNode pInitial = p.GetNamedArg(ASN1Codes.C_ORIGINAL_VALUE);

            m_nOriginalValue = pInitial.GetArgN(0).GetIntValue();
        }
示例#7
0
        public virtual void Initialise(MHParseNode p, MHEngine engine)
        {
            // The first argument should be present.
            MHParseNode arg = p.GetArgN(0);

            // Extract the field.
            m_ObjectIdentifier.Initialise(arg, engine);
        }
示例#8
0
 public void Initialise(MHParseNode arg, MHEngine engine)
 {
     if (arg.GetTagNo() == ASN1Codes.C_INDIRECTREFERENCE)
     {
         // Indirect reference.
         m_fIsDirect = false;
         m_Indirect.Initialise(arg.GetArgN(0), engine);
     }
     else if (arg.GetTagNo() == ASN1Codes.C_CONTENT_REFERENCE)
     { // Simple integer value.
         m_fIsDirect = true;
         m_Direct.Initialise(arg.GetArgN(0), engine);
     }
     else
     {
         throw new MHEGException("Expected direct or indirect content reference");
     }
 }
示例#9
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // Original value should be an Content reference.
            MHParseNode pInitial = p.GetNamedArg(ASN1Codes.C_ORIGINAL_VALUE);
            // and this should be a ObjRef node.
            MHParseNode pArg = pInitial.GetNamedArg(ASN1Codes.C_CONTENT_REFERENCE);

            m_OriginalValue.Initialise(pArg.GetArgN(0), engine);
        }
示例#10
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine);
     m_TimerId.Initialise(p.GetArgN(1), engine); // The timer id
     if (p.GetArgCount() > 2)
     {
         MHParseNode pNewTimer = p.GetArgN(2);
         m_TimerValue.Initialise(pNewTimer.GetSeqN(0), engine);
         if (pNewTimer.GetSeqCount() > 1)
         {
             m_TimerType = ST_TimerAbsolute; // May be absolute - depends on the value.
             m_AbsFlag.Initialise(pNewTimer.GetSeqN(1), engine);
         }
         else
         {
             m_TimerType = ST_TimerRelative;
         }
     }
 }
示例#11
0
        // Set this up from the parse tree.
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            Logging.Assert(m_ObjectIdentifier.ObjectNo > 0);
            MHParseNode pIA = p.GetNamedArg(ASN1Codes.C_INITIALLY_ACTIVE);

            if (pIA != null)
            {
                m_fInitiallyActive = pIA.GetArgN(0).GetBoolValue();
            }

            MHParseNode pCHook = p.GetNamedArg(ASN1Codes.C_CONTENT_HOOK);

            if (pCHook != null)
            {
                m_nContentHook = pCHook.GetArgN(0).GetIntValue();
            }

            MHParseNode pOrigContent = p.GetNamedArg(ASN1Codes.C_ORIGINAL_CONTENT);

            if (pOrigContent != null)
            {
                MHParseNode pArg = pOrigContent.GetArgN(0);
                // Either a string - included content.
                if (pArg.NodeType == MHParseNode.PNString)
                {
                    m_ContentType = IN_IncludedContent;
                    pArg.GetStringValue(m_OrigIncludedContent);
                }
                else
                { // or a sequence - referenced content.
                    // In the text version this is tagged with :ContentRef
                    m_ContentType = IN_ReferencedContent;
                    m_OrigContentRef.Initialise(pArg.GetArgN(0), engine);
                    MHParseNode pContentSize = pArg.GetNamedArg(ASN1Codes.C_CONTENT_SIZE);
                    if (pContentSize != null)
                    {
                        m_nOrigContentSize = pContentSize.GetArgN(0).GetIntValue();
                    }
                    MHParseNode pCCPrio = pArg.GetNamedArg(ASN1Codes.C_CONTENT_CACHE_PRIORITY);
                    if (pCCPrio != null)
                    {
                        m_nOrigCCPrio = pCCPrio.GetArgN(0).GetIntValue();
                    }
                }
            }

            MHParseNode pShared = p.GetNamedArg(ASN1Codes.C_SHARED);

            if (pShared != null)
            {
                m_fShared = pShared.GetArgN(0).GetBoolValue();
            }
        }
示例#12
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // Original box size - two integer arguments.
            MHParseNode pOriginalBox = p.GetNamedArg(ASN1Codes.C_ORIGINAL_BOX_SIZE);
            if (pOriginalBox == null) p.Failure("OriginalBoxSize missing");
            m_nOriginalBoxWidth = pOriginalBox.GetArgN(0).GetIntValue();
            m_nOriginalBoxHeight = pOriginalBox.GetArgN(1).GetIntValue();

            // Original position - two integer arguments.  Optional
            MHParseNode pOriginalPos = p.GetNamedArg(ASN1Codes.C_ORIGINAL_POSITION);
            if (pOriginalPos != null) 
            {
                m_nOriginalPosX = pOriginalPos.GetArgN(0).GetIntValue();
                m_nOriginalPosY = pOriginalPos.GetArgN(1).GetIntValue();
            }

            // OriginalPalette ref - optional. 
            MHParseNode pOriginalPaletteRef = p.GetNamedArg(ASN1Codes.C_ORIGINAL_PALETTE_REF);
            if (pOriginalPaletteRef != null) m_OriginalPaletteRef.Initialise(pOriginalPaletteRef.GetArgN(0), engine);
        }
示例#13
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            MHParseNode args = p.GetArgN(1);

            for (int i = 0; i < args.GetSeqCount(); i++)
            {
                MHPointArg pPoint = new MHPointArg();
                m_Points.Append(pPoint);
                pPoint.Initialise(args.GetSeqN(i), engine);
            }
        }
示例#14
0
 public void Initialise(MHParseNode arg, MHEngine engine)
 {
     if (arg.NodeType == MHParseNode.PNTagged && arg.GetTagNo() == ASN1Codes.C_INDIRECTREFERENCE)
     {
         // Indirect reference.
         m_fIsDirect = false;
         m_Indirect.Initialise(arg.GetArgN(0), engine);
     }
     else
     { // Simple integer value.
         m_fIsDirect = true;
         m_ObjRef.Initialise(arg, engine);
     }
 }
示例#15
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine); // Target
     // The next one may be present but NULL in binary.
     if (p.GetArgCount() > 1)
     {
         MHParseNode pCtag = p.GetArgN(1);
         if (pCtag.NodeType == MHParseNode.PNInt)
         {
             m_fIsTagged      = true;
             m_nConnectionTag = pCtag.GetIntValue();
         }
         else
         {
             Logging.Assert(pCtag.NodeType == MHParseNode.PNNull);
         }
     }
     if (p.GetArgCount() > 2)
     {
         MHParseNode pTrEff = p.GetArgN(2);
         m_nTransitionEffect = pTrEff.GetIntValue();
     }
 }
示例#16
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            p.GetNamedArg(ASN1Codes.C_NAME).GetArgN(0).GetStringValue(m_Name); // Program name
            MHParseNode pAvail = p.GetNamedArg(ASN1Codes.C_INITIALLY_AVAILABLE);

            if (pAvail != null)
            {
                m_fInitiallyAvailable = pAvail.GetArgN(0).GetBoolValue();
            }
            // The MHEG Standard says that InitiallyAvailable is mandatory and should be false.
            // That doesn't seem to be the case in some MHEG programs so we force it here.
            m_fInitiallyActive = false;
        }
示例#17
0
        // Set this up from the parse tree.
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // Event register.
            MHParseNode pInputEventReg = p.GetNamedArg(ASN1Codes.C_INPUT_EVENT_REGISTER);

            m_nEventReg = pInputEventReg.GetArgN(0).GetIntValue();
            // Co-ordinate system
            MHParseNode pSceneCoords = p.GetNamedArg(ASN1Codes.C_SCENE_COORDINATE_SYSTEM);

            m_nSceneCoordX = pSceneCoords.GetArgN(0).GetIntValue();
            m_nSceneCoordY = pSceneCoords.GetArgN(1).GetIntValue();
            // Aspect ratio
            MHParseNode pAspectRatio = p.GetNamedArg(ASN1Codes.C_ASPECT_RATIO);

            if (pAspectRatio != null)
            {
                // Is the binary encoded as a sequence or a pair of arguments?
                m_nAspectRatioW = pAspectRatio.GetArgN(0).GetIntValue();
                m_nAspectRatioH = pAspectRatio.GetArgN(1).GetIntValue();
            }
            // Moving cursor
            MHParseNode pMovingCursor = p.GetNamedArg(ASN1Codes.C_MOVING_CURSOR);

            if (pMovingCursor != null)
            {
                pMovingCursor.GetArgN(0).GetBoolValue();
            }
            // Next scene sequence.
            MHParseNode pNextScenes = p.GetNamedArg(ASN1Codes.C_NEXT_SCENES);

            if (pNextScenes != null)
            {
                // TODO:
                Logging.Assert(false);
            }
        }
示例#18
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine); // Target
            MHParseNode pContent = p.GetArgN(1);

            if (pContent.NodeType == MHParseNode.PNSeq)
            {
                // Referenced content.
                m_fIsIncluded  = false;
                m_fSizePresent = m_fCCPriorityPresent = false;
                m_Referenced.Initialise(pContent.GetSeqN(0), engine);

                if (pContent.GetSeqCount() > 1)
                {
                    MHParseNode pArg = pContent.GetSeqN(1);
                    if (pArg.NodeType == MHParseNode.PNTagged && pArg.GetTagNo() == ASN1Codes.C_NEW_CONTENT_SIZE)
                    {
                        MHParseNode pVal = pArg.GetArgN(0);
                        // It may be NULL as a place-holder
                        if (pVal.NodeType == MHParseNode.PNInt)
                        {
                            m_fSizePresent = true;
                            m_ContentSize.Initialise(pVal, engine);
                        }
                    }
                }

                if (pContent.GetSeqCount() > 2)
                {
                    MHParseNode pArg = pContent.GetSeqN(2);
                    if (pArg.NodeType == MHParseNode.PNTagged && pArg.GetTagNo() == ASN1Codes.C_NEW_CONTENT_CACHE_PRIO)
                    {
                        MHParseNode pVal = pArg.GetArgN(0);
                        if (pVal.NodeType == MHParseNode.PNInt)
                        {
                            m_fCCPriorityPresent = true;
                            m_CCPriority.Initialise(pVal, engine);
                        }
                    }
                }
            }
            else
            {
                m_Included.Initialise(pContent, engine);
                m_fIsIncluded = true;
            }
        }
示例#19
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine);
     if (p.GetArgCount() > 1)
     {
         MHParseNode pIndexed  = p.GetNamedArg(ASN1Codes.C_NEW_COLOUR_INDEX);
         MHParseNode pAbsolute = p.GetNamedArg(ASN1Codes.C_NEW_ABSOLUTE_COLOUR);
         if (pIndexed != null)
         {
             m_ColourType = CT_Indexed;
             m_Indexed.Initialise(pIndexed.GetArgN(0), engine);
         }
         else if (pAbsolute != null)
         {
             m_ColourType = CT_Absolute;
             m_Absolute.Initialise(pAbsolute.GetArgN(0), engine);
         }
     }
 }
示例#20
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // Tiling - optional
            MHParseNode pTiling = p.GetNamedArg(ASN1Codes.C_TILING);

            if (pTiling != null)
            {
                m_fTiling = pTiling.GetArgN(0).GetBoolValue();
            }
            // Transparency - optional
            MHParseNode pTransparency = p.GetNamedArg(ASN1Codes.C_ORIGINAL_TRANSPARENCY);

            if (pTransparency != null)
            {
                m_nOrigTransparency = pTransparency.GetArgN(0).GetIntValue();
            }
            m_pContent = engine.GetContext().CreateBitmap(m_fTiling);
        }
示例#21
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            MHParseNode pMovements = p.GetNamedArg(ASN1Codes.C_MOVEMENT_TABLE);

            if (pMovements != null)
            {
                for (int i = 0; i < pMovements.GetArgCount(); i++)
                {
                    MHMovement pMove = new MHMovement();
                    m_MovementTable.Append(pMove);
                    pMove.Initialise(pMovements.GetArgN(i), engine);
                }
            }
            MHParseNode pTokenGrp = p.GetNamedArg(ASN1Codes.C_TOKEN_GROUP_ITEMS);

            if (pTokenGrp != null)
            {
                for (int i = 0; i < pTokenGrp.GetArgCount(); i++)
                {
                    MHTokenGroupItem pToken = new MHTokenGroupItem();
                    m_TokenGrpItems.Append(pToken);
                    pToken.Initialise(pTokenGrp.GetArgN(i), engine);
                }
            }
            MHParseNode pNoToken = p.GetNamedArg(ASN1Codes.C_NO_TOKEN_ACTION_SLOTS);

            if (pNoToken != null)
            {
                for (int i = 0; i < pNoToken.GetArgCount(); i++)
                {
                    MHParseNode      pAct     = pNoToken.GetArgN(i);
                    MHActionSequence pActions = new MHActionSequence();
                    m_NoTokenActionSlots.Append(pActions);
                    // The action slot entry may be NULL.
                    if (pAct.NodeType != MHParseNode.PNNull)
                    {
                        pActions.Initialise(pAct, engine);
                    }
                }
            }
        }
示例#22
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            MHParseNode pMultiplex = p.GetNamedArg(ASN1Codes.C_MULTIPLEX);

            for (int i = 0; i < pMultiplex.GetArgCount(); i++)
            {
                MHParseNode pItem = pMultiplex.GetArgN(i);
                if (pItem.GetTagNo() == ASN1Codes.C_AUDIO)
                {
                    MHAudio pAudio = new MHAudio();
                    m_Multiplex.Append(pAudio);
                    pAudio.Initialise(pItem, engine);
                }
                else if (pItem.GetTagNo() == ASN1Codes.C_VIDEO)
                {
                    MHVideo pVideo = new MHVideo();
                    m_Multiplex.Append(pVideo);
                    pVideo.Initialise(pItem, engine);
                }
                else if (pItem.GetTagNo() == ASN1Codes.C_RTGRAPHICS)
                {
                    MHRTGraphics pRtGraph = new MHRTGraphics();
                    m_Multiplex.Append(pRtGraph);
                    pRtGraph.Initialise(pItem, engine);
                }
                // Ignore unknown items
            }
            MHParseNode pStorage = p.GetNamedArg(ASN1Codes.C_STORAGE);

            if (pStorage != null)
            {
                m_nStorage = pStorage.GetArgN(0).GetEnumValue();
            }
            MHParseNode pLooping = p.GetNamedArg(ASN1Codes.C_LOOPING);

            if (pLooping != null)
            {
                m_nLooping = pLooping.GetArgN(0).GetIntValue();
            }
        }
示例#23
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // Bordered bounding box - optional
            MHParseNode pBBBox = p.GetNamedArg(ASN1Codes.C_BORDERED_BOUNDING_BOX);

            if (pBBBox != null)
            {
                m_fBorderedBBox = pBBBox.GetArgN(0).GetBoolValue();
            }
            // Original line width
            MHParseNode pOlw = p.GetNamedArg(ASN1Codes.C_ORIGINAL_LINE_WIDTH);

            if (pOlw != null)
            {
                m_nOriginalLineWidth = pOlw.GetArgN(0).GetIntValue();
            }
            // Original line style.  This is an integer not an enum.
            MHParseNode pOls = p.GetNamedArg(ASN1Codes.C_ORIGINAL_LINE_STYLE);

            if (pOls != null)
            {
                m_OriginalLineStyle = pOls.GetArgN(0).GetIntValue();
            }
            // Line colour.
            MHParseNode pOrlc = p.GetNamedArg(ASN1Codes.C_ORIGINAL_REF_LINE_COLOUR);

            if (pOrlc != null)
            {
                m_OrigLineColour.Initialise(pOrlc.GetArgN(0), engine);
            }
            // Fill colour
            MHParseNode pOrfc = p.GetNamedArg(ASN1Codes.C_ORIGINAL_REF_FILL_COLOUR);

            if (pOrfc != null)
            {
                m_OrigFillColour.Initialise(pOrfc.GetArgN(0), engine);
            }
        }
示例#24
0
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            MHParseNode pPositions = p.GetNamedArg(ASN1Codes.C_POSITIONS);

            for (int i = 0; i < pPositions.GetArgCount(); i++)
            {
                MHParseNode pPos = pPositions.GetArgN(i);
                Point       pos  = new Point(pPos.GetSeqN(0).GetIntValue(), pPos.GetSeqN(1).GetIntValue());
                m_Positions.Append(pos);
            }
            MHParseNode pWrap = p.GetNamedArg(ASN1Codes.C_WRAP_AROUND);

            if (pWrap != null)
            {
                m_fWrapAround = pWrap.GetArgN(0).GetBoolValue();
            }
            MHParseNode pMultiple = p.GetNamedArg(ASN1Codes.C_MULTIPLE_SELECTION);

            if (pMultiple != null)
            {
                m_fMultipleSelection = pMultiple.GetArgN(0).GetBoolValue();
            }
        }
示例#25
0
        // Set this up from the parse tree.
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            // Set to empty before we start (just in case).
            engine.GetGroupId().Copy("");

            base.Initialise(p, engine);

            // Must be an external reference with an object number of zero.
            Logging.Assert(m_ObjectIdentifier.ObjectNo == 0 && m_ObjectIdentifier.GroupId.Size != 0);

            // Set the group id for the rest of the group to this.
            engine.GetGroupId().Copy(m_ObjectIdentifier.GroupId);

            // Some of the information is irrelevant.
            //  MHParseNode pStdId = p.GetNamedArg(C_STANDARD_IDENTIFIER);
            //  MHParseNode pStdVersion = p.GetNamedArg(C_STANDARD_VERSION);
            //  MHParseNode pObjectInfo = p.GetNamedArg(C_OBJECT_INFORMATION);

            MHParseNode pOnStartUp = p.GetNamedArg(ASN1Codes.C_ON_START_UP);

            if (pOnStartUp != null)
            {
                m_StartUp.Initialise(pOnStartUp, engine);
            }
            MHParseNode pOnCloseDown = p.GetNamedArg(ASN1Codes.C_ON_CLOSE_DOWN);

            if (pOnCloseDown != null)
            {
                m_CloseDown.Initialise(pOnCloseDown, engine);
            }
            MHParseNode pOriginalGCPrio = p.GetNamedArg(ASN1Codes.C_ORIGINAL_GC_PRIORITY);

            if (pOriginalGCPrio != null)
            {
                m_nOrigGroupCachePriority = pOriginalGCPrio.GetArgN(0).GetIntValue();
            }

            // Ignore the other stuff at the moment.
            MHParseNode pItems = p.GetNamedArg(ASN1Codes.C_ITEMS);

            if (pItems == null)
            {
                p.Failure("Missing :Items block");
            }
            for (int i = 0; i < pItems.GetArgCount(); i++)
            {
                MHParseNode  pItem       = pItems.GetArgN(i);
                MHIngredient pIngredient = null;

                // Generate the particular kind of ingredient.
                switch (pItem.GetTagNo())
                {
                case ASN1Codes.C_RESIDENT_PROGRAM: pIngredient = new MHResidentProgram(); break;

//  NOT UK                  case ASN1Codes.C_REMOTE_PROGRAM: pIngredient = new MHRemoteProgram(); break;
//  NOT UK                  case ASN1Codes.C_INTERCHANGED_PROGRAM: pIngredient = new MHInterChgProgram(); break;
//  NOT UK                  case ASN1Codes.C_PALETTE: pIngredient = new MHPalette(); break;
//  NOT UK                  case ASN1Codes.C_FONT: pIngredient = new MHFont(); break;
//  NOT UK                  case ASN1Codes.C_CURSOR_SHAPE: pIngredient = new MHCursorShape(); break;
                case ASN1Codes.C_BOOLEAN_VARIABLE: pIngredient = new MHBooleanVar(); break;

                case ASN1Codes.C_INTEGER_VARIABLE: pIngredient = new MHIntegerVar(); break;

                case ASN1Codes.C_OCTET_STRING_VARIABLE: pIngredient = new MHOctetStrVar(); break;

                case ASN1Codes.C_OBJECT_REF_VARIABLE: pIngredient = new MHObjectRefVar(); break;

                case ASN1Codes.C_CONTENT_REF_VARIABLE: pIngredient = new MHContentRefVar(); break;

                case ASN1Codes.C_LINK: pIngredient = new MHLink(); break;

                case ASN1Codes.C_STREAM: pIngredient = new MHStream(); break;

                case ASN1Codes.C_BITMAP: pIngredient = new MHBitmap(); break;

                case ASN1Codes.C_LINE_ART: pIngredient = new MHLineArt(); break;

                case ASN1Codes.C_DYNAMIC_LINE_ART: pIngredient = new MHDynamicLineArt(); break;

                case ASN1Codes.C_RECTANGLE: pIngredient = new MHRectangle(); break;

// NOT UK                   case ASN1Codes.C_HOTSPOT: pIngredient = new MHHotSpot(); break;
// NOT UK                   case ASN1Codes.C_SWITCH_BUTTON: pIngredient = new MHSwitchButton(); break;
// NOT UK                   case ASN1Codes.C_PUSH_BUTTON: pIngredient = new MHPushButton(); break;
                case ASN1Codes.C_TEXT: pIngredient = new MHText(); break;

                case ASN1Codes.C_ENTRY_FIELD: pIngredient = new MHEntryField(); break;

                case ASN1Codes.C_HYPER_TEXT: pIngredient = new MHHyperText(); break;

                case ASN1Codes.C_SLIDER: pIngredient = new MHSlider(); break;

                case ASN1Codes.C_TOKEN_GROUP: pIngredient = new MHTokenGroup(); break;

                case ASN1Codes.C_LIST_GROUP: pIngredient = new MHListGroup(); break;

                default:
                    // So we find out about these when debugging.
                    Logging.Log(Logging.MHLogError, "'" + pItem.GetTagNo() + "' tag not in switch");
                    Logging.Assert(false);

                    // Future proofing: ignore any ingredients that we don't know about.
                    // Obviously these can only arise in the binary coding.
                    break;
                }
                if (pIngredient != null)
                {
                    // Initialise it from its argments.
                    pIngredient.Initialise(pItem, engine);
                    // Remember the highest numbered ingredient
                    if (pIngredient.ObjectIdentifier.ObjectNo > m_nLastId)
                    {
                        m_nLastId = pIngredient.ObjectIdentifier.ObjectNo;
                    }
                    // Add it to the ingedients of this group.
                    m_Items.Append(pIngredient);
                }
            }
        }
示例#26
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine);
     m_ResultVar.Initialise(p.GetArgN(1), engine);
 }
示例#27
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine);                  // Target
     m_NewValue.Initialise(p.GetArgN(1), engine); // Value to store
 }
示例#28
0
        public void Initialise(MHParseNode p, MHEngine engine)
        {
            // Depending on the caller we may have a tagged argument list or a sequence.
            for (int i = 0; i < p.GetArgCount(); i++)
            {
                MHParseNode  pElemAction = p.GetArgN(i);
                MHElemAction pAction     = null;
                switch (pElemAction.GetTagNo())
                {
                case ASN1Codes.C_ACTIVATE: pAction = new MHActivate(":Activate", true); break;

                case ASN1Codes.C_ADD: pAction = new MHAdd(); break;

                case ASN1Codes.C_ADD_ITEM: pAction = new MHAddItem(); break;

                case ASN1Codes.C_APPEND: pAction = new MHAppend(); break;

                case ASN1Codes.C_BRING_TO_FRONT: pAction = new MHBringToFront(); break;

                case ASN1Codes.C_CALL: pAction = new MHCall(":Call", false); break;

                case ASN1Codes.C_CALL_ACTION_SLOT: pAction = new MHCallActionSlot(); break;

                case ASN1Codes.C_CLEAR: pAction = new MHClear(); break;

                case ASN1Codes.C_CLONE: pAction = new MHClone(); break;

                case ASN1Codes.C_CLOSE_CONNECTION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ??

                case ASN1Codes.C_DEACTIVATE: pAction = new MHActivate(":Deactivate", false); break;

                case ASN1Codes.C_DEL_ITEM: pAction = new MHDelItem(); break;

                case ASN1Codes.C_DESELECT: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // Button

                case ASN1Codes.C_DESELECT_ITEM: pAction = new MHDeselectItem(); break;

                case ASN1Codes.C_DIVIDE: pAction = new MHDivide(); break;

                case ASN1Codes.C_DRAW_ARC: pAction = new MHDrawArcSector(":DrawArc", false); break;

                case ASN1Codes.C_DRAW_LINE: pAction = new MHDrawLine(); break;

                case ASN1Codes.C_DRAW_OVAL: pAction = new MHDrawOval(); break;

                case ASN1Codes.C_DRAW_POLYGON: pAction = new MHDrawPoly(":DrawPolygon", true); break;

                case ASN1Codes.C_DRAW_POLYLINE: pAction = new MHDrawPoly(":DrawPolyline", false); break;

                case ASN1Codes.C_DRAW_RECTANGLE: pAction = new MHDrawRectangle(); break;

                case ASN1Codes.C_DRAW_SECTOR: pAction = new MHDrawArcSector(":DrawSector", true); break;

                case ASN1Codes.C_FORK: pAction = new MHCall(":Fork", true); break;

                case ASN1Codes.C_GET_AVAILABILITY_STATUS: pAction = new MHGetAvailabilityStatus(); break;

                case ASN1Codes.C_GET_BOX_SIZE: pAction = new MHGetBoxSize(); break;

                case ASN1Codes.C_GET_CELL_ITEM: pAction = new MHGetCellItem(); break;

                case ASN1Codes.C_GET_CURSOR_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_GET_ENGINE_SUPPORT: pAction = new MHGetEngineSupport(); break;

                case ASN1Codes.C_GET_ENTRY_POINT: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // EntryField

                case ASN1Codes.C_GET_FILL_COLOUR: pAction = new MHGetFillColour(); break;

                case ASN1Codes.C_GET_FIRST_ITEM: pAction = new MHGetFirstItem(); break;

                case ASN1Codes.C_GET_HIGHLIGHT_STATUS: pAction = new MHTemporary(pElemAction.GetTagNo()); break;   // ?

                case ASN1Codes.C_GET_INTERACTION_STATUS: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_GET_ITEM_STATUS: pAction = new MHGetItemStatus(); break;

                case ASN1Codes.C_GET_LABEL: pAction = new MHTemporary(pElemAction.GetTagNo()); break;             // PushButton

                case ASN1Codes.C_GET_LAST_ANCHOR_FIRED: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // HyperText

                case ASN1Codes.C_GET_LINE_COLOUR: pAction = new MHGetLineColour(); break;

                case ASN1Codes.C_GET_LINE_STYLE: pAction = new MHGetLineStyle(); break;

                case ASN1Codes.C_GET_LINE_WIDTH: pAction = new MHGetLineWidth(); break;

                case ASN1Codes.C_GET_LIST_ITEM: pAction = new MHGetListItem(); break;

                case ASN1Codes.C_GET_LIST_SIZE: pAction = new MHGetListSize(); break;

                case ASN1Codes.C_GET_OVERWRITE_MODE: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_GET_PORTION: pAction = new MHTemporary(pElemAction.GetTagNo()); break;        // Slider

                case ASN1Codes.C_GET_POSITION: pAction = new MHGetPosition(); break;

                case ASN1Codes.C_GET_RUNNING_STATUS: pAction = new MHGetRunningStatus(); break;

                case ASN1Codes.C_GET_SELECTION_STATUS: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_GET_SLIDER_VALUE: pAction = new MHTemporary(pElemAction.GetTagNo()); break;     // Slider

                case ASN1Codes.C_GET_TEXT_CONTENT: pAction = new MHTemporary(pElemAction.GetTagNo()); break;     // Text

                case ASN1Codes.C_GET_TEXT_DATA: pAction = new MHGetTextData(); break;

                case ASN1Codes.C_GET_TOKEN_POSITION: pAction = new MHGetTokenPosition(); break;

                case ASN1Codes.C_GET_VOLUME: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_LAUNCH: pAction = new MHLaunch(); break;

                case ASN1Codes.C_LOCK_SCREEN: pAction = new MHLockScreen(); break;

                case ASN1Codes.C_MODULO: pAction = new MHModulo(); break;

                case ASN1Codes.C_MOVE: pAction = new MHMove(); break;

                case ASN1Codes.C_MOVE_TO: pAction = new MHMoveTo(); break;

                case ASN1Codes.C_MULTIPLY: pAction = new MHMultiply(); break;

                case ASN1Codes.C_OPEN_CONNECTION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_PRELOAD: pAction = new MHPreload(); break;

                case ASN1Codes.C_PUT_BEFORE: pAction = new MHPutBefore(); break;

                case ASN1Codes.C_PUT_BEHIND: pAction = new MHPutBehind(); break;

                case ASN1Codes.C_QUIT: pAction = new MHQuit(); break;

                case ASN1Codes.C_READ_PERSISTENT: pAction = new MHPersistent(":ReadPersistent", true); break;

                case ASN1Codes.C_RUN: pAction = new MHRun(); break;

                case ASN1Codes.C_SCALE_BITMAP: pAction = new MHScaleBitmap(); break;

                case ASN1Codes.C_SCALE_VIDEO: pAction = new MHScaleVideo(); break;

                case ASN1Codes.C_SCROLL_ITEMS: pAction = new MHScrollItems(); break;

                case ASN1Codes.C_SELECT: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // Button

                case ASN1Codes.C_SELECT_ITEM: pAction = new MHSelectItem(); break;

                case ASN1Codes.C_SEND_EVENT: pAction = new MHSendEvent(); break;

                case ASN1Codes.C_SEND_TO_BACK: pAction = new MHSendToBack(); break;

                case ASN1Codes.C_SET_BOX_SIZE: pAction = new MHSetBoxSize(); break;

                case ASN1Codes.C_SET_CACHE_PRIORITY: pAction = new MHTemporary(pElemAction.GetTagNo()); break;       // ?

                case ASN1Codes.C_SET_COUNTER_END_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // Stream

                case ASN1Codes.C_SET_COUNTER_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break;     // Stream

                case ASN1Codes.C_SET_COUNTER_TRIGGER: pAction = new MHTemporary(pElemAction.GetTagNo()); break;      // Stream

                case ASN1Codes.C_SET_CURSOR_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break;      // ?

                case ASN1Codes.C_SET_CURSOR_SHAPE: pAction = new MHTemporary(pElemAction.GetTagNo()); break;         // ?

                case ASN1Codes.C_SET_DATA: pAction = new MHSetData(); break;

                case ASN1Codes.C_SET_ENTRY_POINT: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // EntryField

                case ASN1Codes.C_SET_FILL_COLOUR: pAction = new MHSetFillColour(); break;

                case ASN1Codes.C_SET_FIRST_ITEM: pAction = new MHSetFirstItem(); break;

                case ASN1Codes.C_SET_FONT_REF: pAction = new MHTemporary(pElemAction.GetTagNo()); break;           // Text

                case ASN1Codes.C_SET_HIGHLIGHT_STATUS: pAction = new MHTemporary(pElemAction.GetTagNo()); break;   // ?

                case ASN1Codes.C_SET_INTERACTION_STATUS: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_SET_LABEL: pAction = new MHTemporary(pElemAction.GetTagNo()); break;              // PushButton

                case ASN1Codes.C_SET_LINE_COLOUR: pAction = new MHSetLineColour(); break;

                case ASN1Codes.C_SET_LINE_STYLE: pAction = new MHSetLineStyle(); break;

                case ASN1Codes.C_SET_LINE_WIDTH: pAction = new MHSetLineWidth(); break;

                case ASN1Codes.C_SET_OVERWRITE_MODE: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // EntryField

                case ASN1Codes.C_SET_PALETTE_REF: pAction = new MHTemporary(pElemAction.GetTagNo()); break;    // Visible

                case ASN1Codes.C_SET_PORTION: pAction = new MHTemporary(pElemAction.GetTagNo()); break;        // Slider

                case ASN1Codes.C_SET_POSITION: pAction = new MHSetPosition(); break;

                case ASN1Codes.C_SET_SLIDER_VALUE: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // Slider

                case ASN1Codes.C_SET_SPEED: pAction = new MHTemporary(pElemAction.GetTagNo()); break;        // ?

                case ASN1Codes.C_SET_TIMER: pAction = new MHSetTimer(); break;

                case ASN1Codes.C_SET_TRANSPARENCY: pAction = new MHSetTransparency(); break;

                case ASN1Codes.C_SET_VARIABLE: pAction = new MHSetVariable(); break;

                case ASN1Codes.C_SET_VOLUME: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_SPAWN: pAction = new MHSpawn(); break;

                case ASN1Codes.C_STEP: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // Slider

                case ASN1Codes.C_STOP: pAction = new MHStop(); break;

                case ASN1Codes.C_STORE_PERSISTENT: pAction = new MHPersistent(":StorePersistent", false); break;

                case ASN1Codes.C_SUBTRACT: pAction = new MHSubtract(); break;

                case ASN1Codes.C_TEST_VARIABLE: pAction = new MHTestVariable(); break;

                case ASN1Codes.C_TOGGLE: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // Button

                case ASN1Codes.C_TOGGLE_ITEM: pAction = new MHToggleItem(); break;

                case ASN1Codes.C_TRANSITION_TO: pAction = new MHTransitionTo(); break;

                case ASN1Codes.C_UNLOAD: pAction = new MHUnload(); break;

                case ASN1Codes.C_UNLOCK_SCREEN: pAction = new MHUnlockScreen(); break;

                // UK MHEG added actions.
                case ASN1Codes.C_SET_BACKGROUND_COLOUR: pAction = new MHSetBackgroundColour(); break;

                case ASN1Codes.C_SET_CELL_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                case ASN1Codes.C_SET_INPUT_REGISTER: pAction = new MHSetInputRegister(); break;

                case ASN1Codes.C_SET_TEXT_COLOUR: pAction = new MHSetTextColour(); break;

                case ASN1Codes.C_SET_FONT_ATTRIBUTES: pAction = new MHSetFontAttributes(); break;

                case ASN1Codes.C_SET_VIDEO_DECODE_OFFSET: pAction = new MHSetVideoDecodeOffset(); break;

                case ASN1Codes.C_GET_VIDEO_DECODE_OFFSET: pAction = new MHGetVideoDecodeOffset(); break;

                case ASN1Codes.C_GET_FOCUS_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // HyperText

                case ASN1Codes.C_SET_FOCUS_POSITION: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // HyperText

                case ASN1Codes.C_SET_BITMAP_DECODE_OFFSET: pAction = new MHSetBitmapDecodeOffset(); break;

                case ASN1Codes.C_GET_BITMAP_DECODE_OFFSET: pAction = new MHGetBitmapDecodeOffset(); break;

                case ASN1Codes.C_SET_SLIDER_PARAMETERS: pAction = new MHTemporary(pElemAction.GetTagNo()); break; // ?

                default:
                    Logging.Log(Logging.MHLogWarning, "Action " + pElemAction.GetTagNo() + " not implemented");
                    Logging.Assert(false); // So we find out about these when debugging.
                    // Future proofing: ignore any actions that we don't know about.
                    // Obviously these can only arise in the binary coding.
                    pAction = null;
                    break;
                }
                if (pAction != null)
                {
                    Append(pAction); // Add to the sequence.
                    pAction.Initialise(pElemAction, engine);
                }
            }
        }
示例#29
0
 public override void Initialise(MHParseNode p, MHEngine engine)
 {
     base.Initialise(p, engine);
     m_Feature.Initialise(p.GetArgN(1), engine);
     m_Answer.Initialise(p.GetArgN(2), engine);
 }
示例#30
0
        // Set this up from the parse tree.
        public override void Initialise(MHParseNode p, MHEngine engine)
        {
            base.Initialise(p, engine);
            // The link condition is encoded differently in the binary and text representations.
            MHParseNode pLinkCond = p.GetNamedArg(ASN1Codes.C_LINK_CONDITION);

            if (pLinkCond != null)
            {                                                           // Only in binary.
                m_EventSource.Initialise(pLinkCond.GetArgN(0), engine); // Event source
                m_nEventType = pLinkCond.GetArgN(1).GetEnumValue();     // Event type
                // The event data is optional and type-dependent.
                if (pLinkCond.GetArgCount() >= 3)
                {
                    MHParseNode pEventData = pLinkCond.GetArgN(2);
                    switch (pEventData.NodeType)
                    {
                    case MHParseNode.PNBool: m_EventData.Bool = pEventData.GetBoolValue(); m_EventData.Type = MHUnion.U_Bool; break;

                    case MHParseNode.PNInt: m_EventData.Int = pEventData.GetIntValue(); m_EventData.Type = MHUnion.U_Int; break;

                    case MHParseNode.PNString: pEventData.GetStringValue(m_EventData.String); m_EventData.Type = MHUnion.U_String; break;

                    default: pEventData.Failure("Unknown type of event data"); break;
                    }
                }
            }
            else
            {                                                                       // Only in text.
                MHParseNode pEventSource = p.GetNamedArg(ASN1Codes.P_EVENT_SOURCE); // Event source
                if (pEventSource == null)
                {
                    p.Failure("Missing :EventSource");
                }
                m_EventSource.Initialise(pEventSource.GetArgN(0), engine);
                MHParseNode pEventType = p.GetNamedArg(ASN1Codes.P_EVENT_TYPE); // Event type
                if (pEventType == null)
                {
                    p.Failure("Missing :EventType");
                }
                m_nEventType = pEventType.GetArgN(0).GetEnumValue();
                MHParseNode pEventData = p.GetNamedArg(ASN1Codes.P_EVENT_DATA); // Event data - optional
                if (pEventData != null)
                {
                    MHParseNode pEventDataArg = pEventData.GetArgN(0);
                    switch (pEventDataArg.NodeType)
                    {
                    case MHParseNode.PNBool: m_EventData.Bool = pEventDataArg.GetBoolValue(); m_EventData.Type = MHUnion.U_Bool; break;

                    case MHParseNode.PNInt: m_EventData.Int = pEventDataArg.GetIntValue(); m_EventData.Type = MHUnion.U_Int; break;

                    case MHParseNode.PNString: pEventDataArg.GetStringValue(m_EventData.String); m_EventData.Type = MHUnion.U_String; break;

                    default: pEventDataArg.Failure("Unknown type of event data"); break;
                    }
                }
            }

            MHParseNode pLinkEffect = p.GetNamedArg(ASN1Codes.C_LINK_EFFECT);

            m_LinkEffect.Initialise(pLinkEffect, engine);
        }