├── AndroidManifest.xml
├── README
├── assets
├── Breakout
│ ├── Ball.lua
│ ├── Brick.lua
│ ├── Game.lua
│ ├── Paddle.lua
│ ├── Painter.lua
│ ├── Wall.lua
│ └── breakout.lua
├── glut.lua
├── init.lua
├── lua
│ └── strict.lua
└── main.lua
├── jni
├── Android.mk
├── Application.mk
├── android
│ ├── include
│ │ ├── binder
│ │ │ ├── Binder.h
│ │ │ ├── IBinder.h
│ │ │ ├── IInterface.h
│ │ │ ├── IMemory.h
│ │ │ └── Parcel.h
│ │ ├── camera
│ │ │ ├── Camera.h
│ │ │ ├── CameraHardwareInterface.h
│ │ │ ├── CameraParameters.h
│ │ │ └── ICameraClient.h
│ │ ├── cutils
│ │ │ ├── atomic.h
│ │ │ └── native_handle.h
│ │ └── utils
│ │ │ ├── Errors.h
│ │ │ ├── KeyedVector.h
│ │ │ ├── Log.h
│ │ │ ├── RefBase.h
│ │ │ ├── SharedBuffer.h
│ │ │ ├── SortedVector.h
│ │ │ ├── String16.h
│ │ │ ├── String8.h
│ │ │ ├── TextOutput.h
│ │ │ ├── Timers.h
│ │ │ ├── TypeHelpers.h
│ │ │ ├── Vector.h
│ │ │ └── VectorImpl.h
│ └── lib
│ │ ├── armeabi
│ │ ├── armeabi-v7a
│ │ ├── armeabi_nexus7
│ │ ├── libbinder.so
│ │ ├── libcamera_client.so
│ │ └── libutils.so
│ │ ├── armeabi_samsung
│ │ ├── libbinder.so
│ │ ├── libcamera_client.so
│ │ └── libutils.so
│ │ └── x86
│ │ ├── libbinder.so
│ │ ├── libcamera_client.so
│ │ └── libutils.so
├── freetype-2.4.4
│ ├── .gitignore
│ ├── Android.mk
│ ├── FTL.txt
│ ├── README.md
│ ├── include
│ │ ├── freetype
│ │ │ ├── config
│ │ │ │ ├── ftconfig.h
│ │ │ │ ├── ftheader.h
│ │ │ │ ├── ftmodule.h
│ │ │ │ ├── ftoption.h
│ │ │ │ └── ftstdlib.h
│ │ │ ├── freetype.h
│ │ │ ├── ftadvanc.h
│ │ │ ├── ftbbox.h
│ │ │ ├── ftbdf.h
│ │ │ ├── ftbitmap.h
│ │ │ ├── ftcache.h
│ │ │ ├── ftchapters.h
│ │ │ ├── ftcid.h
│ │ │ ├── fterrdef.h
│ │ │ ├── fterrors.h
│ │ │ ├── ftgasp.h
│ │ │ ├── ftglyph.h
│ │ │ ├── ftgxval.h
│ │ │ ├── ftgzip.h
│ │ │ ├── ftimage.h
│ │ │ ├── ftincrem.h
│ │ │ ├── ftlcdfil.h
│ │ │ ├── ftlist.h
│ │ │ ├── ftlzw.h
│ │ │ ├── ftmac.h
│ │ │ ├── ftmm.h
│ │ │ ├── ftmodapi.h
│ │ │ ├── ftmoderr.h
│ │ │ ├── ftotval.h
│ │ │ ├── ftoutln.h
│ │ │ ├── ftpfr.h
│ │ │ ├── ftrender.h
│ │ │ ├── ftsizes.h
│ │ │ ├── ftsnames.h
│ │ │ ├── ftstroke.h
│ │ │ ├── ftsynth.h
│ │ │ ├── ftsystem.h
│ │ │ ├── fttrigon.h
│ │ │ ├── fttypes.h
│ │ │ ├── ftwinfnt.h
│ │ │ ├── ftxf86.h
│ │ │ ├── internal
│ │ │ │ ├── autohint.h
│ │ │ │ ├── ftcalc.h
│ │ │ │ ├── ftdebug.h
│ │ │ │ ├── ftdriver.h
│ │ │ │ ├── ftgloadr.h
│ │ │ │ ├── ftmemory.h
│ │ │ │ ├── ftobjs.h
│ │ │ │ ├── ftpic.h
│ │ │ │ ├── ftrfork.h
│ │ │ │ ├── ftserv.h
│ │ │ │ ├── ftstream.h
│ │ │ │ ├── fttrace.h
│ │ │ │ ├── ftvalid.h
│ │ │ │ ├── internal.h
│ │ │ │ ├── pcftypes.h
│ │ │ │ ├── psaux.h
│ │ │ │ ├── pshints.h
│ │ │ │ ├── services
│ │ │ │ │ ├── svbdf.h
│ │ │ │ │ ├── svcid.h
│ │ │ │ │ ├── svgldict.h
│ │ │ │ │ ├── svgxval.h
│ │ │ │ │ ├── svkern.h
│ │ │ │ │ ├── svmm.h
│ │ │ │ │ ├── svotval.h
│ │ │ │ │ ├── svpfr.h
│ │ │ │ │ ├── svpostnm.h
│ │ │ │ │ ├── svpscmap.h
│ │ │ │ │ ├── svpsinfo.h
│ │ │ │ │ ├── svsfnt.h
│ │ │ │ │ ├── svttcmap.h
│ │ │ │ │ ├── svtteng.h
│ │ │ │ │ ├── svttglyf.h
│ │ │ │ │ ├── svwinfnt.h
│ │ │ │ │ └── svxf86nm.h
│ │ │ │ ├── sfnt.h
│ │ │ │ ├── t1types.h
│ │ │ │ └── tttypes.h
│ │ │ ├── t1tables.h
│ │ │ ├── ttnameid.h
│ │ │ ├── tttables.h
│ │ │ ├── tttags.h
│ │ │ └── ttunpat.h
│ │ └── ft2build.h
│ └── src
│ │ ├── autofit
│ │ ├── Jamfile
│ │ ├── afangles.c
│ │ ├── afangles.h
│ │ ├── afcjk.c
│ │ ├── afcjk.h
│ │ ├── afdummy.c
│ │ ├── afdummy.h
│ │ ├── aferrors.h
│ │ ├── afglobal.c
│ │ ├── afglobal.h
│ │ ├── afhints.c
│ │ ├── afhints.h
│ │ ├── afindic.c
│ │ ├── afindic.h
│ │ ├── aflatin.c
│ │ ├── aflatin.h
│ │ ├── aflatin2.c
│ │ ├── aflatin2.h
│ │ ├── afloader.c
│ │ ├── afloader.h
│ │ ├── afmodule.c
│ │ ├── afmodule.h
│ │ ├── afpic.c
│ │ ├── afpic.h
│ │ ├── aftypes.h
│ │ ├── afwarp.c
│ │ ├── afwarp.h
│ │ ├── autofit.c
│ │ ├── module.mk
│ │ └── rules.mk
│ │ ├── base
│ │ ├── basepic.c
│ │ ├── basepic.h
│ │ ├── ftadvanc.c
│ │ ├── ftapi.c
│ │ ├── ftbase.c
│ │ ├── ftbase.h
│ │ ├── ftbbox.c
│ │ ├── ftbitmap.c
│ │ ├── ftcalc.c
│ │ ├── ftdbgmem.c
│ │ ├── ftdebug.c
│ │ ├── ftgloadr.c
│ │ ├── ftglyph.c
│ │ ├── ftinit.c
│ │ ├── ftobjs.c
│ │ ├── ftoutln.c
│ │ ├── ftpic.c
│ │ ├── ftrfork.c
│ │ ├── ftsnames.c
│ │ ├── ftstream.c
│ │ ├── ftstroke.c
│ │ ├── ftsynth.c
│ │ ├── ftsystem.c
│ │ ├── fttrigon.c
│ │ └── ftutil.c
│ │ ├── cff
│ │ ├── Jamfile
│ │ ├── cff.c
│ │ ├── cffcmap.c
│ │ ├── cffcmap.h
│ │ ├── cffdrivr.c
│ │ ├── cffdrivr.h
│ │ ├── cfferrs.h
│ │ ├── cffgload.c
│ │ ├── cffgload.h
│ │ ├── cffload.c
│ │ ├── cffload.h
│ │ ├── cffobjs.c
│ │ ├── cffobjs.h
│ │ ├── cffparse.c
│ │ ├── cffparse.h
│ │ ├── cffpic.c
│ │ ├── cffpic.h
│ │ ├── cfftoken.h
│ │ ├── cfftypes.h
│ │ ├── module.mk
│ │ └── rules.mk
│ │ ├── pshinter
│ │ ├── Jamfile
│ │ ├── module.mk
│ │ ├── pshalgo.c
│ │ ├── pshalgo.h
│ │ ├── pshglob.c
│ │ ├── pshglob.h
│ │ ├── pshinter.c
│ │ ├── pshmod.c
│ │ ├── pshmod.h
│ │ ├── pshnterr.h
│ │ ├── pshpic.c
│ │ ├── pshpic.h
│ │ ├── pshrec.c
│ │ ├── pshrec.h
│ │ └── rules.mk
│ │ ├── psnames
│ │ ├── Jamfile
│ │ ├── module.mk
│ │ ├── psmodule.c
│ │ ├── psmodule.h
│ │ ├── psnamerr.h
│ │ ├── psnames.c
│ │ ├── pspic.c
│ │ ├── pspic.h
│ │ ├── pstables.h
│ │ └── rules.mk
│ │ ├── raster
│ │ ├── Jamfile
│ │ ├── ftmisc.h
│ │ ├── ftraster.c
│ │ ├── ftraster.h
│ │ ├── ftrend1.c
│ │ ├── ftrend1.h
│ │ ├── module.mk
│ │ ├── raster.c
│ │ ├── rasterrs.h
│ │ ├── rastpic.c
│ │ ├── rastpic.h
│ │ └── rules.mk
│ │ ├── sfnt
│ │ ├── Jamfile
│ │ ├── module.mk
│ │ ├── rules.mk
│ │ ├── sfdriver.c
│ │ ├── sfdriver.h
│ │ ├── sferrors.h
│ │ ├── sfnt.c
│ │ ├── sfntpic.c
│ │ ├── sfntpic.h
│ │ ├── sfobjs.c
│ │ ├── sfobjs.h
│ │ ├── ttbdf.c
│ │ ├── ttbdf.h
│ │ ├── ttcmap.c
│ │ ├── ttcmap.h
│ │ ├── ttcmapc.h
│ │ ├── ttkern.c
│ │ ├── ttkern.h
│ │ ├── ttload.c
│ │ ├── ttload.h
│ │ ├── ttmtx.c
│ │ ├── ttmtx.h
│ │ ├── ttpost.c
│ │ ├── ttpost.h
│ │ ├── ttsbit.c
│ │ ├── ttsbit.h
│ │ └── ttsbit0.c
│ │ ├── smooth
│ │ ├── Jamfile
│ │ ├── ftgrays.c
│ │ ├── ftgrays.h
│ │ ├── ftsmerrs.h
│ │ ├── ftsmooth.c
│ │ ├── ftsmooth.h
│ │ ├── ftspic.c
│ │ ├── ftspic.h
│ │ ├── module.mk
│ │ ├── rules.mk
│ │ └── smooth.c
│ │ └── truetype
│ │ ├── Jamfile
│ │ ├── module.mk
│ │ ├── rules.mk
│ │ ├── truetype.c
│ │ ├── ttdriver.c
│ │ ├── ttdriver.h
│ │ ├── tterrors.h
│ │ ├── ttgload.c
│ │ ├── ttgload.h
│ │ ├── ttgxvar.c
│ │ ├── ttgxvar.h
│ │ ├── ttinterp.c
│ │ ├── ttinterp.h
│ │ ├── ttobjs.c
│ │ ├── ttobjs.h
│ │ ├── ttpic.c
│ │ ├── ttpic.h
│ │ ├── ttpload.c
│ │ └── ttpload.h
├── include
│ ├── activity.h
│ └── jnicontext.h
├── lua-5.1.4
│ ├── Android.mk
│ ├── include
│ │ ├── lauxlib.h
│ │ ├── lua.h
│ │ ├── luaconf.h
│ │ ├── luaconf.h.default
│ │ └── lualib.h
│ ├── lua-license.txt
│ └── src
│ │ ├── lapi.c
│ │ ├── lapi.h
│ │ ├── lauxlib.c
│ │ ├── lbaselib.c
│ │ ├── lbaselib.c.default
│ │ ├── lcode.c
│ │ ├── lcode.h
│ │ ├── ldblib.c
│ │ ├── ldebug.c
│ │ ├── ldebug.h
│ │ ├── ldo.c
│ │ ├── ldo.h
│ │ ├── ldump.c
│ │ ├── lfunc.c
│ │ ├── lfunc.h
│ │ ├── lgc.c
│ │ ├── lgc.h
│ │ ├── linit.c
│ │ ├── liolib.c
│ │ ├── llex.c
│ │ ├── llex.c.default
│ │ ├── llex.h
│ │ ├── llimits.h
│ │ ├── lmathlib.c
│ │ ├── lmem.c
│ │ ├── lmem.h
│ │ ├── loadlib.c
│ │ ├── lobject.c
│ │ ├── lobject.h
│ │ ├── lopcodes.c
│ │ ├── lopcodes.h
│ │ ├── loslib.c
│ │ ├── lparser.c
│ │ ├── lparser.h
│ │ ├── lstate.c
│ │ ├── lstate.h
│ │ ├── lstring.c
│ │ ├── lstring.h
│ │ ├── lstrlib.c
│ │ ├── ltable.c
│ │ ├── ltable.h
│ │ ├── ltablib.c
│ │ ├── ltm.c
│ │ ├── ltm.h
│ │ ├── lua.c
│ │ ├── luac.c
│ │ ├── luauser.c
│ │ ├── luauser.h
│ │ ├── lundump.c
│ │ ├── lundump.h
│ │ ├── lvm.c
│ │ ├── lvm.h
│ │ ├── lzio.c
│ │ ├── lzio.h
│ │ └── print.c
├── lua_modules
│ ├── Android.mk
│ ├── android_asset
│ │ ├── Android.mk
│ │ ├── luaasset.cpp
│ │ └── luaasset.h
│ ├── android_camera
│ │ ├── Android.mk
│ │ ├── luajnicamera.cpp
│ │ └── luanativecamera.cpp
│ ├── android_egl
│ │ ├── Android.mk
│ │ ├── luaegl.cpp
│ │ └── luaegl.h
│ ├── android_inputevent
│ │ ├── Android.mk
│ │ ├── luainputevent.cpp
│ │ ├── luainputevent.h
│ │ ├── luainputevent_oo.cpp
│ │ └── luainputevent_oo.h
│ ├── android_sensor
│ │ ├── Android.mk
│ │ ├── luasensor.cpp
│ │ ├── luasensor.h
│ │ └── test_sensor.lua
│ ├── android_toast
│ │ ├── Android.mk
│ │ ├── luatoast.cpp
│ │ ├── luatoast.h
│ │ └── luatoast_orig.cpp
│ ├── android_tts
│ │ ├── Android.mk
│ │ ├── luatts.cpp
│ │ ├── luatts.h
│ │ └── luatts_oo.cpp
│ ├── android_vibrator
│ │ ├── Android.mk
│ │ ├── luavibrator.cpp
│ │ └── luavibrator.h
│ ├── carray
│ ├── fontlib
│ ├── lanes
│ │ ├── ABOUT
│ │ ├── Android.mk
│ │ ├── COPYRIGHT
│ │ ├── assert.lua
│ │ ├── basic.lua
│ │ ├── bin2c.lua
│ │ ├── keeper.c
│ │ ├── keeper.h
│ │ ├── keeper.lch
│ │ ├── keeper.lua
│ │ ├── lanes.c
│ │ ├── lanes.lua
│ │ ├── pthread_hack.c
│ │ ├── threading.c
│ │ ├── threading.h
│ │ ├── tools.c
│ │ └── tools.h
│ ├── opengl
│ ├── socket
│ │ ├── Android.mk
│ │ ├── LICENSE
│ │ ├── README
│ │ ├── auxiliar.c
│ │ ├── auxiliar.h
│ │ ├── buffer.c
│ │ ├── buffer.h
│ │ ├── except.c
│ │ ├── except.h
│ │ ├── ftp.lua
│ │ ├── http.lua
│ │ ├── inet.c
│ │ ├── inet.h
│ │ ├── io.c
│ │ ├── io.h
│ │ ├── ltn12.lua
│ │ ├── luasocket.c
│ │ ├── luasocket.h
│ │ ├── makefile
│ │ ├── mime.c
│ │ ├── mime.h
│ │ ├── mime.lua
│ │ ├── mime.lua.default
│ │ ├── options.c
│ │ ├── options.h
│ │ ├── select.c
│ │ ├── select.h
│ │ ├── smtp.lua
│ │ ├── socket.h
│ │ ├── socket.lua
│ │ ├── socket.lua.default
│ │ ├── tcp.c
│ │ ├── tcp.h
│ │ ├── timeout.c
│ │ ├── timeout.h
│ │ ├── tp.lua
│ │ ├── udp.c
│ │ ├── udp.h
│ │ ├── unix.c
│ │ ├── unix.h
│ │ ├── url.lua
│ │ ├── usocket.c
│ │ ├── usocket.h
│ │ ├── wsocket.c
│ │ └── wsocket.h
│ └── unix
├── src
│ ├── activity.cpp
│ └── jnicontext.cpp
└── test
│ ├── graphics.cpp
│ ├── graphics.h
│ ├── inputs.cpp
│ └── main.cpp
└── res
├── drawable-hdpi
└── icon.png
├── drawable-ldpi
└── icon.png
├── drawable-mdpi
└── icon.png
└── values
└── strings.xml
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | This repository contains the Android NDK code (no Java)
2 | for a Native Activity project with a fully-embedded Lua
3 | environment.
4 |
5 |
--------------------------------------------------------------------------------
/assets/Breakout/Ball.lua:
--------------------------------------------------------------------------------
1 | module(..., package.seeall);
2 |
3 | require('Wall');
4 |
5 | DT = 0.001;
6 |
7 | local mt = getfenv();
8 | mt.__index = mt;
9 |
10 | function new()
11 | local obj = {};
12 |
13 | obj.x = Wall.WIDTH/2;
14 | obj.y = Wall.HEIGHT - 3;
15 | obj.vx = 80;
16 | obj.vy = -80;
17 |
18 | setmetatable(obj, mt);
19 | return obj;
20 | end
21 |
22 | function draw(self, p)
23 | p:setColor(Painter.WHITE);
24 | p:ball(self.x, self.y);
25 | end
26 |
27 | function tick(self, f)
28 | local x = f.x;
29 | local y = f.y;
30 | local LIM = .2;
31 | if (x > LIM) then x = LIM; end
32 | if (x < -LIM) then x = -LIM; end
33 | if (y > LIM) then y = LIM; end
34 | if (y < -LIM) then y = -LIM; end
35 |
36 | self.vx = self.vx + 20*x;
37 | self.vy = self.vy + 20*y;
38 | self.x = self.x + DT*self.vx;
39 | self.y = self.y + DT*self.vy;
40 | end
41 |
42 |
43 |
--------------------------------------------------------------------------------
/assets/Breakout/Brick.lua:
--------------------------------------------------------------------------------
1 | module(..., package.seeall);
2 |
3 | WIDTH = 20;
4 | HEIGHT = 8;
5 |
6 | local mt = getfenv();
7 | mt.__index = mt;
8 |
9 | function new(col, row)
10 | local obj = {};
11 |
12 | obj.col = col;
13 | obj.row = row;
14 | obj.countDownTimer = -1;
15 |
16 | setmetatable(obj, mt);
17 | return obj;
18 | end
19 |
20 | function draw(self, p)
21 | local iColor;
22 | if (self.countDownTimer == -1) then
23 | iColor = (math.floor(self.row/2) % Painter.nColor) + 1;
24 | p:setColor(iColor);
25 | p:bar(self.col*WIDTH+1, self.row*HEIGHT+1,
26 | (self.col+1)*WIDTH-1, (self.row+1)*HEIGHT-1);
27 | elseif (self.countDownTimer ~= 0) then
28 | iColor = (math.floor(self.countDownTimer/10) % Painter.nColor) + 1;
29 | p.setColor(iColor);
30 | p:bar(self.col*WIDTH+1, self.row*HEIGHT+1,
31 | (self.col+1)*WIDTH-1, (self.row+1)*HEIGHT-1);
32 | end
33 | end
34 |
35 | function tick(self, ball)
36 | local f = {x=0, y=0};
37 | if (self.countDownTimer == 0) then
38 | return f;
39 | end
40 | if (self.countDownTimer > 0) then
41 | self.countDownTimer = self.countDownTimer - 1;
42 | end
43 |
44 | local f1 = (ball.y - self.row * HEIGHT) * WIDTH -
45 | (ball.x - self.col * WIDTH) * HEIGHT;
46 | local f2 = (ball.y - self.row * HEIGHT - HEIGHT) * WIDTH +
47 | (ball.x - self.col * WIDTH) * HEIGHT;
48 | local d = (f1 < 0);
49 | local u = (f2 < 0);
50 | if (d and u) then -- top
51 | if (self.row * HEIGHT - ball.y - 1 < 0) then
52 | f.y = f.y + self.row * HEIGHT - ball.y - 1;
53 | end
54 | elseif (d and not u) then -- right
55 | if (self.col * WIDTH + WIDTH - ball.x + 1 > 0) then
56 | f.x = f.x + self.col * WIDTH + WIDTH - ball.x + 1;
57 | end
58 | elseif (not d and u) then -- left
59 | if (self.col *WIDTH - ball.x - 1 < 0) then
60 | f.x = f.x + self.col * WIDTH - ball.x - 1;
61 | end
62 | else -- bottom
63 | if (self.row *HEIGHT + HEIGHT - ball.y + 1 > 0) then
64 | f.y = f.y + self.row * HEIGHT + HEIGHT - ball.y + 1;
65 | end
66 | end
67 |
68 | return f;
69 | end
70 |
71 | function destroy(self)
72 | if (self.countDownTimer == -1) then
73 | self.countDownTimer = 60;
74 | end
75 | end
76 |
--------------------------------------------------------------------------------
/assets/Breakout/Game.lua:
--------------------------------------------------------------------------------
1 | module(..., package.seeall);
2 |
3 | require('Wall');
4 | require('Ball');
5 | require('Paddle');
6 |
7 | local mt = getfenv();
8 | mt.__index = mt;
9 |
10 | function new()
11 | local obj = {};
12 |
13 | obj.wall = Wall.new();
14 | obj.ball = Ball.new();
15 | obj.paddle = Paddle.new();
16 |
17 | setmetatable(obj, mt);
18 | return obj;
19 | end
20 |
21 | function draw(self, p)
22 | self.wall:draw(p);
23 | self.ball:draw(p);
24 | self.paddle:draw(p);
25 | end
26 |
27 | function setX(self, x)
28 | self.paddle:setX(x);
29 | end
30 |
31 | function tick(self)
32 | f = self.wall:tick(self.ball);
33 | fpaddle = self.paddle:tick(self.ball);
34 | f.x = f.x + fpaddle.x;
35 | f.y = f.y + fpaddle.y;
36 |
37 | self.ball:tick(f);
38 | if (self.ball.y > Wall.HEIGHT) then
39 | self.ball = Ball.new();
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/assets/Breakout/Paddle.lua:
--------------------------------------------------------------------------------
1 | module(..., package.seeall);
2 |
3 | require('Wall');
4 | require('Painter');
5 |
6 | WIDTH = 32;
7 |
8 | local mt = getfenv();
9 | mt.__index = mt;
10 |
11 | function new()
12 | local obj = {};
13 |
14 | obj.x = Wall.WIDTH/2;
15 |
16 | setmetatable(obj, mt);
17 | return obj;
18 | end
19 |
20 | function draw(self, p)
21 | p:setColor(Painter.ORANGE);
22 | p:bar(self.x - WIDTH/2, Wall.HEIGHT - 2,
23 | self.x + WIDTH/2, Wall.HEIGHT);
24 | end
25 |
26 | function tick(self, ball)
27 | local f = {x=0, y=0};
28 | local s = ball.x - self.x + WIDTH/2;
29 | if ((s >= 0) and (s < WIDTH)
30 | and (Wall.HEIGHT - 3 - ball.y < 0)) then
31 | f.x = (Wall.HEIGHT-3-ball.y)*(self.x-ball.x)/WIDTH;
32 | f.y = Wall.HEIGHT-3-ball.y;
33 | end
34 |
35 | return f;
36 | end
37 |
38 | function setX(self, x)
39 | self.x = x;
40 | end
41 |
--------------------------------------------------------------------------------
/assets/Breakout/Painter.lua:
--------------------------------------------------------------------------------
1 | module(..., package.seeall);
2 |
3 | require('math');
4 | require('gles1');
5 | require('carray');
6 |
7 | RED = 'red';
8 | ORANGE = 'orange';
9 | YELLOW = 'yellow';
10 | GREEN = 'green';
11 | WHITE = 'white';
12 | BLACK = 'black';
13 |
14 | local mt = getfenv();
15 | mt.__index = mt;
16 |
17 | function new()
18 | local obj = {};
19 | setmetatable(obj, mt);
20 | return obj;
21 | end
22 |
23 |
24 | local vRect = carray.new("float",
25 | {0, 0,
26 | 1, 0,
27 | 0, 1,
28 | 1, 1});
29 |
30 | function bar(self, x1, y1, x2, y2)
31 | --[[
32 | local v = carray.new("float",
33 | {x1, y1,
34 | x2, y1,
35 | x1, y2,
36 | x2, y2});
37 | --]]
38 | gl.PushMatrix();
39 | gl.Translatef(x1, y1, 0);
40 | gl.Scalef(x2-x1, y2-y1, 0);
41 | gl.EnableClientState(gl.VERTEX_ARRAY);
42 | gl.VertexPointer(2, gl.FLOAT, 0, carray.pointer(vRect));
43 | gl.DrawArrays(gl.TRIANGLE_STRIP, 0, 4);
44 | gl.DisableClientState(gl.VERTEX_ARRAY);
45 | gl.PopMatrix();
46 | end
47 |
48 | local nCircle = 90;
49 | local vCircle = carray.new("float", 2*(nCircle+1));
50 | vCircle[1] = 0;
51 | vCircle[2] = 0;
52 | for i = 1,nCircle do
53 | local k = 2*i+1;
54 | local a = 2*math.pi*(i-1)/(nCircle-1);
55 | vCircle[k] = math.cos(a);
56 | vCircle[k+1] = math.sin(a);
57 | end
58 |
59 | function ball(self, x, y)
60 | --[[
61 | local v = carray.new("float",
62 | {x+3, y,
63 | x, y+3,
64 | x-3, y,
65 | x, y-3});
66 | --]]
67 | gl.PushMatrix();
68 | gl.Translatef(x, y, 0);
69 | gl.Scalef(3, 3, 0);
70 | gl.EnableClientState(gl.VERTEX_ARRAY);
71 | gl.VertexPointer(2, gl.FLOAT, 0, carray.pointer(vCircle));
72 | gl.DrawArrays(gl.TRIANGLE_FAN, 0, nCircle+1);
73 | gl.DisableClientState(gl.VERTEX_ARRAY);
74 | gl.PopMatrix();
75 | end
76 |
77 | colorNames = {"yellow", "green", "orange", "red", "white", "black"};
78 | colorTable = {{1,1,0},
79 | {0,1,0},
80 | {1,0.5,0},
81 | {1,0,0},
82 | {1,1,1},
83 | {0,0,0}};
84 | do
85 | local n = 0;
86 | local i;
87 | for i = 1,#colorNames do
88 | colorTable[colorNames[i]] = colorTable[i];
89 | end
90 | end
91 | nColor = #colorTable;
92 |
93 | function setColor(self, name)
94 | c = colorTable[name];
95 | if (c) then
96 | gl.Color4f(c[1], c[2], c[3], 1);
97 | end
98 | end
99 |
--------------------------------------------------------------------------------
/assets/Breakout/Wall.lua:
--------------------------------------------------------------------------------
1 | module(..., package.seeall);
2 |
3 | require('Brick');
4 |
5 | EXPAND = 1;
6 | ROWS_COUNT = 16 * EXPAND;
7 | COLS_COUNT = 8*3 * EXPAND;
8 |
9 | WIDTH = ROWS_COUNT * Brick.WIDTH;
10 | HEIGHT = COLS_COUNT * Brick.HEIGHT;
11 |
12 | local mt = getfenv();
13 | mt.__index = mt;
14 |
15 | function new()
16 | local obj = {};
17 |
18 | obj.bricks = {};
19 | local row, col;
20 | for row = 0,ROWS_COUNT/3 do
21 | for col = 0,COLS_COUNT-1 do
22 | obj.bricks[#obj.bricks + 1] = Brick.new(col, row);
23 | end
24 | end
25 |
26 | setmetatable(obj, mt);
27 | return obj;
28 | end
29 |
30 | function draw(self, p)
31 | local i;
32 | for i = 1,#self.bricks do
33 | self.bricks[i]:draw(p);
34 | end
35 | end
36 |
37 | function tick(self, ball)
38 | f = {x=0, y=0};
39 | if (ball.x < 1) then
40 | f.x = f.x + (1 - ball.x);
41 | end
42 | if (ball.x > WIDTH - 1) then
43 | f.x = f.x + (WIDTH - 1 - ball.x);
44 | end
45 | if (ball.y < 1) then
46 | f.y = f.y + (1 - ball.y);
47 | end
48 |
49 | local i;
50 | for i = 1,#self.bricks do
51 | local fbrick = self.bricks[i]:tick(ball);
52 | f.x = f.x + fbrick.x;
53 | f.y = f.y + fbrick.y;
54 | if ((fbrick.x ~= 0) or (fbrick.y ~= 0)) then
55 | self.bricks[i]:destroy();
56 | end
57 | end
58 |
59 | return f;
60 | end
61 |
--------------------------------------------------------------------------------
/assets/Breakout/breakout.lua:
--------------------------------------------------------------------------------
1 | require('glut');
2 | require('gles1');
3 |
4 | require('Painter');
5 | require('Game');
6 | require('Wall');
7 | require('Ball');
8 |
9 | game = Game.new();
10 | p = Painter.new();
11 |
12 | width = Wall.WIDTH;
13 | height = Wall.HEIGHT;
14 |
15 | winCreated = false;
16 |
17 | function display()
18 | gl.Clear(gl.COLOR_BUFFER_BIT);
19 |
20 | game:draw(p);
21 |
22 | glut.SwapBuffers();
23 | end
24 |
25 | function reshape(w, h)
26 | width = w;
27 | height = h;
28 | winCreated = true;
29 |
30 | -- gl.Viewport(0, 0, w, h);
31 | gl.Viewport(0, 0, w, h-20);
32 |
33 | gl.ClearColor(0, 0, 0, 1.0);
34 | gl.MatrixMode(gl.PROJECTION);
35 | gl.LoadIdentity();
36 | gl.Orthof(0, Wall.WIDTH, Wall.HEIGHT, 0, -1.0, 1.0);
37 | gl.MatrixMode(gl.MODELVIEW);
38 | gl.LoadIdentity();
39 | end
40 |
41 |
42 | function timer(t)
43 | for i = 0, 1/25/Ball.DT do
44 | game:tick();
45 | end
46 | if (winCreated) then
47 | display();
48 | end
49 | glut.TimerFunc(1000/25, timer, 0);
50 | end
51 |
52 | function mouse(x,y)
53 | game:setX((Wall.WIDTH/width)*x);
54 | end
55 |
56 | glut.Init();
57 | glut.InitDisplayMode(glut.DOUBLE + glut.RGB);
58 | glut.InitWindowSize(Wall.WIDTH, Wall.HEIGHT);
59 | glut.CreateWindow('Breakout');
60 | glut.DisplayFunc(display);
61 | glut.ReshapeFunc(reshape);
62 | glut.PassiveMotionFunc(mouse);
63 | glut.WMCloseFunc(function() os.exit() end);
64 | timer();
65 |
66 | glut.MainLoop();
67 |
--------------------------------------------------------------------------------
/assets/init.lua:
--------------------------------------------------------------------------------
1 | print("Starting init.lua")
2 | require("asset")
3 |
4 | --Modify global dofile() function
5 | _dofile = _G.dofile;
6 | dofile = asset.dofile;
7 | --[[
8 | function dofile(filename)
9 | local lf, err;
10 | lf, err = loadfile(filename);
11 | if (lf) then
12 | return lf();
13 | else
14 | lf, err = asset.loadfile(filename);
15 | if (lf) then
16 | return lf()
17 | else
18 | print(err);
19 | end
20 | end
21 | end
22 | --]]
23 |
24 | --Start up main.lua:
25 | -- Setup path for require() loader
26 | asset.path = "Breakout/?.lua;"..asset.path;
27 |
28 | dofile("Breakout/breakout.lua");
29 |
--------------------------------------------------------------------------------
/assets/lua/strict.lua:
--------------------------------------------------------------------------------
1 | --
2 | -- strict.lua
3 | -- checks uses of undeclared global variables
4 | -- All global variables must be 'declared' through a regular assignment
5 | -- (even assigning nil will do) in a main chunk before being used
6 | -- anywhere or assigned to inside a function.
7 | --
8 |
9 | local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget
10 |
11 | local mt = getmetatable(_G)
12 | if mt == nil then
13 | mt = {}
14 | setmetatable(_G, mt)
15 | end
16 |
17 | mt.__declared = {}
18 |
19 | local function what ()
20 | local d = getinfo(3, "S")
21 | return d and d.what or "C"
22 | end
23 |
24 | mt.__newindex = function (t, n, v)
25 | if not mt.__declared[n] then
26 | local w = what()
27 | if w ~= "main" and w ~= "C" then
28 | error("assign to undeclared variable '"..n.."'", 2)
29 | end
30 | mt.__declared[n] = true
31 | end
32 | rawset(t, n, v)
33 | end
34 |
35 | mt.__index = function (t, n)
36 | if not mt.__declared[n] and what() ~= "C" then
37 | error("variable '"..n.."' is not declared", 2)
38 | end
39 | return rawget(t, n)
40 | end
41 |
42 |
--------------------------------------------------------------------------------
/assets/main.lua:
--------------------------------------------------------------------------------
1 | print("Starting main.lua")
2 |
3 | require('glut');
4 | require('gles1');
5 | require('toast');
6 | require('unix');
7 |
8 | function onStart()
9 | toast.new("onStart"):show();
10 | end
11 |
12 | function display()
13 | print("display")
14 | gl.ClearColor(0, 0.2, 0.8, 1);
15 | gl.Clear(gl.COLOR_BUFFER_BIT);
16 |
17 | glut.SwapBuffers();
18 | end
19 |
20 | function reshape(w,h)
21 | print("reshape",w,h)
22 | gl.Viewport(0, 0, w, h);
23 | end
24 |
25 | function timer(arg)
26 | print("timer", unix.time());
27 | glut.TimerFunc(1000, timer, 0);
28 | end
29 |
30 | function mouse(x,y)
31 | print("mouse:",x,y);
32 | end
33 |
34 | glut.Init()
35 | glut.InitDisplayMode(glut.DOUBLE + glut.RGB);
36 | glut.InitWindowSize(400,400);
37 | glut.CreateWindow('Breakout')
38 |
39 | glut.DisplayFunc(display);
40 | glut.ReshapeFunc(reshape);
41 | glut.PassiveMotionFunc(mouse);
42 |
43 | timer();
44 | glut.MainLoop();
45 |
46 |
47 |
--------------------------------------------------------------------------------
/jni/Android.mk:
--------------------------------------------------------------------------------
1 | JNI_PATH := $(call my-dir)
2 | #NDK_PATH := /Users/ddlee/Android/android-ndk-r8d
3 |
4 | # luacore, freetype2, allegro5:
5 | include $(call all-subdir-makefiles)
6 |
7 | LOCAL_PATH := $(JNI_PATH)
8 |
9 | # Native main activity library
10 | # Note: Android runtime loader is very limited
11 | # Native activity library cannot dlopen any custom shared libraries
12 | # Need to statically link lua core module here
13 | include $(CLEAR_VARS)
14 | LOCAL_MODULE := lua-activity
15 |
16 | LOCAL_SRC_FILES := src/activity.cpp
17 | # Statically compile in jnicontext:
18 | LOCAL_SRC_FILES += src/jnicontext.cpp
19 |
20 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
21 | LOCAL_LDLIBS := -llog -landroid -ldl
22 | LOCAL_STATIC_LIBRARIES := luacore-static
23 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include \
24 | $(LOCAL_PATH)/lua-5.1.4/include
25 | include $(BUILD_SHARED_LIBRARY)
26 |
27 | # Custom lua modules are linked to liblua-activity.so
28 |
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_PLATFORM := android-9
2 | #APP_ABI := armeabi
3 | APP_ABI := armeabi x86 armeabi-v7a
4 | #APP_STL := stlport_static
5 |
--------------------------------------------------------------------------------
/jni/android/include/camera/ICameraClient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef ANDROID_HARDWARE_ICAMERA_APP_H
18 | #define ANDROID_HARDWARE_ICAMERA_APP_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | namespace android {
27 |
28 | class ICameraClient: public IInterface
29 | {
30 | public:
31 | DECLARE_META_INTERFACE(CameraClient);
32 |
33 | virtual void notifyCallback(int32_t msgType, int32_t ext1, int32_t ext2) = 0;
34 | virtual void dataCallback(int32_t msgType, const sp& data) = 0;
35 | virtual void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp& data) = 0;
36 | };
37 |
38 | // ----------------------------------------------------------------------------
39 |
40 | class BnCameraClient: public BnInterface
41 | {
42 | public:
43 | virtual status_t onTransact( uint32_t code,
44 | const Parcel& data,
45 | Parcel* reply,
46 | uint32_t flags = 0);
47 | };
48 |
49 | }; // namespace android
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/jni/android/include/utils/Log.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2005 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | //
18 | // C/C++ logging functions. See the logging documentation for API details.
19 | //
20 | // We'd like these to be available from C code (in case we import some from
21 | // somewhere), so this has a C interface.
22 | //
23 | // The output will be correct when the log file is shared between multiple
24 | // threads and/or multiple processes so long as the operating system
25 | // supports O_APPEND. These calls have mutex-protected data structures
26 | // and so are NOT reentrant. Do not use LOG in a signal handler.
27 | //
28 | #ifndef _LIBS_UTILS_LOG_H
29 | #define _LIBS_UTILS_LOG_H
30 |
31 | #include
32 |
33 | #endif // _LIBS_UTILS_LOG_H
34 |
--------------------------------------------------------------------------------
/jni/android/lib/armeabi:
--------------------------------------------------------------------------------
1 | armeabi_nexus7
--------------------------------------------------------------------------------
/jni/android/lib/armeabi-v7a:
--------------------------------------------------------------------------------
1 | armeabi_nexus7
--------------------------------------------------------------------------------
/jni/android/lib/armeabi_nexus7/libbinder.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/armeabi_nexus7/libbinder.so
--------------------------------------------------------------------------------
/jni/android/lib/armeabi_nexus7/libcamera_client.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/armeabi_nexus7/libcamera_client.so
--------------------------------------------------------------------------------
/jni/android/lib/armeabi_nexus7/libutils.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/armeabi_nexus7/libutils.so
--------------------------------------------------------------------------------
/jni/android/lib/armeabi_samsung/libbinder.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/armeabi_samsung/libbinder.so
--------------------------------------------------------------------------------
/jni/android/lib/armeabi_samsung/libcamera_client.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/armeabi_samsung/libcamera_client.so
--------------------------------------------------------------------------------
/jni/android/lib/armeabi_samsung/libutils.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/armeabi_samsung/libutils.so
--------------------------------------------------------------------------------
/jni/android/lib/x86/libbinder.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/x86/libbinder.so
--------------------------------------------------------------------------------
/jni/android/lib/x86/libcamera_client.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/x86/libcamera_client.so
--------------------------------------------------------------------------------
/jni/android/lib/x86/libutils.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/android/lib/x86/libutils.so
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | # built application files
3 | *.apk
4 | *.ap_
5 |
6 | # files for the dex VM
7 | *.dex
8 |
9 | # Java class files
10 | *.class
11 |
12 | # generated files
13 | bin/
14 | gen/
15 | obj/
16 |
17 | # Local configuration file (sdk path, etc)
18 | local.properties
19 | # Compiled Object files
20 | *.slo
21 | *.lo
22 | *.o
23 |
24 | # Compiled Dynamic libraries
25 | *.so
26 |
27 | # Compiled Static libraries
28 | *.lai
29 | *.la
30 | *.a
31 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | #LOCAL_MODULE := freetype2
5 | LOCAL_MODULE := freetype2-static
6 | LOCAL_SRC_FILES := \
7 | src/autofit/autofit.c \
8 | src/base/basepic.c \
9 | src/base/ftapi.c \
10 | src/base/ftbase.c \
11 | src/base/ftbbox.c \
12 | src/base/ftbitmap.c \
13 | src/base/ftdbgmem.c \
14 | src/base/ftdebug.c \
15 | src/base/ftglyph.c \
16 | src/base/ftinit.c \
17 | src/base/ftpic.c \
18 | src/base/ftstroke.c \
19 | src/base/ftsynth.c \
20 | src/base/ftsystem.c \
21 | src/cff/cff.c \
22 | src/pshinter/pshinter.c \
23 | src/psnames/psnames.c \
24 | src/raster/raster.c \
25 | src/sfnt/sfnt.c \
26 | src/smooth/smooth.c \
27 | src/truetype/truetype.c
28 |
29 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src
30 | LOCAL_CFLAGS := -DFT2_BUILD_LIBRARY=1
31 | LOCAL_LDLIBS := -ldl -llog
32 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
33 | #include $(BUILD_SHARED_LIBRARY)
34 | include $(BUILD_STATIC_LIBRARY)
35 |
36 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/FTL.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/freetype-2.4.4/FTL.txt
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/README.md:
--------------------------------------------------------------------------------
1 | # Freetype 2 Android
2 |
3 | This is simply a distribution of the Freetype 2 library, that includes Android make files ready to build the Freetype 2 library into a static and shared binaries for version 2.2 of the Android operating system. This distribution requires release 5 of the Android Native Development Kit.
4 |
5 | The project only includes the Freetype modules for processing TrueType and OpenType fonts. Other font modules have been disabled. If you want to re-enable these modules, you will need to download the Freetype 2 source code, and then copy the module source files to the appropriate location in either the "include/" or "src/" folders of this distribution. The Freetype source code is [available here](http://download.savannah.gnu.org/releases/freetype/). The instructions for including these new modules in the Android makefile is left as an exercise, but if you follow the pattern of the truetype module in the Android makefile, your module should compile correctly.
6 |
7 | The code in this distribution comes from version 2.4.4 of the Freetype library.
8 |
9 | There is an analogous library for Xcode and iOS [here](https://github.com/cdave1/freetype2-ios).
10 |
11 |
12 | # Install
13 |
14 | This distribution requires release 5 of the Android Native Development Kit.
15 |
16 | To build, cd to the Android/jni/ directory and type:
17 | $ ndk-build freetype2-static
18 |
19 |
20 | The file Android/jni/Application.mk contains the target and platform settings used by ndk-build. The current settings are:
21 |
22 | APP_ABI := armeabi armeabi-v7a
23 | APP_PLATFORM := android-8
24 |
25 | To use the library in another ndk library, you will need to include the Android/jni/module.mk file in the Android.mk of the library you want to use freetype with.
26 |
27 |
28 | # License
29 |
30 | This code is distributed under the terms of the [Freetype License](http://www.freetype.org/FTL.TXT). The Freetype License is also included in this distribution. If you are going to use code in this project, please make sure you follow the instructions in the Freetype License.
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/config/ftmodule.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file registers the FreeType modules compiled into the library.
3 | *
4 | * If you use GNU make, this file IS NOT USED! Instead, it is created in
5 | * the objects directory (normally `/objs/') based on information
6 | * from `/modules.cfg'.
7 | *
8 | * Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
9 | * FreeType without GNU make.
10 | *
11 | */
12 |
13 | //FT_USE_MODULE( FT_Module_Class, autofit_module_class )
14 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
15 | //FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
16 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
17 | //FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
18 | //FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
19 | //FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
20 | //FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
21 | //FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
22 | //FT_USE_MODULE( FT_Module_Class, psaux_module_class )
23 | FT_USE_MODULE( FT_Module_Class, psnames_module_class )
24 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
25 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
26 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
27 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
28 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
29 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
30 | //FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
31 |
32 | /* EOF */
33 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/internal/pcftypes.h:
--------------------------------------------------------------------------------
1 | /* pcftypes.h
2 |
3 | FreeType font driver for pcf fonts
4 |
5 | Copyright (C) 2000, 2001, 2002 by
6 | Francesco Zappa Nardelli
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is
13 | furnished to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in
16 | all copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 | */
26 |
27 |
28 | #ifndef __PCFTYPES_H__
29 | #define __PCFTYPES_H__
30 |
31 |
32 | #include
33 | #include FT_FREETYPE_H
34 |
35 |
36 | FT_BEGIN_HEADER
37 |
38 |
39 | typedef struct PCF_Public_FaceRec_
40 | {
41 | FT_FaceRec root;
42 | FT_StreamRec gzip_stream;
43 | FT_Stream gzip_source;
44 |
45 | char* charset_encoding;
46 | char* charset_registry;
47 |
48 | } PCF_Public_FaceRec, *PCF_Public_Face;
49 |
50 |
51 | FT_END_HEADER
52 |
53 | #endif /* __PCFTYPES_H__ */
54 |
55 |
56 | /* END */
57 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/internal/services/svkern.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* svkern.h */
4 | /* */
5 | /* The FreeType Kerning service (specification). */
6 | /* */
7 | /* Copyright 2006 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SVKERN_H__
20 | #define __SVKERN_H__
21 |
22 | #include FT_INTERNAL_SERVICE_H
23 | #include FT_TRUETYPE_TABLES_H
24 |
25 |
26 | FT_BEGIN_HEADER
27 |
28 | #define FT_SERVICE_ID_KERNING "kerning"
29 |
30 |
31 | typedef FT_Error
32 | (*FT_Kerning_TrackGetFunc)( FT_Face face,
33 | FT_Fixed point_size,
34 | FT_Int degree,
35 | FT_Fixed* akerning );
36 |
37 | FT_DEFINE_SERVICE( Kerning )
38 | {
39 | FT_Kerning_TrackGetFunc get_track;
40 | };
41 |
42 | /* */
43 |
44 |
45 | FT_END_HEADER
46 |
47 |
48 | #endif /* __SVKERN_H__ */
49 |
50 |
51 | /* END */
52 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/internal/services/svotval.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* svotval.h */
4 | /* */
5 | /* The FreeType OpenType validation service (specification). */
6 | /* */
7 | /* Copyright 2004, 2006 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SVOTVAL_H__
20 | #define __SVOTVAL_H__
21 |
22 | #include FT_OPENTYPE_VALIDATE_H
23 | #include FT_INTERNAL_VALIDATE_H
24 |
25 | FT_BEGIN_HEADER
26 |
27 |
28 | #define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate"
29 |
30 |
31 | typedef FT_Error
32 | (*otv_validate_func)( FT_Face volatile face,
33 | FT_UInt ot_flags,
34 | FT_Bytes *base,
35 | FT_Bytes *gdef,
36 | FT_Bytes *gpos,
37 | FT_Bytes *gsub,
38 | FT_Bytes *jstf );
39 |
40 |
41 | FT_DEFINE_SERVICE( OTvalidate )
42 | {
43 | otv_validate_func validate;
44 | };
45 |
46 | /* */
47 |
48 |
49 | FT_END_HEADER
50 |
51 |
52 | #endif /* __SVOTVAL_H__ */
53 |
54 |
55 | /* END */
56 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/internal/services/svtteng.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* svtteng.h */
4 | /* */
5 | /* The FreeType TrueType engine query service (specification). */
6 | /* */
7 | /* Copyright 2006 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SVTTENG_H__
20 | #define __SVTTENG_H__
21 |
22 | #include FT_INTERNAL_SERVICE_H
23 | #include FT_MODULE_H
24 |
25 |
26 | FT_BEGIN_HEADER
27 |
28 |
29 | /*
30 | * SFNT table loading service.
31 | */
32 |
33 | #define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
34 |
35 | /*
36 | * Used to implement FT_Get_TrueType_Engine_Type
37 | */
38 |
39 | FT_DEFINE_SERVICE( TrueTypeEngine )
40 | {
41 | FT_TrueTypeEngineType engine_type;
42 | };
43 |
44 | /* */
45 |
46 |
47 | FT_END_HEADER
48 |
49 |
50 | #endif /* __SVTTENG_H__ */
51 |
52 |
53 | /* END */
54 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/internal/services/svwinfnt.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* svwinfnt.h */
4 | /* */
5 | /* The FreeType Windows FNT/FONT service (specification). */
6 | /* */
7 | /* Copyright 2003 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SVWINFNT_H__
20 | #define __SVWINFNT_H__
21 |
22 | #include FT_INTERNAL_SERVICE_H
23 | #include FT_WINFONTS_H
24 |
25 |
26 | FT_BEGIN_HEADER
27 |
28 |
29 | #define FT_SERVICE_ID_WINFNT "winfonts"
30 |
31 | typedef FT_Error
32 | (*FT_WinFnt_GetHeaderFunc)( FT_Face face,
33 | FT_WinFNT_HeaderRec *aheader );
34 |
35 |
36 | FT_DEFINE_SERVICE( WinFnt )
37 | {
38 | FT_WinFnt_GetHeaderFunc get_header;
39 | };
40 |
41 | /* */
42 |
43 |
44 | FT_END_HEADER
45 |
46 |
47 | #endif /* __SVWINFNT_H__ */
48 |
49 |
50 | /* END */
51 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/freetype/internal/services/svxf86nm.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* svxf86nm.h */
4 | /* */
5 | /* The FreeType XFree86 services (specification only). */
6 | /* */
7 | /* Copyright 2003 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SVXF86NM_H__
20 | #define __SVXF86NM_H__
21 |
22 | #include FT_INTERNAL_SERVICE_H
23 |
24 |
25 | FT_BEGIN_HEADER
26 |
27 |
28 | /*
29 | * A trivial service used to return the name of a face's font driver,
30 | * according to the XFree86 nomenclature. Note that the service data
31 | * is a simple constant string pointer.
32 | */
33 |
34 | #define FT_SERVICE_ID_XF86_NAME "xf86-driver-name"
35 |
36 | #define FT_XF86_FORMAT_TRUETYPE "TrueType"
37 | #define FT_XF86_FORMAT_TYPE_1 "Type 1"
38 | #define FT_XF86_FORMAT_BDF "BDF"
39 | #define FT_XF86_FORMAT_PCF "PCF"
40 | #define FT_XF86_FORMAT_TYPE_42 "Type 42"
41 | #define FT_XF86_FORMAT_CID "CID Type 1"
42 | #define FT_XF86_FORMAT_CFF "CFF"
43 | #define FT_XF86_FORMAT_PFR "PFR"
44 | #define FT_XF86_FORMAT_WINFNT "Windows FNT"
45 |
46 | /* */
47 |
48 |
49 | FT_END_HEADER
50 |
51 |
52 | #endif /* __SVXF86NM_H__ */
53 |
54 |
55 | /* END */
56 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/include/ft2build.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ft2build.h */
4 | /* */
5 | /* FreeType 2 build and setup macros. */
6 | /* (Generic version) */
7 | /* */
8 | /* Copyright 1996-2001, 2006 by */
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 | /* */
11 | /* This file is part of the FreeType project, and may only be used, */
12 | /* modified, and distributed under the terms of the FreeType project */
13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 | /* this file you indicate that you have read the license and */
15 | /* understand and accept it fully. */
16 | /* */
17 | /***************************************************************************/
18 |
19 |
20 | /*************************************************************************/
21 | /* */
22 | /* This file corresponds to the default `ft2build.h' file for */
23 | /* FreeType 2. It uses the `freetype' include root. */
24 | /* */
25 | /* Note that specific platforms might use a different configuration. */
26 | /* See builds/unix/ft2unix.h for an example. */
27 | /* */
28 | /*************************************************************************/
29 |
30 |
31 | #ifndef __FT2_BUILD_GENERIC_H__
32 | #define __FT2_BUILD_GENERIC_H__
33 |
34 | #include
35 |
36 | #endif /* __FT2_BUILD_GENERIC_H__ */
37 |
38 |
39 | /* END */
40 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/autofit Jamfile
2 | #
3 | # Copyright 2003, 2004, 2005, 2006, 2007, 2009 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP src autofit ;
13 |
14 | {
15 | local _sources ;
16 |
17 | # define FT2_AUTOFIT2 to enable experimental latin hinter replacement
18 | if $(FT2_AUTOFIT2)
19 | {
20 | DEFINES += FT_OPTION_AUTOFIT2 ;
21 | }
22 | if $(FT2_MULTI)
23 | {
24 | _sources = afangles afglobal afhints aflatin afcjk afindic afloader afmodule afdummy afwarp afpic ;
25 |
26 | if $(FT2_AUTOFIT2)
27 | {
28 | _sources += aflatin2 ;
29 | }
30 | }
31 | else
32 | {
33 | _sources = autofit ;
34 | }
35 |
36 | Library $(FT2_LIB) : $(_sources).c ;
37 | }
38 |
39 | # end of src/autofit Jamfile
40 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/afangles.h:
--------------------------------------------------------------------------------
1 | /*
2 | * afangles.h
3 | *
4 | * This is a dummy file, used to please the build system. It is never
5 | * included by the auto-fitter sources.
6 | *
7 | */
8 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/afcjk.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* afcjk.h */
4 | /* */
5 | /* Auto-fitter hinting routines for CJK script (specification). */
6 | /* */
7 | /* Copyright 2006, 2007 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __AFCJK_H__
20 | #define __AFCJK_H__
21 |
22 | #include "afhints.h"
23 |
24 |
25 | FT_BEGIN_HEADER
26 |
27 |
28 | /* the CJK-specific script class */
29 |
30 | AF_DECLARE_SCRIPT_CLASS(af_cjk_script_class)
31 |
32 |
33 | FT_LOCAL( FT_Error )
34 | af_cjk_metrics_init( AF_LatinMetrics metrics,
35 | FT_Face face );
36 |
37 | FT_LOCAL( void )
38 | af_cjk_metrics_scale( AF_LatinMetrics metrics,
39 | AF_Scaler scaler );
40 |
41 | FT_LOCAL( FT_Error )
42 | af_cjk_hints_init( AF_GlyphHints hints,
43 | AF_LatinMetrics metrics );
44 |
45 | FT_LOCAL( FT_Error )
46 | af_cjk_hints_apply( AF_GlyphHints hints,
47 | FT_Outline* outline,
48 | AF_LatinMetrics metrics );
49 |
50 | /* */
51 |
52 | FT_END_HEADER
53 |
54 | #endif /* __AFCJK_H__ */
55 |
56 |
57 | /* END */
58 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/afdummy.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* afdummy.h */
4 | /* */
5 | /* Auto-fitter dummy routines to be used if no hinting should be */
6 | /* performed (specification). */
7 | /* */
8 | /* Copyright 2003, 2004, 2005 by */
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 | /* */
11 | /* This file is part of the FreeType project, and may only be used, */
12 | /* modified, and distributed under the terms of the FreeType project */
13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 | /* this file you indicate that you have read the license and */
15 | /* understand and accept it fully. */
16 | /* */
17 | /***************************************************************************/
18 |
19 |
20 | #ifndef __AFDUMMY_H__
21 | #define __AFDUMMY_H__
22 |
23 | #include "aftypes.h"
24 |
25 |
26 | FT_BEGIN_HEADER
27 |
28 | /* A dummy script metrics class used when no hinting should
29 | * be performed. This is the default for non-latin glyphs!
30 | */
31 |
32 | AF_DECLARE_SCRIPT_CLASS(af_dummy_script_class)
33 |
34 | /* */
35 |
36 | FT_END_HEADER
37 |
38 |
39 | #endif /* __AFDUMMY_H__ */
40 |
41 |
42 | /* END */
43 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/aferrors.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* aferrors.h */
4 | /* */
5 | /* Autofitter error codes (specification only). */
6 | /* */
7 | /* Copyright 2005 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the Autofitter error enumeration */
22 | /* constants. */
23 | /* */
24 | /*************************************************************************/
25 |
26 | #ifndef __AFERRORS_H__
27 | #define __AFERRORS_H__
28 |
29 | #include FT_MODULE_ERRORS_H
30 |
31 | #undef __FTERRORS_H__
32 |
33 | #define FT_ERR_PREFIX AF_Err_
34 | #define FT_ERR_BASE FT_Mod_Err_Autofit
35 |
36 | #include FT_ERRORS_H
37 |
38 | #endif /* __AFERRORS_H__ */
39 |
40 | /* END */
41 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/afindic.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* afindic.h */
4 | /* */
5 | /* Auto-fitter hinting routines for Indic scripts (specification). */
6 | /* */
7 | /* Copyright 2007 by */
8 | /* Rahul Bhalerao , . */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __AFINDIC_H__
20 | #define __AFINDIC_H__
21 |
22 | #include "afhints.h"
23 |
24 |
25 | FT_BEGIN_HEADER
26 |
27 |
28 | /* the Indic-specific script class */
29 |
30 | AF_DECLARE_SCRIPT_CLASS(af_indic_script_class)
31 |
32 |
33 | /* */
34 |
35 | FT_END_HEADER
36 |
37 | #endif /* __AFINDIC_H__ */
38 |
39 |
40 | /* END */
41 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/aflatin2.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* aflatin2.h */
4 | /* */
5 | /* Auto-fitter hinting routines for latin script (specification). */
6 | /* */
7 | /* Copyright 2003, 2004, 2005, 2006, 2007 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __AFLATIN2_H__
20 | #define __AFLATIN2_H__
21 |
22 | #include "afhints.h"
23 |
24 |
25 | FT_BEGIN_HEADER
26 |
27 |
28 | /* the latin-specific script class */
29 |
30 | AF_DECLARE_SCRIPT_CLASS(af_latin2_script_class)
31 |
32 | /* */
33 |
34 | FT_END_HEADER
35 |
36 | #endif /* __AFLATIN_H__ */
37 |
38 |
39 | /* END */
40 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/afmodule.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* afmodule.h */
4 | /* */
5 | /* Auto-fitter module implementation (specification). */
6 | /* */
7 | /* Copyright 2003, 2004, 2005 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __AFMODULE_H__
20 | #define __AFMODULE_H__
21 |
22 | #include
23 | #include FT_INTERNAL_OBJECTS_H
24 | #include FT_MODULE_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 | FT_DECLARE_MODULE(autofit_module_class)
30 |
31 |
32 | FT_END_HEADER
33 |
34 | #endif /* __AFMODULE_H__ */
35 |
36 |
37 | /* END */
38 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/autofit.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* autofit.c */
4 | /* */
5 | /* Auto-fitter module (body). */
6 | /* */
7 | /* Copyright 2003, 2004, 2005, 2006, 2007 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 | #include
21 | #include "afpic.c"
22 | #include "afangles.c"
23 | #include "afglobal.c"
24 | #include "afhints.c"
25 |
26 | #include "afdummy.c"
27 | #include "aflatin.c"
28 | #ifdef FT_OPTION_AUTOFIT2
29 | #include "aflatin2.c"
30 | #endif
31 | #include "afcjk.c"
32 | #include "afindic.c"
33 |
34 | #include "afloader.c"
35 | #include "afmodule.c"
36 |
37 | #ifdef AF_USE_WARPER
38 | #include "afwarp.c"
39 | #endif
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/autofit/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 auto-fitter module definition
3 | #
4 |
5 |
6 | # Copyright 2003, 2004, 2005, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += AUTOFIT_MODULE
17 |
18 | define AUTOFIT_MODULE
19 | $(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/base/ftbase.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftbase.c */
4 | /* */
5 | /* Single object library component (body only). */
6 | /* */
7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #include
20 |
21 | #define FT_MAKE_OPTION_SINGLE_OBJECT
22 |
23 | #include "ftpic.c"
24 | #include "basepic.c"
25 | #include "ftadvanc.c"
26 | #include "ftcalc.c"
27 | #include "ftdbgmem.c"
28 | #include "ftgloadr.c"
29 | #include "ftobjs.c"
30 | #include "ftoutln.c"
31 | #include "ftrfork.c"
32 | #include "ftsnames.c"
33 | #include "ftstream.c"
34 | #include "fttrigon.c"
35 | #include "ftutil.c"
36 |
37 | #if defined( FT_MACINTOSH ) && !defined ( DARWIN_NO_CARBON )
38 | #include "ftmac.c"
39 | #endif
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/base/ftpic.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftpic.c */
4 | /* */
5 | /* The FreeType position independent code services (body). */
6 | /* */
7 | /* Copyright 2009 by */
8 | /* Oran Agra and Mickey Gabel. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #include
20 | #include FT_FREETYPE_H
21 | #include FT_INTERNAL_OBJECTS_H
22 | #include "basepic.h"
23 |
24 | #ifdef FT_CONFIG_OPTION_PIC
25 |
26 | /* documentation is in ftpic.h */
27 |
28 | FT_BASE_DEF( FT_Error )
29 | ft_pic_container_init( FT_Library library )
30 | {
31 | FT_PIC_Container* pic_container = &library->pic_container;
32 | FT_Error error = FT_Err_Ok;
33 |
34 | FT_MEM_SET( pic_container, 0, sizeof(*pic_container) );
35 |
36 | error = ft_base_pic_init( library );
37 | if(error)
38 | return error;
39 |
40 | return FT_Err_Ok;
41 | }
42 |
43 |
44 | /* Destroy the contents of the container. */
45 | FT_BASE_DEF( void )
46 | ft_pic_container_destroy( FT_Library library )
47 | {
48 | ft_base_pic_free( library );
49 | }
50 |
51 | #endif /* FT_CONFIG_OPTION_PIC */
52 |
53 |
54 | /* END */
55 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/cff/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/cff Jamfile
2 | #
3 | # Copyright 2001, 2002 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) cff ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = cffdrivr cffgload cffload cffobjs cffparse cffcmap cffpic ;
20 | }
21 | else
22 | {
23 | _sources = cff ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/cff Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/cff/cff.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* cff.c */
4 | /* */
5 | /* FreeType OpenType driver component (body only). */
6 | /* */
7 | /* Copyright 1996-2001, 2002 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "cffpic.c"
23 | #include "cffdrivr.c"
24 | #include "cffparse.c"
25 | #include "cffload.c"
26 | #include "cffobjs.c"
27 | #include "cffgload.c"
28 | #include "cffcmap.c"
29 |
30 | /* END */
31 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/cff/cffdrivr.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* cffdrivr.h */
4 | /* */
5 | /* High-level OpenType driver interface (specification). */
6 | /* */
7 | /* Copyright 1996-2001, 2002 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __CFFDRIVER_H__
20 | #define __CFFDRIVER_H__
21 |
22 |
23 | #include
24 | #include FT_INTERNAL_DRIVER_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | FT_DECLARE_DRIVER( cff_driver_class )
31 |
32 |
33 | FT_END_HEADER
34 |
35 | #endif /* __CFFDRIVER_H__ */
36 |
37 |
38 | /* END */
39 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/cff/cfferrs.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* cfferrs.h */
4 | /* */
5 | /* CFF error codes (specification only). */
6 | /* */
7 | /* Copyright 2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the CFF error enumeration constants. */
22 | /* */
23 | /*************************************************************************/
24 |
25 | #ifndef __CFFERRS_H__
26 | #define __CFFERRS_H__
27 |
28 | #include FT_MODULE_ERRORS_H
29 |
30 | #undef __FTERRORS_H__
31 |
32 | #define FT_ERR_PREFIX CFF_Err_
33 | #define FT_ERR_BASE FT_Mod_Err_CFF
34 |
35 |
36 | #include FT_ERRORS_H
37 |
38 | #endif /* __CFFERRS_H__ */
39 |
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/cff/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 CFF module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += CFF_DRIVER
17 |
18 | define CFF_DRIVER
19 | $(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/cff/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 OpenType/CFF driver configuration rules
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2001, 2003 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # OpenType driver directory
17 | #
18 | CFF_DIR := $(SRC_DIR)/cff
19 |
20 |
21 | CFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR))
22 |
23 |
24 | # CFF driver sources (i.e., C files)
25 | #
26 | CFF_DRV_SRC := $(CFF_DIR)/cffobjs.c \
27 | $(CFF_DIR)/cffload.c \
28 | $(CFF_DIR)/cffgload.c \
29 | $(CFF_DIR)/cffparse.c \
30 | $(CFF_DIR)/cffcmap.c \
31 | $(CFF_DIR)/cffdrivr.c
32 |
33 | # CFF driver headers
34 | #
35 | CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \
36 | $(CFF_DIR)/cfftoken.h \
37 | $(CFF_DIR)/cfftypes.h \
38 | $(CFF_DIR)/cfferrs.h
39 |
40 |
41 | # CFF driver object(s)
42 | #
43 | # CFF_DRV_OBJ_M is used during `multi' builds
44 | # CFF_DRV_OBJ_S is used during `single' builds
45 | #
46 | CFF_DRV_OBJ_M := $(CFF_DRV_SRC:$(CFF_DIR)/%.c=$(OBJ_DIR)/%.$O)
47 | CFF_DRV_OBJ_S := $(OBJ_DIR)/cff.$O
48 |
49 | # CFF driver source file for single build
50 | #
51 | CFF_DRV_SRC_S := $(CFF_DIR)/cff.c
52 |
53 |
54 | # CFF driver - single object
55 | #
56 | $(CFF_DRV_OBJ_S): $(CFF_DRV_SRC_S) $(CFF_DRV_SRC) $(FREETYPE_H) $(CFF_DRV_H)
57 | $(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CFF_DRV_SRC_S))
58 |
59 |
60 | # CFF driver - multiple objects
61 | #
62 | $(OBJ_DIR)/%.$O: $(CFF_DIR)/%.c $(FREETYPE_H) $(CFF_DRV_H)
63 | $(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
64 |
65 |
66 | # update main driver object lists
67 | #
68 | DRV_OBJS_S += $(CFF_DRV_OBJ_S)
69 | DRV_OBJS_M += $(CFF_DRV_OBJ_M)
70 |
71 |
72 | # EOF
73 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/pshinter Jamfile
2 | #
3 | # Copyright 2001, 2003 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) pshinter ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = pshrec pshglob pshalgo pshmod pshpic ;
20 | }
21 | else
22 | {
23 | _sources = pshinter ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/pshinter Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 PSHinter module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2001, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += PSHINTER_MODULE
17 |
18 | define PSHINTER_MODULE
19 | $(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/pshinter.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* pshinter.c */
4 | /* */
5 | /* FreeType PostScript Hinting module */
6 | /* */
7 | /* Copyright 2001, 2003 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "pshpic.c"
23 | #include "pshrec.c"
24 | #include "pshglob.c"
25 | #include "pshalgo.c"
26 | #include "pshmod.c"
27 |
28 |
29 | /* END */
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/pshmod.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* pshmod.h */
4 | /* */
5 | /* PostScript hinter module interface (specification). */
6 | /* */
7 | /* Copyright 2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __PSHMOD_H__
20 | #define __PSHMOD_H__
21 |
22 |
23 | #include
24 | #include FT_MODULE_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | FT_DECLARE_MODULE( pshinter_module_class )
31 |
32 |
33 | FT_END_HEADER
34 |
35 |
36 | #endif /* __PSHMOD_H__ */
37 |
38 |
39 | /* END */
40 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/pshnterr.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* pshnterr.h */
4 | /* */
5 | /* PS Hinter error codes (specification only). */
6 | /* */
7 | /* Copyright 2003 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the PSHinter error enumeration constants. */
22 | /* */
23 | /*************************************************************************/
24 |
25 | #ifndef __PSHNTERR_H__
26 | #define __PSHNTERR_H__
27 |
28 | #include FT_MODULE_ERRORS_H
29 |
30 | #undef __FTERRORS_H__
31 |
32 | #define FT_ERR_PREFIX PSH_Err_
33 | #define FT_ERR_BASE FT_Mod_Err_PShinter
34 |
35 | #include FT_ERRORS_H
36 |
37 | #endif /* __PSHNTERR_H__ */
38 |
39 |
40 | /* END */
41 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/pshpic.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* pshpic.h */
4 | /* */
5 | /* The FreeType position independent code services for pshinter module. */
6 | /* */
7 | /* Copyright 2009 by */
8 | /* Oran Agra and Mickey Gabel. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __PSHPIC_H__
20 | #define __PSHPIC_H__
21 |
22 |
23 | FT_BEGIN_HEADER
24 |
25 | #include FT_INTERNAL_PIC_H
26 |
27 | #ifndef FT_CONFIG_OPTION_PIC
28 |
29 | #define FTPSHINTER_INTERFACE_GET pshinter_interface
30 |
31 | #else /* FT_CONFIG_OPTION_PIC */
32 |
33 | #include FT_INTERNAL_POSTSCRIPT_HINTS_H
34 |
35 | typedef struct PSHinterPIC_
36 | {
37 | PSHinter_Interface pshinter_interface;
38 | } PSHinterPIC;
39 |
40 | #define GET_PIC(lib) ((PSHinterPIC*)((lib)->pic_container.autofit))
41 | #define FTPSHINTER_INTERFACE_GET (GET_PIC(library)->pshinter_interface)
42 |
43 |
44 | #endif /* FT_CONFIG_OPTION_PIC */
45 |
46 | /* */
47 |
48 | FT_END_HEADER
49 |
50 | #endif /* __PSHPIC_H__ */
51 |
52 |
53 | /* END */
54 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/pshinter/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 PSHinter driver configuration rules
3 | #
4 |
5 |
6 | # Copyright 2001, 2003 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # PSHINTER driver directory
17 | #
18 | PSHINTER_DIR := $(SRC_DIR)/pshinter
19 |
20 |
21 | # compilation flags for the driver
22 | #
23 | PSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR))
24 |
25 |
26 | # PSHINTER driver sources (i.e., C files)
27 | #
28 | PSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshrec.c \
29 | $(PSHINTER_DIR)/pshglob.c \
30 | $(PSHINTER_DIR)/pshmod.c \
31 | $(PSHINTER_DIR)/pshalgo.c
32 |
33 |
34 | # PSHINTER driver headers
35 | #
36 | PSHINTER_DRV_H := $(PSHINTER_DRV_SRC:%c=%h) \
37 | $(PSHINTER_DIR)/pshnterr.h
38 |
39 |
40 | # PSHINTER driver object(s)
41 | #
42 | # PSHINTER_DRV_OBJ_M is used during `multi' builds.
43 | # PSHINTER_DRV_OBJ_S is used during `single' builds.
44 | #
45 | PSHINTER_DRV_OBJ_M := $(PSHINTER_DRV_SRC:$(PSHINTER_DIR)/%.c=$(OBJ_DIR)/%.$O)
46 | PSHINTER_DRV_OBJ_S := $(OBJ_DIR)/pshinter.$O
47 |
48 | # PSHINTER driver source file for single build
49 | #
50 | PSHINTER_DRV_SRC_S := $(PSHINTER_DIR)/pshinter.c
51 |
52 |
53 | # PSHINTER driver - single object
54 | #
55 | $(PSHINTER_DRV_OBJ_S): $(PSHINTER_DRV_SRC_S) $(PSHINTER_DRV_SRC) \
56 | $(FREETYPE_H) $(PSHINTER_DRV_H)
57 | $(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSHINTER_DRV_SRC_S))
58 |
59 |
60 | # PSHINTER driver - multiple objects
61 | #
62 | $(OBJ_DIR)/%.$O: $(PSHINTER_DIR)/%.c $(FREETYPE_H) $(PSHINTER_DRV_H)
63 | $(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
64 |
65 |
66 | # update main driver object lists
67 | #
68 | DRV_OBJS_S += $(PSHINTER_DRV_OBJ_S)
69 | DRV_OBJS_M += $(PSHINTER_DRV_OBJ_M)
70 |
71 |
72 | # EOF
73 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/psnames Jamfile
2 | #
3 | # Copyright 2001 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) psnames ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = psmodule pspic ;
20 | }
21 | else
22 | {
23 | _sources = psnames ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/psnames Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 PSnames module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += PSNAMES_MODULE
17 |
18 | define PSNAMES_MODULE
19 | $(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/psmodule.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* psmodule.h */
4 | /* */
5 | /* High-level PSNames module interface (specification). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __PSMODULE_H__
20 | #define __PSMODULE_H__
21 |
22 |
23 | #include
24 | #include FT_MODULE_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | FT_DECLARE_MODULE( psnames_module_class )
31 |
32 |
33 | FT_END_HEADER
34 |
35 | #endif /* __PSMODULE_H__ */
36 |
37 |
38 | /* END */
39 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/psnamerr.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* psnamerr.h */
4 | /* */
5 | /* PS names module error codes (specification only). */
6 | /* */
7 | /* Copyright 2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the PS names module error enumeration */
22 | /* constants. */
23 | /* */
24 | /*************************************************************************/
25 |
26 | #ifndef __PSNAMERR_H__
27 | #define __PSNAMERR_H__
28 |
29 | #include FT_MODULE_ERRORS_H
30 |
31 | #undef __FTERRORS_H__
32 |
33 | #define FT_ERR_PREFIX PSnames_Err_
34 | #define FT_ERR_BASE FT_Mod_Err_PSnames
35 |
36 | #include FT_ERRORS_H
37 |
38 | #endif /* __PSNAMERR_H__ */
39 |
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/psnames.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* psnames.c */
4 | /* */
5 | /* FreeType PSNames module component (body only). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "pspic.c"
23 | #include "psmodule.c"
24 |
25 |
26 | /* END */
27 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/pspic.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* pspic.h */
4 | /* */
5 | /* The FreeType position independent code services for psnames module. */
6 | /* */
7 | /* Copyright 2009 by */
8 | /* Oran Agra and Mickey Gabel. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __PSPIC_H__
20 | #define __PSPIC_H__
21 |
22 |
23 | FT_BEGIN_HEADER
24 |
25 | #include FT_INTERNAL_PIC_H
26 |
27 | #ifndef FT_CONFIG_OPTION_PIC
28 | #define FT_PSCMAPS_SERVICES_GET pscmaps_services
29 | #define FT_PSCMAPS_INTERFACE_GET pscmaps_interface
30 |
31 | #else /* FT_CONFIG_OPTION_PIC */
32 |
33 | #include FT_SERVICE_POSTSCRIPT_CMAPS_H
34 |
35 | typedef struct PSModulePIC_
36 | {
37 | FT_ServiceDescRec* pscmaps_services;
38 | FT_Service_PsCMapsRec pscmaps_interface;
39 | } PSModulePIC;
40 |
41 | #define GET_PIC(lib) ((PSModulePIC*)((lib)->pic_container.psnames))
42 | #define FT_PSCMAPS_SERVICES_GET (GET_PIC(library)->pscmaps_services)
43 | #define FT_PSCMAPS_INTERFACE_GET (GET_PIC(library)->pscmaps_interface)
44 |
45 | #endif /* FT_CONFIG_OPTION_PIC */
46 |
47 | /* */
48 |
49 | FT_END_HEADER
50 |
51 | #endif /* __PSPIC_H__ */
52 |
53 |
54 | /* END */
55 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/psnames/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 PSNames driver configuration rules
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2001, 2003 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # PSNames driver directory
17 | #
18 | PSNAMES_DIR := $(SRC_DIR)/psnames
19 |
20 |
21 | # compilation flags for the driver
22 | #
23 | PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))
24 |
25 |
26 | # PSNames driver sources (i.e., C files)
27 | #
28 | PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
29 |
30 |
31 | # PSNames driver headers
32 | #
33 | PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
34 | $(PSNAMES_DIR)/pstables.h \
35 | $(PSNAMES_DIR)/psnamerr.h
36 |
37 |
38 | # PSNames driver object(s)
39 | #
40 | # PSNAMES_DRV_OBJ_M is used during `multi' builds
41 | # PSNAMES_DRV_OBJ_S is used during `single' builds
42 | #
43 | PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)
44 | PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
45 |
46 | # PSNames driver source file for single build
47 | #
48 | PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c
49 |
50 |
51 | # PSNames driver - single object
52 | #
53 | $(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
54 | $(FREETYPE_H) $(PSNAMES_DRV_H)
55 | $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))
56 |
57 |
58 | # PSNames driver - multiple objects
59 | #
60 | $(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
61 | $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
62 |
63 |
64 | # update main driver object lists
65 | #
66 | DRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)
67 | DRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)
68 |
69 |
70 | # EOF
71 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/raster Jamfile
2 | #
3 | # Copyright 2001 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) raster ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = ftraster ftrend1 rastpic ;
20 | }
21 | else
22 | {
23 | _sources = raster ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/raster Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/ftraster.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftraster.h */
4 | /* */
5 | /* The FreeType glyph rasterizer (specification). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used */
11 | /* modified and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __FTRASTER_H__
20 | #define __FTRASTER_H__
21 |
22 |
23 | #include
24 | #include FT_CONFIG_CONFIG_H
25 | #include FT_IMAGE_H
26 |
27 |
28 | FT_BEGIN_HEADER
29 |
30 |
31 | /*************************************************************************/
32 | /* */
33 | /* Uncomment the following line if you are using ftraster.c as a */
34 | /* standalone module, fully independent of FreeType. */
35 | /* */
36 | /* #define _STANDALONE_ */
37 |
38 | FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster;
39 |
40 |
41 | FT_END_HEADER
42 |
43 | #endif /* __FTRASTER_H__ */
44 |
45 |
46 | /* END */
47 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/ftrend1.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftrend1.h */
4 | /* */
5 | /* The FreeType glyph rasterizer interface (specification). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __FTREND1_H__
20 | #define __FTREND1_H__
21 |
22 |
23 | #include
24 | #include FT_RENDER_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | FT_DECLARE_RENDERER( ft_raster1_renderer_class )
31 |
32 | /* this renderer is _NOT_ part of the default modules, you'll need */
33 | /* to register it by hand in your application. It should only be */
34 | /* used for backwards-compatibility with FT 1.x anyway. */
35 | /* */
36 | FT_DECLARE_RENDERER( ft_raster5_renderer_class )
37 |
38 |
39 | FT_END_HEADER
40 |
41 | #endif /* __FTREND1_H__ */
42 |
43 |
44 | /* END */
45 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 renderer module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += RASTER_MODULE
17 |
18 | define RASTER_MODULE
19 | $(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/raster.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* raster.c */
4 | /* */
5 | /* FreeType monochrome rasterer module component (body only). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "rastpic.c"
23 | #include "ftraster.c"
24 | #include "ftrend1.c"
25 |
26 |
27 | /* END */
28 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/rasterrs.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* rasterrs.h */
4 | /* */
5 | /* monochrome renderer error codes (specification only). */
6 | /* */
7 | /* Copyright 2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the monochrome renderer error enumeration */
22 | /* constants. */
23 | /* */
24 | /*************************************************************************/
25 |
26 | #ifndef __RASTERRS_H__
27 | #define __RASTERRS_H__
28 |
29 | #include FT_MODULE_ERRORS_H
30 |
31 | #undef __FTERRORS_H__
32 |
33 | #define FT_ERR_PREFIX Raster_Err_
34 | #define FT_ERR_BASE FT_Mod_Err_Raster
35 |
36 | #include FT_ERRORS_H
37 |
38 | #endif /* __RASTERRS_H__ */
39 |
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/rastpic.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* rastpic.h */
4 | /* */
5 | /* The FreeType position independent code services for raster module. */
6 | /* */
7 | /* Copyright 2009 by */
8 | /* Oran Agra and Mickey Gabel. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __RASTPIC_H__
20 | #define __RASTPIC_H__
21 |
22 |
23 | FT_BEGIN_HEADER
24 |
25 | #include FT_INTERNAL_PIC_H
26 |
27 | #ifndef FT_CONFIG_OPTION_PIC
28 | #define FT_STANDARD_RASTER_GET ft_standard_raster
29 |
30 | #else /* FT_CONFIG_OPTION_PIC */
31 |
32 | typedef struct RasterPIC_
33 | {
34 | int ref_count;
35 | FT_Raster_Funcs ft_standard_raster;
36 | } RasterPIC;
37 |
38 | #define GET_PIC(lib) ((RasterPIC*)((lib)->pic_container.raster))
39 | #define FT_STANDARD_RASTER_GET (GET_PIC(library)->ft_standard_raster)
40 |
41 | #endif /* FT_CONFIG_OPTION_PIC */
42 |
43 | /* */
44 |
45 | FT_END_HEADER
46 |
47 | #endif /* __RASTPIC_H__ */
48 |
49 |
50 | /* END */
51 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/raster/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 renderer module build rules
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2001, 2003, 2008, 2009 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # raster driver directory
17 | #
18 | RASTER_DIR := $(SRC_DIR)/raster
19 |
20 | # compilation flags for the driver
21 | #
22 | RASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))
23 |
24 |
25 | # raster driver sources (i.e., C files)
26 | #
27 | RASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \
28 | $(RASTER_DIR)/ftrend1.c
29 |
30 |
31 | # raster driver headers
32 | #
33 | RASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \
34 | $(RASTER_DIR)/rasterrs.h
35 |
36 |
37 | # raster driver object(s)
38 | #
39 | # RASTER_DRV_OBJ_M is used during `multi' builds.
40 | # RASTER_DRV_OBJ_S is used during `single' builds.
41 | #
42 | RASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O)
43 | RASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O
44 |
45 | # raster driver source file for single build
46 | #
47 | RASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c
48 |
49 |
50 | # raster driver - single object
51 | #
52 | $(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \
53 | $(FREETYPE_H) $(RASTER_DRV_H)
54 | $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S))
55 |
56 |
57 | # raster driver - multiple objects
58 | #
59 | $(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H)
60 | $(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
61 |
62 |
63 | # update main driver object lists
64 | #
65 | DRV_OBJS_S += $(RASTER_DRV_OBJ_S)
66 | DRV_OBJS_M += $(RASTER_DRV_OBJ_M)
67 |
68 |
69 | # EOF
70 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/sfnt Jamfile
2 | #
3 | # Copyright 2001, 2002, 2004, 2005 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) sfnt ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = sfobjs sfdriver ttcmap ttmtx ttpost ttload ttsbit ttkern ttbdf sfntpic ;
20 | }
21 | else
22 | {
23 | _sources = sfnt ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/sfnt Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 SFNT module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += SFNT_MODULE
17 |
18 | define SFNT_MODULE
19 | $(OPEN_DRIVER) FT_Module_Class, sfnt_module_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)sfnt $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 SFNT driver configuration rules
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # SFNT driver directory
17 | #
18 | SFNT_DIR := $(SRC_DIR)/sfnt
19 |
20 |
21 | # compilation flags for the driver
22 | #
23 | SFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR))
24 |
25 |
26 | # SFNT driver sources (i.e., C files)
27 | #
28 | SFNT_DRV_SRC := $(SFNT_DIR)/ttload.c \
29 | $(SFNT_DIR)/ttmtx.c \
30 | $(SFNT_DIR)/ttcmap.c \
31 | $(SFNT_DIR)/ttsbit.c \
32 | $(SFNT_DIR)/ttpost.c \
33 | $(SFNT_DIR)/ttkern.c \
34 | $(SFNT_DIR)/ttbdf.c \
35 | $(SFNT_DIR)/sfobjs.c \
36 | $(SFNT_DIR)/sfdriver.c
37 |
38 | # SFNT driver headers
39 | #
40 | # Note that ttsbit0.c gets #included by ttsbit.c.
41 | #
42 | SFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h) \
43 | $(SFNT_DIR)/sferrors.h \
44 | $(SFNT_DIR)/ttsbit0.c
45 |
46 |
47 | # SFNT driver object(s)
48 | #
49 | # SFNT_DRV_OBJ_M is used during `multi' builds.
50 | # SFNT_DRV_OBJ_S is used during `single' builds.
51 | #
52 | SFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR)/%.c=$(OBJ_DIR)/%.$O)
53 | SFNT_DRV_OBJ_S := $(OBJ_DIR)/sfnt.$O
54 |
55 | # SFNT driver source file for single build
56 | #
57 | SFNT_DRV_SRC_S := $(SFNT_DIR)/sfnt.c
58 |
59 |
60 | # SFNT driver - single object
61 | #
62 | $(SFNT_DRV_OBJ_S): $(SFNT_DRV_SRC_S) $(SFNT_DRV_SRC) \
63 | $(FREETYPE_H) $(SFNT_DRV_H)
64 | $(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SFNT_DRV_SRC_S))
65 |
66 |
67 | # SFNT driver - multiple objects
68 | #
69 | $(OBJ_DIR)/%.$O: $(SFNT_DIR)/%.c $(FREETYPE_H) $(SFNT_DRV_H)
70 | $(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
71 |
72 |
73 | # update main driver object lists
74 | #
75 | DRV_OBJS_S += $(SFNT_DRV_OBJ_S)
76 | DRV_OBJS_M += $(SFNT_DRV_OBJ_M)
77 |
78 |
79 | # EOF
80 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/sfdriver.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* sfdriver.h */
4 | /* */
5 | /* High-level SFNT driver interface (specification). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SFDRIVER_H__
20 | #define __SFDRIVER_H__
21 |
22 |
23 | #include
24 | #include FT_MODULE_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | FT_DECLARE_MODULE( sfnt_module_class )
31 |
32 |
33 | FT_END_HEADER
34 |
35 | #endif /* __SFDRIVER_H__ */
36 |
37 |
38 | /* END */
39 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/sferrors.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* sferrors.h */
4 | /* */
5 | /* SFNT error codes (specification only). */
6 | /* */
7 | /* Copyright 2001, 2004 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the SFNT error enumeration constants. */
22 | /* */
23 | /*************************************************************************/
24 |
25 | #ifndef __SFERRORS_H__
26 | #define __SFERRORS_H__
27 |
28 | #include FT_MODULE_ERRORS_H
29 |
30 | #undef __FTERRORS_H__
31 |
32 | #define FT_ERR_PREFIX SFNT_Err_
33 | #define FT_ERR_BASE FT_Mod_Err_SFNT
34 |
35 | #define FT_KEEP_ERR_PREFIX
36 |
37 | #include FT_ERRORS_H
38 |
39 | #endif /* __SFERRORS_H__ */
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/sfnt.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* sfnt.c */
4 | /* */
5 | /* Single object library component. */
6 | /* */
7 | /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "sfntpic.c"
23 | #include "ttload.c"
24 | #include "ttmtx.c"
25 | #include "ttcmap.c"
26 | #include "ttkern.c"
27 | #include "sfobjs.c"
28 | #include "sfdriver.c"
29 |
30 | #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
31 | #include "ttsbit.c"
32 | #endif
33 |
34 | #ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
35 | #include "ttpost.c"
36 | #endif
37 |
38 | #ifdef TT_CONFIG_OPTION_BDF
39 | #include "ttbdf.c"
40 | #endif
41 |
42 | /* END */
43 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/sfobjs.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* sfobjs.h */
4 | /* */
5 | /* SFNT object management (specification). */
6 | /* */
7 | /* Copyright 1996-2001, 2002 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __SFOBJS_H__
20 | #define __SFOBJS_H__
21 |
22 |
23 | #include
24 | #include FT_INTERNAL_SFNT_H
25 | #include FT_INTERNAL_OBJECTS_H
26 |
27 |
28 | FT_BEGIN_HEADER
29 |
30 |
31 | FT_LOCAL( FT_Error )
32 | sfnt_init_face( FT_Stream stream,
33 | TT_Face face,
34 | FT_Int face_index,
35 | FT_Int num_params,
36 | FT_Parameter* params );
37 |
38 | FT_LOCAL( FT_Error )
39 | sfnt_load_face( FT_Stream stream,
40 | TT_Face face,
41 | FT_Int face_index,
42 | FT_Int num_params,
43 | FT_Parameter* params );
44 |
45 | FT_LOCAL( void )
46 | sfnt_done_face( TT_Face face );
47 |
48 |
49 | FT_END_HEADER
50 |
51 | #endif /* __SFDRIVER_H__ */
52 |
53 |
54 | /* END */
55 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/ttbdf.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ttbdf.h */
4 | /* */
5 | /* TrueType and OpenType embedded BDF properties (specification). */
6 | /* */
7 | /* Copyright 2005 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __TTBDF_H__
20 | #define __TTBDF_H__
21 |
22 |
23 | #include
24 | #include "ttload.h"
25 | #include FT_BDF_H
26 |
27 |
28 | FT_BEGIN_HEADER
29 |
30 |
31 | FT_LOCAL( void )
32 | tt_face_free_bdf_props( TT_Face face );
33 |
34 |
35 | FT_LOCAL( FT_Error )
36 | tt_face_find_bdf_prop( TT_Face face,
37 | const char* property_name,
38 | BDF_PropertyRec *aprop );
39 |
40 |
41 | FT_END_HEADER
42 |
43 | #endif /* __TTBDF_H__ */
44 |
45 |
46 | /* END */
47 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/ttcmapc.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ttcmapc.h */
4 | /* */
5 | /* TT CMAP classes definitions (specification only). */
6 | /* */
7 | /* Copyright 2009 by */
8 | /* Oran Agra and Mickey Gabel. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifdef TT_CONFIG_CMAP_FORMAT_0
20 | TTCMAPCITEM(tt_cmap0_class_rec)
21 | #endif
22 |
23 | #ifdef TT_CONFIG_CMAP_FORMAT_2
24 | TTCMAPCITEM(tt_cmap2_class_rec)
25 | #endif
26 |
27 | #ifdef TT_CONFIG_CMAP_FORMAT_4
28 | TTCMAPCITEM(tt_cmap4_class_rec)
29 | #endif
30 |
31 | #ifdef TT_CONFIG_CMAP_FORMAT_6
32 | TTCMAPCITEM(tt_cmap6_class_rec)
33 | #endif
34 |
35 | #ifdef TT_CONFIG_CMAP_FORMAT_8
36 | TTCMAPCITEM(tt_cmap8_class_rec)
37 | #endif
38 |
39 | #ifdef TT_CONFIG_CMAP_FORMAT_10
40 | TTCMAPCITEM(tt_cmap10_class_rec)
41 | #endif
42 |
43 | #ifdef TT_CONFIG_CMAP_FORMAT_12
44 | TTCMAPCITEM(tt_cmap12_class_rec)
45 | #endif
46 |
47 | #ifdef TT_CONFIG_CMAP_FORMAT_13
48 | TTCMAPCITEM(tt_cmap13_class_rec)
49 | #endif
50 |
51 | #ifdef TT_CONFIG_CMAP_FORMAT_14
52 | TTCMAPCITEM(tt_cmap14_class_rec)
53 | #endif
54 |
55 | /* END */
56 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/ttkern.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ttkern.h */
4 | /* */
5 | /* Load the basic TrueType kerning table. This doesn't handle */
6 | /* kerning data within the GPOS table at the moment. */
7 | /* */
8 | /* Copyright 1996-2001, 2002, 2005, 2007 by */
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 | /* */
11 | /* This file is part of the FreeType project, and may only be used, */
12 | /* modified, and distributed under the terms of the FreeType project */
13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 | /* this file you indicate that you have read the license and */
15 | /* understand and accept it fully. */
16 | /* */
17 | /***************************************************************************/
18 |
19 |
20 | #ifndef __TTKERN_H__
21 | #define __TTKERN_H__
22 |
23 |
24 | #include
25 | #include FT_INTERNAL_STREAM_H
26 | #include FT_INTERNAL_TRUETYPE_TYPES_H
27 |
28 |
29 | FT_BEGIN_HEADER
30 |
31 |
32 | FT_LOCAL( FT_Error )
33 | tt_face_load_kern( TT_Face face,
34 | FT_Stream stream );
35 |
36 | FT_LOCAL( void )
37 | tt_face_done_kern( TT_Face face );
38 |
39 | FT_LOCAL( FT_Int )
40 | tt_face_get_kerning( TT_Face face,
41 | FT_UInt left_glyph,
42 | FT_UInt right_glyph );
43 |
44 | #define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 )
45 |
46 |
47 | FT_END_HEADER
48 |
49 | #endif /* __TTKERN_H__ */
50 |
51 |
52 | /* END */
53 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/ttmtx.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ttmtx.h */
4 | /* */
5 | /* Load the metrics tables common to TTF and OTF fonts (specification). */
6 | /* */
7 | /* Copyright 2006 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __TTMTX_H__
20 | #define __TTMTX_H__
21 |
22 |
23 | #include
24 | #include FT_INTERNAL_STREAM_H
25 | #include FT_INTERNAL_TRUETYPE_TYPES_H
26 |
27 |
28 | FT_BEGIN_HEADER
29 |
30 |
31 | FT_LOCAL( FT_Error )
32 | tt_face_load_hhea( TT_Face face,
33 | FT_Stream stream,
34 | FT_Bool vertical );
35 |
36 |
37 | FT_LOCAL( FT_Error )
38 | tt_face_load_hmtx( TT_Face face,
39 | FT_Stream stream,
40 | FT_Bool vertical );
41 |
42 |
43 | FT_LOCAL( FT_Error )
44 | tt_face_get_metrics( TT_Face face,
45 | FT_Bool vertical,
46 | FT_UInt gindex,
47 | FT_Short* abearing,
48 | FT_UShort* aadvance );
49 |
50 | FT_END_HEADER
51 |
52 | #endif /* __TTMTX_H__ */
53 |
54 |
55 | /* END */
56 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/sfnt/ttpost.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ttpost.h */
4 | /* */
5 | /* Postcript name table processing for TrueType and OpenType fonts */
6 | /* (specification). */
7 | /* */
8 | /* Copyright 1996-2001, 2002 by */
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 | /* */
11 | /* This file is part of the FreeType project, and may only be used, */
12 | /* modified, and distributed under the terms of the FreeType project */
13 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 | /* this file you indicate that you have read the license and */
15 | /* understand and accept it fully. */
16 | /* */
17 | /***************************************************************************/
18 |
19 |
20 | #ifndef __TTPOST_H__
21 | #define __TTPOST_H__
22 |
23 |
24 | #include
25 | #include FT_CONFIG_CONFIG_H
26 | #include FT_INTERNAL_TRUETYPE_TYPES_H
27 |
28 |
29 | FT_BEGIN_HEADER
30 |
31 |
32 | FT_LOCAL( FT_Error )
33 | tt_face_get_ps_name( TT_Face face,
34 | FT_UInt idx,
35 | FT_String** PSname );
36 |
37 | FT_LOCAL( void )
38 | tt_face_free_ps_names( TT_Face face );
39 |
40 |
41 | FT_END_HEADER
42 |
43 | #endif /* __TTPOST_H__ */
44 |
45 |
46 | /* END */
47 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/smooth Jamfile
2 | #
3 | # Copyright 2001 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) smooth ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = ftgrays ftsmooth ftspic ;
20 | }
21 | else
22 | {
23 | _sources = smooth ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/smooth Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/ftsmerrs.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftsmerrs.h */
4 | /* */
5 | /* smooth renderer error codes (specification only). */
6 | /* */
7 | /* Copyright 2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the smooth renderer error enumeration */
22 | /* constants. */
23 | /* */
24 | /*************************************************************************/
25 |
26 | #ifndef __FTSMERRS_H__
27 | #define __FTSMERRS_H__
28 |
29 | #include FT_MODULE_ERRORS_H
30 |
31 | #undef __FTERRORS_H__
32 |
33 | #define FT_ERR_PREFIX Smooth_Err_
34 | #define FT_ERR_BASE FT_Mod_Err_Smooth
35 |
36 | #include FT_ERRORS_H
37 |
38 | #endif /* __FTSMERRS_H__ */
39 |
40 |
41 | /* END */
42 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/ftsmooth.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftsmooth.h */
4 | /* */
5 | /* Anti-aliasing renderer interface (specification). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __FTSMOOTH_H__
20 | #define __FTSMOOTH_H__
21 |
22 |
23 | #include
24 | #include FT_RENDER_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | #ifndef FT_CONFIG_OPTION_NO_STD_RASTER
31 | FT_DECLARE_RENDERER( ft_std_renderer_class )
32 | #endif
33 |
34 | #ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER
35 | FT_DECLARE_RENDERER( ft_smooth_renderer_class )
36 |
37 | FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class )
38 |
39 | FT_DECLARE_RENDERER( ft_smooth_lcd_v_renderer_class )
40 | #endif
41 |
42 |
43 |
44 | FT_END_HEADER
45 |
46 | #endif /* __FTSMOOTH_H__ */
47 |
48 |
49 | /* END */
50 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/ftspic.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ftspic.h */
4 | /* */
5 | /* The FreeType position independent code services for smooth module. */
6 | /* */
7 | /* Copyright 2009 by */
8 | /* Oran Agra and Mickey Gabel. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __FTSPIC_H__
20 | #define __FTSPIC_H__
21 |
22 |
23 | FT_BEGIN_HEADER
24 |
25 | #include FT_INTERNAL_PIC_H
26 |
27 | #ifndef FT_CONFIG_OPTION_PIC
28 | #define FT_GRAYS_RASTER_GET ft_grays_raster
29 |
30 | #else /* FT_CONFIG_OPTION_PIC */
31 |
32 | typedef struct SmoothPIC_
33 | {
34 | int ref_count;
35 | FT_Raster_Funcs ft_grays_raster;
36 | } SmoothPIC;
37 |
38 | #define GET_PIC(lib) ((SmoothPIC*)((lib)->pic_container.smooth))
39 | #define FT_GRAYS_RASTER_GET (GET_PIC(library)->ft_grays_raster)
40 |
41 | #endif /* FT_CONFIG_OPTION_PIC */
42 |
43 | /* */
44 |
45 | FT_END_HEADER
46 |
47 | #endif /* __FTSPIC_H__ */
48 |
49 |
50 | /* END */
51 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 smooth renderer module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += SMOOTH_RENDERER
17 |
18 | define SMOOTH_RENDERER
19 | $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_renderer_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE)
21 | $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcd_renderer_class $(CLOSE_DRIVER)
22 | $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE)
23 | $(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcdv_renderer_class $(CLOSE_DRIVER)
24 | $(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE)
25 | endef
26 |
27 | # EOF
28 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 smooth renderer module build rules
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2001, 2003 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # smooth driver directory
17 | #
18 | SMOOTH_DIR := $(SRC_DIR)/smooth
19 |
20 | # compilation flags for the driver
21 | #
22 | SMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR))
23 |
24 |
25 | # smooth driver sources (i.e., C files)
26 | #
27 | SMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c \
28 | $(SMOOTH_DIR)/ftsmooth.c
29 |
30 |
31 | # smooth driver headers
32 | #
33 | SMOOTH_DRV_H := $(SMOOTH_DRV_SRC:%c=%h) \
34 | $(SMOOTH_DIR)/ftsmerrs.h
35 |
36 |
37 | # smooth driver object(s)
38 | #
39 | # SMOOTH_DRV_OBJ_M is used during `multi' builds.
40 | # SMOOTH_DRV_OBJ_S is used during `single' builds.
41 | #
42 | SMOOTH_DRV_OBJ_M := $(SMOOTH_DRV_SRC:$(SMOOTH_DIR)/%.c=$(OBJ_DIR)/%.$O)
43 | SMOOTH_DRV_OBJ_S := $(OBJ_DIR)/smooth.$O
44 |
45 | # smooth driver source file for single build
46 | #
47 | SMOOTH_DRV_SRC_S := $(SMOOTH_DIR)/smooth.c
48 |
49 |
50 | # smooth driver - single object
51 | #
52 | $(SMOOTH_DRV_OBJ_S): $(SMOOTH_DRV_SRC_S) $(SMOOTH_DRV_SRC) \
53 | $(FREETYPE_H) $(SMOOTH_DRV_H)
54 | $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SMOOTH_DRV_SRC_S))
55 |
56 |
57 | # smooth driver - multiple objects
58 | #
59 | $(OBJ_DIR)/%.$O: $(SMOOTH_DIR)/%.c $(FREETYPE_H) $(SMOOTH_DRV_H)
60 | $(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
61 |
62 |
63 | # update main driver object lists
64 | #
65 | DRV_OBJS_S += $(SMOOTH_DRV_OBJ_S)
66 | DRV_OBJS_M += $(SMOOTH_DRV_OBJ_M)
67 |
68 |
69 | # EOF
70 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/smooth/smooth.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* smooth.c */
4 | /* */
5 | /* FreeType anti-aliasing rasterer module component (body only). */
6 | /* */
7 | /* Copyright 1996-2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "ftspic.c"
23 | #include "ftgrays.c"
24 | #include "ftsmooth.c"
25 |
26 |
27 | /* END */
28 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/truetype/Jamfile:
--------------------------------------------------------------------------------
1 | # FreeType 2 src/truetype Jamfile
2 | #
3 | # Copyright 2001, 2004 by
4 | # David Turner, Robert Wilhelm, and Werner Lemberg.
5 | #
6 | # This file is part of the FreeType project, and may only be used, modified,
7 | # and distributed under the terms of the FreeType project license,
8 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
9 | # indicate that you have read the license and understand and accept it
10 | # fully.
11 |
12 | SubDir FT2_TOP $(FT2_SRC_DIR) truetype ;
13 |
14 | {
15 | local _sources ;
16 |
17 | if $(FT2_MULTI)
18 | {
19 | _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ttpic ;
20 | }
21 | else
22 | {
23 | _sources = truetype ;
24 | }
25 |
26 | Library $(FT2_LIB) : $(_sources).c ;
27 | }
28 |
29 | # end of src/truetype Jamfile
30 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/truetype/module.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 TrueType module definition
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2006 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | FTMODULE_H_COMMANDS += TRUETYPE_DRIVER
17 |
18 | define TRUETYPE_DRIVER
19 | $(OPEN_DRIVER) FT_Driver_ClassRec, tt_driver_class $(CLOSE_DRIVER)
20 | $(ECHO_DRIVER)truetype $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE)
21 | endef
22 |
23 | # EOF
24 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/truetype/rules.mk:
--------------------------------------------------------------------------------
1 | #
2 | # FreeType 2 TrueType driver configuration rules
3 | #
4 |
5 |
6 | # Copyright 1996-2000, 2001, 2003, 2004 by
7 | # David Turner, Robert Wilhelm, and Werner Lemberg.
8 | #
9 | # This file is part of the FreeType project, and may only be used, modified,
10 | # and distributed under the terms of the FreeType project license,
11 | # LICENSE.TXT. By continuing to use, modify, or distribute this file you
12 | # indicate that you have read the license and understand and accept it
13 | # fully.
14 |
15 |
16 | # TrueType driver directory
17 | #
18 | TT_DIR := $(SRC_DIR)/truetype
19 |
20 |
21 | # compilation flags for the driver
22 | #
23 | TT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR))
24 |
25 |
26 | # TrueType driver sources (i.e., C files)
27 | #
28 | TT_DRV_SRC := $(TT_DIR)/ttobjs.c \
29 | $(TT_DIR)/ttpload.c \
30 | $(TT_DIR)/ttgload.c \
31 | $(TT_DIR)/ttinterp.c \
32 | $(TT_DIR)/ttgxvar.c \
33 | $(TT_DIR)/ttdriver.c
34 |
35 | # TrueType driver headers
36 | #
37 | TT_DRV_H := $(TT_DRV_SRC:%.c=%.h) \
38 | $(TT_DIR)/tterrors.h
39 |
40 |
41 | # TrueType driver object(s)
42 | #
43 | # TT_DRV_OBJ_M is used during `multi' builds
44 | # TT_DRV_OBJ_S is used during `single' builds
45 | #
46 | TT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR)/%.c=$(OBJ_DIR)/%.$O)
47 | TT_DRV_OBJ_S := $(OBJ_DIR)/truetype.$O
48 |
49 | # TrueType driver source file for single build
50 | #
51 | TT_DRV_SRC_S := $(TT_DIR)/truetype.c
52 |
53 |
54 | # TrueType driver - single object
55 | #
56 | $(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H)
57 | $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(TT_DRV_SRC_S))
58 |
59 |
60 | # driver - multiple objects
61 | #
62 | $(OBJ_DIR)/%.$O: $(TT_DIR)/%.c $(FREETYPE_H) $(TT_DRV_H)
63 | $(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
64 |
65 |
66 | # update main driver object lists
67 | #
68 | DRV_OBJS_S += $(TT_DRV_OBJ_S)
69 | DRV_OBJS_M += $(TT_DRV_OBJ_M)
70 |
71 |
72 | # EOF
73 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/truetype/truetype.c:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* truetype.c */
4 | /* */
5 | /* FreeType TrueType driver component (body only). */
6 | /* */
7 | /* Copyright 1996-2001, 2004, 2006 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #define FT_MAKE_OPTION_SINGLE_OBJECT
20 |
21 | #include
22 | #include "ttpic.c"
23 | #include "ttdriver.c" /* driver interface */
24 | #include "ttpload.c" /* tables loader */
25 | #include "ttgload.c" /* glyph loader */
26 | #include "ttobjs.c" /* object manager */
27 |
28 | #ifdef TT_USE_BYTECODE_INTERPRETER
29 | #include "ttinterp.c"
30 | #endif
31 |
32 | #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
33 | #include "ttgxvar.c" /* gx distortable font */
34 | #endif
35 |
36 |
37 | /* END */
38 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/truetype/ttdriver.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* ttdriver.h */
4 | /* */
5 | /* High-level TrueType driver interface (specification). */
6 | /* */
7 | /* Copyright 1996-2001, 2002 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | #ifndef __TTDRIVER_H__
20 | #define __TTDRIVER_H__
21 |
22 |
23 | #include
24 | #include FT_INTERNAL_DRIVER_H
25 |
26 |
27 | FT_BEGIN_HEADER
28 |
29 |
30 | FT_DECLARE_DRIVER( tt_driver_class )
31 |
32 |
33 | FT_END_HEADER
34 |
35 | #endif /* __TTDRIVER_H__ */
36 |
37 |
38 | /* END */
39 |
--------------------------------------------------------------------------------
/jni/freetype-2.4.4/src/truetype/tterrors.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************/
2 | /* */
3 | /* tterrors.h */
4 | /* */
5 | /* TrueType error codes (specification only). */
6 | /* */
7 | /* Copyright 2001 by */
8 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 | /* */
10 | /* This file is part of the FreeType project, and may only be used, */
11 | /* modified, and distributed under the terms of the FreeType project */
12 | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 | /* this file you indicate that you have read the license and */
14 | /* understand and accept it fully. */
15 | /* */
16 | /***************************************************************************/
17 |
18 |
19 | /*************************************************************************/
20 | /* */
21 | /* This file is used to define the TrueType error enumeration */
22 | /* constants. */
23 | /* */
24 | /*************************************************************************/
25 |
26 | #ifndef __TTERRORS_H__
27 | #define __TTERRORS_H__
28 |
29 | #include FT_MODULE_ERRORS_H
30 |
31 | #undef __FTERRORS_H__
32 |
33 | #define FT_ERR_PREFIX TT_Err_
34 | #define FT_ERR_BASE FT_Mod_Err_TrueType
35 |
36 | #include FT_ERRORS_H
37 |
38 | #endif /* __TTERRORS_H__ */
39 |
40 | /* END */
41 |
--------------------------------------------------------------------------------
/jni/include/activity.h:
--------------------------------------------------------------------------------
1 | #ifndef activity_h
2 | #define activity_h
3 |
4 | #include "lua.h"
5 | #include "lualib.h"
6 | #include "lauxlib.h"
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | #ifndef LOG_TAG
14 | #define LOG_TAG "lua"
15 | #endif
16 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
17 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
18 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | struct engine {
25 | ANativeActivity *activity;
26 | lua_State *L;
27 |
28 | AConfiguration *config;
29 | ANativeWindow *window;
30 |
31 | AInputQueue *queue;
32 | ALooper *looper;
33 |
34 | int msgread;
35 | int msgwrite;
36 | };
37 |
38 |
39 | #ifdef __cplusplus
40 | }
41 | #endif
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/jni/include/jnicontext.h:
--------------------------------------------------------------------------------
1 | #ifndef jnicontext_h
2 | #define jnicontext_h
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | #ifdef __cplusplus
10 | extern "C" {
11 | #endif
12 |
13 | void jniSetJavaVM(JavaVM* vm);
14 | JavaVM* jniGetJavaVM();
15 | JNIEnv* jniGetEnv();
16 |
17 | int jniSetContext(jobject context);
18 | jobject jniGetActivity();
19 | jobject jniGetApplication();
20 | jobject jniGetApplicationContext();
21 |
22 | int jniSetAssetManager(AAssetManager *a);
23 | AAssetManager *jniGetAssetManager();
24 | int jniSetAssetManager(AAssetManager *a);
25 |
26 | jclass jniFindClass(const char *name);
27 | const char* jniGetFilesDir(ANativeActivity *activity);
28 |
29 | #ifdef __cplusplus
30 | }
31 | #endif
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # Core Lua library
4 | # compiled as static library to embed in liblua-activity.so
5 | include $(CLEAR_VARS)
6 | LOCAL_MODULE := luacore-static
7 | LOCAL_SRC_FILES := \
8 | src/lapi.c \
9 | src/lauxlib.c \
10 | src/lbaselib.c \
11 | src/lcode.c \
12 | src/ldblib.c \
13 | src/ldebug.c \
14 | src/ldo.c \
15 | src/ldump.c \
16 | src/lfunc.c \
17 | src/lgc.c \
18 | src/linit.c \
19 | src/liolib.c \
20 | src/llex.c \
21 | src/lmathlib.c \
22 | src/lmem.c \
23 | src/loadlib.c \
24 | src/lobject.c \
25 | src/lopcodes.c \
26 | src/loslib.c \
27 | src/lparser.c \
28 | src/lstate.c \
29 | src/lstring.c \
30 | src/lstrlib.c \
31 | src/ltable.c \
32 | src/ltablib.c \
33 | src/ltm.c \
34 | src/lundump.c \
35 | src/lvm.c \
36 | src/lzio.c \
37 | src/print.c
38 |
39 | # Auxiliary lua user defined file
40 | # LOCAL_SRC_FILES += luauser.c
41 | # LOCAL_CFLAGS := -DLUA_DL_DLOPEN -DLUA_USER_H='"luauser.h"'
42 |
43 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/src
44 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
45 | LOCAL_CFLAGS := -DLUA_DL_DLOPEN
46 | LOCAL_LDLIBS := -ldl -llog
47 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
48 | include $(BUILD_STATIC_LIBRARY)
49 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/include/lualib.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua standard libraries
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #ifndef lualib_h
9 | #define lualib_h
10 |
11 | #include "lua.h"
12 |
13 |
14 | /* Key to file-handle type */
15 | #define LUA_FILEHANDLE "FILE*"
16 |
17 |
18 | #define LUA_COLIBNAME "coroutine"
19 | LUALIB_API int (luaopen_base) (lua_State *L);
20 |
21 | #define LUA_TABLIBNAME "table"
22 | LUALIB_API int (luaopen_table) (lua_State *L);
23 |
24 | #define LUA_IOLIBNAME "io"
25 | LUALIB_API int (luaopen_io) (lua_State *L);
26 |
27 | #define LUA_OSLIBNAME "os"
28 | LUALIB_API int (luaopen_os) (lua_State *L);
29 |
30 | #define LUA_STRLIBNAME "string"
31 | LUALIB_API int (luaopen_string) (lua_State *L);
32 |
33 | #define LUA_MATHLIBNAME "math"
34 | LUALIB_API int (luaopen_math) (lua_State *L);
35 |
36 | #define LUA_DBLIBNAME "debug"
37 | LUALIB_API int (luaopen_debug) (lua_State *L);
38 |
39 | #define LUA_LOADLIBNAME "package"
40 | LUALIB_API int (luaopen_package) (lua_State *L);
41 |
42 |
43 | /* open all previous libraries */
44 | LUALIB_API void (luaL_openlibs) (lua_State *L);
45 |
46 |
47 |
48 | #ifndef lua_assert
49 | #define lua_assert(x) ((void)0)
50 | #endif
51 |
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/lua-license.txt:
--------------------------------------------------------------------------------
1 | Lua License
2 | -----------
3 |
4 | Lua is licensed under the terms of the MIT license reproduced below.
5 | This means that Lua is free software and can be used for both academic
6 | and commercial purposes at absolutely no cost.
7 |
8 | For details and rationale, see http://www.lua.org/license.html .
9 |
10 | ===============================================================================
11 |
12 | Copyright (C) 1994-2008 Lua.org, PUC-Rio.
13 |
14 | Permission is hereby granted, free of charge, to any person obtaining a copy
15 | of this software and associated documentation files (the "Software"), to deal
16 | in the Software without restriction, including without limitation the rights
17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 | copies of the Software, and to permit persons to whom the Software is
19 | furnished to do so, subject to the following conditions:
20 |
21 | The above copyright notice and this permission notice shall be included in
22 | all copies or substantial portions of the Software.
23 |
24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 | THE SOFTWARE.
31 |
32 | ===============================================================================
33 |
34 | (end of COPYRIGHT)
35 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lapi.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Auxiliary functions from Lua API
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lapi_h
8 | #define lapi_h
9 |
10 |
11 | #include "lobject.h"
12 |
13 |
14 | LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/ldebug.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Auxiliary functions from Debug Interface module
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ldebug_h
8 | #define ldebug_h
9 |
10 |
11 | #include "lstate.h"
12 |
13 |
14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
15 |
16 | #define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
17 |
18 | #define resethookcount(L) (L->hookcount = L->basehookcount)
19 |
20 |
21 | LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
22 | const char *opname);
23 | LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
24 | LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
25 | const TValue *p2);
26 | LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
27 | const TValue *p2);
28 | LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
29 | LUAI_FUNC void luaG_errormsg (lua_State *L);
30 | LUAI_FUNC int luaG_checkcode (const Proto *pt);
31 | LUAI_FUNC int luaG_checkopenop (Instruction i);
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/ldo.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Stack and Call structure of Lua
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ldo_h
8 | #define ldo_h
9 |
10 |
11 | #include "lobject.h"
12 | #include "lstate.h"
13 | #include "lzio.h"
14 |
15 |
16 | #define luaD_checkstack(L,n) \
17 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
18 | luaD_growstack(L, n); \
19 | else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
20 |
21 |
22 | #define incr_top(L) {luaD_checkstack(L,1); L->top++;}
23 |
24 | #define savestack(L,p) ((char *)(p) - (char *)L->stack)
25 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
26 |
27 | #define saveci(L,p) ((char *)(p) - (char *)L->base_ci)
28 | #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n)))
29 |
30 |
31 | /* results from luaD_precall */
32 | #define PCRLUA 0 /* initiated a call to a Lua function */
33 | #define PCRC 1 /* did a call to a C function */
34 | #define PCRYIELD 2 /* C funtion yielded */
35 |
36 |
37 | /* type of protected functions, to be ran by `runprotected' */
38 | typedef void (*Pfunc) (lua_State *L, void *ud);
39 |
40 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
41 | LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
42 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
43 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
44 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
45 | ptrdiff_t oldtop, ptrdiff_t ef);
46 | LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
47 | LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
48 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
49 | LUAI_FUNC void luaD_growstack (lua_State *L, int n);
50 |
51 | LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
52 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
53 |
54 | LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
55 |
56 | #endif
57 |
58 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lfunc.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Auxiliary functions to manipulate prototypes and closures
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lfunc_h
8 | #define lfunc_h
9 |
10 |
11 | #include "lobject.h"
12 |
13 |
14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \
15 | cast(int, sizeof(TValue)*((n)-1)))
16 |
17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \
18 | cast(int, sizeof(TValue *)*((n)-1)))
19 |
20 |
21 | LUAI_FUNC Proto *luaF_newproto (lua_State *L);
22 | LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);
23 | LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);
24 | LUAI_FUNC UpVal *luaF_newupval (lua_State *L);
25 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);
26 | LUAI_FUNC void luaF_close (lua_State *L, StkId level);
27 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);
28 | LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);
29 | LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);
30 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,
31 | int pc);
32 |
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/linit.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Initialization of libraries for lua.c
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #define linit_c
9 | #define LUA_LIB
10 |
11 | #include "lua.h"
12 |
13 | #include "lualib.h"
14 | #include "lauxlib.h"
15 |
16 |
17 | static const luaL_Reg lualibs[] = {
18 | {"", luaopen_base},
19 | {LUA_LOADLIBNAME, luaopen_package},
20 | {LUA_TABLIBNAME, luaopen_table},
21 | {LUA_IOLIBNAME, luaopen_io},
22 | {LUA_OSLIBNAME, luaopen_os},
23 | {LUA_STRLIBNAME, luaopen_string},
24 | {LUA_MATHLIBNAME, luaopen_math},
25 | {LUA_DBLIBNAME, luaopen_debug},
26 | {NULL, NULL}
27 | };
28 |
29 |
30 | LUALIB_API void luaL_openlibs (lua_State *L) {
31 | const luaL_Reg *lib = lualibs;
32 | for (; lib->func; lib++) {
33 | lua_pushcfunction(L, lib->func);
34 | lua_pushstring(L, lib->name);
35 | lua_call(L, 1, 0);
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lmem.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Interface to Memory Manager
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lmem_h
8 | #define lmem_h
9 |
10 |
11 | #include
12 |
13 | #include "llimits.h"
14 | #include "lua.h"
15 |
16 | #define MEMERRMSG "not enough memory"
17 |
18 |
19 | #define luaM_reallocv(L,b,on,n,e) \
20 | ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \
21 | luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
22 | luaM_toobig(L))
23 |
24 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0)
25 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0)
26 | #define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t))
27 |
28 | #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t))
29 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t)))
30 | #define luaM_newvector(L,n,t) \
31 | cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
32 |
33 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \
34 | if ((nelems)+1 > (size)) \
35 | ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))
36 |
37 | #define luaM_reallocvector(L, v,oldn,n,t) \
38 | ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))
39 |
40 |
41 | LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,
42 | size_t size);
43 | LUAI_FUNC void *luaM_toobig (lua_State *L);
44 | LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,
45 | size_t size_elem, int limit,
46 | const char *errormsg);
47 |
48 | #endif
49 |
50 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lstring.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** String table (keep all strings handled by Lua)
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lstring_h
8 | #define lstring_h
9 |
10 |
11 | #include "lgc.h"
12 | #include "lobject.h"
13 | #include "lstate.h"
14 |
15 |
16 | #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
17 |
18 | #define sizeudata(u) (sizeof(union Udata)+(u)->len)
19 |
20 | #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
21 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
22 | (sizeof(s)/sizeof(char))-1))
23 |
24 | #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
25 |
26 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
27 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
28 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
29 |
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/ltable.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua tables (hash)
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ltable_h
8 | #define ltable_h
9 |
10 | #include "lobject.h"
11 |
12 |
13 | #define gnode(t,i) (&(t)->node[i])
14 | #define gkey(n) (&(n)->i_key.nk)
15 | #define gval(n) (&(n)->i_val)
16 | #define gnext(n) ((n)->i_key.nk.next)
17 |
18 | #define key2tval(n) (&(n)->i_key.tvk)
19 |
20 |
21 | LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
22 | LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
23 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
24 | LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
25 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
26 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
27 | LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);
28 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);
29 | LUAI_FUNC void luaH_free (lua_State *L, Table *t);
30 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
31 | LUAI_FUNC int luaH_getn (Table *t);
32 |
33 |
34 | #if defined(LUA_DEBUG)
35 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
36 | LUAI_FUNC int luaH_isdummy (Node *n);
37 | #endif
38 |
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/ltm.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Tag methods
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #include
9 |
10 | #define ltm_c
11 | #define LUA_CORE
12 |
13 | #include "lua.h"
14 |
15 | #include "lobject.h"
16 | #include "lstate.h"
17 | #include "lstring.h"
18 | #include "ltable.h"
19 | #include "ltm.h"
20 |
21 |
22 |
23 | const char *const luaT_typenames[] = {
24 | "nil", "boolean", "userdata", "number",
25 | "string", "table", "function", "userdata", "thread",
26 | "proto", "upval"
27 | };
28 |
29 |
30 | void luaT_init (lua_State *L) {
31 | static const char *const luaT_eventname[] = { /* ORDER TM */
32 | "__index", "__newindex",
33 | "__gc", "__mode", "__eq",
34 | "__add", "__sub", "__mul", "__div", "__mod",
35 | "__pow", "__unm", "__len", "__lt", "__le",
36 | "__concat", "__call"
37 | };
38 | int i;
39 | for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]);
41 | luaS_fix(G(L)->tmname[i]); /* never collect these names */
42 | }
43 | }
44 |
45 |
46 | /*
47 | ** function to be used with macro "fasttm": optimized for absence of
48 | ** tag methods
49 | */
50 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
51 | const TValue *tm = luaH_getstr(events, ename);
52 | lua_assert(event <= TM_EQ);
53 | if (ttisnil(tm)) { /* no tag method? */
54 | events->flags |= cast_byte(1u<metatable;
66 | break;
67 | case LUA_TUSERDATA:
68 | mt = uvalue(o)->metatable;
69 | break;
70 | default:
71 | mt = G(L)->mt[ttype(o)];
72 | }
73 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject);
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/ltm.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Tag methods
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef ltm_h
8 | #define ltm_h
9 |
10 |
11 | #include "lobject.h"
12 |
13 |
14 | /*
15 | * WARNING: if you change the order of this enumeration,
16 | * grep "ORDER TM"
17 | */
18 | typedef enum {
19 | TM_INDEX,
20 | TM_NEWINDEX,
21 | TM_GC,
22 | TM_MODE,
23 | TM_EQ, /* last tag method with `fast' access */
24 | TM_ADD,
25 | TM_SUB,
26 | TM_MUL,
27 | TM_DIV,
28 | TM_MOD,
29 | TM_POW,
30 | TM_UNM,
31 | TM_LEN,
32 | TM_LT,
33 | TM_LE,
34 | TM_CONCAT,
35 | TM_CALL,
36 | TM_N /* number of elements in the enum */
37 | } TMS;
38 |
39 |
40 |
41 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \
42 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
43 |
44 | #define fasttm(l,et,e) gfasttm(G(l), et, e)
45 |
46 | LUAI_DATA const char *const luaT_typenames[];
47 |
48 |
49 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
50 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
51 | TMS event);
52 | LUAI_FUNC void luaT_init (lua_State *L);
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/luauser.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include "lua.h"
3 | #include "luauser.h"
4 |
5 | static pthread_mutex_t lua_mutex = PTHREAD_MUTEX_INITIALIZER;
6 |
7 | void LuaLock(lua_State * L)
8 | {
9 | pthread_mutex_lock(&lua_mutex);
10 | }
11 |
12 | void LuaUnlock(lua_State * L)
13 | {
14 | pthread_mutex_unlock(&lua_mutex);
15 | }
16 |
17 |
18 | /*
19 | static struct {
20 | pthread_mutex_t mutex;
21 | int init;
22 | } Gl;
23 |
24 | void LuaLockInitial(lua_State * L)
25 | {
26 | if (!Gl.init) {
27 | // Create mutex
28 | pthread_mutex_init(&Gl.mutex, NULL);
29 | Gl.init = 1;
30 | }
31 | }
32 |
33 | void LuaLockFinal(lua_State * L)
34 | {
35 | // Destroy mutex
36 | if (Gl.init)
37 | {
38 | pthread_mutex_destroy(&Gl.mutex);
39 | Gl.init = 0;
40 | }
41 | }
42 |
43 | void LuaLock(lua_State * L)
44 | {
45 | // Lock mutex
46 | pthread_mutex_lock(&Gl.mutex);
47 | }
48 |
49 | void LuaUnlock(lua_State * L)
50 | {
51 | // Unlock mutex
52 | pthread_mutex_unlock(&Gl.mutex);
53 | }
54 | */
55 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/luauser.h:
--------------------------------------------------------------------------------
1 | #ifndef luauser_h
2 | #define luauser_h
3 |
4 | void LuaLock(lua_State * L);
5 | void LuaUnlock(lua_State * L);
6 | #define lua_lock(L) LuaLock(L)
7 | #define lua_unlock(L) LuaUnlock(L)
8 |
9 | /*
10 | #ifdef luai_userstateopen
11 | #undef luai_userstateopen
12 | #endif
13 | #define luai_userstateopen(L) LuaLockInitial(L)
14 |
15 | #ifdef luai_userstatethread
16 | #undef luai_userstatethread
17 | #endif
18 | #define luai_userstatethread(L,L1) LuaLockInitial(L1)
19 |
20 | #ifdef luai_userstateclose
21 | #undef luai_userstateclose
22 | #endif
23 | #define luai_userstateclose(L) LuaLockFinal(L)
24 |
25 | void LuaLockInitial(lua_State * L);
26 | void LuaLockFinal(lua_State * L);
27 | */
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lundump.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** load precompiled Lua chunks
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lundump_h
8 | #define lundump_h
9 |
10 | #include "lobject.h"
11 | #include "lzio.h"
12 |
13 | /* load one chunk; from lundump.c */
14 | LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);
15 |
16 | /* make header; from lundump.c */
17 | LUAI_FUNC void luaU_header (char* h);
18 |
19 | /* dump one chunk; from ldump.c */
20 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
21 |
22 | #ifdef luac_c
23 | /* print one chunk; from print.c */
24 | LUAI_FUNC void luaU_print (const Proto* f, int full);
25 | #endif
26 |
27 | /* for header of binary files -- this is Lua 5.1 */
28 | #define LUAC_VERSION 0x51
29 |
30 | /* for header of binary files -- this is the official format */
31 | #define LUAC_FORMAT 0
32 |
33 | /* size of header of binary files */
34 | #define LUAC_HEADERSIZE 12
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lvm.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Lua virtual machine
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 | #ifndef lvm_h
8 | #define lvm_h
9 |
10 |
11 | #include "ldo.h"
12 | #include "lobject.h"
13 | #include "ltm.h"
14 |
15 |
16 | #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
17 |
18 | #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \
19 | (((o) = luaV_tonumber(o,n)) != NULL))
20 |
21 | #define equalobj(L,o1,o2) \
22 | (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
23 |
24 |
25 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
26 | LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);
27 | LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
28 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
29 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
30 | StkId val);
31 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
32 | StkId val);
33 | LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);
34 | LUAI_FUNC void luaV_concat (lua_State *L, int total, int last);
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lzio.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** a generic input stream interface
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #include
9 |
10 | #define lzio_c
11 | #define LUA_CORE
12 |
13 | #include "lua.h"
14 |
15 | #include "llimits.h"
16 | #include "lmem.h"
17 | #include "lstate.h"
18 | #include "lzio.h"
19 |
20 |
21 | int luaZ_fill (ZIO *z) {
22 | size_t size;
23 | lua_State *L = z->L;
24 | const char *buff;
25 | lua_unlock(L);
26 | buff = z->reader(L, z->data, &size);
27 | lua_lock(L);
28 | if (buff == NULL || size == 0) return EOZ;
29 | z->n = size - 1;
30 | z->p = buff;
31 | return char2int(*(z->p++));
32 | }
33 |
34 |
35 | int luaZ_lookahead (ZIO *z) {
36 | if (z->n == 0) {
37 | if (luaZ_fill(z) == EOZ)
38 | return EOZ;
39 | else {
40 | z->n++; /* luaZ_fill removed first byte; put back it */
41 | z->p--;
42 | }
43 | }
44 | return char2int(*z->p);
45 | }
46 |
47 |
48 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {
49 | z->L = L;
50 | z->reader = reader;
51 | z->data = data;
52 | z->n = 0;
53 | z->p = NULL;
54 | }
55 |
56 |
57 | /* --------------------------------------------------------------- read --- */
58 | size_t luaZ_read (ZIO *z, void *b, size_t n) {
59 | while (n) {
60 | size_t m;
61 | if (luaZ_lookahead(z) == EOZ)
62 | return n; /* return number of missing bytes */
63 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */
64 | memcpy(b, z->p, m);
65 | z->n -= m;
66 | z->p += m;
67 | b = (char *)b + m;
68 | n -= m;
69 | }
70 | return 0;
71 | }
72 |
73 | /* ------------------------------------------------------------------------ */
74 | char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {
75 | if (n > buff->buffsize) {
76 | if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;
77 | luaZ_resizebuffer(L, buff, n);
78 | }
79 | return buff->buffer;
80 | }
81 |
82 |
83 |
--------------------------------------------------------------------------------
/jni/lua-5.1.4/src/lzio.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
3 | ** Buffered streams
4 | ** See Copyright Notice in lua.h
5 | */
6 |
7 |
8 | #ifndef lzio_h
9 | #define lzio_h
10 |
11 | #include "lua.h"
12 |
13 | #include "lmem.h"
14 |
15 |
16 | #define EOZ (-1) /* end of stream */
17 |
18 | typedef struct Zio ZIO;
19 |
20 | #define char2int(c) cast(int, cast(unsigned char, (c)))
21 |
22 | #define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
23 |
24 | typedef struct Mbuffer {
25 | char *buffer;
26 | size_t n;
27 | size_t buffsize;
28 | } Mbuffer;
29 |
30 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)
31 |
32 | #define luaZ_buffer(buff) ((buff)->buffer)
33 | #define luaZ_sizebuffer(buff) ((buff)->buffsize)
34 | #define luaZ_bufflen(buff) ((buff)->n)
35 |
36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0)
37 |
38 |
39 | #define luaZ_resizebuffer(L, buff, size) \
40 | (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \
41 | (buff)->buffsize = size)
42 |
43 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)
44 |
45 |
46 | LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
48 | void *data);
49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
50 | LUAI_FUNC int luaZ_lookahead (ZIO *z);
51 |
52 |
53 |
54 | /* --------- Private Part ------------------ */
55 |
56 | struct Zio {
57 | size_t n; /* bytes still unread */
58 | const char *p; /* current position in buffer */
59 | lua_Reader reader;
60 | void* data; /* additional data */
61 | lua_State *L; /* Lua state (for reader) */
62 | };
63 |
64 |
65 | LUAI_FUNC int luaZ_fill (ZIO *z);
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/jni/lua_modules/Android.mk:
--------------------------------------------------------------------------------
1 | MODULE_PATH := $(call my-dir)
2 |
3 | include $(call all-subdir-makefiles)
4 |
5 | LOCAL_PATH := $(MODULE_PATH)
6 |
7 | ifeq ("multi","comment")
8 |
9 | endif
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_asset/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # asset module to access Android package assets
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := asset
6 | LOCAL_LDLIBS := -landroid -llog
7 | LOCAL_SRC_FILES := luaasset.cpp
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_asset/luaasset.h:
--------------------------------------------------------------------------------
1 | #ifndef luaasset_h
2 | #define luaasset_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 | #ifdef __cplusplus
14 | #undef LUALIB_API
15 | #define LUALIB_API extern "C"
16 | #endif
17 |
18 | #define LUA_ASSETLIBNAME "asset"
19 |
20 | LUALIB_API int (luaopen_asset) (lua_State *L);
21 | LUALIB_API int (luaL_loadasset) (lua_State *L, const char *filename);
22 |
23 | #define luaL_doasset(L, fn) \
24 | (luaL_loadasset(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_camera/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # native camera module to access Android camera
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := nativecamera
6 | LOCAL_SRC_FILES := luanativecamera.cpp
7 | LOCAL_C_INCLUDES += $(JNI_PATH)/android/include
8 | LOCAL_LDFLAGS += -L$(JNI_PATH)/android/lib/$(TARGET_ARCH_ABI)
9 | LOCAL_LDLIBS := -lcamera_client -lutils -lbinder -llog
10 | LOCAL_SHARED_LIBRARIES := lua-activity
11 | include $(BUILD_SHARED_LIBRARY)
12 |
13 | # JNI camera module to access Android camera
14 | include $(CLEAR_VARS)
15 | LOCAL_MODULE := jnicamera
16 | LOCAL_SRC_FILES := luajnicamera.cpp
17 | LOCAL_C_INCLUDES += $(JNI_PATH)/android/include
18 | LOCAL_LDFLAGS += -L$(JNI_PATH)/android/lib/$(TARGET_ARCH_ABI)
19 | LOCAL_LDLIBS := -lcamera_client -lutils -lbinder -llog
20 | LOCAL_SHARED_LIBRARIES := lua-activity
21 | include $(BUILD_SHARED_LIBRARY)
22 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_egl/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # OpenGL EGL module
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := egl
6 | LOCAL_SRC_FILES := luaegl.cpp
7 | LOCAL_LDLIBS := -landroid -llog -lEGL
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_egl/luaegl.h:
--------------------------------------------------------------------------------
1 | #ifndef __LUAEGL_H__
2 | #define __LUAEGL_H__
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | int luaopen_luaegl(lua_State *L);
9 |
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
14 |
15 | #endif
16 |
17 |
18 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_inputevent/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # inputevent modules to query Android Input Events
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := inputevent
6 | LOCAL_SRC_FILES := luainputevent.cpp
7 | LOCAL_LDLIBS := -landroid -llog
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_inputevent/luainputevent.h:
--------------------------------------------------------------------------------
1 | #ifndef luainputevent_h
2 | #define luainputevent_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 | #ifdef __cplusplus
14 | #undef LUALIB_API
15 | #define LUALIB_API extern "C"
16 | #endif
17 |
18 | LUALIB_API int luaopen_inputevent (lua_State *L);
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_inputevent/luainputevent_oo.h:
--------------------------------------------------------------------------------
1 | #ifndef luainputevent_h
2 | #define luainputevent_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 | #ifdef __cplusplus
14 | #undef LUALIB_API
15 | #define LUALIB_API extern "C"
16 | #endif
17 |
18 | LUALIB_API int luaopen_inputevent (lua_State *L);
19 |
20 | LUALIB_API
21 | void lua_pushinputevent(lua_State *L, const AInputEvent *event);
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_sensor/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # sensor module to access Android sensor (accel, mag, gyr, etc.)
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := sensor
6 | LOCAL_LDLIBS := -landroid -llog
7 | LOCAL_SRC_FILES := luasensor.cpp
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_sensor/luasensor.h:
--------------------------------------------------------------------------------
1 | #ifndef luasensor_h
2 | #define luasensor_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #include "lualib.h"
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
14 | #ifdef __cplusplus
15 | #undef LUALIB_API
16 | #define LUALIB_API extern "C"
17 | #endif
18 |
19 | LUALIB_API int (luaopen_sensor) (lua_State *L);
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_sensor/test_sensor.lua:
--------------------------------------------------------------------------------
1 | sensor = require('sensor')
2 |
3 | if not s then
4 | s = sensor.new();
5 | end
6 |
7 | slist = s:getSensorList();
8 | for i = 1,#slist do
9 | print("Sensor", i);
10 | for k,v in pairs(slist[i]) do
11 | print(string.format(" %s %s",k,tostring(v)));
12 | end
13 | end
14 |
15 | print("Default Accel", s:getDefaultSensor(sensor.TYPE_ACCELEROMETER));
16 |
17 | for i = 1,#slist do
18 | s:enableSensor(i)
19 | end
20 |
21 | print("proximity", s:setEventRate(9, 1000000));
22 |
23 | print("accel", s:setEventRate(5, 250000));
24 | print("gyro", s:setEventRate(4, 250000));
25 | print("magnetic", s:setEventRate(6, 250000));
26 |
27 |
28 | svalue = {};
29 | for i = 1,100 do
30 | unix.usleep(100000);
31 | e = s:getEvents();
32 | if (e) then
33 | print("sensor num events", #e);
34 | for i = 1,#e do
35 | -- print(" event", i);
36 | -- table.foreach(e[i], print);
37 | svalue[e[i].sensor] = {unpack(e[i])};
38 | end
39 | end
40 | end
41 |
42 | for i = 1,#slist do
43 | s:disableSensor(i)
44 | end
45 |
46 | for i = 1,#svalue do
47 | print("svalue", i)
48 | table.foreach(svalue[i], print);
49 | end
--------------------------------------------------------------------------------
/jni/lua_modules/android_toast/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # toast module to show Android toast messages
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := toast
6 | LOCAL_SRC_FILES := luatoast.cpp
7 | LOCAL_LDLIBS := -landroid -llog
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_toast/luatoast.h:
--------------------------------------------------------------------------------
1 | #ifndef luatoast_h
2 | #define luatoast_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 | #ifdef __cplusplus
14 | #undef LUALIB_API
15 | #define LUALIB_API extern "C"
16 | #endif
17 |
18 | LUALIB_API int (luaopen_toast) (lua_State *L);
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_tts/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # TTS module for Android text to speech
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := tts
6 | LOCAL_SRC_FILES := luatts.cpp
7 | LOCAL_LDLIBS := -landroid -llog
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_tts/luatts.h:
--------------------------------------------------------------------------------
1 | #ifndef luatts_h
2 | #define luatts_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 | #ifdef __cplusplus
14 | #undef LUALIB_API
15 | #define LUALIB_API extern "C"
16 | #endif
17 |
18 | LUALIB_API int (luaopen_tts) (lua_State *L);
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_vibrator/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # vibrator module to access Android vibrator
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := vibrator
6 | LOCAL_SRC_FILES := luavibrator.cpp
7 | LOCAL_LDLIBS := -landroid -llog
8 | LOCAL_SHARED_LIBRARIES := lua-activity
9 | include $(BUILD_SHARED_LIBRARY)
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/android_vibrator/luavibrator.h:
--------------------------------------------------------------------------------
1 | #ifndef luavibrator_h
2 | #define luavibrator_h
3 |
4 | #ifdef __cplusplus
5 | extern "C"
6 | {
7 | #endif
8 | #include "lua.h"
9 | #ifdef __cplusplus
10 | }
11 | #endif
12 |
13 | #ifdef __cplusplus
14 | #undef LUALIB_API
15 | #define LUALIB_API extern "C"
16 | #endif
17 |
18 | #define LUA_VIBRATORLIBNAME "vibrator"
19 |
20 | LUALIB_API int (luaopen_vibrator) (lua_State *L);
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/jni/lua_modules/carray:
--------------------------------------------------------------------------------
1 | /Users/ddlee/Lua/Modules/carray
--------------------------------------------------------------------------------
/jni/lua_modules/fontlib:
--------------------------------------------------------------------------------
1 | /Users/ddlee/Lua/Modules/fontlib
--------------------------------------------------------------------------------
/jni/lua_modules/lanes/ABOUT:
--------------------------------------------------------------------------------
1 |
2 | Lua Lanes
3 | ---------
4 |
5 | Lanes is a lightweight, native, lazy evaluating multithreading library for
6 | Lua 5.1. It allows efficient use of multicore processors in Lua, by passing
7 | function calls into separate OS threads, and separate Lua states.
8 |
9 | No locking of the threads is needed, only launching and waiting for (with an
10 | optional timeout) a thread to get ready. Efficient communications between the
11 | running threads are possible either using message passing or shared state
12 | models. Values passed can be anything but coroutines (see detailed limitations
13 | in the manual).
14 |
15 | Lua Lanes has been optimized for performance, and provides around 50-60%
16 | speed increase when running heavily threaded applications on dual core
17 | processors (compared to running a non-threaded plain Lua implementation).
18 |
--------------------------------------------------------------------------------
/jni/lua_modules/lanes/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # lua lanes core module
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := lua51-lanes
6 | LOCAL_SRC_FILES := \
7 | lanes.c \
8 | threading.c \
9 | tools.c \
10 | keeper.c \
11 | pthread_hack.c
12 | LOCAL_SHARED_LIBRARIES := lua-activity
13 | include $(BUILD_SHARED_LIBRARY)
14 |
--------------------------------------------------------------------------------
/jni/lua_modules/lanes/COPYRIGHT:
--------------------------------------------------------------------------------
1 |
2 | Lua Lanes is licensed under the same MIT license as the Lua 5.1 source code,
3 | reproduced below.
4 |
5 | For details and rationale, see http://www.lua.org/license.html
6 |
7 | ===============================================================================
8 |
9 | Copyright (C) 2007-11 Asko Kauppi,
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in
19 | all copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | THE SOFTWARE.
28 |
29 | ===============================================================================
30 |
31 | (end of COPYRIGHT)
32 |
--------------------------------------------------------------------------------
/jni/lua_modules/lanes/keeper.h:
--------------------------------------------------------------------------------
1 | #if !defined( __keeper_h__)
2 | #define __keeper_h__ 1
3 |
4 | struct s_Keeper
5 | {
6 | MUTEX_T lock_;
7 | lua_State *L;
8 | //int count;
9 | };
10 |
11 | const char *init_keepers( int const _nbKeepers);
12 | struct s_Keeper *keeper_acquire( const void *ptr);
13 | void keeper_release( struct s_Keeper *K);
14 | void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel);
15 | int keeper_call( lua_State *K, char const *func_name, lua_State *L, void *linda, uint_t starting_index);
16 | void close_keepers(void);
17 |
18 |
19 | #endif // __keeper_h__
--------------------------------------------------------------------------------
/jni/lua_modules/lanes/pthread_hack.c:
--------------------------------------------------------------------------------
1 | // pthread functions not present in Android bionic:
2 | #ifdef __ANDROID__
3 |
4 | #include
5 |
6 | int pthread_cancel(pthread_t thread) { }
7 | int pthread_yield() { }
8 |
9 | #endif
10 |
--------------------------------------------------------------------------------
/jni/lua_modules/opengl:
--------------------------------------------------------------------------------
1 | /Users/ddlee/Lua/Modules/opengl
--------------------------------------------------------------------------------
/jni/lua_modules/socket/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | # Need to build as libsocket_core.so
4 | # since Android libs directory cannot have subdirectories
5 | # and because all-in-one loader loads before Android asset loader
6 | include $(CLEAR_VARS)
7 | LOCAL_MODULE := socket_core
8 | LOCAL_SRC_FILES := \
9 | luasocket.c \
10 | timeout.c \
11 | buffer.c \
12 | io.c \
13 | auxiliar.c \
14 | options.c \
15 | inet.c \
16 | tcp.c \
17 | udp.c \
18 | except.c \
19 | select.c \
20 | usocket.c
21 | LOCAL_SHARED_LIBRARIES := lua-activity
22 | include $(BUILD_SHARED_LIBRARY)
23 |
24 | # lua socket mime.core module (all-in-one loader should open libmime.so)
25 | include $(CLEAR_VARS)
26 | LOCAL_MODULE := mime_core
27 | LOCAL_SRC_FILES := mime.c
28 | LOCAL_SHARED_LIBRARIES := lua-activity
29 | include $(BUILD_SHARED_LIBRARY)
30 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/LICENSE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/jni/lua_modules/socket/LICENSE
--------------------------------------------------------------------------------
/jni/lua_modules/socket/README:
--------------------------------------------------------------------------------
1 | This is the LuaSocket 2.0.1. It has been tested on WinXP, Mac OS X,
2 | and Linux. Please use the Lua mailing list to report any bugs
3 | (or "features") you encounter.
4 |
5 | Have fun,
6 | Diego Nehab.
7 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/buffer.h:
--------------------------------------------------------------------------------
1 | #ifndef BUF_H
2 | #define BUF_H
3 | /*=========================================================================*\
4 | * Input/Output interface for Lua programs
5 | * LuaSocket toolkit
6 | *
7 | * Line patterns require buffering. Reading one character at a time involves
8 | * too many system calls and is very slow. This module implements the
9 | * LuaSocket interface for input/output on connected objects, as seen by
10 | * Lua programs.
11 | *
12 | * Input is buffered. Output is *not* buffered because there was no simple
13 | * way of making sure the buffered output data would ever be sent.
14 | *
15 | * The module is built on top of the I/O abstraction defined in io.h and the
16 | * timeout management is done with the timeout.h interface.
17 | *
18 | * RCS ID: $Id: buffer.h,v 1.12 2005/10/07 04:40:59 diego Exp $
19 | \*=========================================================================*/
20 | #include "lua.h"
21 |
22 | #include "io.h"
23 | #include "timeout.h"
24 |
25 | /* buffer size in bytes */
26 | #define BUF_SIZE 8192
27 |
28 | /* buffer control structure */
29 | typedef struct t_buffer_ {
30 | double birthday; /* throttle support info: creation time, */
31 | size_t sent, received; /* bytes sent, and bytes received */
32 | p_io io; /* IO driver used for this buffer */
33 | p_timeout tm; /* timeout management for this buffer */
34 | size_t first, last; /* index of first and last bytes of stored data */
35 | char data[BUF_SIZE]; /* storage space for buffer data */
36 | } t_buffer;
37 | typedef t_buffer *p_buffer;
38 |
39 | int buffer_open(lua_State *L);
40 | void buffer_init(p_buffer buf, p_io io, p_timeout tm);
41 | int buffer_meth_send(lua_State *L, p_buffer buf);
42 | int buffer_meth_receive(lua_State *L, p_buffer buf);
43 | int buffer_meth_getstats(lua_State *L, p_buffer buf);
44 | int buffer_meth_setstats(lua_State *L, p_buffer buf);
45 | int buffer_isempty(p_buffer buf);
46 |
47 | #endif /* BUF_H */
48 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/except.h:
--------------------------------------------------------------------------------
1 | #ifndef EXCEPT_H
2 | #define EXCEPT_H
3 | /*=========================================================================*\
4 | * Exception control
5 | * LuaSocket toolkit (but completely independent from other modules)
6 | *
7 | * This provides support for simple exceptions in Lua. During the
8 | * development of the HTTP/FTP/SMTP support, it became aparent that
9 | * error checking was taking a substantial amount of the coding. These
10 | * function greatly simplify the task of checking errors.
11 | *
12 | * The main idea is that functions should return nil as its first return
13 | * value when it finds an error, and return an error message (or value)
14 | * following nil. In case of success, as long as the first value is not nil,
15 | * the other values don't matter.
16 | *
17 | * The idea is to nest function calls with the "try" function. This function
18 | * checks the first value, and calls "error" on the second if the first is
19 | * nil. Otherwise, it returns all values it received.
20 | *
21 | * The protect function returns a new function that behaves exactly like the
22 | * function it receives, but the new function doesn't throw exceptions: it
23 | * returns nil followed by the error message instead.
24 | *
25 | * With these two function, it's easy to write functions that throw
26 | * exceptions on error, but that don't interrupt the user script.
27 | *
28 | * RCS ID: $Id: except.h,v 1.2 2005/09/29 06:11:41 diego Exp $
29 | \*=========================================================================*/
30 |
31 | #include "lua.h"
32 |
33 | int except_open(lua_State *L);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/inet.h:
--------------------------------------------------------------------------------
1 | #ifndef INET_H
2 | #define INET_H
3 | /*=========================================================================*\
4 | * Internet domain functions
5 | * LuaSocket toolkit
6 | *
7 | * This module implements the creation and connection of internet domain
8 | * sockets, on top of the socket.h interface, and the interface of with the
9 | * resolver.
10 | *
11 | * The function inet_aton is provided for the platforms where it is not
12 | * available. The module also implements the interface of the internet
13 | * getpeername and getsockname functions as seen by Lua programs.
14 | *
15 | * The Lua functions toip and tohostname are also implemented here.
16 | *
17 | * RCS ID: $Id: inet.h,v 1.16 2005/10/07 04:40:59 diego Exp $
18 | \*=========================================================================*/
19 | #include "lua.h"
20 | #include "socket.h"
21 | #include "timeout.h"
22 |
23 | #ifdef _WIN32
24 | #define INET_ATON
25 | #endif
26 |
27 | int inet_open(lua_State *L);
28 |
29 | const char *inet_trycreate(p_socket ps, int type);
30 | const char *inet_tryconnect(p_socket ps, const char *address,
31 | unsigned short port, p_timeout tm);
32 | const char *inet_trybind(p_socket ps, const char *address,
33 | unsigned short port);
34 |
35 | int inet_meth_getpeername(lua_State *L, p_socket ps);
36 | int inet_meth_getsockname(lua_State *L, p_socket ps);
37 |
38 | #ifdef INET_ATON
39 | int inet_aton(const char *cp, struct in_addr *inp);
40 | #endif
41 |
42 | #endif /* INET_H */
43 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/io.c:
--------------------------------------------------------------------------------
1 | /*=========================================================================*\
2 | * Input/Output abstraction
3 | * LuaSocket toolkit
4 | *
5 | * RCS ID: $Id: io.c,v 1.6 2005/09/29 06:11:41 diego Exp $
6 | \*=========================================================================*/
7 | #include "io.h"
8 |
9 | /*=========================================================================*\
10 | * Exported functions
11 | \*=========================================================================*/
12 | /*-------------------------------------------------------------------------*\
13 | * Initializes C structure
14 | \*-------------------------------------------------------------------------*/
15 | void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx) {
16 | io->send = send;
17 | io->recv = recv;
18 | io->error = error;
19 | io->ctx = ctx;
20 | }
21 |
22 | /*-------------------------------------------------------------------------*\
23 | * I/O error strings
24 | \*-------------------------------------------------------------------------*/
25 | const char *io_strerror(int err) {
26 | switch (err) {
27 | case IO_DONE: return NULL;
28 | case IO_CLOSED: return "closed";
29 | case IO_TIMEOUT: return "timeout";
30 | default: return "unknown error";
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/luasocket.h:
--------------------------------------------------------------------------------
1 | #ifndef LUASOCKET_H
2 | #define LUASOCKET_H
3 | /*=========================================================================*\
4 | * LuaSocket toolkit
5 | * Networking support for the Lua language
6 | * Diego Nehab
7 | * 9/11/1999
8 | *
9 | * RCS ID: $Id: luasocket.h,v 1.25 2007/06/11 23:44:54 diego Exp $
10 | \*=========================================================================*/
11 | #include "lua.h"
12 |
13 | /*-------------------------------------------------------------------------*\
14 | * Current socket library version
15 | \*-------------------------------------------------------------------------*/
16 | #define LUASOCKET_VERSION "LuaSocket 2.0.2"
17 | #define LUASOCKET_COPYRIGHT "Copyright (C) 2004-2007 Diego Nehab"
18 | #define LUASOCKET_AUTHORS "Diego Nehab"
19 |
20 | /*-------------------------------------------------------------------------*\
21 | * This macro prefixes all exported API functions
22 | \*-------------------------------------------------------------------------*/
23 | #ifndef LUASOCKET_API
24 | #define LUASOCKET_API extern
25 | #endif
26 |
27 | /*-------------------------------------------------------------------------*\
28 | * Initializes the library.
29 | \*-------------------------------------------------------------------------*/
30 | LUASOCKET_API int luaopen_socket_core(lua_State *L);
31 |
32 | #endif /* LUASOCKET_H */
33 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/makefile:
--------------------------------------------------------------------------------
1 | #------
2 | # Load configuration
3 | #
4 | include ../config
5 |
6 | #------
7 | # Hopefully no need to change anything below this line
8 | #
9 |
10 | #------
11 | # Modules belonging to socket-core
12 | #
13 |
14 | #$(COMPAT)/compat-5.1.o \
15 |
16 | SOCKET_OBJS:= \
17 | luasocket.o \
18 | timeout.o \
19 | buffer.o \
20 | io.o \
21 | auxiliar.o \
22 | options.o \
23 | inet.o \
24 | tcp.o \
25 | udp.o \
26 | except.o \
27 | select.o \
28 | usocket.o
29 |
30 | #------
31 | # Modules belonging mime-core
32 | #
33 | #$(COMPAT)/compat-5.1.o \
34 |
35 | MIME_OBJS:=\
36 | mime.o
37 |
38 | #------
39 | # Modules belonging unix (local domain sockets)
40 | #
41 | UNIX_OBJS:=\
42 | buffer.o \
43 | auxiliar.o \
44 | options.o \
45 | timeout.o \
46 | io.o \
47 | usocket.o \
48 | unix.o
49 |
50 | all: $(SOCKET_SO) $(MIME_SO)
51 |
52 | $(SOCKET_SO): $(SOCKET_OBJS)
53 | $(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS)
54 |
55 | $(MIME_SO): $(MIME_OBJS)
56 | $(LD) $(LDFLAGS) -o $@ $(MIME_OBJS)
57 |
58 | $(UNIX_SO): $(UNIX_OBJS)
59 | $(LD) $(LDFLAGS) -o $@ $(UNIX_OBJS)
60 |
61 | #------
62 | # List of dependencies
63 | #
64 | auxiliar.o: auxiliar.c auxiliar.h
65 | buffer.o: buffer.c buffer.h io.h timeout.h
66 | except.o: except.c except.h
67 | inet.o: inet.c inet.h socket.h io.h timeout.h usocket.h
68 | io.o: io.c io.h timeout.h
69 | luasocket.o: luasocket.c luasocket.h auxiliar.h except.h timeout.h \
70 | buffer.h io.h inet.h socket.h usocket.h tcp.h udp.h select.h
71 | mime.o: mime.c mime.h
72 | options.o: options.c auxiliar.h options.h socket.h io.h timeout.h \
73 | usocket.h inet.h
74 | select.o: select.c socket.h io.h timeout.h usocket.h select.h
75 | tcp.o: tcp.c auxiliar.h socket.h io.h timeout.h usocket.h inet.h \
76 | options.h tcp.h buffer.h
77 | timeout.o: timeout.c auxiliar.h timeout.h
78 | udp.o: udp.c auxiliar.h socket.h io.h timeout.h usocket.h inet.h \
79 | options.h udp.h
80 | unix.o: unix.c auxiliar.h socket.h io.h timeout.h usocket.h options.h \
81 | unix.h buffer.h
82 | usocket.o: usocket.c socket.h io.h timeout.h usocket.h
83 |
84 | clean:
85 | rm -f $(SOCKET_SO) $(SOCKET_OBJS)
86 | rm -f $(MIME_SO) $(UNIX_SO) $(MIME_OBJS) $(UNIX_OBJS)
87 |
88 | #------
89 | # End of makefile configuration
90 | #
91 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/mime.h:
--------------------------------------------------------------------------------
1 | #ifndef MIME_H
2 | #define MIME_H
3 | /*=========================================================================*\
4 | * Core MIME support
5 | * LuaSocket toolkit
6 | *
7 | * This module provides functions to implement transfer content encodings
8 | * and formatting conforming to RFC 2045. It is used by mime.lua, which
9 | * provide a higher level interface to this functionality.
10 | *
11 | * RCS ID: $Id: mime.h,v 1.15 2007/06/11 23:44:54 diego Exp $
12 | \*=========================================================================*/
13 | #include "lua.h"
14 |
15 | /*-------------------------------------------------------------------------*\
16 | * Current MIME library version
17 | \*-------------------------------------------------------------------------*/
18 | #define MIME_VERSION "MIME 1.0.2"
19 | #define MIME_COPYRIGHT "Copyright (C) 2004-2007 Diego Nehab"
20 | #define MIME_AUTHORS "Diego Nehab"
21 |
22 | /*-------------------------------------------------------------------------*\
23 | * This macro prefixes all exported API functions
24 | \*-------------------------------------------------------------------------*/
25 | #ifndef MIME_API
26 | #define MIME_API extern
27 | #endif
28 |
29 | MIME_API int luaopen_mime_core(lua_State *L);
30 |
31 | #endif /* MIME_H */
32 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/options.h:
--------------------------------------------------------------------------------
1 | #ifndef OPTIONS_H
2 | #define OPTIONS_H
3 | /*=========================================================================*\
4 | * Common option interface
5 | * LuaSocket toolkit
6 | *
7 | * This module provides a common interface to socket options, used mainly by
8 | * modules UDP and TCP.
9 | *
10 | * RCS ID: $Id: options.h,v 1.4 2005/10/07 04:40:59 diego Exp $
11 | \*=========================================================================*/
12 |
13 | #include "lua.h"
14 | #include "socket.h"
15 |
16 | /* option registry */
17 | typedef struct t_opt {
18 | const char *name;
19 | int (*func)(lua_State *L, p_socket ps);
20 | } t_opt;
21 | typedef t_opt *p_opt;
22 |
23 | /* supported options */
24 | int opt_dontroute(lua_State *L, p_socket ps);
25 | int opt_broadcast(lua_State *L, p_socket ps);
26 | int opt_reuseaddr(lua_State *L, p_socket ps);
27 | int opt_tcp_nodelay(lua_State *L, p_socket ps);
28 | int opt_keepalive(lua_State *L, p_socket ps);
29 | int opt_linger(lua_State *L, p_socket ps);
30 | int opt_reuseaddr(lua_State *L, p_socket ps);
31 | int opt_ip_multicast_ttl(lua_State *L, p_socket ps);
32 | int opt_ip_multicast_loop(lua_State *L, p_socket ps);
33 | int opt_ip_add_membership(lua_State *L, p_socket ps);
34 | int opt_ip_drop_membersip(lua_State *L, p_socket ps);
35 |
36 | /* invokes the appropriate option handler */
37 | int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps);
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/select.h:
--------------------------------------------------------------------------------
1 | #ifndef SELECT_H
2 | #define SELECT_H
3 | /*=========================================================================*\
4 | * Select implementation
5 | * LuaSocket toolkit
6 | *
7 | * Each object that can be passed to the select function has to export
8 | * method getfd() which returns the descriptor to be passed to the
9 | * underlying select function. Another method, dirty(), should return
10 | * true if there is data ready for reading (required for buffered input).
11 | *
12 | * RCS ID: $Id: select.h,v 1.7 2004/06/16 01:02:07 diego Exp $
13 | \*=========================================================================*/
14 |
15 | int select_open(lua_State *L);
16 |
17 | #endif /* SELECT_H */
18 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/tcp.h:
--------------------------------------------------------------------------------
1 | #ifndef TCP_H
2 | #define TCP_H
3 | /*=========================================================================*\
4 | * TCP object
5 | * LuaSocket toolkit
6 | *
7 | * The tcp.h module is basicly a glue that puts together modules buffer.h,
8 | * timeout.h socket.h and inet.h to provide the LuaSocket TCP (AF_INET,
9 | * SOCK_STREAM) support.
10 | *
11 | * Three classes are defined: master, client and server. The master class is
12 | * a newly created tcp object, that has not been bound or connected. Server
13 | * objects are tcp objects bound to some local address. Client objects are
14 | * tcp objects either connected to some address or returned by the accept
15 | * method of a server object.
16 | *
17 | * RCS ID: $Id: tcp.h,v 1.7 2005/10/07 04:40:59 diego Exp $
18 | \*=========================================================================*/
19 | #include "lua.h"
20 |
21 | #include "buffer.h"
22 | #include "timeout.h"
23 | #include "socket.h"
24 |
25 | typedef struct t_tcp_ {
26 | t_socket sock;
27 | t_io io;
28 | t_buffer buf;
29 | t_timeout tm;
30 | } t_tcp;
31 |
32 | typedef t_tcp *p_tcp;
33 |
34 | int tcp_open(lua_State *L);
35 |
36 | #endif /* TCP_H */
37 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/timeout.h:
--------------------------------------------------------------------------------
1 | #ifndef TIMEOUT_H
2 | #define TIMEOUT_H
3 | /*=========================================================================*\
4 | * Timeout management functions
5 | * LuaSocket toolkit
6 | *
7 | * RCS ID: $Id: timeout.h,v 1.14 2005/10/07 04:40:59 diego Exp $
8 | \*=========================================================================*/
9 | #include "lua.h"
10 |
11 | /* timeout control structure */
12 | typedef struct t_timeout_ {
13 | double block; /* maximum time for blocking calls */
14 | double total; /* total number of miliseconds for operation */
15 | double start; /* time of start of operation */
16 | } t_timeout;
17 | typedef t_timeout *p_timeout;
18 |
19 | int timeout_open(lua_State *L);
20 | void timeout_init(p_timeout tm, double block, double total);
21 | double timeout_get(p_timeout tm);
22 | double timeout_getretry(p_timeout tm);
23 | p_timeout timeout_markstart(p_timeout tm);
24 | double timeout_getstart(p_timeout tm);
25 | double timeout_gettime(void);
26 | int timeout_meth_settimeout(lua_State *L, p_timeout tm);
27 |
28 | #define timeout_iszero(tm) ((tm)->block == 0.0)
29 |
30 | #endif /* TIMEOUT_H */
31 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/udp.h:
--------------------------------------------------------------------------------
1 | #ifndef UDP_H
2 | #define UDP_H
3 | /*=========================================================================*\
4 | * UDP object
5 | * LuaSocket toolkit
6 | *
7 | * The udp.h module provides LuaSocket with support for UDP protocol
8 | * (AF_INET, SOCK_DGRAM).
9 | *
10 | * Two classes are defined: connected and unconnected. UDP objects are
11 | * originally unconnected. They can be "connected" to a given address
12 | * with a call to the setpeername function. The same function can be used to
13 | * break the connection.
14 | *
15 | * RCS ID: $Id: udp.h,v 1.10 2005/10/07 04:40:59 diego Exp $
16 | \*=========================================================================*/
17 | #include "lua.h"
18 |
19 | #include "timeout.h"
20 | #include "socket.h"
21 |
22 | /* can't be larger than wsocket.c MAXCHUNK!!! */
23 | #define UDP_DATAGRAMSIZE 8192
24 |
25 | typedef struct t_udp_ {
26 | t_socket sock;
27 | t_timeout tm;
28 | } t_udp;
29 | typedef t_udp *p_udp;
30 |
31 | int udp_open(lua_State *L);
32 |
33 | #endif /* UDP_H */
34 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/unix.h:
--------------------------------------------------------------------------------
1 | #ifndef UNIX_H
2 | #define UNIX_H
3 | /*=========================================================================*\
4 | * Unix domain object
5 | * LuaSocket toolkit
6 | *
7 | * This module is just an example of how to extend LuaSocket with a new
8 | * domain.
9 | *
10 | * RCS ID: $Id: unix.h,v 1.9 2006/03/13 07:16:39 diego Exp $
11 | \*=========================================================================*/
12 | #include "lua.h"
13 |
14 | #include "buffer.h"
15 | #include "timeout.h"
16 | #include "socket.h"
17 |
18 | typedef struct t_unix_ {
19 | t_socket sock;
20 | t_io io;
21 | t_buffer buf;
22 | t_timeout tm;
23 | } t_unix;
24 | typedef t_unix *p_unix;
25 |
26 | int luaopen_socket_unix(lua_State *L);
27 |
28 | #endif /* UNIX_H */
29 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/usocket.h:
--------------------------------------------------------------------------------
1 | #ifndef USOCKET_H
2 | #define USOCKET_H
3 | /*=========================================================================*\
4 | * Socket compatibilization module for Unix
5 | * LuaSocket toolkit
6 | *
7 | * RCS ID: $Id: usocket.h,v 1.7 2005/10/07 04:40:59 diego Exp $
8 | \*=========================================================================*/
9 |
10 | /*=========================================================================*\
11 | * BSD include files
12 | \*=========================================================================*/
13 | /* error codes */
14 | #include
15 | /* close function */
16 | #include
17 | /* fnctnl function and associated constants */
18 | #include
19 | /* struct sockaddr */
20 | #include
21 | /* socket function */
22 | #include
23 | /* struct timeval */
24 | #include
25 | /* gethostbyname and gethostbyaddr functions */
26 | #include
27 | /* sigpipe handling */
28 | #include
29 | /* IP stuff*/
30 | #include
31 | #include
32 | /* TCP options (nagle algorithm disable) */
33 | #include
34 |
35 | typedef int t_socket;
36 | typedef t_socket *p_socket;
37 |
38 | #define SOCKET_INVALID (-1)
39 |
40 | #endif /* USOCKET_H */
41 |
--------------------------------------------------------------------------------
/jni/lua_modules/socket/wsocket.h:
--------------------------------------------------------------------------------
1 | #ifndef WSOCKET_H
2 | #define WSOCKET_H
3 | /*=========================================================================*\
4 | * Socket compatibilization module for Win32
5 | * LuaSocket toolkit
6 | *
7 | * RCS ID: $Id: wsocket.h,v 1.4 2005/10/07 04:40:59 diego Exp $
8 | \*=========================================================================*/
9 |
10 | /*=========================================================================*\
11 | * WinSock include files
12 | \*=========================================================================*/
13 | #include
14 |
15 | typedef int socklen_t;
16 | typedef SOCKET t_socket;
17 | typedef t_socket *p_socket;
18 |
19 | #define SOCKET_INVALID (INVALID_SOCKET)
20 |
21 | #endif /* WSOCKET_H */
22 |
--------------------------------------------------------------------------------
/jni/lua_modules/unix:
--------------------------------------------------------------------------------
1 | /Users/ddlee/Lua/Modules/unix
--------------------------------------------------------------------------------
/jni/test/graphics.h:
--------------------------------------------------------------------------------
1 | extern "C"
2 | int init_display(ANativeWindow *window);
3 |
4 | extern "C"
5 | void draw_frame();
6 |
7 | extern "C"
8 | void term_display();
9 |
--------------------------------------------------------------------------------
/jni/test/inputs.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 |
6 | #include
7 | #include
8 |
9 | #include "activity.h"
10 |
11 | /*
12 | static void process_input(struct engine *engine) {
13 | if (engine->queue == NULL) return;
14 |
15 | while (AInputQueue_hasEvents(engine->queue) > 0) {
16 | AInputEvent* event = NULL;
17 | if (AInputQueue_getEvent(engine->queue, &event) >= 0) {
18 | LOGI("New input event: type=%d", AInputEvent_getType(event));
19 | if (AInputQueue_preDispatchEvent(engine->queue, event)) {
20 | return;
21 | }
22 | else {
23 | int32_t handled = 1;
24 | AInputQueue_finishEvent(engine->queue, event, handled);
25 | }
26 | }
27 | else {
28 | LOGI("Failure reading input event");
29 | }
30 |
31 | }
32 | }
33 | */
34 |
35 | static void* input_thread_entry(void* param) {
36 | struct engine *engine = (struct engine *)param;
37 |
38 | lua_State *Lthread = lua_newthread(engine->L);
39 |
40 | luaL_dostring(Lthread, "n = 0");
41 | while (1) {
42 | usleep(10000);
43 | luaL_dostring(Lthread, "n = n+1");
44 |
45 | /*
46 | // Kills UI thread
47 | sprintf(cmd,"toast.show(\"event %d\")",n);
48 | write(engine->msgwrite, cmd, strlen(cmd));
49 | */
50 | }
51 |
52 | return NULL;
53 | }
54 |
55 |
56 | extern "C"
57 | int input_thread_start(void* param) {
58 | struct engine *engine = (struct engine *)param;
59 |
60 | /*
61 | pthread_mutex_init(&engine->mutex, NULL);
62 | pthread_cond_init(&engine->cond, NULL);
63 | */
64 |
65 | pthread_attr_t attr;
66 | pthread_attr_init(&attr);
67 | pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
68 | pthread_create(&engine->thread, &attr, input_thread_entry, engine);
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ddlee/AndroidLuaActivity/5c6918e281dec67761075430d80b6801d2189080/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | LuaActivity
4 |
5 |
--------------------------------------------------------------------------------