public Bookmark(IDjvuReader reader, IDjvuDocument document, INavmChunk navm, Bookmark parent) { InitializeReferences(document, navm, parent); DecodeBookmarkData(reader); LoadReferencedPage(); }
public BGjpChunk(IDjvuReader reader, IDjvuElement parent, IDjvuDocument document, string chunkID = "", long length = 0) : base(reader, parent, document, chunkID, length) { }
/// <summary> /// Initialize allows to delay reading of IFFChunk content to the moment it is needed. /// </summary> /// <param name="reader"></param> public virtual void Initialize(IDjvuReader reader) { reader.Position = DataOffset; ReadData(reader); IsInitialized = true; }
/// <summary> /// Reads the data for the chunk /// </summary> /// <param name="reader"></param> public virtual void ReadData(IDjvuReader reader) { DataOffset = reader.Position; reader.Position += Length; }
/// <summary> /// Decodes the children of this chunk /// </summary> /// <param name="reader"></param> internal virtual void ReadChildren(IDjvuReader reader) { _TempChildren = new List <IDjvuNode>(); long maxPosition = this.Length + DataOffset; // Jump to next FORM data "space" - it is skipped for root FORM if (this != Document.RootForm) { reader.Position = DataOffset; if (DjvuParser.IsFormChunk(ChunkType)) { maxPosition -= 4; } } // Read in all the chunks while (true) { if (reader.Position % 2 == 1) { reader.Position++; } if (reader.Position >= maxPosition) { break; } // Read the chunk ID string id = reader.ReadUTF8String(4); ChunkType type = DjvuParser.GetChunkType(id); long length = reader.ReadUInt32BigEndian(); bool isFormChunk = DjvuParser.IsFormChunk(type); if (isFormChunk) { id = reader.ReadUTF8String(4); type = DjvuParser.GetChunkType(id); } // Reset the stream position // reader.Position -= 4; var chunk = DjvuParser.CreateDecodedDjvuNode(reader, Document, this, type, id, length); if (chunk != null) { if (!DjvuParser.IsRootFormChild(type)) { _TempChildren.Add(chunk); _TempChildren[_TempChildren.Count - 1].Initialize(reader); reader.Position = chunk.Length + chunk.DataOffset; } else { Document.RootForm._TempChildren.Add(chunk); reader.Position = chunk.Length + chunk.DataOffset; if (isFormChunk) { reader.Position -= 4; } } } } Children = _TempChildren; _TempChildren = null; }
public override void Initialize(IDjvuReader reader) { reader.Position = DataOffset + 4; ReadData(reader); }
public DjvuFormElement(IDjvuReader reader, IDjvuElement parent, IDjvuDocument document, string chunkID = "", long length = 0) : base(reader, parent, document, chunkID, length) { InitializeInternal(); }
public override void ReadData(IDjvuReader reader) { base.ReadData(reader); // TODO use ETW logging here }
public UnknownChunk(IDjvuReader reader, IDjvuElement parent, IDjvuDocument document, string chunkID = "", long length = 0) : base(reader, parent, document, chunkID, length) { // Nothing }