1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-24 10:12:20 -05:00

Documentation.

This commit is contained in:
Merlijn Wajer 2010-06-27 12:07:39 +02:00
parent 2eb1879c83
commit a30358226d
7 changed files with 158 additions and 18 deletions

View File

@ -13,7 +13,6 @@ Installing simba
Installing Simba is pretty straighforward and will only take a couple of
minutes.
.. _simba-installer:
Simba installer
@ -27,10 +26,16 @@ Once it is done downloading, simply run the installer and follow the steps.
.. note::
Simba will install to C:/ by default; if you want to install it
somewhere else, make sure you select a different location!
If you are running Windows Vista or Windows 7, then you will probably want
to install it to C:/ or another place; as long as writing in the actual
directory does not require administrator permissions. C:/ is a safe bet.
You can install Simba to your ``Program Files`` directory, but you will have
to run Simba as administrator in that case.
Simba will probably tell you there is an update available. In this case, an
update button will appear. Alternatively you can update Simba using
Tools -> Update.
update button will appear. Click it and the Simba Updater will show up.
Alternatively you can update Simba using Tools -> Update.
.. note::
Updating Simba regularly is recommended.
@ -43,12 +48,11 @@ This is harder and not recommended. Steps on how to do this will follow later.
For now, simply stick to the installer and update Simba after the install has
completed.
Setting up SRL 4 with Simba
---------------------------
If you were using the :ref:`simba-installer` then you can simply enable the
``SRL Updater`` extension. (Go to View -> Extensions and enable srl.sex)
``SRL Updater`` extension. (Go to View -> Extensions and enable ``srl.sex``)
This is the only supported way. You can simply do a svn checkout on the srl
repository, but if you can do that, then you should be able to set up SRL

View File

@ -8,13 +8,15 @@ Documentation TODO
* *Wizzup* - Script manager (technical).
* Extend "Getting Started". Include downloading scripts from the manager.
* think of good chapters for the complete tutorial. (it should teach basic
stuff, not document all features. script reference is for that
stuff, not document all features. script reference is for that purpose)
* write a lot more chapters for simba references. There's plenty to document.
* write working with files for scriptreference (or any other chapter)
It may be useful to check http://wizzup.org/simba/article/4
* Features -> Perhaps (interactive) images?
* Expand "Troubleshooting"
- And its subsection.
* Expand "Feature Overview"
- And its subs. There's like nothing in them, those are the type
of pages I was talking about. Combine them under feature overview?
* Expand "Troubleshooting"
- And its subsection.
* Expand "Feature Overview"
- And its subs. There's like nothing in them, those are the type
of pages I was talking about. Combine them under feature overview?

View File

@ -22,8 +22,8 @@ Simba can:
* Read and write files.
* Connect to the internet to read websites and post data to them.
* Run pascal programs for you. If you're a bit creative you can have a lot
of fun stuff with Simba, you can even make a game in it.
of fun stuff with Simba, you could even make a game in it!
and much, much more. Start now by :ref:`installingsimba`.
and more. Start now by :ref:`installingsimba`.
If you want to know more about Simba, see :ref:`whysimba`

View File

@ -78,6 +78,15 @@ Open Minded
Open minded. We appreciate your help, ideas and critisism!
Debug Friendly
~~~~~~~~~~~~~~
Simba aims to be debug friendly. It will show you where your errors are during
complation, and when you are running scripts Simba will point out where you are
passing invalid arguments. The action Simba takes when this happens is
configurable. (It can issue a warning and continue, or simply terminate
the script)
Well Documented
~~~~~~~~~~~~~~~

81
Projects/MMLLib/array.py Executable file
View File

@ -0,0 +1,81 @@
#!/usr/bin/env python
from ctypes import *
import platform
if platform.system() == 'Windows':
dll = CDLL('./libmml.dll')
else:
dll = CDLL('./libmml.so')
class PascalArray(object):
def __init__(self, pastype, ptr):
self._type = pastype
self._p = ptr
def __del__(self):
print 'Freeing now: %i' % self._p
dll.freearr(self._p)
print 'Freed'
def __len__(self):
return cast(self._p, POINTER(c_ulong))[-1] + 1
def __getitem__(self, pos):
if pos > len(self):
print 'Out of range'
return None
return cast(self._p, POINTER(self._type))[pos]
def __setitem__(self, pos, item):
if pos > len(self):
print 'Out of range'
return
if sizeof(item) != sizeof(self._type):
print 'Incorrect structure'
return
cast(self._p, POINTER(self._type))[pos] = item
class POINT(Structure):
_fields_ = [('x', c_int),
('y', c_int)]
PPOINT = POINTER(POINT)
dll.returnpoints.restype = POINTER(POINT)
dll.returnpoints.argtypes = None
dll.fpc_freemem_.restype = None
dll.fpc_freemem_.argtypes = [POINTER(c_int)]
dll.fpc_allocmem_.restype = POINTER(c_int)
dll.fpc_allocmem_.argtypes = [c_int]
mem = dll.fpc_allocmem_(8)
print 'allocated'
dll.fpc_freemem_(mem)
print 'freed'
myarr = PascalArray(POINT, dll.returnarray())
print 'Allocated array'
print len(myarr)
for i in range(len(myarr)):
print myarr[i].x, myarr[i].y
p = POINT()
p.x = 42;
p.y = 42;
myarr[0] = p
for i in range(len(myarr)):
print myarr[i].x, myarr[i].y
print 'Freeing'
del myarr
#print myarr
#print 'freeing'
#dll.freearr.argtypes = [POINTER(c_int)]
#dll.freearr.restype = None
#
#dll.freearr(cast(myarr._p, POINTER(c_int)))
#print myarr[0].x

48
Projects/MMLLib/pymml/mmldtm.py Executable file
View File

@ -0,0 +1,48 @@
#!/usr/bin/env python
class Bitmap(object):
# Pixels, alleen ter illustratie atm
pixels = None
# Index van de managed bitmaps
_index = None
def __init__(self):
self.pixels = [range(100) for x in range(100)]
pass
def __getitem__(self, item):
if iterable(item):
return self.pixels[item[0]][item[1]]
def find(self, searchbox = (), tol = 0, frm = (), _type = 'default', client
= None):
if iterable(searchbox):
if len(searchbox) != 4:
raise Exception("Invalid argument")
# Hier volgen gewoon de juiste calls
class Mouse(object):
lastPolledPos = (0,0)
states = None
def __init__(self):
self.states = {'left': 'down', 'right' : 'up', 'middle' : ' up'}
pass
def _getButtonState(self, button):
return self.states[button]
def __getitem__(self, item):
if iterable(item):
if item['state'] in ('left', 'right', 'middle'):
return self._getButtonState(item['state'])
iterable = lambda x: hasattr(x, '__iter__')
m = Mouse()
print m[{'state' : 'left'}]
a = Bitmap()
print a[(2,3)]
a.find()

View File

@ -1,9 +1,5 @@
- DTM Editor
- BMP Editor
- DTM Features
- SRL Installer
- Extra GUI icons
- Installer
- Test scripts
- DWS
- Documentation + wiki
- Documentation + wiki