Embedding/NewApi/Win32: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 37: Line 37:


== Using XULRunner SDK ==
== Using XULRunner SDK ==
* [http://developer.mozilla.org/en/docs/index.php?title=Gecko_SDK xulrunner sdk].
* Get it from [http://developer.mozilla.org/en/docs/index.php?title=Gecko_SDK xulrunner sdk].
* Set GRE_HOME to point to the xulrunner-sdk/bin folder.
* Set GRE_HOME to point to the xulrunner-sdk/bin folder.
'''Note''': There are currently some issues when building against the xulrunner sdk on win32, e.g. debug builds crash. The xulrunner sdk is using a patched win32 CRT (for jemalloc).
* '''Note''': The xulrunner sdk is using a patched win32 CRT (for jemalloc). This requires that you change the project settings to use the statically linked CRT (under "C/C++ > Code Generation > Runtime Library" and choose a non DLL library: /MT or /MTd)

Revision as of 09:40, 8 July 2008

Sample using the new API and win32

This is a small test application using the win32 API and the new embedding API to implement a very rudimentary browser.

Prerequisites

  • A build of xulrunner or firefox. A debug build is recommended during development. More on building xulrunner can be found here. This is a sample mozconfig
mk_add_options MOZ_CO_PROJECT=browser,xulrunner

ac_add_options --enable-application=browser

ac_add_options --enable-debug
ac_add_options --disable-optimize
ac_add_options --enable-tests

ac_add_options --disable-installer
ac_add_options --disable-crashreporter
ac_add_options --disable-javaxpcom
ac_add_options --disable-printing
ac_add_options --disable-embedding-tests

mk_add_options MOZ_OBJDIR=@topsrcdir@/../objdir
mk_add_options MOZ_MAKE_FLAGS=-j4
  • Get the code
  • Set the environment variable GRE_HOME to point to your build's dist/bin folder

Building

There are VisualC++ solutions for both 2005 and 2008. They are found under mozembed/win32:

  • win32_test.sln for VC2005
  • win32_test_2008.sln for VC2008

Running

You need to have GRE_HOME in your path. As this might conflict with an existing firefox install, you may want to set this up in the VC debug properties. You can add a line like this under Environment:

PATH=$(GRE_HOME);$(PATH)

Using XULRunner SDK

  • Get it from xulrunner sdk.
  • Set GRE_HOME to point to the xulrunner-sdk/bin folder.
  • Note: The xulrunner sdk is using a patched win32 CRT (for jemalloc). This requires that you change the project settings to use the statically linked CRT (under "C/C++ > Code Generation > Runtime Library" and choose a non DLL library: /MT or /MTd)