SRL Archive - Development

[devel] Simba on Mac


Markus

2010-09-08 08:16:44

Note: This is just one big 'Note to self', but because I like openness I'm posting this in public - if you got any ideas about the problems we still got you're free to help ofcourse.
Right now we managed to succesfully compile and run Simba at OS X, it seems to work at both Leopard and Snow Leopard (if you have a working X11 which is still necessary for now).
However, there are a couple of issues we ran into during the process. I'm summarizing them here among with some potential fixes and approaches on fixing them. I can summarise them basically in two (three) points:
  1. os_darwin needs to have a fully functional IOManager
  2. We need a Windowselector
  3. (SMART needs to be recompiled and tested)
IOManager
As you haven't read in the documentation (as I couldn't find it, rofl), the IOManager consists of the following components:

  • A TWindow component which handles things like keystrokes, mouse movements and pixeldata
  • A TIOManager which has a purpose I haven't fully determined yet (seems to do targets only)
I'll start with TWindow

TWindow

Responsible for most of the platform specific functions. I'll start with the HID IO:

Generating Mouse events
Under OS X, mouse events aren't particularly hard to generate. As can be read at the official Quartz Event Services Reference, it's just calling CGCreateMouseEvent with the appropriate parameters.
A good thing is that both CGEvent.h (required for generating the events) and CGGeometry.h are already ported to FPC so using the functions isn't too hard.

Generating Keyboard events
Keyboard events aren't too tough, too. Just calling CGEventCreateKeyboardEvent with appropriate params (event source (can be NULL), keycode and keydown (bool)) will generate all the keypresses we want. It doesn't seem there's an equilavent to win32's SendText but that isn't a real problem.

Of course, there are tons of other things that need to be sorted out, like grabbing the screen (glReadPixels?) or client, and figuring out how to get the Windowselector to work.
However, I need to go now so no time for that ;)

Wizzup?

2010-09-08 09:37:04

Perhaps we can Extend IOManager so that the WindowSelector can be cross platform too? At least for the actual ``Selecting'' part?