示例#1
0
 // Return the value, looking up any indirect ref.
 public void GetValue(MHOctetString str, MHEngine engine)
 {
     if (m_fIsDirect)
     {
         str.Copy(m_Direct);
     }
     else
     {
         MHUnion result = new MHUnion();
         MHRoot  pBase  = engine.FindObject(m_Indirect);
         pBase.GetVariableValue(result, engine);
         // From my reading of the MHEG documents implicit conversion is only
         // performed when assigning variables.  Nevertheless the Channel 4
         // Teletext assumes that implicit conversion takes place here as well.
         if (result.Type == MHUnion.U_Int)
         {
             // Implicit conversion of string to integer.
             MHOctetString s = new MHOctetString("" + result.Int);
             str.Copy(s);
         }
         else
         {
             result.CheckType(MHUnion.U_String);
             str.Copy(result.String);
         }
     }
 }
示例#2
0
        //  void GetDefaultFont(MHFontBody &font); // Not currently implemented
        public void GetDefaultFontAttrs(MHOctetString str)
        {
            MHApplication pApp = CurrentApp();

            if (pApp != null && pApp.FontAttrs.Size > 0)
            {
                str.Copy(pApp.FontAttrs);
            }
            else
            {
                str.Copy("plain.24.24.0");  // TODO: Check this.
            }
        }
示例#3
0
 public void Initialise(MHParseNode p, MHEngine engine)
 {
     if (p.NodeType == MHParseNode.PNInt)
     {
         m_nObjectNo = p.GetIntValue();
         // Set the group id to the id of this group.
         m_GroupId.Copy(engine.GetGroupId());
     }
     else if (p.NodeType == MHParseNode.PNSeq)
     {
         MHParseNode   pFirst  = p.GetSeqN(0);
         MHOctetString groupId = new MHOctetString();
         pFirst.GetStringValue(m_GroupId);
         m_nObjectNo = p.GetSeqN(1).GetIntValue();
     }
     else
     {
         p.Failure("ObjectRef: Argument is not int or sequence");
     }
 }
示例#4
0
 public void Copy(MHContentRef cr)
 {
     m_ContentRef.Copy(cr.m_ContentRef);
 }
示例#5
0
 public MHUnion(MHOctetString strVal)
 {
     m_Type   = U_String;
     m_StrVal = new MHOctetString();
     m_StrVal.Copy(strVal);
 }
示例#6
0
 public void SetFromString(string str)
 {
     m_nColIndex = -1;
     m_ColStr.Copy(new MHOctetString(str));
 }
示例#7
0
 public void Copy(MHFontBody fb)
 {
     m_DirFont.Copy(fb.m_DirFont);
     m_IndirFont.Copy(fb.m_IndirFont);
 }