Sign in Join
Wiki copytemporary

GeckoPort version2: what changed

Revision 5 to 6. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11### About
22
33GeckoPort is a Lazarus/Free Pascal version of Takanori Ito's Gecko SDK for Delphi, including the TGeckoBrowser component. Version 2 is based on automatically generated include-files from the idl files from the Gecko SDK. For this purpose the idltopas utility is used. This way it's earier to follow the fast Gecko-release cycle now gecko-developers do not maintain backwards compatibility anymore. You can find more information about the old version of GeckoPort [[GeckoPort|here]].
44
55Current sources are based on Gecko 9, as Gecko 10 has a bug preventing it from being embedded.
66
77### Screenshots
88
99![](/wiki-images/c/cc/GeckoPort_GBrowser_Win32.jpg)
1010
1111### License
1212
1313MPL 1.1
1414
1515### Installation
1616
1717There is a fpmake-package for GeckoPort in the Free Pascal repository. To install the geckoport fpmake-package on your system:
1818
1919- Make sure that you have [[fppkg]] correctly configured. Also look if the [[fppkg|path of your Lazarus installation]] is correctly set.
2020- Install the fpmake gecko-package for Free Pascal. Give the following command on the command line:
2121
2222``` bash
2323fppkg install gecko
2424```
2525
2626- When the installation is complete (re)start Lazarus
2727- In Lazarus, choose Package \| Install/Uninstall Packages
2828- Select GeckoComponents in the list of 'Do not install' packages and click on 'Install selection'.
2929- Click 'Save and rebuild IDE' to rebuild and relaunch Lazarus.
3030
3131To compile a sample app:
3232
3333- Choose File \| Open, then select ChromeWin.lpi or GBrowser.lpi (both in the SampleApps subfolder).
3434- Choose Run \| Run to compile and run the sample app.
3535
3636Note that you'll need the Gecko libraries installed before you can run one of the sample apps. If necessary, use an installer from here:
3737
38-` `[`https://developer.mozilla.org/en/XULRunner`](https://developer.mozilla.org/en/XULRunner)
38+```text
39+ https://developer.mozilla.org/en/XULRunner
40+```
3941
4042### Development
4143
4244You can download the sources from the GeckoPort from the Lazarus-ccr using Subversion:
4345
4446``` bash
4547svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/geckoport/version2 [local dir]
4648```
4749
4850To install this version, go to the (local) source-directory and use
4951
5052``` bash
5153fppkg install -o -gl
5254```
5355
5456The '-o -gl' parameters are to include debug-info.
5557
5658### To Do
5759
5860#### Win32 widgetset
5961
6062The ChromeWin and GBrowser sample apps work the same as they do with Delphi.
6163
6264Currently the code looks for a xulrunner in the following order:
6365
6466- The ParamStr(1). This means the first parameter in command line. This is **temporary** for testing purposes only and it will be removed soon.
6567- The application is located in the same folder as the xulrunner.
6668- The xulrunner is located in a folder under application executable. Folder must be named "xulrunner".
6769- Scan registry looking for a GRE "*Gecko Runtime Environment*".
6870- Scan registry looking for a Firefox installation.
6971
7072With 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:
7173
7274``` pascal
7375SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]);
7476```
7577
7678Note 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.
7779
7880Firefox 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.
7981
8082#### Carbon widgetset
8183
8284A 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.
8385
8486#### Cocoa widgetset
8587
8688Although 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.
8789
8890Note 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, version 2.6 or higher, or compiled from FPC SVN trunk).
8991
9092You 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.
9193
9294To 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.
9395
9496The GBrowser sample app will crash because of the current incomplete state of the Cocoa widgetset.
9597
9698#### GTK2 widgetset
9799
98100On Linux, be sure to set the LD_LIBRARY_PATH environment variable to the xulrunner directory before running one of the sample apps. For example:
99101
100102``` bash
101103export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/xulrunner-1.9.1.4
102104```
103105
104106The Gecko detect code in Linux gets the LD_LIBRARY_PATH environment variable and looks for a suitable XULRunner which path is in it.
105107
106108Currently 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.
107109
108110Please report testing success or failure to the GeckoPort maintainer:
109111
110-` "José Mejuto" joshyfun (at) gmail (dot) com (`*`Current maintainer`*`)`\
111-` MacPgmr (at) fastermac (dot) net (`*`Original maintainer`*`)`
112+```text
113+ "José Mejuto" joshyfun (at) gmail (dot) com (Current maintainer)
114+ MacPgmr (at) fastermac (dot) net (Original maintainer)
115+```
112116
113117## See also
114118
115119- [[GeckoPort]]
116120
117121---
118122*From the Free Pascal wiki, page "GeckoPort version2", 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).*
119123Category: Components
120124Category: Lazarus-CCR

Back to history