Exemplo n.º 1
0
        public ClientAnchor(EscherRecordData erd) : base(erd)
        {
            sbyte[] bytes = Bytes;

            // The x1 cell
            int x1Cell     = IntegerHelper.getInt(bytes[2], bytes[3]);
            int x1Fraction = IntegerHelper.getInt(bytes[4], bytes[5]);

            x1 = x1Cell + (double)x1Fraction / (double)1024;

            // The y1 cell
            int y1Cell     = IntegerHelper.getInt(bytes[6], bytes[7]);
            int y1Fraction = IntegerHelper.getInt(bytes[8], bytes[9]);

            y1 = y1Cell + (double)y1Fraction / (double)256;

            // The x2 cell
            int x2Cell     = IntegerHelper.getInt(bytes[10], bytes[11]);
            int x2Fraction = IntegerHelper.getInt(bytes[12], bytes[13]);

            x2 = x2Cell + (double)x2Fraction / (double)1024;

            // The y1 cell
            int y2Cell     = IntegerHelper.getInt(bytes[14], bytes[15]);
            int y2Fraction = IntegerHelper.getInt(bytes[16], bytes[17]);

            y2 = y2Cell + (double)y2Fraction / (double)256;
        }
Exemplo n.º 2
0
 public Sp(EscherRecordData erd) : base(erd)
 {
     shapeType = Instance;
     sbyte[] bytes = Bytes;
     shapeId          = IntegerHelper.getInt(bytes[0], bytes[1], bytes[2], bytes[3]);
     persistenceFlags = IntegerHelper.getInt(bytes[4], bytes[5], bytes[6], bytes[7]);
 }
Exemplo n.º 3
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="">erd
 /// </param>
 public BlipStoreEntry(EscherRecordData erd) : base(erd)
 {
     type  = BlipType.getType(Instance);
     write = false;
     sbyte[] bytes = Bytes;
     referenceCount = IntegerHelper.getInt(bytes[24], bytes[25], bytes[26], bytes[27]);
 }
Exemplo n.º 4
0
        /// <summary> Constructor invoked when reading in an escher stream
        ///
        /// </summary>
        /// <param name="erd">the escher record
        /// </param>
        public Dg(EscherRecordData erd) : base(erd)
        {
            drawingId = Instance;

            sbyte[] bytes = Bytes;
            shapeCount = IntegerHelper.getInt(bytes[0], bytes[1], bytes[2], bytes[3]);
            seed       = IntegerHelper.getInt(bytes[4], bytes[5], bytes[6], bytes[7]);
        }
Exemplo n.º 5
0
        /// <summary> Initializes the drawing data from the escher record read in</summary>
        private void  initialize()
        {
            EscherRecordData er = new EscherRecordData(this, 0);

            Assert.verify(er.isContainer());

            escherData = new EscherContainer(er);

            Assert.verify(escherData.Length == drawingData.Length);
            Assert.verify(escherData.Type == EscherRecordType.DGG_CONTAINER);

            initialized = true;
        }
Exemplo n.º 6
0
        /// <summary> Initializes the member variables from the Escher stream data</summary>
        private void  initialize()
        {
            EscherRecordData er = new EscherRecordData(this, 0);

            Assert.verify(er.isContainer());

            escherData = new EscherContainer(er);

            readSpContainer = null;
            if (escherData.Type == EscherRecordType.DG_CONTAINER)
            {
                EscherRecordData erd = new EscherRecordData(this, 80);
                Assert.verify(erd.Type == EscherRecordType.SP_CONTAINER);
                readSpContainer = new SpContainer(erd);
            }
            else
            {
                Assert.verify(escherData.Type == EscherRecordType.SP_CONTAINER);
                readSpContainer = new SpContainer(er);
            }

            Sp sp = (Sp)readSpContainer.Children[0];

            objectId = sp.ShapeId - 1024;

            Opt opt = (Opt)readSpContainer.Children[1];

            if (opt.getProperty(260) != null)
            {
                blipId = opt.getProperty(260).Value;
            }

            if (opt.getProperty(261) != null)
            {
                imageFile = new System.IO.FileInfo(opt.getProperty(261).stringValue);
            }
            else
            {
                logger.warn("no filename property for drawing");
                imageFile = new System.IO.FileInfo(System.Convert.ToString(blipId));
            }

            ClientAnchor clientAnchor = (ClientAnchor)readSpContainer.Children[2];

            x      = clientAnchor.X1;
            y      = clientAnchor.Y1;
            width  = clientAnchor.X2 - x;
            height = clientAnchor.Y2 - y;

            initialized = true;
        }
