FLTK logo

STR #3240

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 | Roadmap 1.3 | Post Text | Post File | SVN ⇄ GIT | Prev | Next ]

STR #3240

Application:FLTK Library
Status:5 - New
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:Fl_Html_View - more capable replacement for Fl_Help_View
Version:1.3-feature
Created By:rokan2
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 rokan2
06:53 Jul 14, 2015
html.zip
162k
 
 
#2 rokan2
06:54 Jul 14, 2015
screenshot-1.png
138k
 
 
#3 rokan2
06:54 Jul 14, 2015
screenshot-2.png
134k
 
 
#4 rokan2
06:55 Jul 14, 2015
screenshot-3.png
142k
 
 
#5 rokan2
07:03 Jul 14, 2015
Fl_Html_View.html
66k
 
 
#6 AlbrechtS
03:31 Jul 17, 2015
Discipline.png
12k
 
 
#7 AlbrechtS
03:42 Jul 17, 2015
smiley.png
22k
 
     

Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
 
#1 rokan2
06:52 Jul 14, 2015
Fl_Html_View is much more capable (see screenshots), less-buggy and extensible replacement for Fl_Help_View. The widget is fully source compatible with Fl_Help_View so Fl_Help_View can be just a typedef to it or Fl_Html_View can be renamed as Fl_Help_View in some future FLTK version. For now it is just an external widget which does not require modification of FLTK library.

It also adds "html" label drawing capabilities through FL_HTML_LABEL* labeltype so that html-formatted text can be rendered as "ritch text" label in any FLTK widget.

For list of features see Fl_Html_View.html

Roman
 
 
#2 greg.ercolano
20:31 Jul 14, 2015
Wow

Does all that and clean code too? Amazin'! ;)

Wanna see what others say, but initially this is looking great.
 
 
#3 AlbrechtS
03:42 Jul 17, 2015
Thanks for this powerful contribution. As said elsewhere, this could be added to the FLTK library or used to replace Fl_Help_View in FLTK 1.4. I didn't look at the code yet though, nor did I test anything.

The code size (as Roman said: less than 10,000 lines) would be more than 5% of the current code size of the entire FLTK library (w/o test and examples folders). Current size is 177,468 LOC, including all UTF-8 conversion tables, which are not all included in the lib, IIRC).

That said, it might be interesting to check if we can add this powerful widget as a separate library like Fl_Images. Especially if the announce extensions (print preview, more CSS capabilities) add even more to the code size. Just a thought...


Note: I uploaded the missing demo image files smiley.png and Discipline.png to complete the posted test file
http://www.fltk.org/strfiles/3240/Fl_Html_View.html
 
 
#4 superbem
19:56 Dec 18, 2015
Nice. I like it the idea.
But it hangs when it have some parse errors.
When using the method value(const char*)
 
 
#5 haavard.holm
11:24 Jul 15, 2017
Hi,

Seems like there is a small bug in the code.

I use the following code :
      {Fl_Html_View *o = HTML_View = new Fl_Html_View(x+300, y+70, width-x-300, y+height-150);
        o->color(FL_WHITE);
        o->format_width(-1);
        
        o->load("Manual/Start.html", 0);
        
      }
Running valgrind on my program do produce errors based on this code.

Else I find the widget very useful !

Best regards
Håvard
 
 
#6 greg.ercolano
13:37 Jul 15, 2017
I'm following up with Haavard's valgrind output he posted on fltk.general,
as it's likely useful to determine what he's reporting:

---- snip
==28623== Conditional jump or move depends on uninitialised value(s)
==28623==    at 0x52B456: Fl_Html_Parser::create_word(char const*, unsigned int, int) (Fl_Html_Parser.cxx:1271)
==28623==    by 0x52B0D5: Fl_Xml_Parser::parse(char const*, Fl_Xml_Object**) (Fl_Html_Parser.cxx:1203)
==28623==    by 0x52B80C: Fl_Html_Parser::parse(char const*, Fl_Xml_Object**) (Fl_Html_Parser.cxx:1343)
==28623==    by 0x52F19C: Fl_Html_View::value(char const*, bool, char const*) (Fl_Html_View.cxx:1136)
==28623==    by 0x52F62A: Fl_Html_View::load(char const*, bool, bool) (Fl_Html_View.cxx:1198)
==28623==    by 0x470EA8: Fl_Html_View::load(char const*) (Fl_Html_View.H:102)

Also if I run valgrind on the example-code-example I get error messages from valgrind.
---- snip
 
 
#7 greg.ercolano
13:52 Jul 15, 2017
I believe valgrind is objecting to the Fl_Xml_Parser class
data element 'last_result_' is not initialized by the class constructor.

Looking at Fl_Xml_Parser's constructor:

  Fl_Xml_Parser(int table_size = 32):Fl_Html_Tokenizer(0), parent_table_size_(table_size) {
    parent_table_ = new Fl_Xml_Object * [table_size];
    parent_table_next_ = new Fl_Xml_Object ** [table_size];
    scht_ = Fl_Html_Tokenizer::Special_Character_Table::default_table();
  }

..it does seem like there's no initialization of last_result_.

This uninitialized value is apparently being used by Fl_Html_Parse::create_word()
at line #1411 in src/Fl_Html_Parser.cxx:

   if(last_result()==CDATA)
 
 
#8 AlbrechtS
06:10 Feb 09, 2019
Please see STR 3511 (closed, but maybe related).
https://www.fltk.org/str.php?L3511
 
 
#9 gk
06:23 Feb 09, 2019
If you load a local file with Fl_Html_View, local images are not loaded.
The problem seems to be in Fl_Html_Parser where the value of directory_ is
set incorrectly to the same as filename_ if there are no slashes in the
string. Making directory_ an empty string for that case solves the problem:

  ......
  if(slash)
    *slash = 0;
  else *directory_ = 0;  // no slash found: no directory name was included
}
 
     

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'.