On 09/07/2012 18:00, Greg Ercolano wrote:

> 
>       Wow, that's a big one; the DOM is huge based on my experience doing
>       javascript programming.. too complicated for me to take on, but
>       someone might be up for it.

Sorry, my fault, I should NEVER use the term DOM.

What I want is NOT a standard - compliant browser, not javascript, no CSS and 
this kind of stuff. I do not want a browser, I want a simple lightweight "rich
text" editor operating on HTML-subset formatted files. Tag-recognition wise it 
would be similar to Fl_Help_View (with addition of a few features, like inlined
images and some small improvements to the tables).

First I wanted to modify Fl_Help_View, but this class is rather a rendering 
interpreter which operates with block-lines - not on tree-structured document, 
so
turning it to an editor would be rather a mess (the Fl_Html_View code is 
already rather messy). I think the better approach would be to operate 
recursively on
tree-like tag structure with some virtual measure(), draw() and handle() 
functions which would operate within current margin structure (the margins 
could be
modified by the tags themselves, for instance <table> narrows the margins up to 
certain depth). The best part of this would be possibility of adding a new TAG
just by registering a new tag name together with pointers to measure() draw() 
and handle() functions in a hash table (or a pointer to a subclass of some pure
virtual Fl_Html_Tag class) so that the capability of this new widget could 
would be easily extended, even on runtime by some plugins.

Loading and saving the tree structure from the file is the easiest part - 
during the weekend I have already written a small non-validating html parser to 
do
that. The more difficult part is rendering this tree - maybe some parts of 
Fl_Help_View code could be used to render some parts. The most difficult part 
would
be to make it editable to turn it into the editor. But editing would be 
implemented only later once the rendering/formatting part is done.


> 
>       Webkit gets big fast, since you can hook in things like flash,
>       media players (movies, etc), javascript...

Yes, that is what scares me. I have successfully embedded Internet Explorer 
window in FLTK window, but it was quite frustrating challenge and took a lot of 
time
with a lot of ugly code around.

Apart from that it would be nice to have lightweight rich text editor widget. 
The forgiving html format is chosen only because most of devices have some kind 
of
browser installed (excluding my toaster - but its quite ancient one) and it is 
useful to be able to load lax code, export to more strict mxml/xml is easy.

R.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to