Exemplo n.º 7
0
        public Dgg(EscherRecordData erd) : base(erd)
        {
            clusters = new ArrayList();
            sbyte[] bytes = Bytes;
            maxShapeId    = IntegerHelper.getInt(bytes[0], bytes[1], bytes[2], bytes[3]);
            numClusters   = IntegerHelper.getInt(bytes[4], bytes[5], bytes[6], bytes[7]);
            shapesSaved   = IntegerHelper.getInt(bytes[8], bytes[9], bytes[10], bytes[11]);
            drawingsSaved = IntegerHelper.getInt(bytes[12], bytes[13], bytes[14], bytes[15]);

            int pos = 16;

            for (int i = 0; i < numClusters; i++)
            {
                int     dgId = IntegerHelper.getInt(bytes[pos], bytes[pos + 1]);
                int     sids = IntegerHelper.getInt(bytes[pos + 2], bytes[pos + 3]);
                Cluster c    = new Cluster(dgId, sids);
                clusters.Add(c);
                pos += 4;
            }
        }
Exemplo n.º 8
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="type">the type
 /// </param>
 protected internal EscherRecord(EscherRecordType type)
 {
     data = new EscherRecordData(type);
 }
Exemplo n.º 9
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="erd">the data
 /// </param>
 protected internal EscherRecord(EscherRecordData erd)
 {
     data = erd;
 }
Exemplo n.º 10
0
 public SplitMenuColors(EscherRecordData erd) : base(erd)
 {
 }
Exemplo n.º 11
0
        private void  initialize()
        {
            int curpos = Pos + HEADER_LENGTH;
            int endpos = Pos + Length;

            EscherRecord newRecord = null;

            while (curpos < endpos)
            {
                EscherRecordData erd = new EscherRecordData(EscherStream, curpos);

                EscherRecordType type = erd.Type;
                if (type == EscherRecordType.DGG)
                {
                    newRecord = new Dgg(erd);
                }
                else if (type == EscherRecordType.DG)
                {
                    newRecord = new Dg(erd);
                }
                else if (type == EscherRecordType.BSTORE_CONTAINER)
                {
                    newRecord = new BStoreContainer(erd);
                }
                else if (type == EscherRecordType.SPGR_CONTAINER)
                {
                    newRecord = new SpgrContainer(erd);
                }
                else if (type == EscherRecordType.SP_CONTAINER)
                {
                    newRecord = new SpContainer(erd);
                }
                else if (type == EscherRecordType.SPGR)
                {
                    newRecord = new Spgr(erd);
                }
                else if (type == EscherRecordType.SP)
                {
                    newRecord = new Sp(erd);
                }
                else if (type == EscherRecordType.CLIENT_ANCHOR)
                {
                    newRecord = new ClientAnchor(erd);
                }
                else if (type == EscherRecordType.CLIENT_DATA)
                {
                    newRecord = new ClientData(erd);
                }
                else if (type == EscherRecordType.BSE)
                {
                    newRecord = new BlipStoreEntry(erd);
                }
                else if (type == EscherRecordType.OPT)
                {
                    newRecord = new Opt(erd);
                }
                else if (type == EscherRecordType.SPLIT_MENU_COLORS)
                {
                    newRecord = new SplitMenuColors(erd);
                }
                else
                {
                    newRecord = new EscherAtom(erd);
                }

                children.Add(newRecord);
                curpos += newRecord.Length;
            }

            initialized = true;
        }
Exemplo n.º 12
0
 public EscherContainer(EscherRecordData erd) : base(erd)
 {
     initialized = false;
     children    = new ArrayList();
 }
Exemplo n.º 13
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="">erd
 /// </param>
 public ClientData(EscherRecordData erd) : base(erd)
 {
 }
Exemplo n.º 14
0
 public Opt(EscherRecordData erd) : base(erd)
 {
     numProperties = Instance;
     readProperties();
 }
Exemplo n.º 15
0
 /// <summary> Constructor
 ///
 /// </summary>
 /// <param name="erd">the escher record data read in
 /// </param>
 public SpgrContainer(EscherRecordData erd) : base(erd)
 {
 }
Exemplo n.º 16
0
 public Spgr(EscherRecordData erd) : base(erd)
 {
 }
Exemplo n.º 17
0
 public EscherAtom(EscherRecordData erd) : base(erd)
 {
 }
Exemplo n.º 18
0
 /// <summary> Constructor used to instantiate this object when reading from an
 /// escher stream
 ///
 /// </summary>
 /// <param name="erd">the escher data
 /// </param>
 public BStoreContainer(EscherRecordData erd) : base(erd)
 {
     numBlips = Instance;
 }