1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 01:02:17 -05:00

Few small changes.

This commit is contained in:
Merlijn Wajer 2010-04-15 00:13:31 +02:00
parent fc8a181cec
commit e68dab9280
3 changed files with 19 additions and 1 deletions

View File

@ -10,6 +10,10 @@ class MMLCoreException(Exception):
Exception.__init__(self, err)
class MMLCore(object):
'''
The MMLCore object is to be opened only once per Python instance.
It opens the libmml library, and calls init().
'''
def __init__(self, dllpath):
self.dll = CDLL(dllpath)

View File

@ -8,6 +8,15 @@ class MouseException(Exception):
# Usage:
class Mouse(object):
'''
The MML Mouse object communicates directly with libmml,
but wraps it around a nice and easy to use layer.
It will allow several ways to set mouse positions and
buttons. __getitem__ and __setitem__ are also implemented,
so one can access mouse buttons states and positions with [].
'''
# _mc = MMLCore reference.
_mc = None
Left ='Left'
@ -19,7 +28,8 @@ class Mouse(object):
_lpp = (0, 0)
def __init__(self, MC):
'''Initialize the Mouse object'''
''' Initialize the Mouse object. Needs a DLL Mufasa Core object
(which contains the dll reference.)'''
self._mc = MC
self._initialiseDLLFuncs()
pass

View File

@ -1,6 +1,10 @@
from ctypes import *
class POINT(Structure):
'''
POINT represents a point with two variables, x and y.
POINT is mainly used for Python <-> MML communication.
'''
_fields_ = [('x', c_int),
('y', c_int)]