Recent

Author Topic: TwebBrowser in lazarus ?  (Read 39631 times)

hsbelli

  • New Member
  • *
  • Posts: 10
TwebBrowser in lazarus ?
« on: August 17, 2009, 06:12:42 pm »
Is good idea include a component like twebbrowser like delphi, just the components like ipro o pbear not offer full fuctionality like view in html a flash file or output of ip camera. Its is posible soon?.
Thanks.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 918
    • Burdjia
Re: TwebBrowser in lazarus ?
« Reply #1 on: August 21, 2009, 02:34:06 pm »
AFAIK Delphi's TWebBrowser si Windows only because it just embeds Internet Explorer browser in the form.

About to create a cross-platform TWebBrowser equivalent, may be it's possible. I saw some open source HTML renderers out there written in Pascal. Another one that embeds a cross-platform open sourced browser (as Firefox or so) may be possible too. In any case it would be a lot of work (I can't do it right now, I have very few free time :()
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

hsbelli

  • New Member
  • *
  • Posts: 10
Re: TwebBrowser in lazarus ?
« Reply #2 on: August 21, 2009, 07:42:01 pm »
Yes i know thath is a lot of work. but really i need an example how use gecko or webkit in lazarus for linux. Exists this?.
Thanks

mica

  • Full Member
  • ***
  • Posts: 192
Re: TwebBrowser in lazarus ?
« Reply #3 on: August 22, 2009, 01:28:10 pm »

alter

  • Full Member
  • ***
  • Posts: 151
    • KSP website
Re: TwebBrowser in lazarus ?
« Reply #4 on: October 27, 2009, 05:25:57 pm »
Still it would be nice to make TWebBrowser component for at least Qt and win32 interfaces

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 918
    • Burdjia
Re: TwebBrowser in lazarus ?
« Reply #5 on: October 28, 2009, 02:19:13 pm »
Finally I've find it again. Dave Baldwin did release it's HTM Viewer components for Delphi by free. He wrote:

Quote from: Dave Baldwin
Note: The HTML Display Components (including the source code) are now in the public domain. I regret that I am unable to provide modifications or maintenance in the future.

I didn't use these components so I have no idea about how they work, but I think it would be a good starting point for a future cross-platform HTML viewer component for Free Pascal/Lazarus. :)
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Zaher

  • Hero Member
  • *****
  • Posts: 571
    • parmaja.com
Re: TwebBrowser in lazarus ?
« Reply #6 on: October 29, 2009, 02:16:16 pm »
I read somewhere in this forums that possible to add Firefox browser in both linux and windows.
My opportunity/chance to have TWebBrowser in Lazarus.

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: TwebBrowser in lazarus ?
« Reply #7 on: October 29, 2009, 02:45:43 pm »
Theoretically, making a browser should be very very easy, I mean, it only reads tags and displays them, Considering that not even Microsoft has been able to make a browser, means making one is more difficult than what it seems, i think embedding somethng like firefox, would be the best solution

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 918
    • Burdjia
Re: TwebBrowser in lazarus ?
« Reply #8 on: October 29, 2009, 04:34:27 pm »
Theoretically, making a browser should be very very easy, I mean, it only reads tags and displays them,

Actually it is. Just read the XHTML file with a XML parser and "print" the "tree". That's all. The problem is do it beautiful (CSS, pictures...) and useful (links, JavaScript, ...)

Considering that not even Microsoft has been able to make a browser, means making one is more difficult than what it seems, i think embedding somethng like firefox, would be the best solution.

AFAIK it's possible to embed Gecko (Mozilla's HTML "renderer" and JavaScript interpretor/compiler). It's multiplatform, open sourced and free so there shouldn't be problem.

BTW, does somebody test Dave' components?
« Last Edit: October 29, 2009, 04:37:47 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

alter

  • Full Member
  • ***
  • Posts: 151
    • KSP website
Re: TwebBrowser in lazarus ?
« Reply #9 on: October 29, 2009, 06:59:32 pm »
Theoretically, making a browser should be very very easy, I mean, it only reads tags and displays them, Considering that not even Microsoft has been able to make a browser, means making one is more difficult than what it seems, i think embedding somethng like firefox, would be the best solution
What I am actually thinking about is giving the ability to import IE control. I know that it would be hard atm (tried myself) but then it should actually solve many problems. Right now it is possible for sure to make proper component for Qt and possibly Gtk interfaces however win32 lacks abilities to do that.
About creating cross platform version it is possible. I am doing it right now with Qt by having additional class that contains all stuff I need (like user agent, url loading, resizing and so on). If for example we use IE or WebKit on win32 and other platforms then notice that WebKit from Qt does nothing more than any rendering engine. And since WebKit is available for all platforms we consider then possibly making such control with that engine. I know about implications it brings but still right now it's the best option.
Point is that there has been alreadt a few attempts to write such control for Gtk, there is for Qt and so on but so far nothing universal.
There is as Qt/Webikit demo
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

And yes, I know about that, I am using WebKit from Qt myself:-)

Edit: I decided to start proper class. Right now it is not a control (just TObject). It uses Qt WebKit, provides functionality like cookies management, loading url (with ability to use progress bar), editing html and sending custom agent string. What needs to be done for sure are proper headers (for WebKit I guess) for other interfaces. I believe that we can make it happen but in order to do that any help is welcomed. So if you are interested in then just pm me.
« Last Edit: October 29, 2009, 11:17:52 pm by alter »

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: TwebBrowser in lazarus ?
« Reply #10 on: October 30, 2009, 12:54:08 am »
BTW, does somebody test Dave' components?

