2 ms·
They are. More than just the drawing routines, quite literally the entire thing directly invokes Be APIs. For instance XQueryPointer just calls directly into th
by waddlesplash 4y ago
They are. More than just the drawing routines, quite literally the entire thing directly invokes Be APIs. For instance XQueryPointer just calls directly into the Interface Kit to get the present mouse position, or XSetWMProperties directly modifies the Haiku-native window state, title, etc.
However, that being said, if you wanted to do something similar or equivalent on some other platform, you could probably copy quite a lot of the structure, and then delete the actual implementation and replace it with your own. I restructured things a bunch in the early phases of working on this, and there's a lot of boilerplate code (e.g. macros.c, large parts of the event dispatcher) which you could reuse verbatim; though it's mixed in with the non-boilerplate code.
There were some other projects I ran into that looked like they were more generic, e.g. https://github.com/Abestanis/SDL2X11Emulation https://github.com/Abestanis/SDL2X11Emulation (also check the forks of that -- though I'm one of them, I experimented with it a bit before starting on this thing; but it's very incomplete and SDL2 really isn't designed for this), but none anywhere near as advanced as this is now.
- LeFantome 4y agoI glanced at the code earlier and my first thought was fact it could be adapted to provide Xlib for SerenityOS. I have nothing to do with Serenity and have never even used C++ but your code was easy to read and so the possibility just jumped out at me.