Sign in Join
Wiki copytemporary

GeckoPort: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11### New version available
22
33This information is based on the older, version 1 of GeckoPort. For the latest version see [[GeckoPort version2|here]].
44
55### About
66
77GeckoPort is a Lazarus/Free Pascal version of Takanori Ito's Gecko SDK for Delphi, including the TGeckoBrowser component. The original unported Delphi source is available from here:
88
99` `[`http://d-gecko.svn.sourceforge.net/viewvc/d-gecko/`](http://d-gecko.svn.sourceforge.net/viewvc/d-gecko/)
1010
1111### Screenshots
1212
13-<figure>
1413<img src="GeckoPort_GBrowser_Win32.jpg" title="GBrowser sample app using the Win32 widgetset" width="600" />
15-<figcaption>GBrowser sample app using the Win32 widgetset</figcaption>
16-</figure>
1714
1815### Download
1916
2017You can download the ported source using Subversion:
2118
2219``` bash
2320svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/geckoport/version1 [local dir]
2421```
2522
2623### License
2724
2825MPL 1.1
2926
3027### Installation
3128
3229To install the GeckoComponents package in Lazarus:
3330
3431- Choose Package \| Open package file, then select GeckoComponents.lpk (in the Components subfolder).
3532
3633- Click Compile to compile the package.
3734
3835- Click Install to rebuild and relaunch Lazarus.
3936
4037To compile a sample app:
4138
4239- Choose File \| Open, then select ChromeWin.lpi or GBrowser.lpi (both in the SampleApps subfolder).
4340
4441- Choose Run \| Run to compile and run the sample app.
4542
4643Note that you'll need the Gecko libraries installed before you can run one of the sample apps. If necessary, use an installer from here:
4744
4845` `[`https://developer.mozilla.org/en/XULRunner`](https://developer.mozilla.org/en/XULRunner)
4946
5047### To Do
5148
5249#### Win32 widgetset
5350
5451The ChromeWin and GBrowser sample apps work the same as they do with Delphi.
5552
5653Currently the code looks for a xulrunner in the following order:
5754
5855- The ParamStr(1). This means the first parameter in command line. This is **temporary** for testing purposes only and it will be removed soon.
5956- The application is located in the same folder as the xulrunner.
6057- The xulrunner is located in a folder under application executable. Folder must be named "xulrunner".
6158- Scan registry looking for a GRE "*Gecko Runtime Environment*".
6259- Scan registry looking for a Firefox installation.
6360
64-<s>Xulrunner working up to revision 1.9.1.11 Releases 1.9.2.x and up does not work currently.</s> XULRunner has been tested with 1.9.2.5 since calling mode in fpc 2.5.1 has been fixed and it works. XULRunner has been tested with 2.0.0.8pre and works but as there are some incompatibilities with 1.x.x.x branch in XULRunner the source code must be compiled using "-dXULRUNNER2".
61+Xulrunner working up to revision 1.9.1.11 Releases 1.9.2.x and up does not work currently. XULRunner has been tested with 1.9.2.5 since calling mode in fpc 2.5.1 has been fixed and it works. XULRunner has been tested with 2.0.0.8pre and works but as there are some incompatibilities with 1.x.x.x branch in XULRunner the source code must be compiled using "-dXULRUNNER2".
6562
6663With Free Pascal 2.4.x and 2.5.1 on Windows, you must disable floating point exceptions as soon as possible in your program. Add the Math unit to your uses clause and add the following statement at the beginning of your program:
6764
6865``` pascal
6966SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]);
7067```
7168
7269Note that this will disable floating point exceptions in all code, not just in the Gecko libraries. See the sample app .dpr files for examples of how to add this code.
7370
74-<s>Firefox runner has not been tested as 3.6 does not work at all.</s> Firefox runner is now working, tested with Firefox 3.6.12 but the application exe **MUST** be in the same folder as Firefox or you will get a hangup now of them.
71+Firefox runner has not been tested as 3.6 does not work at all. Firefox runner is now working, tested with Firefox 3.6.12 but the application exe **MUST** be in the same folder as Firefox or you will get a hangup now of them.
7572
7673#### Carbon widgetset
7774
78-<s>Carbon will not work due the lack of safecall calling convention in current fpc ( *2.5.1* ).</s>
75+Carbon will not work due the lack of safecall calling convention in current fpc ( *2.5.1* ).
7976
8077A native window must be passed in to initialize the browser component. On OS X, this must be a Cocoa window, otherwise the Carbon widgetset will not work.
8178
8279#### Cocoa widgetset
8380
84-<s>Cocoa will not work due the lack of safecall calling convention in current fpc ( *2.5.1* ).</s>
81+Cocoa will not work due the lack of safecall calling convention in current fpc ( *2.5.1* ).
8582
8683Although the Cocoa widgetset currently has support only for TForm and one or two other controls, the ChromeWin sample app can be run with the Cocoa widgetset since this app uses only TForm.
8784
8885Note that the GeckoPort package now uses the new Objective Pascal-based Cocoa widgetset instead of the old PasCocoa-based widgetset. To compile the ObjC-based Cocoa widgetset, you will need a version of FPC that includes Objective Pascal support (for example, compiled from the FPC SVN trunk, which is currently version 2.5.1).
8986
9087You will also need to set the app's widgetset to Cocoa, since the default is Carbon. Or you can compile ChromeWin.lpi with lazbuild and specify the --ws=cocoa switch. See the lb-cw-cocoa.sh script for an example.
9188
9289To run the ChromeWin sample app, you need to set DYLD_LIBRARY_PATH so that the XUL library can load the other Gecko libraries it depends on. A simple way to do this is to start ChromeWin.app with the included run-cw-mac.sh script. Note that this script assumes that you have the XUL.framework installed.
9390
9491The GBrowser sample app will crash because of the current incomplete state of the Cocoa widgetset.
9592
9693#### GTK2 widgetset
9794
98-<s>GTK2 on Linux/Unix will not work due the lack of safecall calling convention in current fpc ( *2.5.1* ).</s> Solved by Joost in fpc 2.5.1
95+GTK2 on Linux/Unix will not work due the lack of safecall calling convention in current fpc ( *2.5.1* ). Solved by Joost in fpc 2.5.1
9996
10097On Linux, be sure to set the LD_LIBRARY_PATH environment variable to the xulrunner directory before running one of the sample apps. For example:
10198
10299``` bash
103100export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/xulrunner-1.9.1.4
104101```
105102
106-<s>For now the code assumes that libxul.so is located in /usr/lib/xulrunner-1.9.1.4. You can edit the code to change this.</s>
103+For now the code assumes that libxul.so is located in /usr/lib/xulrunner-1.9.1.4. You can edit the code to change this.
107104
108105The Gecko detect code in Linux gets the LD_LIBRARY_PATH environment variable and looks for a suitable XULRunner which path is in it.
109106
110-<s>Currently the sample apps do not work on Linux, failing in libmozjs.so within the call to libxul.so's XRE_InitEmbedding from nsXRE.pas.</s>
107+Currently the sample apps do not work on Linux, failing in libmozjs.so within the call to libxul.so's XRE_InitEmbedding from nsXRE.pas.
111108
112109Currently sample apps works in Linux/Ubuntu 9.04 using Lazarus 0.9.29 and fpc 2.5.1 with some paint problems that I think will be resolved soon and seems to be related to GTK2 interface.
113110
114111Please report testing success or failure to the GeckoPort maintainer:
115112
116113` "José Mejuto" joshyfun (at) gmail (dot) com (`*`Current maintainer`*`)`\
117114` MacPgmr (at) fastermac (dot) net (`*`Original maintainer`*`)`
118115
119116## See also
120117
121118- [[GeckoPort version2]]
122119- [A detailed Tutorial at LazPlanet](http://lazplanet.blogspot.com/2013/10/browser-in-lazarus-with-gecko-pt1.html)
123120
124121---
125122*From the Free Pascal wiki, page "GeckoPort", as it stood on 2020-02-16 after a change by GAN, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
126123Category: Components
127124Category: Lazarus-CCR

Back to history