diff --git a/jni/NativeFormats/fbreader/src/bookmodel/BookReader.cpp b/jni/NativeFormats/fbreader/src/bookmodel/BookReader.cpp index 069d2ac43..2df7c8cd8 100644 --- a/jni/NativeFormats/fbreader/src/bookmodel/BookReader.cpp +++ b/jni/NativeFormats/fbreader/src/bookmodel/BookReader.cpp @@ -247,9 +247,9 @@ void BookReader::addVideoEntry(const ZLVideoEntry &entry) { } } -void BookReader::addFBReaderSpecialEntry(const std::string &action, const std::map &data) { +void BookReader::addExtensionEntry(const std::string &action, const std::map &data) { if (myCurrentTextModel != 0) { - myCurrentTextModel->addFBReaderSpecialEntry(action, data); + myCurrentTextModel->addExtensionEntry(action, data); } } diff --git a/jni/NativeFormats/fbreader/src/bookmodel/BookReader.h b/jni/NativeFormats/fbreader/src/bookmodel/BookReader.h index 8d1e20cf6..477f2c249 100644 --- a/jni/NativeFormats/fbreader/src/bookmodel/BookReader.h +++ b/jni/NativeFormats/fbreader/src/bookmodel/BookReader.h @@ -74,7 +74,7 @@ public: void addImage(const std::string &id, shared_ptr image); void addVideoEntry(const ZLVideoEntry &entry); - void addFBReaderSpecialEntry(const std::string &action, const std::map &data); + void addExtensionEntry(const std::string &action, const std::map &data); void beginContentsParagraph(int referenceNumber = -1); void endContentsParagraph(); diff --git a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp index a86e27033..4b43b076c 100644 --- a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp @@ -543,7 +543,7 @@ void XHTMLTagPreAction::doAtEnd(XHTMLReader &reader) { } void XHTMLTagOpdsAction::doAtStart(XHTMLReader &reader, const char **xmlattributes) { - bookReader(reader).addFBReaderSpecialEntry("opds", reader.attributeMap(xmlattributes)); + bookReader(reader).addExtensionEntry("opds", reader.attributeMap(xmlattributes)); } void XHTMLTagOpdsAction::doAtEnd(XHTMLReader &reader) { diff --git a/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.cpp b/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.cpp index a5b344a22..2e9763c8e 100644 --- a/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.cpp +++ b/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.cpp @@ -385,7 +385,7 @@ void ZLTextModel::addVideoEntry(const ZLVideoEntry &entry) { ++myParagraphLengths.back(); } -void ZLTextModel::addFBReaderSpecialEntry(const std::string &action, const std::map &data) { +void ZLTextModel::addExtensionEntry(const std::string &action, const std::map &data) { std::size_t fullLength = 2; // entry type + map size fullLength += 2 + ZLUnicodeUtil::utf8Length(action) * 2; // action name for (std::map::const_iterator it = data.begin(); it != data.end(); ++it) { @@ -394,7 +394,7 @@ void ZLTextModel::addFBReaderSpecialEntry(const std::string &action, const std:: } myLastEntryStart = myAllocator->allocate(fullLength); - *myLastEntryStart = ZLTextParagraphEntry::FBREADER_SPECIAL; + *myLastEntryStart = ZLTextParagraphEntry::EXTENSION_ENTRY; *(myLastEntryStart + 1) = data.size(); char *p = myLastEntryStart + 2; diff --git a/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.h b/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.h index 749e34349..3caf48768 100644 --- a/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.h +++ b/jni/NativeFormats/zlibrary/text/src/model/ZLTextModel.h @@ -78,7 +78,7 @@ public: void addFixedHSpace(unsigned char length); void addBidiReset(); void addVideoEntry(const ZLVideoEntry &entry); - void addFBReaderSpecialEntry(const std::string &action, const std::map &data); + void addExtensionEntry(const std::string &action, const std::map &data); void flush(); diff --git a/jni/NativeFormats/zlibrary/text/src/model/ZLTextParagraph.h b/jni/NativeFormats/zlibrary/text/src/model/ZLTextParagraph.h index 902ce17f9..3bdca6b5a 100644 --- a/jni/NativeFormats/zlibrary/text/src/model/ZLTextParagraph.h +++ b/jni/NativeFormats/zlibrary/text/src/model/ZLTextParagraph.h @@ -48,7 +48,7 @@ public: RESET_BIDI_ENTRY = 9, AUDIO_ENTRY = 10, VIDEO_ENTRY = 11, - FBREADER_SPECIAL = 12, + EXTENSION_ENTRY = 12, }; protected: @@ -154,10 +154,10 @@ private: ResetBidiEntry(); }; -class FBReaderSpecialEntry : public ZLTextParagraphEntry { +class ExtensionEntry : public ZLTextParagraphEntry { public: - ~FBReaderSpecialEntry(); + ~ExtensionEntry(); const std::string &action() const; const std::string &data() const; @@ -269,9 +269,9 @@ inline short ImageEntry::vOffset() const { return myVOffset; } inline ResetBidiEntry::ResetBidiEntry() {} -inline FBReaderSpecialEntry::~FBReaderSpecialEntry() {} -inline const std::string &FBReaderSpecialEntry::action() const { return myAction; } -inline const std::string &FBReaderSpecialEntry::data() const { return myData; } +inline ExtensionEntry::~ExtensionEntry() {} +inline const std::string &ExtensionEntry::action() const { return myAction; } +inline const std::string &ExtensionEntry::data() const { return myData; } inline ZLTextParagraph::ZLTextParagraph() : myEntryNumber(0) {} inline ZLTextParagraph::~ZLTextParagraph() {} diff --git a/src/org/geometerplus/zlibrary/text/model/FBReaderSpecialEntry.java b/src/org/geometerplus/zlibrary/text/model/ExtensionEntry.java similarity index 85% rename from src/org/geometerplus/zlibrary/text/model/FBReaderSpecialEntry.java rename to src/org/geometerplus/zlibrary/text/model/ExtensionEntry.java index 84d21bd24..16983d1b0 100644 --- a/src/org/geometerplus/zlibrary/text/model/FBReaderSpecialEntry.java +++ b/src/org/geometerplus/zlibrary/text/model/ExtensionEntry.java @@ -21,11 +21,11 @@ package org.geometerplus.zlibrary.text.model; import java.util.Map; -public class FBReaderSpecialEntry { +public class ExtensionEntry { public final String Type; public final Map Data; - FBReaderSpecialEntry(String type, Map data) { + ExtensionEntry(String type, Map data) { Type = type; Data = data; } @@ -35,10 +35,10 @@ public class FBReaderSpecialEntry { if (this == other) { return true; } - if (!(other instanceof FBReaderSpecialEntry)) { + if (!(other instanceof ExtensionEntry)) { return false; } - final FBReaderSpecialEntry entry = (FBReaderSpecialEntry)other; + final ExtensionEntry entry = (ExtensionEntry)other; return Type.equals(entry.Type) && Data.equals(entry.Data); } diff --git a/src/org/geometerplus/zlibrary/text/model/ZLTextParagraph.java b/src/org/geometerplus/zlibrary/text/model/ZLTextParagraph.java index 87355ac21..6a3b1c6c9 100644 --- a/src/org/geometerplus/zlibrary/text/model/ZLTextParagraph.java +++ b/src/org/geometerplus/zlibrary/text/model/ZLTextParagraph.java @@ -32,7 +32,7 @@ public interface ZLTextParagraph { byte RESET_BIDI = 9; byte AUDIO = 10; byte VIDEO = 11; - byte FBREADER_SPECIAL = 12; + byte EXTENSION = 12; } interface EntryIterator { @@ -50,7 +50,7 @@ public interface ZLTextParagraph { ZLImageEntry getImageEntry(); ZLVideoEntry getVideoEntry(); - FBReaderSpecialEntry getFBReaderSpecialEntry(); + ExtensionEntry getExtensionEntry(); ZLTextStyleEntry getStyleEntry(); short getFixedHSpaceLength(); diff --git a/src/org/geometerplus/zlibrary/text/model/ZLTextPlainModel.java b/src/org/geometerplus/zlibrary/text/model/ZLTextPlainModel.java index 01989db8f..a3e6486b6 100644 --- a/src/org/geometerplus/zlibrary/text/model/ZLTextPlainModel.java +++ b/src/org/geometerplus/zlibrary/text/model/ZLTextPlainModel.java @@ -70,8 +70,8 @@ public class ZLTextPlainModel implements ZLTextModel, ZLTextStyleEntry.Feature { // VideoEntry private ZLVideoEntry myVideoEntry; - // FBReaderSpecialEntry - private FBReaderSpecialEntry myFBReaderSpecialEntry; + // ExtensionEntry + private ExtensionEntry myExtensionEntry; // StyleEntry private ZLTextStyleEntry myStyleEntry; @@ -125,8 +125,8 @@ public class ZLTextPlainModel implements ZLTextModel, ZLTextStyleEntry.Feature { return myVideoEntry; } - public FBReaderSpecialEntry getFBReaderSpecialEntry() { - return myFBReaderSpecialEntry; + public ExtensionEntry getExtensionEntry() { + return myExtensionEntry; } public ZLTextStyleEntry getStyleEntry() { @@ -272,7 +272,7 @@ public class ZLTextPlainModel implements ZLTextModel, ZLTextStyleEntry.Feature { } break; } - case ZLTextParagraph.Entry.FBREADER_SPECIAL: + case ZLTextParagraph.Entry.EXTENSION: { final short kindLength = (short)data[dataOffset++]; final String kind = new String(data, dataOffset, kindLength); @@ -288,7 +288,7 @@ public class ZLTextPlainModel implements ZLTextModel, ZLTextStyleEntry.Feature { map.put(key, new String(data, dataOffset, valueLength)); dataOffset += valueLength; } - myFBReaderSpecialEntry = new FBReaderSpecialEntry(kind, map); + myExtensionEntry = new ExtensionEntry(kind, map); break; } } diff --git a/src/org/geometerplus/zlibrary/text/view/ZLTextParagraphCursor.java b/src/org/geometerplus/zlibrary/text/view/ZLTextParagraphCursor.java index 78762c49c..78697409f 100644 --- a/src/org/geometerplus/zlibrary/text/view/ZLTextParagraphCursor.java +++ b/src/org/geometerplus/zlibrary/text/view/ZLTextParagraphCursor.java @@ -108,9 +108,9 @@ public final class ZLTextParagraphCursor { case ZLTextParagraph.Entry.VIDEO: elements.add(new ZLTextVideoElement(it.getVideoEntry().sources())); break; - case ZLTextParagraph.Entry.FBREADER_SPECIAL: + case ZLTextParagraph.Entry.EXTENSION: { - final FBReaderSpecialEntry entry = it.getFBReaderSpecialEntry(); + final ExtensionEntry entry = it.getExtensionEntry(); if ("opds".equals(entry.Type)) { elements.addAll(myView.Holder.getElements(entry.Data)); }