If you search this forum you'll find that the question of porting Dave Baldwin's controls to Lazarus has been discussed several times. I actually have already ported them, although not everything is working correctly. You are free to try out the latest ported source from here:

http://web.fastermac.net/~MacPgmr/Lazarus/

(Grab the THtmlPort .zip file.)

I made this available last spring both here and to several individuals, but I never got any response.

The ported demo app displays pretty well with win32 and carbon, which are the only two widgetsets that interest me.

A package file is included for installing the components in Lazarus, but these really don't work very well in Lazarus and I have no idea why.

Good luck.

Thanks

-Phil

Phil

  • Hero Member
  • *****
  • Posts: 2750
Re: TwebBrowser in lazarus ?
« Reply #11 on: October 31, 2009, 08:53:50 pm »
Update on THmlPort (Dave Baldwin HTML components ported to Lazarus):

Here is a screenshot that shows Dave's FrameDem example app on a MacBook using the Carbon widgetset (tested today with the new 0.9.28.2 release of Lazarus):

http://web.fastermac.net/~MacPgmr/Lazarus/FrameDem_MacBook.jpg

To test the FrameDem app yourself, install the htmlcomp.lpk package in Lazarus, then open and compile framedem.lpi in the demo_src folder.

Here are some things that don't work quite right that someone could investigate:

- On Intel machines (Mac and Windows), Lazarus has problems installing the package, either giving a file-not-found error or a checksum error. Usually compiling the package twice in succession will allow Lazarus to install the package. Note that Lazarus on a PowerPC Mac does not have these problems.

- On an Intel Mac, using the HTML design controls in the Lazarus designer gives an access violation error. Note that no error is generated on a PowerPC Mac.

- On Windows, displaying the FrameDem About box doesn't work right - dialog can't be closed. Note that no problem on Intel and PowerPC Mac.

- Some HTML features like special characters and display of graphic files do not yet work on Mac.

- I tested with GTK2 and the FrameDem app displays some HTML, then throws a run-time 202 (stack overflow) exception that crashes the app. Offhand this looks like something is looping in the GTK2 widgetset code that eventually exhausts the stack, since the same code works fine on Windows and Mac Carbon.

Please post here your experiences with this package. In my experience, some of the problems with a newly ported package ultimately prove to be gaps or bugs in the LCL, not anything wrong with the original or ported package code. To get these things fixed generally requires that you post a small app on the Bugtracker site (at left) that demonstrates the LCL or IDE problem. In other words, the better that the LCL and IDE work consistently across platforms, the better chance that a ported package will eventually work acceptably.

Thanks.

-Phil

http://web.fastermac.net/~MacPgmr/Lazarus/

(Grab the THtmlPort .zip file.)



uuf6429

  • Newbie
  • Posts: 4
  • C++: an octopus made by nailing legs to a dog.
    • Covac Software
Re: TwebBrowser in lazarus ?
« Reply #12 on: October 31, 2009, 10:39:05 pm »
There could be a plugin/component for Mozilla XULRunner. This means a browser could be used on any platform, since Firefox is cross-platform as well.
I've seen this (and used it as well) in Java, thanks to Christopher Deckers' "NativeSwing" (for Java).

Someone mentioned JS being compiled, that is very unlikely:
1. JS is too dynamic to be easily compiled.
2. JS applications change themselves, most of the time, rewriting themselves (for example, AJAX applications).
3. ...

Writing a web browser is NOT easy. Take into consideration all the different "features" it needs to have. Besides, we really do not want Yet Another Web Browser on the market (with it's own set of quirks) do we?

In cases where you need to show some basic stuff, the current HTML viewers should be perfect for the job. When a really good web browser component is needed, it's better to use another company's (Lazarus team looks already too busy without having to make the next-generation web browser).

Regards,
Christian Sciberras
Programmer (n): An organism that can turn caffeine into code.

alter

  • Full Member
  • ***
  • Posts: 151
    • KSP website
Re: TwebBrowser in lazarus ?
« Reply #13 on: November 01, 2009, 12:22:41 am »
Writing a web browser is NOT easy. Take into consideration all the different "features" it needs to have. Besides, we really do not want Yet Another Web Browser on the market (with it's own set of quirks) do we?
Just for a notice you mean another rendering engine rather, right?:-)

In cases where you need to show some basic stuff, the current HTML viewers should be perfect for the job. When a really good web browser component is needed, it's better to use another company's (Lazarus team looks already too busy without having to make the next-generation web browser).

Regards,
Christian Sciberras
As I said above. We already have working example using Qt. What is needed now it's proper headers for either WebKit (not the one used by Qt ofc) or Gecko that someone will maintain. It's pretty much Qt bindings except that this time you might not have to write another library in order to put proper functionality.

mica

  • Full Member
  • ***
  • Posts: 192
Re: TwebBrowser in lazarus ?
« Reply #14 on: November 01, 2009, 12:35:33 am »
i tried THmlPort on Linux but i get a
cant find htmlview errror.
i renamed it to Htmlview.pas but the error remains.
« Last Edit: November 01, 2009, 12:39:34 am by mica »