| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkView.h" | 9 #include "SkView.h" |
| 10 #include "SkLua.h" | 10 #include "SkLua.h" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "Resources.h" | 12 #include "Resources.h" |
| 13 #include "SkData.h" | 13 #include "SkData.h" |
| 14 | 14 |
| 15 extern "C" { | 15 extern "C" { |
| 16 #include "lua.h" | 16 #include "lua.h" |
| 17 #include "lualib.h" | 17 #include "lualib.h" |
| 18 #include "lauxlib.h" | 18 #include "lauxlib.h" |
| 19 } | 19 } |
| 20 | 20 |
| 21 #define LUA_FILENAME "test.lua" | 21 //#define LUA_FILENAME "test.lua" |
| 22 //#define LUA_FILENAME "slides.lua" | 22 #define LUA_FILENAME "slides.lua" |
| 23 | 23 |
| 24 static const char gDrawName[] = "onDrawContent"; | 24 static const char gDrawName[] = "onDrawContent"; |
| 25 static const char gClickName[] = "onClickHandler"; | 25 static const char gClickName[] = "onClickHandler"; |
| 26 static const char gUnicharName[] = "onCharHandler"; | 26 static const char gUnicharName[] = "onCharHandler"; |
| 27 | 27 |
| 28 static const char gMissingCode[] = "" | 28 static const char gMissingCode[] = "" |
| 29 "local paint = Sk.newPaint()" | 29 "local paint = Sk.newPaint()" |
| 30 "paint:setAntiAlias(true)" | 30 "paint:setAntiAlias(true)" |
| 31 "paint:setTextSize(30)" | 31 "paint:setTextSize(30)" |
| 32 "" | 32 "" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 private: | 148 private: |
| 149 SkLua* fLua; | 149 SkLua* fLua; |
| 150 | 150 |
| 151 typedef SampleView INHERITED; | 151 typedef SampleView INHERITED; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 ////////////////////////////////////////////////////////////////////////////// | 154 ////////////////////////////////////////////////////////////////////////////// |
| 155 | 155 |
| 156 static SkView* MyFactory() { return new LuaView; } | 156 static SkView* MyFactory() { return new LuaView; } |
| 157 static SkViewRegister reg(MyFactory); | 157 static SkViewRegister reg(MyFactory); |
| OLD | NEW |