maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   RFC: Developing a vector-based drawing library for handwriting (libpenpen) (https://talk.maemo.org/showthread.php?t=59324)

benlau 2010-07-28 14:13

RFC: Developing a vector-based drawing library for handwriting (libpenpen)
 
Hi developers,

I am the author of PenPen SketchBook , it is a handwriting memo/sketch book for quick note taking . I wish you already know what is it.

The core of the software is a vector-based drawing engine. It could save pen stroke in a vector based format. And, unlike bitmap graphics , the eraser removes the whole stroke instead of a small region. It is optimized for handwriting memo , so you could remove the entired word easily.

I am planning to release PenPen's vector drawing engine into a library called as libpenpen (Based on Qt). So that other developer may embed a handwriting area in their application easily. Before release it , I would like to seek for more comment / suggestion from you.

The current module / feature in PenPen
-QGraphicsItem based objects
-- Handwriting with different type of color and width size (QGraphicsView based)
-- Stroke eraser
-XML serializer
-A editor interface module (Drawpad)
-Custom Color dialog (Qt's QColorDialog is buggy on Maemo)
-Derived class of QAbstractItemModel for multiple drawing reviewer.

Pending features:
- Undo
- Set background from image
- zooming

The expected feature of libpenpen:
- QGraphicsItem based objects
-- Handwriting with different type of color and width size (QGraphicsView based)
-- Stroke eraser
- XML serializer

Expected License : BSD (Not decided yet)

Source code : http://bazaar.launchpad.net/~benlau/...src/libpenpen/

Classes Document : http://dl.dropbox.com/u/2152786/penp...tml/index.html

Several questions:

1) Will you be interested to develop application with handwriting function? (e.g Annonation on image/pdf , signature , ...)

2) Do you think that the feature of libpenpen enough for you?

3) Could you suggest more feature should be provided by libpenpen?

By the way, few more questions not related to libpenpen. Do you use sqlite in your application? What do you think about Qt's database module? Do it suitable for your need?

Thanks.

johnel 2010-07-28 14:33

Re: RFC: Developing a vector-based drawing library for handwriting
 
Something like this would be very welcome but remember to keep the features tightly focused.

Keep the library as "simple" as you can and try to avoid putting too much in it.

Maybe make it extensible (e.g. a "plugin" api) and other people as well as yourself can extend it.

Basically, keep the library focused but allow the ability to extend it.

Hope this makes sense.

manvik60 2010-07-28 14:47

Re: RFC: Developing a vector-based drawing library for handwriting
 
I am not really into this and certainly not want to hijack the thread, but just want to say YOU ROCK !!!!. Your PenPen is really great, my daughter really loves it.
+1 vote.

Venemo 2010-07-28 19:05

Re: RFC: Developing a vector-based drawing library for handwriting
 
Hi Benlau,

Actually, I'm rejoiced to see your library, as I could find very good use for it in my upcoming Sticky Scribble Notes widget.

For color dialog, you could use the SimpleColorDialog found in Hildon-Extras. http://wiki.maemo.org/Hildon-Extras
I actually wrote a Qt wrapper for the Gtk-based parts, so it is dead easy to use it from your lib. (We are currently working on a library release for it, but currently the leader is on vacation... for the moment, we just include its stuff in our projects.)

Is there any information or API doc about your library?

benlau 2010-07-29 02:36

Re: RFC: Developing a vector-based drawing library for handwriting
 
Quote:

Originally Posted by Venemo (Post 768185)
For color dialog, you could use the SimpleColorDialog found in Hildon-Extras. http://wiki.maemo.org/Hildon-Extras
I actually wrote a Qt wrapper for the Gtk-based parts, so it is dead easy to use it from your lib. (We are currently working on a library release for it, but currently the leader is on vacation... for the moment, we just include its stuff in our projects.)

Great! Then I can save a lot of time in developing widget on Qt for Maemo!

Quote:

Originally Posted by Venemo (Post 768185)
Is there any information or API doc about your library?

yes . The doc is available (not completed) at : http://dl.dropbox.com/u/2152786/penp...tml/index.html

I will write a demo program on how to use the API.

Venemo 2010-07-29 09:03

Re: RFC: Developing a vector-based drawing library for handwriting
 
Quote:

Originally Posted by benlau (Post 768614)
Great! Then I can save a lot of time in developing widget on Qt for Maemo!

Indeed.
A picture of the dialog is here:
Link
It also has an "Advanced" button for advanced color selection, and you can set an arbitrary title and default color for the dialog.
It returns a QColor instance which holds the selected color data.

Quote:

Originally Posted by benlau (Post 768614)
yes . The doc is available (not completed) at : http://dl.dropbox.com/u/2152786/penp...tml/index.html

Thanks!
If I see it correctly, all I need is a PPPaper instance, and do stuff with that?

Quote:

Originally Posted by benlau (Post 768614)
I will write a demo program on how to use the API.

I would very much welcome that! :)

benlau 2010-07-29 10:07

Re: RFC: Developing a vector-based drawing library for handwriting
 
Quote:

Originally Posted by Venemo (Post 768874)
Indeed.
A picture of the dialog is here:
Link
It also has an "Advanced" button for advanced color selection, and you can set an arbitrary title and default color for the dialog.
It returns a QColor instance which holds the selected color data.

Thanks!

Quote:

Originally Posted by Venemo (Post 768874)
Thanks!
If I see it correctly, all I need is a PPPaper instance, and do stuff with that?

yes. The core is PPPaper.

Moreover, Qt has two GUI framework. The first one is QWidget based , which is similar to GtkWidget , it provide a traditional way to develop GUI.

The other one is QGraphicsItem based , which is designed for 2D / 3D graphical user interface. Each item has it own transformation matrix , which is similar to Flash.

PenPen use the second one , which is more flexible , but the code to get started is a little bit complex than using widget. I am thinking about to pack a QWidget class so that it is more easy to get started.

The concept should be much clear when the demo code is ready.

benlau 2010-07-29 17:34

Re: RFC: Developing a vector-based drawing library for handwriting (libpenpen)
 
An example code could be find at (The API is not completed) :

http://bazaar.launchpad.net/~benlau/...idget/main.cpp

hmm... I should add more comments... but time to sleep :(

Venemo 2010-08-03 11:46

Re: RFC: Developing a vector-based drawing library for handwriting
 
Quote:

Originally Posted by benlau (Post 768925)
PenPen use the second one , which is more flexible , but the code to get started is a little bit complex than using widget. I am thinking about to pack a QWidget class so that it is more easy to get started.

The concept should be much clear when the demo code is ready.

A QWidget-based approach would be a good thing for me. :)
As I see, there is already such an approach in the demo code, isn't there?

benlau 2010-08-03 13:07

Re: RFC: Developing a vector-based drawing library for handwriting
 
Quote:

Originally Posted by Venemo (Post 774183)
A QWidget-based approach would be a good thing for me. :)
As I see, there is already such an approach in the demo code, isn't there?

yes! A PPPaperWidget class is already ready , but still working with few more functions before official release.

Demo code:
http://bazaar.launchpad.net/~benlau/...idget/main.cpp

Screenshot:


All times are GMT. The time now is 19:26.

vBulletin® Version 3.8.8