Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: experimental/PdfViewer/generate_code.py

Issue 18536014: pdfviewer: more load references dinamically plumming (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/generate_code.py
===================================================================
--- experimental/PdfViewer/generate_code.py (revision 9970)
+++ experimental/PdfViewer/generate_code.py (working copy)
@@ -374,8 +374,8 @@
if len(prop.fTypes.split()) == 1:
t = prop.fTypes.strip()
- nativeFileClass.write(' ' + knowTypes[t][0] + ' ' + prop.fCppName + '(const SkNativeParsedPDF* doc);\n')
- nativeFileClassCpp.write('' + knowTypes[t][0] + ' SkPdf' + cls.fName + '::' + prop.fCppName + '(const SkNativeParsedPDF* doc) {\n')
+ nativeFileClass.write(' ' + knowTypes[t][0] + ' ' + prop.fCppName + '(SkNativeParsedPDF* doc);\n')
+ nativeFileClassCpp.write('' + knowTypes[t][0] + ' SkPdf' + cls.fName + '::' + prop.fCppName + '(SkNativeParsedPDF* doc) {\n')
nativeFileClassCpp.write(' SkPdfObject* ret = get(\"' + prop.fName + '\", \"' + prop.fAbr + '\");\n')
nativeFileClassCpp.write(' if (doc) {ret = doc->resolveReference(ret);}\n')
nativeFileClassCpp.write(' if ((ret != NULL && ' + knowTypes[t][3] + ') || (doc == NULL && ret != NULL && ret->isReference())) return ' + knowTypes[t][1] + ';\n')
@@ -395,17 +395,17 @@
for type in prop.fTypes.split():
t = type.strip()
- nativeFileClass.write(' bool is' + prop.fCppName + 'A' + t.title() + '(const SkNativeParsedPDF* doc);\n')
+ nativeFileClass.write(' bool is' + prop.fCppName + 'A' + t.title() + '(SkNativeParsedPDF* doc);\n')
- nativeFileClassCpp.write('bool SkPdf' + cls.fName + '::is' + prop.fCppName + 'A' + t.title() + '(const SkNativeParsedPDF* doc) {\n')
+ nativeFileClassCpp.write('bool SkPdf' + cls.fName + '::is' + prop.fCppName + 'A' + t.title() + '(SkNativeParsedPDF* doc) {\n')
nativeFileClassCpp.write(' SkPdfObject* ret = get(\"' + prop.fName + '\", \"' + prop.fAbr + '\");\n')
nativeFileClassCpp.write(' if (doc) {ret = doc->resolveReference(ret);}\n')
nativeFileClassCpp.write(' return ret != NULL && ' + knowTypes[t][3] + ';\n')
nativeFileClassCpp.write('}\n')
nativeFileClassCpp.write('\n')
- nativeFileClass.write(' ' + knowTypes[t][0] + ' get' + prop.fCppName + 'As' + t.title() + '(const SkNativeParsedPDF* doc);\n')
- nativeFileClassCpp.write('' + knowTypes[t][0] + ' SkPdf' + cls.fName + '::get' + prop.fCppName + 'As' + t.title() + '(const SkNativeParsedPDF* doc) {\n')
+ nativeFileClass.write(' ' + knowTypes[t][0] + ' get' + prop.fCppName + 'As' + t.title() + '(SkNativeParsedPDF* doc);\n')
+ nativeFileClassCpp.write('' + knowTypes[t][0] + ' SkPdf' + cls.fName + '::get' + prop.fCppName + 'As' + t.title() + '(SkNativeParsedPDF* doc) {\n')
nativeFileClassCpp.write(' SkPdfObject* ret = get(\"' + prop.fName + '\", \"' + prop.fAbr + '\");\n')
nativeFileClassCpp.write(' if (doc) {ret = doc->resolveReference(ret);}\n')
@@ -468,11 +468,11 @@
fileMapperNative.write('class SkPdfMapper {\n')
- fileMapperNative.write(' const SkNativeParsedPDF* fParsedDoc;\n')
+ fileMapperNative.write(' SkNativeParsedPDF* fParsedDoc;\n')
fileMapperNative.write('public:\n')
- fileMapperNative.write(' SkPdfMapper(const SkNativeParsedPDF* doc) : fParsedDoc(doc) {}\n')
+ fileMapperNative.write(' SkPdfMapper(SkNativeParsedPDF* doc) : fParsedDoc(doc) {}\n')
fileMapperNative.write('\n')
for name in self.fClassesNamesInOrder:
« no previous file with comments | « no previous file | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698