Hi,

I wrote this simplistic application to learn libMyPaint logic & API.

This is far from being complete. But it is a good start to discuss with experimented libMyPaint dev...
Once finished, it may be used as a demonstration of LibMyPaint API use...
(for guys like me who would like to use libMyPaint in their application)

For now, I had to include these 4 GPL files : brushmodes.cpp/.h and mypaint-tiled-surface.cpp/.h.
Note for anyone who would like to include this code into a proprietary project : these 2 files are GPL and as long as you keep them in this mini-project, the whole project is GPL and can not be include into a proprietary project. (I should write some replacement for these files as a next step - unless their license is modified)

License is the very same than libmypaint (ISC ..?) regarding the code I wrote (ONLY ./miniQtProject directory)
Brushes have various licenses...
c-json contains the stand-alone c-json project with its license.

To build it :

- Get Qt 4.x, a compilator and a shell
- type : qmake (to build makefile or equivalent)
- type : make  (or nmake on windows)

It should build testApp(.exe).
Run it from this directory as the application uses the "./brushes" directory.

Note that I build this on Windows, using MSVC 2010 but, as this is pure Qt code, it is cross-platform. You may experience some little issues if using another environment. Any feed-back is welcome.

TODO :

I only used ~4 libMyPaint API calls. I guess that this application should do much better to be a good demonstration of libMyPaint API.

Fix the brush order ! I did not realize yesterday that the file order.conf was containing this information. So I am parsing the brushes and sort them alphabetically... (which is dumb)

Understand/Fix the crash that occurs randomly if I select a new brush. I suspect some issue when json delete its pointers as it seems that some memory is used after it is freeing. (I had another issue with c-json which shows that it has not been build a lot on win32/msvc)

Get/Set the brush color (internal to LibMyPaint) with the GUI Code to select it... Right now, you can select another color but it changes nothing to your brush

Use correctly the API. As I wrote this code without any doc, it could be completely wrong...

May be add a panel to change the brush settings... could be helpful.

Write some replacement for brushmodes.cpp and mypaint-tiled-surface.cpp, so the whole thing could be used by anyone.

No optimization at all will be done. Right now, the surface is not infinite (but quite huge) and the drawing may be somehow a bit slow. I do not care. This code is just an example. Optimize it for your own surface/canvas !

Well... this is just few hours of work ;-) What do you expect !  (I spent more time reading the code itself to understand the API than writing this demo)