mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Refactor class method names.
Also move functionality to more logical place in canvas.js and jpx.js.
This commit is contained in:
parent
921c1e82a3
commit
99440ab691
15 changed files with 1554 additions and 1543 deletions
|
@ -19,11 +19,11 @@ var Parser = (function ParserClosure() {
|
|||
}
|
||||
|
||||
Parser.prototype = {
|
||||
refill: function parserRefill() {
|
||||
refill: function Parser_refill() {
|
||||
this.buf1 = this.lexer.getObj();
|
||||
this.buf2 = this.lexer.getObj();
|
||||
},
|
||||
shift: function parserShift() {
|
||||
shift: function Parser_shift() {
|
||||
if (isCmd(this.buf2, 'ID')) {
|
||||
this.buf1 = this.buf2;
|
||||
this.buf2 = null;
|
||||
|
@ -34,7 +34,7 @@ var Parser = (function ParserClosure() {
|
|||
this.buf2 = this.lexer.getObj();
|
||||
}
|
||||
},
|
||||
getObj: function parserGetObj(cipherTransform) {
|
||||
getObj: function Parser_getObj(cipherTransform) {
|
||||
if (isCmd(this.buf1, 'BI')) { // inline image
|
||||
this.shift();
|
||||
return this.makeInlineImage(cipherTransform);
|
||||
|
@ -98,7 +98,7 @@ var Parser = (function ParserClosure() {
|
|||
this.shift();
|
||||
return obj;
|
||||
},
|
||||
makeInlineImage: function parserMakeInlineImage(cipherTransform) {
|
||||
makeInlineImage: function Parser_makeInlineImage(cipherTransform) {
|
||||
var lexer = this.lexer;
|
||||
var stream = lexer.stream;
|
||||
|
||||
|
@ -160,11 +160,11 @@ var Parser = (function ParserClosure() {
|
|||
|
||||
return imageStream;
|
||||
},
|
||||
fetchIfRef: function parserFetchIfRef(obj) {
|
||||
fetchIfRef: function Parser_fetchIfRef(obj) {
|
||||
// not relying on the xref.fetchIfRef -- xref might not be set
|
||||
return isRef(obj) ? this.xref.fetch(obj) : obj;
|
||||
},
|
||||
makeStream: function parserMakeStream(dict, cipherTransform) {
|
||||
makeStream: function Parser_makeStream(dict, cipherTransform) {
|
||||
var lexer = this.lexer;
|
||||
var stream = lexer.stream;
|
||||
|
||||
|
@ -192,7 +192,7 @@ var Parser = (function ParserClosure() {
|
|||
stream.parameters = dict;
|
||||
return stream;
|
||||
},
|
||||
filter: function parserFilter(stream, dict, length) {
|
||||
filter: function Parser_filter(stream, dict, length) {
|
||||
var filter = this.fetchIfRef(dict.get('Filter', 'F'));
|
||||
var params = this.fetchIfRef(dict.get('DecodeParms', 'DP'));
|
||||
if (isName(filter))
|
||||
|
@ -215,7 +215,7 @@ var Parser = (function ParserClosure() {
|
|||
}
|
||||
return stream;
|
||||
},
|
||||
makeFilter: function parserMakeFilter(stream, name, length, params) {
|
||||
makeFilter: function Parser_makeFilter(stream, name, length, params) {
|
||||
if (name == 'FlateDecode' || name == 'Fl') {
|
||||
if (params) {
|
||||
return new PredictorStream(new FlateStream(stream), params);
|
||||
|
@ -265,7 +265,7 @@ var Lexer = (function LexerClosure() {
|
|||
this.stream = stream;
|
||||
}
|
||||
|
||||
Lexer.isSpace = function lexerIsSpace(ch) {
|
||||
Lexer.isSpace = function Lexer_isSpace(ch) {
|
||||
return ch == ' ' || ch == '\t' || ch == '\x0d' || ch == '\x0a';
|
||||
};
|
||||
|
||||
|
@ -300,7 +300,7 @@ var Lexer = (function LexerClosure() {
|
|||
}
|
||||
|
||||
Lexer.prototype = {
|
||||
getNumber: function lexerGetNumber(ch) {
|
||||
getNumber: function Lexer_getNumber(ch) {
|
||||
var floating = false;
|
||||
var str = ch;
|
||||
var stream = this.stream;
|
||||
|
@ -328,7 +328,7 @@ var Lexer = (function LexerClosure() {
|
|||
error('Invalid floating point number: ' + value);
|
||||
return value;
|
||||
},
|
||||
getString: function lexerGetString() {
|
||||
getString: function Lexer_getString() {
|
||||
var numParen = 1;
|
||||
var done = false;
|
||||
var str = '';
|
||||
|
@ -412,7 +412,7 @@ var Lexer = (function LexerClosure() {
|
|||
} while (!done);
|
||||
return str;
|
||||
},
|
||||
getName: function lexerGetName(ch) {
|
||||
getName: function Lexer_getName(ch) {
|
||||
var str = '';
|
||||
var stream = this.stream;
|
||||
while (!!(ch = stream.lookChar()) && !specialChars[ch.charCodeAt(0)]) {
|
||||
|
@ -439,7 +439,7 @@ var Lexer = (function LexerClosure() {
|
|||
str.length);
|
||||
return new Name(str);
|
||||
},
|
||||
getHexString: function lexerGetHexString(ch) {
|
||||
getHexString: function Lexer_getHexString(ch) {
|
||||
var str = '';
|
||||
var stream = this.stream;
|
||||
for (;;) {
|
||||
|
@ -468,7 +468,7 @@ var Lexer = (function LexerClosure() {
|
|||
}
|
||||
return str;
|
||||
},
|
||||
getObj: function lexerGetObj() {
|
||||
getObj: function Lexer_getObj() {
|
||||
// skip whitespace and comments
|
||||
var comment = false;
|
||||
var stream = this.stream;
|
||||
|
@ -541,7 +541,7 @@ var Lexer = (function LexerClosure() {
|
|||
return null;
|
||||
return Cmd.get(str);
|
||||
},
|
||||
skipToNextLine: function lexerSkipToNextLine() {
|
||||
skipToNextLine: function Lexer_skipToNextLine() {
|
||||
var stream = this.stream;
|
||||
while (true) {
|
||||
var ch = stream.getChar();
|
||||
|
@ -554,7 +554,7 @@ var Lexer = (function LexerClosure() {
|
|||
}
|
||||
}
|
||||
},
|
||||
skip: function lexerSkip() {
|
||||
skip: function Lexer_skip() {
|
||||
this.stream.skip();
|
||||
}
|
||||
};
|
||||
|
@ -578,7 +578,7 @@ var Linearization = (function LinearizationClosure() {
|
|||
}
|
||||
|
||||
Linearization.prototype = {
|
||||
getInt: function linearizationGetInt(name) {
|
||||
getInt: function Linearization_getInt(name) {
|
||||
var linDict = this.linDict;
|
||||
var obj;
|
||||
if (isDict(linDict) &&
|
||||
|
@ -588,7 +588,7 @@ var Linearization = (function LinearizationClosure() {
|
|||
}
|
||||
error('"' + name + '" field in linearization table is invalid');
|
||||
},
|
||||
getHint: function linearizationGetHint(index) {
|
||||
getHint: function Linearization_getHint(index) {
|
||||
var linDict = this.linDict;
|
||||
var obj1, obj2;
|
||||
if (isDict(linDict) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue