FLTK logo

STR #2634

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Post Text | Post File | SVN ⇄ GIT | Prev | Next ]

STR #2634

Application:FLTK Library
Status:5 - New
Priority:3 - Moderate, e.g. unable to compile the software
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:fl_help_view bug fixes and new features
Version:1.4-feature
Created By:markcw
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size  
 
#1 markcw
06:32 May 17, 2011
Fl_Help_View.cxx
217k
 
 
#2 markcw
06:36 May 17, 2011
Fl_Help_View.H
12k
 
 
#3 mingodad
14:01 May 17, 2011
fl_Help_View.zip
29k
 
 
#4 mingodad
10:21 Dec 10, 2011
ourhelp.zip
1.0M
 
 
#5 greg.ercolano
18:19 Apr 04, 2013
markcw-Fl_Help_View-orig-vs-new-as-patches.zip
142k
 
 
#6 greg.ercolano
18:45 Apr 04, 2013
mingodad--03-08-2010-Fl_Help_View-orig-vs-new-as-patches.zip
67k
 
     

Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
 
#1 markcw
06:32 May 17, 2011
Hi, this is a major update to fl_help_view.cxx, see attached and post below for header. You can also get the 2 files here http://blitzmirror.ueuo.com/fl_help_view.zip

I have been working on this since July 2008 and have been meaning to release it for the last 6 months but I got worn out by it so it got delayed. I have been developing it through the BlitzMax language but I got stuck trying to get it working with the fltk library again. I had problems with the make in Linux on my Dell Inspiron 1525 laptop, fluid won't link. I would be very grateful for a fix for this btw, see below for error. I finally got it working on my Macbook recently, that is with fl_help_dialog.cxx tested via test/help. I haven't tried Windows at all because I'm still confused by the install methods, any help?

Also I found a bug in Mac (not sure if it happens in Linux/Windows) with getcwd() is always 'Users/username' so I had to put the documentation folder in Users to get test/help working.

I do intend to keep working on this project so feel free to post bug reports here.

This is the fluid error on Linux...

mark@mark-laptop:~/fltk-1.3.x-r7677$ make
=== making jpeg ===
=== making png ===
=== making src ===
Compiling Fl_Help_View.cxx...
/usr/bin/ar cr ../lib/libfltk.a ...
=== making fluid ===
Linking fluid...
../lib/libfltk.a(Fl_Double_Window.o): In function `Fl_Double_Window::resize(int, int, int, int)':
Fl_Double_Window.cxx:(.text+0x118): undefined reference to `XdbeDeallocateBackBufferName'
../lib/libfltk.a(Fl_Double_Window.o): In function `can_xdbe()':
Fl_Double_Window.cxx:(.text+0x186): undefined reference to `XdbeQueryExtension'
Fl_Double_Window.cxx:(.text+0x1bd): undefined reference to `XdbeGetVisualInfo'
Fl_Double_Window.cxx:(.text+0x1fa): undefined reference to `XdbeFreeVisualInfo'
../lib/libfltk.a(Fl_Double_Window.o): In function `Fl_Double_Window::flush(int)':
Fl_Double_Window.cxx:(.text+0x346): undefined reference to `XdbeAllocateBackBufferName'
Fl_Double_Window.cxx:(.text+0x432): undefined reference to `XdbeSwapBuffers'
../lib/libfltk.a(Fl_visual.o): In function `test_visual(XVisualInfo&, int)':
Fl_visual.cxx:(.text+0x7f): undefined reference to `XdbeQueryExtension'
Fl_visual.cxx:(.text+0xb6): undefined reference to `XdbeGetVisualInfo'
collect2: ld returned 1 exit status
make[1]: *** [fluid] Error 1
make: *** [all] Error 1
 
 
#2 markcw
06:37 May 17, 2011
See above for header, my mistake I thought you could only post one file per topic.  
 
#3 markcw
06:39 May 17, 2011
Here is my worklog for fl_help_view

rev 27
- fixed compiler errors to get it building with fltk-1.3.x make
- fixed seemingly random fonts appearing on Mac, required changes to header
- fixed font list not being read properly on PPC Mac
- fixed no spaces between words on PPC Mac

rev 26
- changed scope of handle() to public
- added css functions: load_css(), parse_css(), get_css_value(), get_font_size()
- added css properties: background-color, font-family/weight/style/size
- added recognition system for css shorthand properties: font, background
- fixed table without /tr breaking next row alignment
- fixed table without tr not being drawn
- added nearest font match to font_face()

rev 25
- removed getcwd for init with relative path, need to init with full path.
- fixed format_table crash if td colspan width too thin.
- added page topline position history, required changes to header/fltkgui.
- added javascript:history.back/forward/go support, required changes to fltkgui.
- added openurl support for user navigation style, required changes to fltkgui.

rev 24
- fixed some more misc bugs.
- added new function: setstyle, required changes to header and fltkgui.
- added default user navigation style.
- added print error page instead of null link.
- added getcwd for initializing with a relative path.

rev 23
- fixed a few misc bugs.
- removed font_find function, not necessary, required changes to header.
- fixed build_faces and font_face functions to work with anti-aliased fonts.

rev 22
- fixed </a> sometimes not working bug, style spilling into next <td>.
- added new methods: filepath and fileislink, for link targets fix.
- fixed link targets not stored in link history, required changes to header and fltkgui.

rev 21
- removed support for drawing new char refs via Symbol font, not compatible with FLTK 1.3.

rev 20
- added new method reformat, for calls to format.
- replaced add_block, format_table functions with extended argument versions.
- added d-pointer by hijacking Fl_Help_Target, required changes to header.
- replaced compare_targets function with cmp_targets, due to d-pointer.
- replaced textfont_ and textsize_ with global statics.
- moved local statics to d-pointer struct.
- fixed links with target values not setting position on new page.

rev 19
- changed vertical scroll size, now moves double the amount.
- added new methods sansfont, monofont.
- added new function font_find, used for new default fonts.
- added new functions build_faces, font_face and font_style.
- added full support for font face attribute, required changes to header.
- fixed bold/italic not working with many fonts.
- removed inconsistent resizing tweak in format.

rev 18
- fixed nested table overwriting cell heights.
- fixed nested table drawn below row height.
- improved format speed to 30% less time, required changes to header.
- fixed cell width not reset before/after nested table.
- fixed nested table popping cell margin.
- fixed pre text in tables not increasing cell width.
- improved pre tabs width, miscalculated in tables.
- added CHR() and MIL() macros.
- fixed tables not popping last font.
- fixed divide by zero error if table cells empty.
- renamed variables and reordered functions alphabetically.

rev 17
- fixed mouse over horizontal scrollbar showing active link/hand icon.
- fixed last line in <td> misaligned, caused by new block per line system.
- fixed empty <td> on end of row affecting next row y position.
- fixed wrong line gaps before and after a table.
- fixed nested tables overwriting <table> and <tr> 'bgcolor'.
- improved color lookup, no hash needed for hex value.

rev 16
- improved block system, every line is now in it's own block.
- removed line[32] field to drop memory usage to about 30%, required changes to header.
- tidied up code comments.

rev 15
- improved <hr> and <h1-6> line spacing.
- fixed font size not updating line y positions, required changes to header.
- fixed nested tables overwriting subsequent <tr> and <td> cell data, required changes to header.

rev 14
- added skipping of <script> to prevent drawing of Javascript code, etc.
- finished fixes to <ul> and <li> code.
- fixed <hr> line spacing miscalculations and added a shadow line.

rev 13
- fixed <br> directly after another <br> not taking a new line.
- added <li> 'type' support and drawing of circle and square bullets.
- fixed <li> bullets on left margin not visible because of no default indent.
- added all the missing character references (quote chars) listed in HTML 4.
- added support for drawing most of the new char refs via the Symbol font.
- fixed control characters not drawing correctly because of null widths.

rev 12
- fixed hang caused by resizing window on a big page, included forms.H for timer code.
- fixed words longer than window width taking an extra line.
- added skipping format below drawing area during resizing, full format is after mouse release.

rev 11
- fixed every table expanded to full document width, now scaled to window width.
- fixed table widths not scaling to exactly what they should.
- fixed text expanded to full document width, now line wrapped to window width.
- fixed <hr> not drawn according to horizontal scrollbar position.
- added <div> support, 'id' for target links and 'align'.


rev 10
- fixed line wrapped images not taking enough new line space.
- fixed </table> not resetting the new line space after an image.
- fixed text on the same line as an image not aligned to the baseline.

rev 9
- added tab spacing support in <pre> with correct tab alignment.
- fixed images to align to the baseline instead of the top, required changes to header.

rev 8
- fixed table margin indents ignored in formatting, required changes to header.
- fixed <td> 'colspan' cells not scaling up when needed, result of previous colspan fix.
- improved tables scaling a bit wider than they should.

rev 7
- fixed <td> with 'colspan' > 1 causing miscalculation of table cell max column widths.
- fixed tables scaling up beyond maximum width.

rev 6
- fixed <pre> courier font changing when scrolling down, required changes to header.
- reorganized HTML tag checking code, separated some tags and listed them alphabetically.
- added all the missing tags listed in HTML 4, they are still unsupported.

rev 5
- fixed <h1> font sizes and paragraph spacing.
- fixed '<' character assumed to be an HTML tag.
- HTML tags in <pre> changing courier font.

rev 4
- added smart paragraph system so things like '<p></p>' only take one paragraph.
- fixed <ul> margin indent set by font size instead of a fixed width.
- fixed </pre> not taking a new line in certain cases.
- improved <h1> and </h1> paragraph spacing.

rev 3
- fixed <td> margin indent set by font size instead of a fixed width.
- fixed </table> not closing the table row width.

rev 2
- fixed <td> with 'colspan' > 1 causing miscalculation of table cell minimum widths.
- fixed </tr> and </table> not popping the table's margin indent back.

rev 1
- fixed </pre> not taking a new line causing text directly after it to draw on the same line.
- added <blockquote> support which uses the existing <ul> code.
 
 
#4 greg.ercolano
11:29 May 17, 2011
Wow, sounds great.. and a lot of work!

It's surely going to get bumped to 1.4, as we're in final release stages for 1.3.

Regarding the Xdbe errors, sounds like a partial install of the X11 dev environment. Make sure you have libXext installed on your machine (eg. /usr/lib/libXext*) as I believe that's what supplies the Xdbe functions.

What version of linux are you using?

For ubuntu 8.x I used the following commands to setup my X11 dev environment:

apt-get install libx11-dev
apt-get install libxt-dev
apt-get install libxft-dev
 
 
#5 ianmacarthur
13:35 May 17, 2011
@markcw: I'm temporarily bumping this to 1.4 for now, so we can push ahead with the 1.3.0 release cycle.
Don't take that the wrong way though - we'll come back to this.

In particular, can you post in fltk.general your questions (e.g. about getcwd() on OSX and building on win32 hosts) and we can give you a few tips and pointers to keep you going!

Thanks for the input.
 
 
#6 markcw
14:04 May 17, 2011
Greg, thanks for the help, I got the make working in Linux, I have ubuntu 9.10, I didn't have libxext-dev installed.

Ian, ok I will post my questions to fltk.general then. Thanks for the advice.
 
 
#7 mingodad
14:09 May 17, 2011
I did posted my Fl_Help_View working version too, I did it in the past but it was not accepted.

I removed basically all static variable, recoded the parser, and removed a lot of duplicated code.

I use Fl_Help_view as a page formatter for reporting purposes without showing it on screen.

Also still there is a lot of inefficient code on the block format calculation, something like what was used on Fl_Text_Editor/Fl_Text_Buffer on wich Manolo did a rewrite to make it faster and less cpu expensive, the same could be applied here.

When I have time and patience I'll try to see what I can use from this new contribution.

Ideally I would prefer to have people from Dillo to jump in and contribute with their html engine that is a lot superior.
 
 
#8 mingodad
14:45 Dec 06, 2011
I was playing with this revamped Fl_Help_View and I works with nested tables very well and found a small mistke that prevents row background color to work.

On line 3331 of Fl_Help_View.cxx:

----------- change this
            if (get_attr(attrptr, "BGCOLOR", attr, sizeof(attr)))
              block->bgcolor = get_color(attr, rclr);

