Make it compatible with XULRunner 2.0.0.8pre

It must be compiled with -dXULRUNNER2 as some interfaces has changed the iid and interface.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1398 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Joshy 2010-12-06 18:25:39 +00:00
parent 039afe9efa
commit bfef390ae7
2 changed files with 45 additions and 0 deletions

View File

@ -2927,6 +2927,15 @@ type
procedure SizeToContent(); safecall;
end;
{$IFDEF XULRUNNER2}
nsIDOMWindow2 = interface(nsIDOMWindow)
['{a6cf906b-15b3-11d2-932e-00805f8add32}']
function GetWindowRoot(): nsIDOMEventTarget; safecall;
property WindowRoot: nsIDOMEventTarget read GetWindowRoot;
function GetApplicationCache(): nsIDOMOfflineResourceList; safecall;
property ApplicationCache: nsIDOMOfflineResourceList read GetApplicationCache;
end;
{$ELSE XULRUNNER2}
nsIDOMWindow2 = interface(nsIDOMWindow)
['{73c5fa35-3add-4c87-a303-a850ccf4d65a}']
function GetWindowRoot(): nsIDOMEventTarget; safecall;
@ -2934,6 +2943,7 @@ type
function GetApplicationCache(): nsIDOMOfflineResourceList; safecall;
property ApplicationCache: nsIDOMOfflineResourceList read GetApplicationCache;
end;
{$ENDIF}
nsIDOMWindowCollection = interface(nsISupports)
['{a6cf906f-15b3-11d2-932e-00805f8add32}']
@ -3829,6 +3839,24 @@ type
function GetWeakReference(): nsIWeakReference; safecall;
end;
{$IFDEF XULRUNNER2}
nsIWebBrowser = interface(nsISupports)
['{33e9d001-caab-4ba9-8961-54902f197202}']
procedure AddWebBrowserListener(aListener: nsIWeakReference; constref aIID: TGUID); safecall;
procedure RemoveWebBrowserListener(aListener: nsIWeakReference; constref aIID: TGUID); safecall;
function GetContainerWindow(): nsIWebBrowserChrome; safecall;
procedure SetContainerWindow(aContainerWindow: nsIWebBrowserChrome); safecall;
property ContainerWindow: nsIWebBrowserChrome read GetContainerWindow write SetContainerWindow;
function GetParentURIContentListener(): nsIURIContentListener; safecall;
procedure SetParentURIContentListener(aParentURIContentListener: nsIURIContentListener); safecall;
property ParentURIContentListener: nsIURIContentListener read GetParentURIContentListener write SetParentURIContentListener;
function GetContentDOMWindow(): nsIDOMWindow; safecall;
property ContentDOMWindow: nsIDOMWindow read GetContentDOMWindow;
function GetIsActive: PRBool; safecall;
procedure SetIsActive(aIsActive: PRBool); safecall;
property IsActive: PRBool read GetIsActive write SetIsActive;
end;
{$ELSE XULRUNNER2}
nsIWebBrowser = interface(nsISupports)
['{69e5df00-7b8b-11d3-af61-00a024ffc08c}']
procedure AddWebBrowserListener(aListener: nsIWeakReference; constref aIID: TGUID); safecall;
@ -3842,6 +3870,7 @@ type
function GetContentDOMWindow(): nsIDOMWindow; safecall;
property ContentDOMWindow: nsIDOMWindow read GetContentDOMWindow;
end;
{$ENDIF}
nsIWebBrowserChrome = interface(nsISupports)
['{ba434c60-9d52-11d3-afb0-00a024ffc08c}']

View File

@ -120,6 +120,12 @@ var
aAppDirProvider: nsIDirectoryServiceProvider;
const aStaticComponents: PStaticModuleInfoArray;
aStaticComponentCount: PRUint32): nsresult; cdecl;
{$IFDEF XULRUNNER2}
initEmbedding2Func :
function (aLibXulDirectory: nsILocalFile;
aAppDirectory: nsILocalFile;
aAppDirProvider: nsIDirectoryServiceProvider): nsresult; cdecl;
{$ENDIF}
notifyProfileFunc : procedure (); cdecl;
termEmbeddingFunc : procedure (); cdecl;
createAppDataFunc :
@ -291,6 +297,9 @@ begin
getStaticComponentsFunc := GetProcAddress(xulModule, 'XRE_GetStaticComponents');
lockProfileDirectoryFunc := GetProcAddress(xulModule, 'XRE_LockProfileDirectory');
initEmbeddingFunc := GetProcAddress(xulModule, 'XRE_InitEmbedding');
{$IFDEF XULRUNNER2}
initEmbedding2Func := GetProcAddress(xulModule, 'XRE_InitEmbedding2');
{$ENDIF}
notifyProfileFunc := GetProcAddress(xulModule, 'XRE_NotifyProfile');
termEmbeddingFunc := GetProcAddress(xulModule, 'XRE_TermEmbedding');
createAppDataFunc := GetProcAddress(xulModule, 'XRE_CreateAppData');
@ -478,6 +487,13 @@ begin
aStaticComponents,
aStaticComponentCount)
else
{$IFDEF XULRUNNER2}
if Assigned(initEmbedding2Func) then
Result := initEmbedding2Func(aLibXulDirectory,
aAppDirectory,
aAppDirProvider)
else
{$ENDIF}
Result := NS_ERROR_NOT_IMPLEMENTED;
end;