Librocket pascal headers? lazarus / 39-Graphics ---------------------------------------------------------------------- Dibo · 2013-12-19 20:16 Hi, Did you hear about librocket? http://librocket.com/wiki/frontend/features http://www.youtube.com/results?search_query=librocket&sm=3 It is very interesting multiplatform render engine which has support for HTML and CSS. I know that we have THtmlPort and IpHTMLPanel but librocket could be good alternative between simple native HTML renders and big heavy engines like gecko or webkit. Library is relatively small (on linux libRocketCore.so = 1.6 MB and libRocketControls.so = 600kb). The problem is that there is no pascal headers. I tried with h2pas but it generate errors (probably because headers are c++). Is it possible to port this lib into Free Pascal? There is also very similar project "Sciter": http://www.terrainformatica.com/sciter/ But only for windows. MacOS and Linux is in progress Regards ---------------------------------------------------------------------- hinst · 2013-12-19 20:55 I think that creating pascal headers for this libRocket library is pretty much impossible. Why? the reason is simple: take look at files in this directory: https://github.com/lloydw/libRocket/tree/master/Include/Rocket/Core There are just too many files and they use various C++ libraries like vector, stdlib.h, map, stack. There are classes, templates. It is tied to C++. Class methods from headers have to match implementations exactly (if you know what I mean; C++ converts class method names) Well, just the fact that these header files contain classes with no implementation is enough to declare that creating pascal headers for this library is impossible. It would be much easier if these header files contained separate functions with arguments of type either primitive (like int, char*) or struct. (this is how WinAPI works, by the way. That is why it is possible to access WinAPI from Delphi & FPC directly just as from programs in C++) ---------------------------------------------------------------------- Dibo · 2013-12-19 23:05 Right. I didn't check all header files, but notice that if this library is using some stdlib etc, then it will be compiled by MinGW compiler into so/dll lib and called by FPC externally. I know that it need more work than pure C headers, but Lazarus has support for Qt libs (c++), so I suppose that some proxy lib is needed which flat librocket C++ headers (like libQt4Pas for Qt headers). Anyway, I think that support for librocket could brings new fancy UI experience in Lazarus world ---------------------------------------------------------------------- hinst · 2013-12-20 12:23 Perhaps it can be ported like Qt, but it is going to be very bothersome. Not impossible though. I believe I could do it if I had enough time. In fact anyone with some experience in C++ and FPC can do it. The only problem here is that it will take a lot of time