mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-04 16:35:15 -05:00
Merge branch 'master' of ssh://villavu.com:54367/simba
This commit is contained in:
commit
a0ba655c1d
@ -23,12 +23,12 @@ begin
|
||||
C:=TCLient.Create('');
|
||||
end;
|
||||
|
||||
function getmousepos: tpoint;
|
||||
function getmousepos: tpoint; cdecl;
|
||||
begin
|
||||
C.IOManager.GetMousePos(result.x,result.y);
|
||||
end;
|
||||
|
||||
function returnpoints: PTPoint;
|
||||
function returnpoints: PTPoint; cdecl;
|
||||
|
||||
begin
|
||||
result := AllocMem(sizeof(TPoint) * 2);
|
||||
@ -38,19 +38,19 @@ begin
|
||||
result[1].y := 30;
|
||||
end;
|
||||
|
||||
function printpoints(b: PTPoint; len: integer): boolean;
|
||||
function printpoints(b: PTPoint; len: integer): boolean; cdecl;
|
||||
var i:integer;
|
||||
begin
|
||||
for i := 0 to len - 1 do
|
||||
writeln('X, Y: (' + inttostr(b[i].x) + ', ' + inttostr(b[i].y) + ')');
|
||||
end;
|
||||
|
||||
procedure hoi(var i: integer);
|
||||
procedure hoi(var i: integer); cdecl;
|
||||
begin
|
||||
i := i + 1;
|
||||
end;
|
||||
|
||||
function givedtm:PPDTM;
|
||||
function givedtm:PPDTM; cdecl;
|
||||
var
|
||||
dtm: PPDTM;
|
||||
begin
|
||||
|
@ -1,6 +1,11 @@
|
||||
#!/usr/bin/env python
|
||||
from ctypes import *
|
||||
import platform
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
dll = CDLL('./libmml.dll')
|
||||
print 'On Windows'
|
||||
else:
|
||||
dll = CDLL('./libmml.so')
|
||||
dll.test.restype = c_char_p
|
||||
a = dll.test()
|
||||
@ -14,6 +19,7 @@ class POINT(Structure):
|
||||
('y', c_int)]
|
||||
|
||||
dll.getmousepos.restype = POINT
|
||||
dll.getmousepos.argtypes = None
|
||||
b = dll.getmousepos()
|
||||
|
||||
print b.x, b.y
|
||||
@ -30,8 +36,8 @@ dll.printpoints.argtypes = [PPOINT, c_int]
|
||||
|
||||
d = dll.printpoints(c, 2)
|
||||
|
||||
dll.hoi.restype = None
|
||||
dll.hoi.argtypes = [POINTER(c_int)]
|
||||
#dll.hoi.restype = None
|
||||
#dll.hoi.argtypes = [POINTER(c_int)]
|
||||
|
||||
e = c_int(5)
|
||||
dll.hoi(byref(e))
|
||||
|
Loading…
Reference in New Issue
Block a user