+++++++++++ by this
            get_attr(attrptr, "BGCOLOR", attr, sizeof(attr));
            block->bgcolor = get_color(attr, rclr);

It sometimes also doesn't break the words properly when formating text, but I didn't found the problem.

Thanks for this big improvement.
 
 
#9 markcw
18:00 Dec 08, 2011
Hi mingodad, thanks for the row background color bug fix ie. <tr bgcolor=xyz> didn't work. Just to confirm that this code does the job:

  get_attr(attrptr, "BGCOLOR", attr, sizeof(attr));

  block->bgcolor = get_color(attr, rclr);

Re: doesn't break the words properly. If you could post a working example that would be great as I've not noticed this.

Also, thanks for your email and re: nested table width problem. Yes I knew there were some problems there, it will take me a while to look into it but I'll get back to you about that.
 
 
#10 mingodad
10:27 Dec 10, 2011
The file ourhelp.zip contains a modified version of Fl_Help_View from this STR and with the discount library for markdown syntax, and try to make something like http://markdownpad.com/ to make it easy and simple to create simple help files for applications created with fltk.

I enclosed this modified Fl_Help_View on a namespace to allow compile it without need to substitute the original Fl_Hel_View and to amke easy debugging.

Any sugestion/improvement are welcome !
 
 
#11 greg.ercolano
17:11 Apr 04, 2013
Getting around to revisiting this.

Unfortunately the changes suggested so far aren't in patch format,
so it's hard to determine what changed to merge into current code.

I'll see if I can recreate a diff from the latest code attached here,
and attach that to this STR so we can see what can be merged into current.
 
 
#12 greg.ercolano
18:19 Apr 04, 2013
Oh, OK, I see the changes are pretty large, so a diff is huge.

Nevertheless, I've compiled a zip file:
markcw-Fl_Help_View-orig-vs-new-as-patches.zip
..which contains three directories with Fl_Help_View* files in each:

    orig -- fltk's original src (based on svn id's from markcw's files)
    new  -- markcw's files
    patch -- patch versions of the changes (diff -Naurw)

I found using xdiff on the 'orig' vs 'new' files lets one see
what's changed. (enable "ignore whitespace" flag, as mark's files
seem to have DOS line endings, messing up a straight diff)

I didn't try to make patch versions of mingodad's files,
as that sounded like changes to support markdown, perhaps something
we should support at some point, but perhaps after we apply fixes
just to the html.

We should also re-investigate mingodad's other patch suggestions
that has code simplification, to see if there can be some common
ground between markcw's code and mingodad's cleanup.

BTW: I didn't write Fl_Help_View, but was kinda inspired to
investigate updating it.. but it looks like the changes are quite
large, almost a rewrite.. hard to justify during maintenance releases.

I agree it would be cool if we could get a dillo rewrite.
But honestly, as limited as Fl_Help_View is, it's still quite
useful and 'light' for simple html viewing.. and now that we have
fl_open_uri(), that lets one more easily open a full browser across
all platforms to view html that includes javascript, animations,
videos, etc.
 
 
#13 greg.ercolano
18:45 Apr 04, 2013
I'm also attaching a zip that contains Domingo's changes
from a posting he made to fltk.dev on 03/08/2010
with the same files broken out:

    orig -- fltk's original src (based on svn id's from Domingo's files)
    new  -- Domingo's files
    patch -- patch versions of the changes (diff -Naurw)

So between these two zips, we can probably pull what we need
to make a merge that includes the best of both.
 
 
#14 AlbrechtS
08:11 Jan 20, 2023
No matter what the large provided code changes may fix (even bug fixes?), this would all need to be evaluated thoroughly. Hence I lowered the priority from "High" to "Moderate".

The code is now more than 10 years old and making a new widget or a total overhaul can't be done now.

It would be good to see specific bug fixes in separate patches (this STR is still open for updates) or as bug reports on GitHub. If you know of any particular bug fixes, please post them on GitHub (preferred) with one report (Issue or PR) per bug fix.

Thank you.

PS: please keep in mind that we don't accept "extraneous" new features for the existing Fl_Help_View widget. This is documented to have only a limited functionality, particularly only HTML 1.x and no CSS.
 
     

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.