ReactOS  0.4.15-dev-1177-g6cb3b62
nsembed.c File Reference
#include "mshtml_private.h"
#include <wincon.h>
#include <shlobj.h>
Include dependency graph for nsembed.c:

Go to the source code of this file.

Classes

struct  nsSingletonEnumerator
 
struct  nsWeakReference
 

Macros

#define NS_APPSTARTUPNOTIFIER_CONTRACTID   "@mozilla.org/embedcomp/appstartup-notifier;1"
 
#define NS_WEBBROWSER_CONTRACTID   "@mozilla.org/embedding/browser/nsWebBrowser;1"
 
#define NS_COMMANDPARAMS_CONTRACTID   "@mozilla.org/embedcomp/command-params;1"
 
#define NS_HTMLSERIALIZER_CONTRACTID   "@mozilla.org/layout/contentserializer;1?mimetype=text/html"
 
#define NS_EDITORCONTROLLER_CONTRACTID   "@mozilla.org/editor/editorcontroller;1"
 
#define NS_PREFERENCES_CONTRACTID   "@mozilla.org/preferences;1"
 
#define NS_VARIANT_CONTRACTID   "@mozilla.org/variant;1"
 
#define NS_CATEGORYMANAGER_CONTRACTID   "@mozilla.org/categorymanager;1"
 
#define NS_XMLHTTPREQUEST_CONTRACTID   "@mozilla.org/xmlextras/xmlhttprequest;1"
 
#define NS_SCRIPTSECURITYMANAGER_CONTRACTID   "@mozilla.org/scriptsecuritymanager;1"
 
#define PR_UINT32_MAX   0xffffffff
 
#define NS_STRING_CONTAINER_INIT_DEPEND   0x0002
 
#define NS_CSTRING_CONTAINER_INIT_DEPEND   0x0002
 
#define NS_DLSYM(func)
 

Typedefs

typedef UINT32 PRUint32
 

Functions

 WINE_DECLARE_DEBUG_CHANNEL (gecko)
 
static nsresult (CDECL *NS_InitXPCOM2)(nsIServiceManager **
 
static nsIFile **static PRUint32 (CDECL *NS_StringGetData)(const nsAString *
 
static nsIFile **static const PRUnichar cpp_bool *static const char cpp_bool *static void *CDECLNS_Alloc (SIZE_T)
 
static void (CDECL *NS_Free)(void *)
 
nsresult create_nsfile (const PRUnichar *path, nsIFile **ret)
 
static nsSingletonEnumeratorimpl_from_nsISimpleEnumerator (nsISimpleEnumerator *iface)
 
static nsresult NSAPI nsSingletonEnumerator_QueryInterface (nsISimpleEnumerator *iface, nsIIDRef riid, void **ppv)
 
static nsrefcnt NSAPI nsSingletonEnumerator_AddRef (nsISimpleEnumerator *iface)
 
static nsrefcnt NSAPI nsSingletonEnumerator_Release (nsISimpleEnumerator *iface)
 
static nsresult NSAPI nsSingletonEnumerator_HasMoreElements (nsISimpleEnumerator *iface, cpp_bool *_retval)
 
static nsresult NSAPI nsSingletonEnumerator_GetNext (nsISimpleEnumerator *iface, nsISupports **_retval)
 
static nsISimpleEnumeratorcreate_singleton_enumerator (nsISupports *value)
 
static nsresult NSAPI nsDirectoryServiceProvider2_QueryInterface (nsIDirectoryServiceProvider2 *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsDirectoryServiceProvider2_AddRef (nsIDirectoryServiceProvider2 *iface)
 
static nsrefcnt NSAPI nsDirectoryServiceProvider2_Release (nsIDirectoryServiceProvider2 *iface)
 
static nsresult create_profile_directory (void)
 
static nsresult NSAPI nsDirectoryServiceProvider2_GetFile (nsIDirectoryServiceProvider2 *iface, const char *prop, cpp_bool *persistent, nsIFile **_retval)
 
static nsresult NSAPI nsDirectoryServiceProvider2_GetFiles (nsIDirectoryServiceProvider2 *iface, const char *prop, nsISimpleEnumerator **_retval)
 
static LRESULT WINAPI nsembed_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void register_nscontainer_class (void)
 
static BOOL install_wine_gecko (void)
 
static void set_environment (LPCWSTR gre_path)
 
static BOOL load_xul (const PRUnichar *gre_path)
 
static BOOL check_version (LPCWSTR gre_path, const char *version_string)
 
static BOOL load_wine_gecko_v (PRUnichar *gre_path, HKEY mshtml_key, const char *version, const char *version_string)
 
static BOOL load_wine_gecko (PRUnichar *gre_path)
 
static void set_bool_pref (nsIPrefBranch *pref, const char *pref_name, BOOL val)
 
static void set_int_pref (nsIPrefBranch *pref, const char *pref_name, int val)
 
static void set_string_pref (nsIPrefBranch *pref, const char *pref_name, const char *val)
 
static void set_lang (nsIPrefBranch *pref)
 
static void set_preferences (void)
 
static BOOL init_xpcom (const PRUnichar *gre_path)
 
BOOL load_gecko (void)
 
voidnsalloc (size_t size)
 
void nsfree (void *mem)
 
BOOL nsACString_Init (nsACString *str, const char *data)
 
void nsACString_InitDepend (nsACString *str, const char *data)
 
void nsACString_SetData (nsACString *str, const char *data)
 
UINT32 nsACString_GetData (const nsACString *str, const char **data)
 
void nsACString_Finish (nsACString *str)
 
BOOL nsAString_Init (nsAString *str, const PRUnichar *data)
 
void nsAString_InitDepend (nsAString *str, const PRUnichar *data)
 
UINT32 nsAString_GetData (const nsAString *str, const PRUnichar **data)
 
void nsAString_Finish (nsAString *str)
 
HRESULT return_nsstr (nsresult nsres, nsAString *nsstr, BSTR *p)
 
nsICommandParamscreate_nscommand_params (void)
 
nsIWritableVariantcreate_nsvariant (void)
 
charget_nscategory_entry (const char *category, const char *entry)
 
nsresult get_nsinterface (nsISupports *iface, REFIID riid, void **ppv)
 
static HRESULT nsnode_to_nsstring_rec (nsIContentSerializer *serializer, nsIDOMNode *nsnode, nsAString *str)
 
HRESULT nsnode_to_nsstring (nsIDOMNode *nsnode, nsAString *str)
 
void get_editor_controller (NSContainer *This)
 
void close_gecko (void)
 
BOOL is_gecko_path (const char *path)
 
void set_viewer_zoom (NSContainer *nscontainer, float factor)
 
static nsWeakReferenceimpl_from_nsIWeakReference (nsIWeakReference *iface)
 
static nsresult NSAPI nsWeakReference_QueryInterface (nsIWeakReference *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsWeakReference_AddRef (nsIWeakReference *iface)
 
static nsrefcnt NSAPI nsWeakReference_Release (nsIWeakReference *iface)
 
static nsresult NSAPI nsWeakReference_QueryReferent (nsIWeakReference *iface, const nsIID *riid, void **result)
 
static NSContainerimpl_from_nsIWebBrowserChrome (nsIWebBrowserChrome *iface)
 
static nsresult NSAPI nsWebBrowserChrome_QueryInterface (nsIWebBrowserChrome *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsWebBrowserChrome_AddRef (nsIWebBrowserChrome *iface)
 
static nsrefcnt NSAPI nsWebBrowserChrome_Release (nsIWebBrowserChrome *iface)
 
static nsresult NSAPI nsWebBrowserChrome_SetStatus (nsIWebBrowserChrome *iface, UINT32 statusType, const PRUnichar *status)
 
static nsresult NSAPI nsWebBrowserChrome_GetWebBrowser (nsIWebBrowserChrome *iface, nsIWebBrowser **aWebBrowser)
 
static nsresult NSAPI nsWebBrowserChrome_SetWebBrowser (nsIWebBrowserChrome *iface, nsIWebBrowser *aWebBrowser)
 
static nsresult NSAPI nsWebBrowserChrome_GetChromeFlags (nsIWebBrowserChrome *iface, UINT32 *aChromeFlags)
 
static nsresult NSAPI nsWebBrowserChrome_SetChromeFlags (nsIWebBrowserChrome *iface, UINT32 aChromeFlags)
 
static nsresult NSAPI nsWebBrowserChrome_DestroyBrowserWindow (nsIWebBrowserChrome *iface)
 
static nsresult NSAPI nsWebBrowserChrome_SizeBrowserTo (nsIWebBrowserChrome *iface, LONG aCX, LONG aCY)
 
static nsresult NSAPI nsWebBrowserChrome_ShowAsModal (nsIWebBrowserChrome *iface)
 
static nsresult NSAPI nsWebBrowserChrome_IsWindowModal (nsIWebBrowserChrome *iface, cpp_bool *_retval)
 
static nsresult NSAPI nsWebBrowserChrome_ExitModalEventLoop (nsIWebBrowserChrome *iface, nsresult aStatus)
 
static NSContainerimpl_from_nsIContextMenuListener (nsIContextMenuListener *iface)
 
static nsresult NSAPI nsContextMenuListener_QueryInterface (nsIContextMenuListener *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsContextMenuListener_AddRef (nsIContextMenuListener *iface)
 
static nsrefcnt NSAPI nsContextMenuListener_Release (nsIContextMenuListener *iface)
 
static nsresult NSAPI nsContextMenuListener_OnShowContextMenu (nsIContextMenuListener *iface, UINT32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode)
 
static NSContainerimpl_from_nsIURIContentListener (nsIURIContentListener *iface)
 
static nsresult NSAPI nsURIContentListener_QueryInterface (nsIURIContentListener *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsURIContentListener_AddRef (nsIURIContentListener *iface)
 
static nsrefcnt NSAPI nsURIContentListener_Release (nsIURIContentListener *iface)
 
static nsresult NSAPI nsURIContentListener_OnStartURIOpen (nsIURIContentListener *iface, nsIURI *aURI, cpp_bool *_retval)
 
static nsresult NSAPI nsURIContentListener_DoContent (nsIURIContentListener *iface, const nsACString *aContentType, cpp_bool aIsContentPreferred, nsIRequest *aRequest, nsIStreamListener **aContentHandler, cpp_bool *_retval)
 
static nsresult NSAPI nsURIContentListener_IsPreferred (nsIURIContentListener *iface, const char *aContentType, char **aDesiredContentType, cpp_bool *_retval)
 
static nsresult NSAPI nsURIContentListener_CanHandleContent (nsIURIContentListener *iface, const char *aContentType, cpp_bool aIsContentPreferred, char **aDesiredContentType, cpp_bool *_retval)
 
static nsresult NSAPI nsURIContentListener_GetLoadCookie (nsIURIContentListener *iface, nsISupports **aLoadCookie)
 
static nsresult NSAPI nsURIContentListener_SetLoadCookie (nsIURIContentListener *iface, nsISupports *aLoadCookie)
 
static nsresult NSAPI nsURIContentListener_GetParentContentListener (nsIURIContentListener *iface, nsIURIContentListener **aParentContentListener)
 
static nsresult NSAPI nsURIContentListener_SetParentContentListener (nsIURIContentListener *iface, nsIURIContentListener *aParentContentListener)
 
static NSContainerimpl_from_nsIEmbeddingSiteWindow (nsIEmbeddingSiteWindow *iface)
 
static nsresult NSAPI nsEmbeddingSiteWindow_QueryInterface (nsIEmbeddingSiteWindow *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsEmbeddingSiteWindow_AddRef (nsIEmbeddingSiteWindow *iface)
 
static nsrefcnt NSAPI nsEmbeddingSiteWindow_Release (nsIEmbeddingSiteWindow *iface)
 
static nsresult NSAPI nsEmbeddingSiteWindow_SetDimensions (nsIEmbeddingSiteWindow *iface, UINT32 flags, LONG x, LONG y, LONG cx, LONG cy)
 
static nsresult NSAPI nsEmbeddingSiteWindow_GetDimensions (nsIEmbeddingSiteWindow *iface, UINT32 flags, LONG *x, LONG *y, LONG *cx, LONG *cy)
 
static nsresult NSAPI nsEmbeddingSiteWindow_SetFocus (nsIEmbeddingSiteWindow *iface)
 
static nsresult NSAPI nsEmbeddingSiteWindow_GetVisibility (nsIEmbeddingSiteWindow *iface, cpp_bool *aVisibility)
 
static nsresult NSAPI nsEmbeddingSiteWindow_SetVisibility (nsIEmbeddingSiteWindow *iface, cpp_bool aVisibility)
 
static nsresult NSAPI nsEmbeddingSiteWindow_GetTitle (nsIEmbeddingSiteWindow *iface, PRUnichar **aTitle)
 
static nsresult NSAPI nsEmbeddingSiteWindow_SetTitle (nsIEmbeddingSiteWindow *iface, const PRUnichar *aTitle)
 
static nsresult NSAPI nsEmbeddingSiteWindow_GetSiteWindow (nsIEmbeddingSiteWindow *iface, void **aSiteWindow)
 
static NSContainerimpl_from_nsITooltipListener (nsITooltipListener *iface)
 
static nsresult NSAPI nsTooltipListener_QueryInterface (nsITooltipListener *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsTooltipListener_AddRef (nsITooltipListener *iface)
 
static nsrefcnt NSAPI nsTooltipListener_Release (nsITooltipListener *iface)
 
static nsresult NSAPI nsTooltipListener_OnShowTooltip (nsITooltipListener *iface, LONG aXCoord, LONG aYCoord, const PRUnichar *aTipText)
 
static nsresult NSAPI nsTooltipListener_OnHideTooltip (nsITooltipListener *iface)
 
static NSContainerimpl_from_nsIInterfaceRequestor (nsIInterfaceRequestor *iface)
 
static nsresult NSAPI nsInterfaceRequestor_QueryInterface (nsIInterfaceRequestor *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsInterfaceRequestor_AddRef (nsIInterfaceRequestor *iface)
 
static nsrefcnt NSAPI nsInterfaceRequestor_Release (nsIInterfaceRequestor *iface)
 
static nsresult NSAPI nsInterfaceRequestor_GetInterface (nsIInterfaceRequestor *iface, nsIIDRef riid, void **result)
 
static NSContainerimpl_from_nsISupportsWeakReference (nsISupportsWeakReference *iface)
 
static nsresult NSAPI nsSupportsWeakReference_QueryInterface (nsISupportsWeakReference *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsSupportsWeakReference_AddRef (nsISupportsWeakReference *iface)
 
static nsrefcnt NSAPI nsSupportsWeakReference_Release (nsISupportsWeakReference *iface)
 
static nsresult NSAPI nsSupportsWeakReference_GetWeakReference (nsISupportsWeakReference *iface, nsIWeakReference **_retval)
 
static HRESULT init_nscontainer (NSContainer *nscontainer)
 
HRESULT create_nscontainer (HTMLDocumentObj *doc, NSContainer **_ret)
 
void NSContainer_Release (NSContainer *This)
 
nsIXMLHttpRequestcreate_nsxhr (nsIDOMWindow *nswindow)
 

Variables

static cpp_bool
 
static HINSTANCE xul_handle = NULL
 
static nsIServiceManagerpServMgr = NULL
 
static nsIComponentManagerpCompMgr = NULL
 
static nsICategoryManagercat_mgr
 
static nsIFileprofile_directory
 
static nsIFileplugin_directory
 
static const WCHAR wszNsContainer [] = {'N','s','C','o','n','t','a','i','n','e','r',0}
 
static ATOM nscontainer_class
 
static WCHAR gecko_path [MAX_PATH]
 
static unsigned gecko_path_len
 
static const nsISimpleEnumeratorVtbl nsSingletonEnumeratorVtbl
 
static const nsIDirectoryServiceProvider2Vtbl nsDirectoryServiceProvider2Vtbl
 
static nsIDirectoryServiceProvider2 nsDirectoryServiceProvider2
 
static CRITICAL_SECTION cs_load_gecko = { &cs_load_gecko_dbg, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG cs_load_gecko_dbg
 
static const nsIWeakReferenceVtbl nsWeakReferenceVtbl
 
static const nsIWebBrowserChromeVtbl nsWebBrowserChromeVtbl
 
static const nsIContextMenuListenerVtbl nsContextMenuListenerVtbl
 
static const nsIURIContentListenerVtbl nsURIContentListenerVtbl
 
static const nsIEmbeddingSiteWindowVtbl nsEmbeddingSiteWindowVtbl
 
static const nsITooltipListenerVtbl nsTooltipListenerVtbl
 
static const nsIInterfaceRequestorVtbl nsInterfaceRequestorVtbl
 
static const nsISupportsWeakReferenceVtbl nsSupportsWeakReferenceVtbl
 

Macro Definition Documentation

◆ NS_APPSTARTUPNOTIFIER_CONTRACTID

#define NS_APPSTARTUPNOTIFIER_CONTRACTID   "@mozilla.org/embedcomp/appstartup-notifier;1"

Definition at line 26 of file nsembed.c.

◆ NS_CATEGORYMANAGER_CONTRACTID

#define NS_CATEGORYMANAGER_CONTRACTID   "@mozilla.org/categorymanager;1"

Definition at line 33 of file nsembed.c.

◆ NS_COMMANDPARAMS_CONTRACTID

#define NS_COMMANDPARAMS_CONTRACTID   "@mozilla.org/embedcomp/command-params;1"

Definition at line 28 of file nsembed.c.

◆ NS_CSTRING_CONTAINER_INIT_DEPEND

#define NS_CSTRING_CONTAINER_INIT_DEPEND   0x0002

Definition at line 40 of file nsembed.c.

◆ NS_DLSYM

#define NS_DLSYM (   func)
Value:
if(!func) \
ERR("Could not GetProcAddress(" #func ") failed\n")
GLenum func
Definition: glext.h:6028
static HINSTANCE xul_handle
Definition: nsembed.c:59
#define GetProcAddress(x, y)
Definition: compat.h:501

◆ NS_EDITORCONTROLLER_CONTRACTID

#define NS_EDITORCONTROLLER_CONTRACTID   "@mozilla.org/editor/editorcontroller;1"

Definition at line 30 of file nsembed.c.

◆ NS_HTMLSERIALIZER_CONTRACTID

#define NS_HTMLSERIALIZER_CONTRACTID   "@mozilla.org/layout/contentserializer;1?mimetype=text/html"

Definition at line 29 of file nsembed.c.

◆ NS_PREFERENCES_CONTRACTID

#define NS_PREFERENCES_CONTRACTID   "@mozilla.org/preferences;1"

Definition at line 31 of file nsembed.c.

◆ NS_SCRIPTSECURITYMANAGER_CONTRACTID

#define NS_SCRIPTSECURITYMANAGER_CONTRACTID   "@mozilla.org/scriptsecuritymanager;1"

Definition at line 35 of file nsembed.c.

◆ NS_STRING_CONTAINER_INIT_DEPEND

#define NS_STRING_CONTAINER_INIT_DEPEND   0x0002

Definition at line 39 of file nsembed.c.

◆ NS_VARIANT_CONTRACTID

#define NS_VARIANT_CONTRACTID   "@mozilla.org/variant;1"

Definition at line 32 of file nsembed.c.

◆ NS_WEBBROWSER_CONTRACTID

#define NS_WEBBROWSER_CONTRACTID   "@mozilla.org/embedding/browser/nsWebBrowser;1"

Definition at line 27 of file nsembed.c.

◆ NS_XMLHTTPREQUEST_CONTRACTID

#define NS_XMLHTTPREQUEST_CONTRACTID   "@mozilla.org/xmlextras/xmlhttprequest;1"

Definition at line 34 of file nsembed.c.

◆ PR_UINT32_MAX

#define PR_UINT32_MAX   0xffffffff

Definition at line 37 of file nsembed.c.

Typedef Documentation

◆ PRUint32

static nsIFile **static const PRUnichar cpp_bool *static PRUint32

Definition at line 42 of file nsembed.c.

Function Documentation

◆ check_version()

static BOOL check_version ( LPCWSTR  gre_path,
const char version_string 
)
static

Definition at line 521 of file nsembed.c.

522 {
524  char version[128];
525  DWORD read=0;
526  HANDLE hfile;
527 
528  static const WCHAR wszVersion[] = {'\\','V','E','R','S','I','O','N',0};
529 
530  strcpyW(file_name, gre_path);
531  strcatW(file_name, wszVersion);
532 
535  if(hfile == INVALID_HANDLE_VALUE) {
536  ERR("Could not open VERSION file\n");
537  return FALSE;
538  }
539 
540  ReadFile(hfile, version, sizeof(version), &read, NULL);
541  version[read] = 0;
542  CloseHandle(hfile);
543 
544  TRACE("%s\n", debugstr_a(version));
545 
547  ERR("Unexpected version %s, expected %s\n", debugstr_a(version),
549  return FALSE;
550  }
551 
552  return TRUE;
553 }
#define CloseHandle
Definition: compat.h:487
#define TRUE
Definition: types.h:120
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
#define FILE_SHARE_READ
Definition: compat.h:136
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:66
#define OPEN_EXISTING
Definition: compat.h:523
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define GENERIC_READ
Definition: compat.h:135
#define ERR(fmt,...)
Definition: debug.h:110
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define ReadFile(a, b, c, d, e)
Definition: compat.h:490
static LPCWSTR file_name
Definition: protocol.c:147
#define CreateFileW
Definition: compat.h:489
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char version_string[]
Definition: mkisofs.c:71
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

Referenced by load_wine_gecko_v(), and SECUR32_initNTLMSP().

◆ close_gecko()

void close_gecko ( void  )

Definition at line 1076 of file nsembed.c.

1077 {
1078  TRACE("()\n");
1079 
1080  release_nsio();
1082 
1083  if(profile_directory) {
1084  nsIFile_Release(profile_directory);
1086  }
1087 
1088  if(plugin_directory) {
1089  nsIFile_Release(plugin_directory);
1091  }
1092 
1093  if(pCompMgr)
1094  nsIComponentManager_Release(pCompMgr);
1095 
1096  if(pServMgr)
1097  nsIServiceManager_Release(pServMgr);
1098 
1099  if(cat_mgr)
1100  nsICategoryManager_Release(cat_mgr);
1101 
1102  /* Gecko doesn't really support being unloaded */
1103  /* if (hXPCOM) FreeLibrary(hXPCOM); */
1104 
1106 }
static nsICategoryManager * cat_mgr
Definition: nsembed.c:63
static nsIServiceManager * pServMgr
Definition: nsembed.c:61
smooth NULL
Definition: ftsmooth.c:416
void release_nsio(void) DECLSPEC_HIDDEN
Definition: nsio.c:4085
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define TRACE(s)
Definition: solgame.cpp:4
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static nsIFile * profile_directory
Definition: nsembed.c:64
static nsIFile * plugin_directory
Definition: nsembed.c:64
void init_mutation(nsIComponentManager *) DECLSPEC_HIDDEN
Definition: mutation.c:774
static CRITICAL_SECTION cs_load_gecko
Definition: nsembed.c:733

Referenced by process_detach().

◆ create_nscommand_params()

nsICommandParams* create_nscommand_params ( void  )

Definition at line 865 of file nsembed.c.

866 {
868  nsresult nsres;
869 
870  if(!pCompMgr)
871  return NULL;
872 
873  nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
874  NS_COMMANDPARAMS_CONTRACTID, NULL, &IID_nsICommandParams,
875  (void**)&ret);
876  if(NS_FAILED(nsres))
877  ERR("Could not get nsICommandParams\n");
878 
879  return ret;
880 }
smooth NULL
Definition: ftsmooth.c:416
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define NS_FAILED(res)
int ret
#define ERR(fmt,...)
Definition: debug.h:110
#define NS_COMMANDPARAMS_CONTRACTID
Definition: nsembed.c:28
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by exec_fontname(), exec_forecolor(), query_ns_edit_status(), set_ns_align(), and set_ns_fontname().

◆ create_nscontainer()

HRESULT create_nscontainer ( HTMLDocumentObj doc,
NSContainer **  _ret 
)

Definition at line 2076 of file nsembed.c.

2077 {
2078  NSContainer *ret;
2079  HRESULT hres;
2080 
2081  if(!load_gecko())
2083 
2084  ret = heap_alloc_zero(sizeof(NSContainer));
2085  if(!ret)
2086  return E_OUTOFMEMORY;
2087 
2088  ret->nsIWebBrowserChrome_iface.lpVtbl = &nsWebBrowserChromeVtbl;
2089  ret->nsIContextMenuListener_iface.lpVtbl = &nsContextMenuListenerVtbl;
2090  ret->nsIURIContentListener_iface.lpVtbl = &nsURIContentListenerVtbl;
2091  ret->nsIEmbeddingSiteWindow_iface.lpVtbl = &nsEmbeddingSiteWindowVtbl;
2092  ret->nsITooltipListener_iface.lpVtbl = &nsTooltipListenerVtbl;
2093  ret->nsIInterfaceRequestor_iface.lpVtbl = &nsInterfaceRequestorVtbl;
2094  ret->nsISupportsWeakReference_iface.lpVtbl = &nsSupportsWeakReferenceVtbl;
2095 
2096  ret->doc = doc;
2097  ret->ref = 1;
2098 
2100  if(SUCCEEDED(hres))
2101  *_ret = ret;
2102  else
2103  nsIWebBrowserChrome_Release(&ret->nsIWebBrowserChrome_iface);
2104  return hres;
2105 }
static HRESULT init_nscontainer(NSContainer *nscontainer)
Definition: nsembed.c:1968
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const nsIInterfaceRequestorVtbl nsInterfaceRequestorVtbl
Definition: nsembed.c:1908
static const nsIContextMenuListenerVtbl nsContextMenuListenerVtbl
Definition: nsembed.c:1509
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
int ret
static const nsIURIContentListenerVtbl nsURIContentListenerVtbl
Definition: nsembed.c:1673
static const nsIEmbeddingSiteWindowVtbl nsEmbeddingSiteWindowVtbl
Definition: nsembed.c:1804
static const nsIWebBrowserChromeVtbl nsWebBrowserChromeVtbl
Definition: nsembed.c:1399
static const nsISupportsWeakReferenceVtbl nsSupportsWeakReferenceVtbl
Definition: nsembed.c:1961
#define _ret
BOOL load_gecko(void)
Definition: nsembed.c:742
static const nsITooltipListenerVtbl nsTooltipListenerVtbl
Definition: nsembed.c:1863
#define SUCCEEDED(hr)
Definition: intsafe.h:49

Referenced by HTMLDocument_Create().

◆ create_nsfile()

nsresult create_nsfile ( const PRUnichar path,
nsIFile **  ret 
)

Definition at line 72 of file nsembed.c.

73 {
74  nsAString str;
75  nsresult nsres;
76 
78  nsres = NS_NewLocalFile(&str, FALSE, ret);
80 
81  if(NS_FAILED(nsres))
82  WARN("NS_NewLocalFile failed: %08x\n", nsres);
83  return nsres;
84 }
#define WARN(fmt,...)
Definition: debug.h:112
#define FALSE
Definition: types.h:117
void nsAString_InitDepend(nsAString *str, const PRUnichar *data)
Definition: nsembed.c:826
const WCHAR * str
#define NS_FAILED(res)
int ret
void nsAString_Finish(nsAString *str)
Definition: nsembed.c:836
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by create_profile_directory(), init_xpcom(), nsDirectoryServiceProvider2_GetFiles(), and nsFileURL_GetFile().

◆ create_nsvariant()

nsIWritableVariant* create_nsvariant ( void  )

Definition at line 882 of file nsembed.c.

883 {
885  nsresult nsres;
886 
887  if(!pCompMgr)
888  return NULL;
889 
890  nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
891  NS_VARIANT_CONTRACTID, NULL, &IID_nsIWritableVariant, (void**)&ret);
892  if(NS_FAILED(nsres))
893  ERR("Could not get nsIVariant\n");
894 
895  return ret;
896 }
smooth NULL
Definition: ftsmooth.c:416
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define NS_FAILED(res)
int ret
#define ERR(fmt,...)
Definition: debug.h:110
#define NS_VARIANT_CONTRACTID
Definition: nsembed.c:32
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by HTMLSelectElement_add().

◆ create_nsxhr()

nsIXMLHttpRequest* create_nsxhr ( nsIDOMWindow nswindow)

Definition at line 2156 of file nsembed.c.

2157 {
2158  nsIScriptSecurityManager *secman;
2159  nsIPrincipal *nspri;
2160  nsIGlobalObject *nsglo;
2161  nsIXMLHttpRequest *nsxhr;
2162  nsresult nsres;
2163 
2164  nsres = nsIServiceManager_GetServiceByContractID(pServMgr,
2166  &IID_nsIScriptSecurityManager, (void**)&secman);
2167  if(NS_FAILED(nsres)) {
2168  ERR("Could not get sec manager service: %08x\n", nsres);
2169  return NULL;
2170  }
2171 
2172  nsres = nsIScriptSecurityManager_GetSystemPrincipal(secman, &nspri);
2173  nsIScriptSecurityManager_Release(secman);
2174  if(NS_FAILED(nsres)) {
2175  ERR("GetSystemPrincipal failed: %08x\n", nsres);
2176  return NULL;
2177  }
2178 
2179  nsres = nsIDOMWindow_QueryInterface(nswindow, &IID_nsIGlobalObject, (void **)&nsglo);
2180  assert(nsres == NS_OK);
2181 
2182  nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
2183  NS_XMLHTTPREQUEST_CONTRACTID, NULL, &IID_nsIXMLHttpRequest,
2184  (void**)&nsxhr);
2185  if(NS_FAILED(nsres)) {
2186  ERR("Could not get nsIXMLHttpRequest: %08x\n", nsres);
2187  nsISupports_Release(nspri);
2188  nsIGlobalObject_Release(nsglo);
2189  return NULL;
2190  }
2191 
2192  nsres = nsIXMLHttpRequest_Init(nsxhr, nspri, NULL, nsglo, NULL, NULL);
2193 
2194  nsISupports_Release(nspri);
2195  nsIGlobalObject_Release(nsglo);
2196  if(NS_FAILED(nsres)) {
2197  ERR("nsIXMLHttpRequest_Init failed: %08x\n", nsres);
2198  nsIXMLHttpRequest_Release(nsxhr);
2199  return NULL;
2200  }
2201  return nsxhr;
2202 }
#define NS_SCRIPTSECURITYMANAGER_CONTRACTID
Definition: nsembed.c:35
#define assert(x)
Definition: debug.h:53
#define NS_OK
static nsIServiceManager * pServMgr
Definition: nsembed.c:61
smooth NULL
Definition: ftsmooth.c:416
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define NS_FAILED(res)
#define ERR(fmt,...)
Definition: debug.h:110
#define NS_XMLHTTPREQUEST_CONTRACTID
Definition: nsembed.c:34
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by HTMLXMLHttpRequestFactory_create().

◆ create_profile_directory()

static nsresult create_profile_directory ( void  )
static

Definition at line 224 of file nsembed.c.

225 {
226  static const WCHAR wine_geckoW[] = {'\\','w','i','n','e','_','g','e','c','k','o',0};
227 
228  WCHAR path[MAX_PATH + sizeof(wine_geckoW)/sizeof(WCHAR)];
229  cpp_bool exists;
230  nsresult nsres;
231  HRESULT hres;
232 
234  if(FAILED(hres)) {
235  ERR("SHGetFolderPath failed: %08x\n", hres);
236  return NS_ERROR_FAILURE;
237  }
238 
239  strcatW(path, wine_geckoW);
241  if(NS_FAILED(nsres))
242  return nsres;
243 
244  nsres = nsIFile_Exists(profile_directory, &exists);
245  if(NS_FAILED(nsres)) {
246  ERR("Exists failed: %08x\n", nsres);
247  return nsres;
248  }
249 
250  if(!exists) {
251  nsres = nsIFile_Create(profile_directory, 1, 0700);
252  if(NS_FAILED(nsres))
253  ERR("Create failed: %08x\n", nsres);
254  }
255 
256  return nsres;
257 }
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
#define NS_ERROR_FAILURE
unsigned char cpp_bool
Definition: atl.c:38
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define CSIDL_APPDATA
Definition: shlobj.h:2037
#define MAX_PATH
Definition: compat.h:34
static nsIFile * profile_directory
Definition: nsembed.c:64
nsresult create_nsfile(const PRUnichar *path, nsIFile **ret)
Definition: nsembed.c:72
#define ERR(fmt,...)
Definition: debug.h:110
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2208
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by nsDirectoryServiceProvider2_GetFile().

◆ create_singleton_enumerator()

static nsISimpleEnumerator* create_singleton_enumerator ( nsISupports value)
static

Definition at line 175 of file nsembed.c.

176 {
178 
179  ret = heap_alloc(sizeof(*ret));
180  if(!ret)
181  return NULL;
182 
183  ret->nsISimpleEnumerator_iface.lpVtbl = &nsSingletonEnumeratorVtbl;
184  ret->ref = 1;
185 
186  if(value)
187  nsISupports_AddRef(value);
188  ret->value = value;
189  return &ret->nsISimpleEnumerator_iface;
190 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
static const nsISimpleEnumeratorVtbl nsSingletonEnumeratorVtbl
Definition: nsembed.c:167
int ret
GLsizei const GLfloat * value
Definition: glext.h:6069

Referenced by nsDirectoryServiceProvider2_GetFiles().

◆ get_editor_controller()

void get_editor_controller ( NSContainer This)

Definition at line 1029 of file nsembed.c.

1030 {
1031  nsIEditingSession *editing_session = NULL;
1032  nsIControllerContext *ctrlctx;
1033  nsresult nsres;
1034 
1035  if(This->editor) {
1036  nsIEditor_Release(This->editor);
1037  This->editor = NULL;
1038  }
1039 
1040  if(This->editor_controller) {
1041  nsIController_Release(This->editor_controller);
1042  This->editor_controller = NULL;
1043  }
1044 
1045  nsres = get_nsinterface((nsISupports*)This->webbrowser, &IID_nsIEditingSession,
1046  (void**)&editing_session);
1047  if(NS_FAILED(nsres)) {
1048  ERR("Could not get nsIEditingSession: %08x\n", nsres);
1049  return;
1050  }
1051 
1052  nsres = nsIEditingSession_GetEditorForWindow(editing_session,
1053  This->doc->basedoc.window->nswindow, &This->editor);
1054  nsIEditingSession_Release(editing_session);
1055  if(NS_FAILED(nsres)) {
1056  ERR("Could not get editor: %08x\n", nsres);
1057  return;
1058  }
1059 
1060  nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
1061  NS_EDITORCONTROLLER_CONTRACTID, NULL, &IID_nsIControllerContext, (void**)&ctrlctx);
1062  if(NS_SUCCEEDED(nsres)) {
1063  nsres = nsIControllerContext_SetCommandContext(ctrlctx, (nsISupports *)This->editor);
1064  if(NS_FAILED(nsres))
1065  ERR("SetCommandContext failed: %08x\n", nsres);
1066  nsres = nsIControllerContext_QueryInterface(ctrlctx, &IID_nsIController,
1067  (void**)&This->editor_controller);
1068  nsIControllerContext_Release(ctrlctx);
1069  if(NS_FAILED(nsres))
1070  ERR("Could not get nsIController interface: %08x\n", nsres);
1071  }else {
1072  ERR("Could not create edit controller: %08x\n", nsres);
1073  }
1074 }
#define NS_EDITORCONTROLLER_CONTRACTID
Definition: nsembed.c:30
smooth NULL
Definition: ftsmooth.c:416
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define NS_FAILED(res)
#define NS_SUCCEEDED(res)
nsresult get_nsinterface(nsISupports *iface, REFIID riid, void **ppv)
Definition: nsembed.c:907
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by handle_edit_load().

◆ get_nscategory_entry()

char* get_nscategory_entry ( const char category,
const char entry 
)

Definition at line 898 of file nsembed.c.

899 {
900  char *ret = NULL;
901  nsresult nsres;
902 
903  nsres = nsICategoryManager_GetCategoryEntry(cat_mgr, category, entry, &ret);
904  return NS_SUCCEEDED(nsres) ? ret : NULL;
905 }
static nsICategoryManager * cat_mgr
Definition: nsembed.c:63
smooth NULL
Definition: ftsmooth.c:416
#define NS_SUCCEEDED(res)
int ret
uint32_t entry
Definition: isohybrid.c:63
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by is_supported_doc_mime().

◆ get_nsinterface()

nsresult get_nsinterface ( nsISupports iface,
REFIID  riid,
void **  ppv 
)

Definition at line 907 of file nsembed.c.

908 {
909  nsIInterfaceRequestor *iface_req;
910  nsresult nsres;
911 
912  nsres = nsISupports_QueryInterface(iface, &IID_nsIInterfaceRequestor, (void**)&iface_req);
913  if(NS_FAILED(nsres))
914  return nsres;
915 
916  nsres = nsIInterfaceRequestor_GetInterface(iface_req, riid, ppv);
917  nsIInterfaceRequestor_Release(iface_req);
918 
919  return nsres;
920 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define NS_FAILED(res)
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by CustomDoc_Release(), do_ns_command(), exec_print(), get_clipboard_commands(), get_editor_controller(), get_ns_command_state(), load_nsuri(), and set_viewer_zoom().

◆ impl_from_nsIContextMenuListener()

static NSContainer* impl_from_nsIContextMenuListener ( nsIContextMenuListener iface)
inlinestatic

Definition at line 1419 of file nsembed.c.

1420 {
1421  return CONTAINING_RECORD(iface, NSContainer, nsIContextMenuListener_iface);
1422 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsContextMenuListener_AddRef(), nsContextMenuListener_OnShowContextMenu(), nsContextMenuListener_QueryInterface(), and nsContextMenuListener_Release().

◆ impl_from_nsIEmbeddingSiteWindow()

static NSContainer* impl_from_nsIEmbeddingSiteWindow ( nsIEmbeddingSiteWindow iface)
inlinestatic

Definition at line 1691 of file nsembed.c.

1692 {
1693  return CONTAINING_RECORD(iface, NSContainer, nsIEmbeddingSiteWindow_iface);
1694 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsEmbeddingSiteWindow_AddRef(), nsEmbeddingSiteWindow_GetDimensions(), nsEmbeddingSiteWindow_GetSiteWindow(), nsEmbeddingSiteWindow_GetTitle(), nsEmbeddingSiteWindow_GetVisibility(), nsEmbeddingSiteWindow_QueryInterface(), nsEmbeddingSiteWindow_Release(), nsEmbeddingSiteWindow_SetDimensions(), nsEmbeddingSiteWindow_SetFocus(), nsEmbeddingSiteWindow_SetTitle(), and nsEmbeddingSiteWindow_SetVisibility().

◆ impl_from_nsIInterfaceRequestor()

static NSContainer* impl_from_nsIInterfaceRequestor ( nsIInterfaceRequestor iface)
inlinestatic

Definition at line 1871 of file nsembed.c.

1872 {
1873  return CONTAINING_RECORD(iface, NSContainer, nsIInterfaceRequestor_iface);
1874 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsInterfaceRequestor_AddRef(), nsInterfaceRequestor_GetInterface(), nsInterfaceRequestor_QueryInterface(), and nsInterfaceRequestor_Release().

◆ impl_from_nsISimpleEnumerator()

static nsSingletonEnumerator* impl_from_nsISimpleEnumerator ( nsISimpleEnumerator iface)
inlinestatic

Definition at line 92 of file nsembed.c.

93 {
94  return CONTAINING_RECORD(iface, nsSingletonEnumerator, nsISimpleEnumerator_iface);
95 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsSingletonEnumerator_AddRef(), nsSingletonEnumerator_GetNext(), nsSingletonEnumerator_HasMoreElements(), nsSingletonEnumerator_QueryInterface(), and nsSingletonEnumerator_Release().

◆ impl_from_nsISupportsWeakReference()

static NSContainer* impl_from_nsISupportsWeakReference ( nsISupportsWeakReference iface)
inlinestatic

Definition at line 1915 of file nsembed.c.

1916 {
1917  return CONTAINING_RECORD(iface, NSContainer, nsISupportsWeakReference_iface);
1918 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsSupportsWeakReference_AddRef(), nsSupportsWeakReference_GetWeakReference(), nsSupportsWeakReference_QueryInterface(), and nsSupportsWeakReference_Release().

◆ impl_from_nsITooltipListener()

static NSContainer* impl_from_nsITooltipListener ( nsITooltipListener iface)
inlinestatic

Definition at line 1818 of file nsembed.c.

1819 {
1820  return CONTAINING_RECORD(iface, NSContainer, nsITooltipListener_iface);
1821 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsTooltipListener_AddRef(), nsTooltipListener_OnHideTooltip(), nsTooltipListener_OnShowTooltip(), nsTooltipListener_QueryInterface(), and nsTooltipListener_Release().

◆ impl_from_nsIURIContentListener()

static NSContainer* impl_from_nsIURIContentListener ( nsIURIContentListener iface)
inlinestatic

Definition at line 1520 of file nsembed.c.

1521 {
1522  return CONTAINING_RECORD(iface, NSContainer, nsIURIContentListener_iface);
1523 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsURIContentListener_AddRef(), nsURIContentListener_CanHandleContent(), nsURIContentListener_DoContent(), nsURIContentListener_GetLoadCookie(), nsURIContentListener_GetParentContentListener(), nsURIContentListener_IsPreferred(), nsURIContentListener_OnStartURIOpen(), nsURIContentListener_QueryInterface(), nsURIContentListener_Release(), nsURIContentListener_SetLoadCookie(), and nsURIContentListener_SetParentContentListener().

◆ impl_from_nsIWeakReference()

static nsWeakReference* impl_from_nsIWeakReference ( nsIWeakReference iface)
inlinestatic

Definition at line 1160 of file nsembed.c.

1161 {
1162  return CONTAINING_RECORD(iface, nsWeakReference, nsIWeakReference_iface);
1163 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsWeakReference_AddRef(), nsWeakReference_QueryInterface(), nsWeakReference_QueryReferent(), and nsWeakReference_Release().

◆ impl_from_nsIWebBrowserChrome()

static NSContainer* impl_from_nsIWebBrowserChrome ( nsIWebBrowserChrome iface)
inlinestatic

Definition at line 1233 of file nsembed.c.

1234 {
1235  return CONTAINING_RECORD(iface, NSContainer, nsIWebBrowserChrome_iface);
1236 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by nsWebBrowserChrome_AddRef(), nsWebBrowserChrome_DestroyBrowserWindow(), nsWebBrowserChrome_ExitModalEventLoop(), nsWebBrowserChrome_GetChromeFlags(), nsWebBrowserChrome_GetWebBrowser(), nsWebBrowserChrome_IsWindowModal(), nsWebBrowserChrome_QueryInterface(), nsWebBrowserChrome_Release(), nsWebBrowserChrome_SetChromeFlags(), nsWebBrowserChrome_SetStatus(), nsWebBrowserChrome_SetWebBrowser(), nsWebBrowserChrome_ShowAsModal(), and nsWebBrowserChrome_SizeBrowserTo().

◆ init_nscontainer()

static HRESULT init_nscontainer ( NSContainer nscontainer)
static

Definition at line 1968 of file nsembed.c.

1969 {
1970  nsIWebBrowserSetup *wbsetup;
1971  nsIScrollable *scrollable;
1972  nsresult nsres;
1973 
1974  nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_WEBBROWSER_CONTRACTID,
1975  NULL, &IID_nsIWebBrowser, (void**)&nscontainer->webbrowser);
1976  if(NS_FAILED(nsres)) {
1977  ERR("Creating WebBrowser failed: %08x\n", nsres);
1978  return E_FAIL;
1979  }
1980 
1981  nsres = nsIWebBrowser_SetContainerWindow(nscontainer->webbrowser, &nscontainer->nsIWebBrowserChrome_iface);
1982  if(NS_FAILED(nsres)) {
1983  ERR("SetContainerWindow failed: %08x\n", nsres);
1984  return E_FAIL;
1985  }
1986 
1987  nsres = nsIWebBrowser_QueryInterface(nscontainer->webbrowser, &IID_nsIBaseWindow,
1988  (void**)&nscontainer->window);
1989  if(NS_FAILED(nsres)) {
1990  ERR("Could not get nsIBaseWindow interface: %08x\n", nsres);
1991  return E_FAIL;
1992  }
1993 
1994  nsres = nsIWebBrowser_QueryInterface(nscontainer->webbrowser, &IID_nsIWebBrowserSetup,
1995  (void**)&wbsetup);
1996  if(NS_SUCCEEDED(nsres)) {
1997  nsres = nsIWebBrowserSetup_SetProperty(wbsetup, SETUP_IS_CHROME_WRAPPER, FALSE);
1998  nsIWebBrowserSetup_Release(wbsetup);
1999  if(NS_FAILED(nsres)) {
2000  ERR("SetProperty(SETUP_IS_CHROME_WRAPPER) failed: %08x\n", nsres);
2001  return E_FAIL;
2002  }
2003  }else {
2004  ERR("Could not get nsIWebBrowserSetup interface\n");
2005  return E_FAIL;
2006  }
2007 
2008  nsres = nsIWebBrowser_QueryInterface(nscontainer->webbrowser, &IID_nsIWebNavigation,
2009  (void**)&nscontainer->navigation);
2010  if(NS_FAILED(nsres)) {
2011  ERR("Could not get nsIWebNavigation interface: %08x\n", nsres);
2012  return E_FAIL;
2013  }
2014 
2015  nsres = nsIWebBrowser_QueryInterface(nscontainer->webbrowser, &IID_nsIWebBrowserFocus,
2016  (void**)&nscontainer->focus);
2017  if(NS_FAILED(nsres)) {
2018  ERR("Could not get nsIWebBrowserFocus interface: %08x\n", nsres);
2019  return E_FAIL;
2020  }
2021 
2022  if(!nscontainer_class) {
2024  if(!nscontainer_class)
2025  return E_FAIL;
2026  }
2027 
2028  nscontainer->hwnd = CreateWindowExW(0, wszNsContainer, NULL,
2029  WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 100, 100,
2030  GetDesktopWindow(), NULL, hInst, nscontainer);
2031  if(!nscontainer->hwnd) {
2032  WARN("Could not create window\n");
2033  return E_FAIL;
2034  }
2035 
2036  nsres = nsIBaseWindow_InitWindow(nscontainer->window, nscontainer->hwnd, NULL, 0, 0, 100, 100);
2037  if(NS_SUCCEEDED(nsres)) {
2038  nsres = nsIBaseWindow_Create(nscontainer->window);
2039  if(NS_FAILED(nsres)) {
2040  WARN("Creating window failed: %08x\n", nsres);
2041  return E_FAIL;
2042  }
2043 
2044  nsIBaseWindow_SetVisibility(nscontainer->window, FALSE);
2045  nsIBaseWindow_SetEnabled(nscontainer->window, FALSE);
2046  }else {
2047  ERR("InitWindow failed: %08x\n", nsres);
2048  return E_FAIL;
2049  }
2050 
2051  nsres = nsIWebBrowser_SetParentURIContentListener(nscontainer->webbrowser,
2052  &nscontainer->nsIURIContentListener_iface);
2053  if(NS_FAILED(nsres))
2054  ERR("SetParentURIContentListener failed: %08x\n", nsres);
2055 
2056  nsres = nsIWebBrowser_QueryInterface(nscontainer->webbrowser, &IID_nsIScrollable, (void**)&scrollable);
2057  if(NS_SUCCEEDED(nsres)) {
2058  nsres = nsIScrollable_SetDefaultScrollbarPreferences(scrollable,
2059  ScrollOrientation_Y, Scrollbar_Always);
2060  if(NS_FAILED(nsres))
2061  ERR("Could not set default Y scrollbar prefs: %08x\n", nsres);
2062 
2063  nsres = nsIScrollable_SetDefaultScrollbarPreferences(scrollable,
2064  ScrollOrientation_X, Scrollbar_Auto);
2065  if(NS_FAILED(nsres))
2066  ERR("Could not set default X scrollbar prefs: %08x\n", nsres);
2067 
2068  nsIScrollable_Release(scrollable);
2069  }else {
2070  ERR("Could not get nsIScrollable: %08x\n", nsres);
2071  }
2072 
2073  return S_OK;
2074 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static void register_nscontainer_class(void)
Definition: nsembed.c:372
nsIWebBrowser * webbrowser
nsIWebBrowserFocus * focus
#define WARN(fmt,...)
Definition: debug.h:112
nsIWebNavigation * navigation
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define E_FAIL
Definition: ddrawi.h:102
#define NS_WEBBROWSER_CONTRACTID
Definition: nsembed.c:27
#define FALSE
Definition: types.h:117
static ATOM nscontainer_class
Definition: nsembed.c:68
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
nsIWebBrowserChrome nsIWebBrowserChrome_iface
static const WCHAR wszNsContainer[]
Definition: nsembed.c:66
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define NS_FAILED(res)
#define NS_SUCCEEDED(res)
nsIURIContentListener nsIURIContentListener_iface
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:51
HINSTANCE hInst
Definition: dxdiag.c:13
nsIBaseWindow * window
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by create_nscontainer().

◆ init_xpcom()

static BOOL init_xpcom ( const PRUnichar gre_path)
static

Definition at line 678 of file nsembed.c.

679 {
680  nsIComponentRegistrar *registrar = NULL;
681  nsIFile *gre_dir;
682  WCHAR *ptr;
683  nsresult nsres;
684 
685  nsres = create_nsfile(gre_path, &gre_dir);
686  if(NS_FAILED(nsres)) {
688  return FALSE;
689  }
690 
691  nsres = NS_InitXPCOM2(&pServMgr, gre_dir, (nsIDirectoryServiceProvider*)&nsDirectoryServiceProvider2);
692  if(NS_FAILED(nsres)) {
693  ERR("NS_InitXPCOM2 failed: %08x\n", nsres);
695  return FALSE;
696  }
697 
698  strcpyW(gecko_path, gre_path);
699  for(ptr = gecko_path; *ptr; ptr++) {
700  if(*ptr == '\\')
701  *ptr = '/';
702  }
704 
705  nsres = nsIServiceManager_QueryInterface(pServMgr, &IID_nsIComponentManager, (void**)&pCompMgr);
706  if(NS_FAILED(nsres))
707  ERR("Could not get nsIComponentManager: %08x\n", nsres);
708 
709  nsres = NS_GetComponentRegistrar(&registrar);
710  if(NS_SUCCEEDED(nsres))
711  init_nsio(pCompMgr, registrar);
712  else
713  ERR("NS_GetComponentRegistrar failed: %08x\n", nsres);
714 
716  set_preferences();
717 
718  nsres = nsIServiceManager_GetServiceByContractID(pServMgr, NS_CATEGORYMANAGER_CONTRACTID,
719  &IID_nsICategoryManager, (void**)&cat_mgr);
720  if(NS_FAILED(nsres))
721  ERR("Could not get category manager service: %08x\n", nsres);
722 
723  if(registrar) {
724  register_nsservice(registrar, pServMgr);
725  nsIComponentRegistrar_Release(registrar);
726  }
727 
728  init_node_cc();
729 
730  return TRUE;
731 }
#define NS_CATEGORYMANAGER_CONTRACTID
Definition: nsembed.c:33
static void set_preferences(void)
Definition: nsembed.c:658
#define TRUE
Definition: types.h:120
static nsICategoryManager * cat_mgr
Definition: nsembed.c:63
static unsigned gecko_path_len
Definition: nsembed.c:70
#define FALSE
Definition: types.h:117
static nsIServiceManager * pServMgr
Definition: nsembed.c:61
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
void register_nsservice(nsIComponentRegistrar *, nsIServiceManager *) DECLSPEC_HIDDEN
Definition: nsservice.c:372
static WCHAR gecko_path[MAX_PATH]
Definition: nsembed.c:69
#define NS_FAILED(res)
static nsIDirectoryServiceProvider2 nsDirectoryServiceProvider2
Definition: nsembed.c:331
#define FreeLibrary(x)
Definition: compat.h:496
__wchar_t WCHAR
Definition: xmlstorage.h:180
void init_node_cc(void)
Definition: htmlnode.c:1328
#define NS_SUCCEEDED(res)
static HINSTANCE xul_handle
Definition: nsembed.c:59
nsresult create_nsfile(const PRUnichar *path, nsIFile **ret)
Definition: nsembed.c:72
void init_nsio(nsIComponentManager *, nsIComponentRegistrar *) DECLSPEC_HIDDEN
Definition: nsio.c:4048
#define ERR(fmt,...)
Definition: debug.h:110
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
HRESULT nsresult
Definition: nsiface.idl:39
void init_mutation(nsIComponentManager *) DECLSPEC_HIDDEN
Definition: mutation.c:774

Referenced by load_gecko().

◆ install_wine_gecko()

static BOOL install_wine_gecko ( void  )
static

Definition at line 387 of file nsembed.c.

388 {
390  STARTUPINFOW si;
391  WCHAR app[MAX_PATH];
392  WCHAR *args;
393  LONG len;
394  BOOL ret;
395 
396  static const WCHAR controlW[] = {'\\','c','o','n','t','r','o','l','.','e','x','e',0};
397  static const WCHAR argsW[] =
398  {' ','a','p','p','w','i','z','.','c','p','l',' ','i','n','s','t','a','l','l','_','g','e','c','k','o',0};
399 
400  len = GetSystemDirectoryW(app, MAX_PATH-sizeof(controlW)/sizeof(WCHAR));
401  memcpy(app+len, controlW, sizeof(controlW));
402 
403  args = heap_alloc(len*sizeof(WCHAR) + sizeof(controlW) + sizeof(argsW));
404  if(!args)
405  return FALSE;
406 
407  memcpy(args, app, len*sizeof(WCHAR) + sizeof(controlW));
408  memcpy(args + len + sizeof(controlW)/sizeof(WCHAR)-1, argsW, sizeof(argsW));
409 
410  TRACE("starting %s\n", debugstr_w(args));
411 
412  memset(&si, 0, sizeof(si));
413  si.cb = sizeof(si);
414  ret = CreateProcessW(app, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
415  heap_free(args);
416  if (ret) {
417  CloseHandle(pi.hThread);
418  WaitForSingleObject(pi.hProcess, INFINITE);
419  CloseHandle(pi.hProcess);
420  }
421 
422  return ret;
423 }
#define CloseHandle
Definition: compat.h:487
static const WCHAR controlW[]
Definition: actctx.c:658
Definition: match.c:390
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4595
#define TRACE(s)
Definition: solgame.cpp:4
DWORD cb
Definition: winbase.h:830
__wchar_t WCHAR
Definition: xmlstorage.h:180
static refpint_t pi[]
Definition: server.c:96
#define MAX_PATH
Definition: compat.h:34
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
#define INFINITE
Definition: serial.h:102
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by load_gecko().

◆ is_gecko_path()

BOOL is_gecko_path ( const char path)

Definition at line 1108 of file nsembed.c.

1109 {
1110  WCHAR *buf, *ptr;
1111  BOOL ret;
1112 
1114  if(!buf || strlenW(buf) < gecko_path_len)
1115  return FALSE;
1116 
1117  for(ptr = buf; *ptr; ptr++) {
1118  if(*ptr == '\\')
1119  *ptr = '/';
1120  }
1121 
1123  buf[gecko_path_len] = 0;
1124 
1125  ret = !strcmpiW(buf, gecko_path);
1126  heap_free(buf);
1127  return ret;
1128 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define URL_UNESCAPE_INPLACE
Definition: shlwapi.h:1224
HRESULT WINAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags)
Definition: url.c:1367
static unsigned gecko_path_len
Definition: nsembed.c:70
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
static WCHAR gecko_path[MAX_PATH]
Definition: nsembed.c:69
__wchar_t WCHAR
Definition: xmlstorage.h:180
static WCHAR * heap_strdupUtoW(const char *str)
int ret
#define strcmpiW(s1, s2)
Definition: unicode.h:39
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by is_gecko_special_uri().

◆ load_gecko()

BOOL load_gecko ( void  )

Definition at line 742 of file nsembed.c.

743 {
744  PRUnichar gre_path[MAX_PATH];
745  BOOL ret = FALSE;
746 
747  static DWORD loading_thread;
748 
749  TRACE("()\n");
750 
751  /* load_gecko may be called recursively */
752  if(loading_thread == GetCurrentThreadId())
753  return pCompMgr != NULL;
754 
756 
757  if(!loading_thread) {
758  loading_thread = GetCurrentThreadId();
759 
760 #ifdef __REACTOS__
761  if(load_wine_gecko(gre_path))
762 #else
763  if(load_wine_gecko(gre_path)
764  || (install_wine_gecko() && load_wine_gecko(gre_path)))
765 #endif
766  ret = init_xpcom(gre_path);
767  else
768  MESSAGE("Could not load wine-gecko. HTML rendering will be disabled.\n");
769  }else {
770  ret = pCompMgr != NULL;
771  }
772 
774 
775  return ret;
776 }
#define MESSAGE
Definition: options.h:86
static BOOL install_wine_gecko(void)
Definition: nsembed.c:387
static BOOL load_wine_gecko(PRUnichar *gre_path)
Definition: nsembed.c:583
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static BOOL init_xpcom(const PRUnichar *gre_path)
Definition: nsembed.c:678
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define TRACE(s)
Definition: solgame.cpp:4
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
WCHAR PRUnichar
Definition: nsiface.idl:48
static CRITICAL_SECTION cs_load_gecko
Definition: nsembed.c:733
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by create_nscontainer(), and DllRegisterServer().

◆ load_wine_gecko()

static BOOL load_wine_gecko ( PRUnichar gre_path)
static

Definition at line 583 of file nsembed.c.

584 {
585  HKEY hkey;
586  DWORD res;
587  BOOL ret;
588 
589  static const WCHAR wszMshtmlKey[] = {
590  'S','o','f','t','w','a','r','e','\\','W','i','n','e',
591  '\\','M','S','H','T','M','L',0};
592 
593  /* @@ Wine registry key: HKLM\Software\Wine\MSHTML */
594  res = RegOpenKeyW(HKEY_LOCAL_MACHINE, wszMshtmlKey, &hkey);
595  if(res != ERROR_SUCCESS)
596  return FALSE;
597 
599 
600  RegCloseKey(hkey);
601  return ret;
602 }
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3296
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define GECKO_VERSION
Definition: addons.c:29
GLuint res
Definition: glext.h:9613
GECKO_VERSION_STRING
Definition: nsiface.idl:29
static BOOL load_wine_gecko_v(PRUnichar *gre_path, HKEY mshtml_key, const char *version, const char *version_string)
Definition: nsembed.c:555
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by load_gecko().

◆ load_wine_gecko_v()

static BOOL load_wine_gecko_v ( PRUnichar gre_path,
HKEY  mshtml_key,
const char version,
const char version_string 
)
static

Definition at line 555 of file nsembed.c.

557 {
558  DWORD res, type, size = MAX_PATH;
559  HKEY hkey = mshtml_key;
560 
561  static const WCHAR wszGeckoPath[] =
562  {'G','e','c','k','o','P','a','t','h',0};
563 
564  if(version) {
565  /* @@ Wine registry key: HKLM\Software\Wine\MSHTML<version> */
566  res = RegOpenKeyA(mshtml_key, version, &hkey);
567  if(res != ERROR_SUCCESS)
568  return FALSE;
569  }
570 
571  res = RegQueryValueExW(hkey, wszGeckoPath, NULL, &type, (LPBYTE)gre_path, &size);
572  if(hkey != mshtml_key)
573  RegCloseKey(hkey);
574  if(res != ERROR_SUCCESS || type != REG_SZ)
575  return FALSE;
576 
577  if(!check_version(gre_path, version_string))
578  return FALSE;
579 
580  return load_xul(gre_path);
581 }
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3257
#define ERROR_SUCCESS
Definition: deptool.c:10
static BOOL check_version(LPCWSTR gre_path, const char *version_string)
Definition: nsembed.c:521
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
static BOOL load_xul(const PRUnichar *gre_path)
Definition: nsembed.c:472
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:66
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
char version_string[]
Definition: mkisofs.c:71
#define REG_SZ
Definition: layer.c:22

Referenced by load_wine_gecko().

◆ load_xul()

static BOOL load_xul ( const PRUnichar gre_path)
static

Definition at line 472 of file nsembed.c.

473 {
474  static const WCHAR xul_dllW[] = {'\\','x','u','l','.','d','l','l',0};
476 
477  strcpyW(file_name, gre_path);
478  strcatW(file_name, xul_dllW);
479 
480  TRACE("(%s)\n", debugstr_w(file_name));
481 
482  set_environment(gre_path);
483 
485  if(!xul_handle) {
486  WARN("Could not load XUL: %d\n", GetLastError());
487  return FALSE;
488  }
489 
490 #define NS_DLSYM(func) \
491  func = (void *)GetProcAddress(xul_handle, #func); \
492  if(!func) \
493  ERR("Could not GetProcAddress(" #func ") failed\n")
494 
495  NS_DLSYM(NS_InitXPCOM2);
496  NS_DLSYM(NS_ShutdownXPCOM);
497  NS_DLSYM(NS_GetComponentRegistrar);
498  NS_DLSYM(NS_StringContainerInit2);
499  NS_DLSYM(NS_CStringContainerInit2);
500  NS_DLSYM(NS_StringContainerFinish);
501  NS_DLSYM(NS_CStringContainerFinish);
502  NS_DLSYM(NS_StringSetData);
503  NS_DLSYM(NS_CStringSetData);
504  NS_DLSYM(NS_NewLocalFile);
505  NS_DLSYM(NS_StringGetData);
506  NS_DLSYM(NS_CStringGetData);
508  NS_DLSYM(NS_Free);
509  NS_DLSYM(ccref_incr);
510  NS_DLSYM(ccref_decr);
511  NS_DLSYM(ccref_init);
512  NS_DLSYM(ccp_init);
513  NS_DLSYM(describe_cc_node);
514  NS_DLSYM(note_cc_edge);
515 
516 #undef NS_DLSYM
517 
518  return TRUE;
519 }
static nsIFile **static const PRUnichar cpp_bool *static const char cpp_bool *static void *CDECL * NS_Alloc(SIZE_T)
static void set_environment(LPCWSTR gre_path)
Definition: nsembed.c:426
#define TRUE
Definition: types.h:120
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define NS_DLSYM(func)
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:339
#define FALSE
Definition: types.h:117
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
static HINSTANCE xul_handle
Definition: nsembed.c:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
static LPCWSTR file_name
Definition: protocol.c:147

Referenced by load_wine_gecko_v().

◆ NS_Alloc()

static nsIFile** static const PRUnichar cpp_bool* static const char cpp_bool* static void* CDECL* NS_Alloc ( SIZE_T  )
static

Referenced by load_xul(), and nsalloc().

◆ nsACString_Finish()

void nsACString_Finish ( nsACString str)

Definition at line 812 of file nsembed.c.

813 {
814  NS_CStringContainerFinish(str);
815 }
const WCHAR * str

Referenced by HTMLXMLHttpRequest_getResponseHeader(), HTMLXMLHttpRequest_open(), nsURIContentListener_OnStartURIOpen(), parse_content_type(), return_nscstr(), and visit_http_headers().

◆ nsACString_GetData()

◆ nsACString_Init()

BOOL nsACString_Init ( nsACString str,
const char data 
)

Definition at line 788 of file nsembed.c.

789 {
790  return NS_SUCCEEDED(NS_CStringContainerInit2(str, data, PR_UINT32_MAX, 0));
791 }
const WCHAR * str
#define PR_UINT32_MAX
Definition: nsembed.c:37
#define NS_SUCCEEDED(res)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by bstr_to_nsacstr(), HTMLXMLHttpRequest_get_statusText(), HTMLXMLHttpRequest_getAllResponseHeaders(), HTMLXMLHttpRequest_getResponseHeader(), and nsURIContentListener_OnStartURIOpen().

◆ nsACString_InitDepend()

void nsACString_InitDepend ( nsACString str,
const char data 
)

Definition at line 797 of file nsembed.c.

798 {
799  NS_CStringContainerInit2(str, data, PR_UINT32_MAX, NS_CSTRING_CONTAINER_INIT_DEPEND);
800 }
const WCHAR * str
#define PR_UINT32_MAX
Definition: nsembed.c:37
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define NS_CSTRING_CONTAINER_INIT_DEPEND
Definition: nsembed.c:40

Referenced by HTMLXMLHttpRequest_getResponseHeader(), parse_content_type(), and visit_http_headers().

◆ nsACString_SetData()

void nsACString_SetData ( nsACString str,
const char data 
)

Definition at line 802 of file nsembed.c.

803 {
804  NS_CStringSetData(str, data, PR_UINT32_MAX);
805 }
const WCHAR * str
#define PR_UINT32_MAX
Definition: nsembed.c:37
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by get_channel_http_header(), get_uri_string(), nsChannel_GetContentCharset(), nsChannel_GetContentType(), nsChannel_GetRequestMethod(), nsChannel_GetResponseStatusText(), nsURI_GetHostPort(), nsURI_GetOriginCharset(), nsURI_GetScheme(), nsURI_GetUserPass(), nsURI_Resolve(), nsURL_GetRef(), and return_wstr_nsacstr().

◆ nsalloc()

void* nsalloc ( size_t  size)

Definition at line 778 of file nsembed.c.

779 {
780  return NS_Alloc(size);
781 }
static nsIFile **static const PRUnichar cpp_bool *static const char cpp_bool *static void *CDECL * NS_Alloc(SIZE_T)
GLsizeiptr size
Definition: glext.h:5919

Referenced by nsTooltipTextProvider_GetNodeText().

◆ nsAString_Finish()

void nsAString_Finish ( nsAString str)

Definition at line 836 of file nsembed.c.

837 {
838  NS_StringContainerFinish(str);
839 }
const WCHAR * str

Referenced by bind_event_scripts(), check_codebase(), check_event_attr(), check_style_attr_value(), create_nselem(), create_nsfile(), detach_nslistener(), detach_xhr_event_listener(), dispid_from_elem_name(), document_write(), elem_string_attr_getter(), elem_string_attr_setter(), exec_hyperlink(), fill_props(), find_event_target(), get_doc_elem_by_id(), get_doc_string(), get_document_charset(), get_elem_attr_value(), get_elem_clsid(), get_font_size(), get_frame_by_name(), get_nsstyle_attr(), get_nsstyle_attr_nsval(), get_nsstyle_attr_var(), get_nsstyle_pixel_val(), get_nsstyle_pos(), get_script_guid(), handle_htmlevent(), handle_link_click_event(), HTMLAnchorElement_get_href(), HTMLAnchorElement_handle_event(), HTMLAnchorElement_put_href(), HTMLAnchorElement_put_name(), HTMLAnchorElement_put_rel(), HTMLAnchorElement_put_search(), HTMLAnchorElement_put_target(), HTMLAreaElement_handle_event(), HTMLBodyElement_get_bgColor(), HTMLBodyElement_get_text(), HTMLBodyElement_put_aLink(), HTMLBodyElement_put_background(), HTMLBodyElement_put_bgColor(), HTMLBodyElement_put_link(), HTMLBodyElement_put_text(), HTMLBodyElement_put_vLink(), HTMLButtonElement_put_name(), HTMLCurrentStyle_Create(), HTMLDocument3_createTextNode(), HTMLDocument3_getElementsByName(), HTMLDocument3_getElementsByTagName(), HTMLDocument5_createComment(), HTMLDocument_get_title(), HTMLDocument_put_title(), HTMLDocumentNode_invoke(), HTMLDOMAttribute_get_specified(), HTMLDOMNode_get_nodeValue(), HTMLDOMNode_put_nodeValue(), HTMLDOMTextNode2_appendData(), HTMLDOMTextNode_put_data(), HTMLElement2_getElementsByTagName(), HTMLElement2_put_dir(), HTMLElement3_put_contentEditable(), HTMLElement_Create(), HTMLElement_get_outerHTML(), HTMLElement_insertAdjacentHTML(), HTMLElement_insertAdjacentText(), HTMLElement_populate_props(), HTMLElement_put_className(), HTMLElement_put_id(), HTMLElement_put_innerHTML(), HTMLElement_put_innerText(), HTMLElement_put_title(), HTMLElementCollection_tags(), HTMLFormElement_get_action(), HTMLFormElement_get_dispid(), HTMLFormElement_put_action(), HTMLFormElement_put_encoding(), HTMLFormElement_put_method(), HTMLFormElement_put_name(), HTMLFormElement_put_target(), HTMLFormElement_submit(), HTMLFrameBase_get_marginHeight(), HTMLFrameBase_get_marginWidth(), HTMLFrameBase_get_scrolling(), HTMLFrameBase_put_frameBorder(), HTMLFrameBase_put_marginHeight(), HTMLFrameBase_put_marginWidth(), HTMLFrameBase_put_name(), HTMLFrameBase_put_scrolling(), HTMLFrameBase_put_src(), HTMLIFrameElement2_put_height(), HTMLIFrameElement2_put_width(), HTMLImgElement_get_src(), HTMLImgElement_put_align(), HTMLImgElement_put_alt(), HTMLImgElement_put_src(), HTMLInputElement_get_src(), HTMLInputElement_is_text_edit(), HTMLInputElement_put_defaultValue(), HTMLInputElement_put_name(), HTMLInputElement_put_src(), HTMLInputElement_put_type(), HTMLInputElement_put_value(), HTMLLabelElement_put_htmlFor(), HTMLLinkElement_put_href(), HTMLLinkElement_put_media(), HTMLLinkElement_put_rel(), HTMLLinkElement_put_rev(), HTMLLinkElement_put_type(), HTMLObjectElement_get_height(), HTMLObjectElement_get_width(), HTMLObjectElement_put_height(), HTMLObjectElement_put_name(), HTMLObjectElement_put_width(), HTMLOptionElement_put_text(), HTMLOptionElement_put_value(), HTMLScriptElement_put_src(), HTMLScriptElement_put_text(), HTMLScriptElement_put_type(), HTMLSelectElement_put_name(), HTMLSelectElement_put_value(), HTMLStyle_get_backgroundPositionX(), HTMLStyle_get_backgroundPositionY(), HTMLStyle_get_cssText(), HTMLStyle_put_backgroundPositionX(), HTMLStyle_put_backgroundPositionY(), HTMLStyle_put_cssText(), HTMLStyle_removeAttribute(), HTMLStyleElement_put_media(), HTMLStyleElement_put_type(), HTMLStyleSheet_put_cssText(), HTMLTable3_put_summary(), HTMLTable_get_bgColor(), HTMLTable_get_width(), HTMLTable_put_align(), HTMLTable_put_bgColor(), HTMLTable_put_cellPadding(), HTMLTable_put_cellSpacing(), HTMLTable_put_frame(), HTMLTable_put_width(), HTMLTableCell_get_bgColor(), HTMLTableCell_put_align(), HTMLTableCell_put_bgColor(), HTMLTableRow_get_bgColor(), HTMLTableRow_put_align(), HTMLTableRow_put_bgColor(), HTMLTableRow_put_vAlign(), HTMLTextAreaElement_put_defaultValue(), HTMLTextAreaElement_put_value(), HTMLTxtRange_get_htmlText(), HTMLTxtRange_pasteHTML(), HTMLTxtRange_put_text(), HTMLWindow2_put_name(), HTMLXMLHttpRequest_bind_event(), HTMLXMLHttpRequest_open(), init_event(), is_elem_name(), is_elem_tag(), move_next_char(), move_prev_char(), navigate_fragment(), nsTooltipTextProvider_GetNodeText(), parse_event_elem(), parse_inline_script(), parse_script_elem(), query_align_status(), range_to_string(), remove_child_attr(), replace_node_by_html(), return_nscolor(), return_nsstr(), run_insert_comment(), set_event_info(), set_font_size(), set_nsstyle_attr(), set_opacity(), update_window_doc(), and wstrbuf_append_node().

◆ nsAString_GetData()

UINT32 nsAString_GetData ( const nsAString str,
const PRUnichar **  data 
)

Definition at line 831 of file nsembed.c.

832 {
833  return NS_StringGetData(str, data, NULL);
834 }
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by check_style_attr_value(), find_event_target(), get_doc_string(), get_document_charset(), get_elem_attr_value(), get_font_size(), get_nsstyle_attr(), get_nsstyle_attr_var(), get_nsstyle_pixel_val(), get_nsstyle_pos(), get_script_guid(), get_target_window(), get_text_node_data(), handle_htmlevent(), HTMLAnchorElement_get_href(), HTMLBodyElement_get_bgColor(), HTMLBodyElement_get_text(), HTMLDocument_get_title(), HTMLDOMNode_get_nodeValue(), HTMLElement_Create(), HTMLElement_get_outerHTML(), HTMLElement_populate_props(), HTMLElementCollection_tags(), HTMLFormElement_get_action(), HTMLFormElement_get_dispid(), HTMLFormElement_submit(), HTMLFrameBase_get_marginHeight(), HTMLFrameBase_get_marginWidth(), HTMLFrameBase_get_scrolling(), HTMLImgElement_get_src(), HTMLInputElement_get_src(), HTMLInputElement_is_text_edit(), HTMLObjectElement_get_height(), HTMLObjectElement_get_width(), HTMLStyle_get_backgroundPositionX(), HTMLStyle_get_backgroundPositionY(), HTMLStyle_get_cssText(), HTMLStyle_put_backgroundPositionX(), HTMLStyle_put_backgroundPositionY(), HTMLStyle_removeAttribute(), HTMLTable_get_bgColor(), HTMLTableCell_get_bgColor(), HTMLTableRow_get_bgColor(), HTMLTxtRange_get_htmlText(), is_elem_name(), is_elem_tag(), navigate_href(), navigate_href_new_window(), nsstr_to_truncated_bstr(), nsTooltipTextProvider_GetNodeText(), parse_event_elem(), parse_inline_script(), parse_script_elem(), remove_child_attr(), return_nscolor(), return_nsstr(), run_insert_comment(), and wstrbuf_append_node().

◆ nsAString_Init()

BOOL nsAString_Init ( nsAString str,
const PRUnichar data 
)

Definition at line 817 of file nsembed.c.

818 {
819  return NS_SUCCEEDED(NS_StringContainerInit2(str, data, PR_UINT32_MAX, 0));
820 }
const WCHAR * str
#define PR_UINT32_MAX
Definition: nsembed.c:37
#define NS_SUCCEEDED(res)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by check_style_attr_value(), find_event_target(), get_doc_string(), get_document_charset(), get_elem_attr_value(), get_font_size(), get_nsstyle_attr(), get_nsstyle_attr_var(), get_nsstyle_pixel_val(), get_nsstyle_pos(), get_script_guid(), get_text_node_data(), handle_htmlevent(), HTMLAnchorElement_get_hash(), HTMLAnchorElement_get_hostname(), HTMLAnchorElement_get_href(), HTMLAnchorElement_get_name(), HTMLAnchorElement_get_rel(), HTMLAnchorElement_get_search(), HTMLAnchorElement_get_target(), HTMLAnchorElement_handle_event(), HTMLAreaElement_handle_event(), HTMLBodyElement_get_aLink(), HTMLBodyElement_get_background(), HTMLBodyElement_get_bgColor(), HTMLBodyElement_get_link(), HTMLBodyElement_get_text(), HTMLBodyElement_get_vLink(), HTMLButtonElement_get_name(), HTMLCurrentStyle_Create(), HTMLDocument5_get_compatMode(), HTMLDocument_get_charset(), HTMLDocument_get_title(), HTMLDOMNode_get_nodeName(), HTMLDOMNode_get_nodeValue(), HTMLDOMTextNode_get_data(), HTMLElement2_get_dir(), HTMLElement3_get_contentEditable(), HTMLElement_Create(), HTMLElement_get_className(), HTMLElement_get_id(), HTMLElement_get_innerHTML(), HTMLElement_get_outerHTML(), HTMLElement_get_tagName(), HTMLElement_get_title(), HTMLElement_populate_props(), HTMLElementCollection_tags(), HTMLFormElement_get_action(), HTMLFormElement_get_dispid(), HTMLFormElement_get_encoding(), HTMLFormElement_get_method(), HTMLFormElement_get_name(), HTMLFormElement_get_target(), HTMLFormElement_submit(), HTMLFrameBase_get_frameBorder(), HTMLFrameBase_get_marginHeight(), HTMLFrameBase_get_marginWidth(), HTMLFrameBase_get_name(), HTMLFrameBase_get_scrolling(), HTMLFrameBase_get_src(), HTMLIFrameElement2_get_height(), HTMLIFrameElement2_get_width(), HTMLImgElement_get_align(), HTMLImgElement_get_alt(), HTMLImgElement_get_name(), HTMLImgElement_get_src(), HTMLInputElement_get_defaultValue(), HTMLInputElement_get_name(), HTMLInputElement_get_src(), HTMLInputElement_get_type(), HTMLInputElement_get_value(), HTMLInputElement_is_text_edit(), HTMLLinkElement_get_href(), HTMLLinkElement_get_media(), HTMLLinkElement_get_rel(), HTMLLinkElement_get_rev(), HTMLLinkElement_get_type(), HTMLObjectElement_get_height(), HTMLObjectElement_get_name(), HTMLObjectElement_get_width(), HTMLOptionElement_get_text(), HTMLOptionElement_get_value(), HTMLScriptElement_get_src(), HTMLScriptElement_get_text(), HTMLScriptElement_get_type(), HTMLScriptElement_put_type(), HTMLSelectElement_get_name(), HTMLSelectElement_get_type(), HTMLSelectElement_get_value(), HTMLStyle_get_backgroundPositionX(), HTMLStyle_get_backgroundPositionY(), HTMLStyle_get_cssText(), HTMLStyle_put_backgroundPositionX(), HTMLStyle_put_backgroundPositionY(), HTMLStyle_removeAttribute(), HTMLStyleElement_get_media(), HTMLStyleElement_get_type(), HTMLStyleSheet_get_cssText(), HTMLStyleSheet_get_href(), HTMLTable3_get_summary(), HTMLTable_get_align(), HTMLTable_get_bgColor(), HTMLTable_get_cellPadding(), HTMLTable_get_cellSpacing(), HTMLTable_get_frame(), HTMLTable_get_width(), HTMLTableCell_get_align(), HTMLTableCell_get_bgColor(), HTMLTableRow_get_align(), HTMLTableRow_get_bgColor(), HTMLTableRow_get_vAlign(), HTMLTextAreaElement_get_defaultValue(), HTMLTextAreaElement_get_name(), HTMLTextAreaElement_get_value(), HTMLTxtRange_get_htmlText(), HTMLWindow2_get_name(), HTMLXMLHttpRequest_get_responseText(), is_elem_name(), is_elem_tag(), nsTooltipTextProvider_GetNodeText(), parse_event_elem(), parse_inline_script(), parse_script_elem(), query_align_status(), remove_child_attr(), run_insert_comment(), var2str(), variant_to_nsastr(), variant_to_nscolor(), and wstrbuf_append_node().

◆ nsAString_InitDepend()

void nsAString_InitDepend ( nsAString str,
const PRUnichar data 
)

Definition at line 826 of file nsembed.c.

827 {
828  NS_StringContainerInit2(str, data, PR_UINT32_MAX, NS_STRING_CONTAINER_INIT_DEPEND);
829 }
const WCHAR * str
#define PR_UINT32_MAX
Definition: nsembed.c:37
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define NS_STRING_CONTAINER_INIT_DEPEND
Definition: nsembed.c:39

Referenced by bind_event_scripts(), create_nselem(), create_nsfile(), detach_nslistener(), detach_xhr_event_listener(), dispid_from_elem_name(), document_write(), elem_string_attr_setter(), exec_hyperlink(), fill_props(), get_doc_elem_by_id(), get_elem_attr_value(), get_frame_by_name(), get_nsstyle_attr_nsval(), HTMLAnchorElement_put_href(), HTMLAnchorElement_put_name(), HTMLAnchorElement_put_rel(), HTMLAnchorElement_put_search(), HTMLAnchorElement_put_target(), HTMLBodyElement_put_background(), HTMLButtonElement_put_name(), HTMLDocument3_createTextNode(), HTMLDocument3_getElementsByName(), HTMLDocument3_getElementsByTagName(), HTMLDocument5_createComment(), HTMLDocument_put_title(), HTMLDocumentNode_invoke(), HTMLDOMAttribute_get_specified(), HTMLDOMNode_put_nodeValue(), HTMLDOMTextNode2_appendData(), HTMLDOMTextNode_put_data(), HTMLElement2_getElementsByTagName(), HTMLElement2_put_dir(), HTMLElement3_put_contentEditable(), HTMLElement_insertAdjacentHTML(), HTMLElement_insertAdjacentText(), HTMLElement_put_className(), HTMLElement_put_id(), HTMLElement_put_innerHTML(), HTMLElement_put_innerText(), HTMLElement_put_title(), HTMLFormElement_put_action(), HTMLFormElement_put_encoding(), HTMLFormElement_put_method(), HTMLFormElement_put_name(), HTMLFormElement_put_target(), HTMLFrameBase_put_frameBorder(), HTMLFrameBase_put_marginHeight(), HTMLFrameBase_put_marginWidth(), HTMLFrameBase_put_name(), HTMLFrameBase_put_scrolling(), HTMLFrameBase_put_src(), HTMLIFrameElement2_put_height(), HTMLIFrameElement2_put_width(), HTMLImgElement_put_align(), HTMLImgElement_put_alt(), HTMLImgElement_put_src(), HTMLInputElement_put_defaultValue(), HTMLInputElement_put_name(), HTMLInputElement_put_src(), HTMLInputElement_put_type(), HTMLInputElement_put_value(), HTMLLabelElement_put_htmlFor(), HTMLLinkElement_put_href(), HTMLLinkElement_put_media(), HTMLLinkElement_put_rel(), HTMLLinkElement_put_rev(), HTMLLinkElement_put_type(), HTMLObjectElement_put_height(), HTMLObjectElement_put_name(), HTMLObjectElement_put_width(), HTMLOptionElement_put_text(), HTMLOptionElement_put_value(), HTMLScriptElement_put_src(), HTMLScriptElement_put_text(), HTMLSelectElement_put_name(), HTMLSelectElement_put_value(), HTMLStyle_put_cssText(), HTMLStyle_removeAttribute(), HTMLStyleElement_put_media(), HTMLStyleElement_put_type(), HTMLStyleSheet_put_cssText(), HTMLTable3_put_summary(), HTMLTable_put_align(), HTMLTable_put_cellSpacing(), HTMLTable_put_frame(), HTMLTableCell_put_align(), HTMLTableRow_put_align(), HTMLTableRow_put_vAlign(), HTMLTextAreaElement_put_defaultValue(), HTMLTextAreaElement_put_value(), HTMLTxtRange_pasteHTML(), HTMLTxtRange_put_text(), HTMLWindow2_put_name(), HTMLXMLHttpRequest_bind_event(), init_event(), navigate_fragment(), replace_node_by_html(), set_event_info(), set_font_size(), set_nsstyle_attr(), set_opacity(), update_window_doc(), and variant_to_nsastr().

◆ NSContainer_Release()

void NSContainer_Release ( NSContainer This)

Definition at line 2107 of file nsembed.c.

2108 {
2109  TRACE("(%p)\n", This);
2110 
2111  This->doc = NULL;
2112 
2113  ShowWindow(This->hwnd, SW_HIDE);
2114  SetParent(This->hwnd, NULL);
2115 
2116  nsIBaseWindow_SetVisibility(This->window, FALSE);
2117  nsIBaseWindow_Destroy(This->window);
2118 
2119  nsIWebBrowser_SetContainerWindow(This->webbrowser, NULL);
2120 
2121  nsIWebBrowser_Release(This->webbrowser);
2122  This->webbrowser = NULL;
2123 
2124  nsIWebNavigation_Release(This->navigation);
2125  This->navigation = NULL;
2126 
2127  nsIBaseWindow_Release(This->window);
2128  This->window = NULL;
2129 
2130  nsIWebBrowserFocus_Release(This->focus);
2131  This->focus = NULL;
2132 
2133  if(This->editor_controller) {
2134  nsIController_Release(This->editor_controller);
2135  This->editor_controller = NULL;
2136  }
2137 
2138  if(This->editor) {
2139  nsIEditor_Release(This->editor);
2140  This->editor = NULL;
2141  }
2142 
2143  if(This->content_listener) {
2144  nsIURIContentListener_Release(This->content_listener);
2145  This->content_listener = NULL;
2146  }
2147 
2148  if(This->hwnd) {
2149  DestroyWindow(This->hwnd);
2150  This->hwnd = NULL;
2151  }
2152 
2153  nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
2154 }
#define SW_HIDE
Definition: winuser.h:762
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by CustomDoc_Release().

◆ nsContextMenuListener_AddRef()

static nsrefcnt NSAPI nsContextMenuListener_AddRef ( nsIContextMenuListener iface)
static

Definition at line 1431 of file nsembed.c.

1432 {
1434  return nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1435 }
static NSContainer * impl_from_nsIContextMenuListener(nsIContextMenuListener *iface)
Definition: nsembed.c:1419

◆ nsContextMenuListener_OnShowContextMenu()

static nsresult NSAPI nsContextMenuListener_OnShowContextMenu ( nsIContextMenuListener iface,
UINT32  aContextFlags,
nsIDOMEvent aEvent,
nsIDOMNode aNode 
)
static

Definition at line 1443 of file nsembed.c.

1445 {
1448  HTMLDOMNode *node;
1449  POINT pt;
1450  DWORD dwID = CONTEXT_MENU_DEFAULT;
1451  nsresult nsres;
1452  HRESULT hres;
1453 
1454  TRACE("(%p)->(%08x %p %p)\n", This, aContextFlags, aEvent, aNode);
1455 
1456  fire_event(This->doc->basedoc.doc_node /* FIXME */, EVENTID_CONTEXTMENU, TRUE, aNode, aEvent, NULL);
1457 
1458  nsres = nsIDOMEvent_QueryInterface(aEvent, &IID_nsIDOMMouseEvent, (void**)&event);
1459  if(NS_FAILED(nsres)) {
1460  ERR("Could not get nsIDOMMouseEvent interface: %08x\n", nsres);
1461  return nsres;
1462  }
1463 
1464  nsIDOMMouseEvent_GetScreenX(event, &pt.x);
1465  nsIDOMMouseEvent_GetScreenY(event, &pt.y);
1466  nsIDOMMouseEvent_Release(event);
1467 
1468  switch(aContextFlags) {
1469  case CONTEXT_NONE:
1470  case CONTEXT_DOCUMENT:
1471  case CONTEXT_TEXT: {
1473 
1474  nsres = nsIDOMHTMLDocument_GetSelection(This->doc->basedoc.doc_node->nsdoc, &selection);
1475  if(NS_SUCCEEDED(nsres) && selection) {
1476  cpp_bool is_collapsed;
1477 
1478  /* FIXME: Check if the click was inside selection. */
1479  nsres = nsISelection_GetIsCollapsed(selection, &is_collapsed);
1480  nsISelection_Release(selection);
1481  if(NS_SUCCEEDED(nsres) && !is_collapsed)
1482  dwID = CONTEXT_MENU_TEXTSELECT;
1483  }
1484  break;
1485  }
1486  case CONTEXT_IMAGE:
1487  case CONTEXT_IMAGE|CONTEXT_LINK:
1488  dwID = CONTEXT_MENU_IMAGE;
1489  break;
1490  case CONTEXT_LINK:
1491  dwID = CONTEXT_MENU_ANCHOR;
1492  break;
1493  case CONTEXT_INPUT:
1494  dwID = CONTEXT_MENU_CONTROL;
1495  break;
1496  default:
1497  FIXME("aContextFlags=%08x\n", aContextFlags);
1498  };
1499 
1500  hres = get_node(This->doc->basedoc.doc_node, aNode, TRUE, &node);
1501  if(FAILED(hres))
1502  return NS_ERROR_FAILURE;
1503 
1504  show_context_menu(This->doc, dwID, &pt, (IDispatch*)&node->IHTMLDOMNode_iface);
1505  node_release(node);
1506  return NS_OK;
1507 }
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
int selection
Definition: ctm.c:92
#define NS_OK
struct node node
static void node_release(HTMLDOMNode *node)
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
#define NS_ERROR_FAILURE
unsigned char cpp_bool
Definition: atl.c:38
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
#define NS_SUCCEEDED(res)
struct _cl_event * event
Definition: glext.h:7739
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
static NSContainer * impl_from_nsIContextMenuListener(nsIContextMenuListener *iface)
Definition: nsembed.c:1419
HRESULT nsresult
Definition: nsiface.idl:39
void show_context_menu(HTMLDocumentObj *, DWORD, POINT *, IDispatch *) DECLSPEC_HIDDEN
Definition: olecmd.c:929
Definition: dlist.c:348
void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode *target, nsIDOMEvent *nsevent, IDispatch *script_this)
Definition: htmlevent.c:1195

◆ nsContextMenuListener_QueryInterface()

static nsresult NSAPI nsContextMenuListener_QueryInterface ( nsIContextMenuListener iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1424 of file nsembed.c.

1426 {
1428  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1429 }
REFIID riid
Definition: precomp.h:44
static NSContainer * impl_from_nsIContextMenuListener(nsIContextMenuListener *iface)
Definition: nsembed.c:1419
GLuint64EXT * result
Definition: glext.h:11304

◆ nsContextMenuListener_Release()

static nsrefcnt NSAPI nsContextMenuListener_Release ( nsIContextMenuListener iface)
static

Definition at line 1437 of file nsembed.c.

1438 {
1440  return nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
1441 }
static NSContainer * impl_from_nsIContextMenuListener(nsIContextMenuListener *iface)
Definition: nsembed.c:1419

◆ nsDirectoryServiceProvider2_AddRef()

static nsrefcnt NSAPI nsDirectoryServiceProvider2_AddRef ( nsIDirectoryServiceProvider2 iface)
static

Definition at line 214 of file nsembed.c.

215 {
216  return 2;
217 }

◆ nsDirectoryServiceProvider2_GetFile()

static nsresult NSAPI nsDirectoryServiceProvider2_GetFile ( nsIDirectoryServiceProvider2 iface,
const char prop,
cpp_bool persistent,
nsIFile **  _retval 
)
static

Definition at line 259 of file nsembed.c.

261 {
262  TRACE("(%s %p %p)\n", debugstr_a(prop), persistent, _retval);
263 
264  if(!strcmp(prop, "ProfD")) {
265  if(!profile_directory) {
266  nsresult nsres;
267 
268  nsres = create_profile_directory();
269  if(NS_FAILED(nsres))
270  return nsres;
271  }
272 
274  return nsIFile_Clone(profile_directory, _retval);
275  }
276 
277  *_retval = NULL;
278  return NS_ERROR_FAILURE;
279 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
#define NS_ERROR_FAILURE
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static nsIFile * profile_directory
Definition: nsembed.c:64
static nsresult create_profile_directory(void)
Definition: nsembed.c:224
HRESULT nsresult
Definition: nsiface.idl:39
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ nsDirectoryServiceProvider2_GetFiles()

static nsresult NSAPI nsDirectoryServiceProvider2_GetFiles ( nsIDirectoryServiceProvider2 iface,
const char prop,
nsISimpleEnumerator **  _retval 
)
static

Definition at line 281 of file nsembed.c.

283 {
284  TRACE("(%s %p)\n", debugstr_a(prop), _retval);
285 
286  if(!strcmp(prop, "APluginsDL")) {
287  WCHAR plugin_path[MAX_PATH];
288  nsIFile *file;
289  int len;
290  nsresult nsres;
291 
292  if(!plugin_directory) {
293  static const WCHAR gecko_pluginW[] = {'\\','g','e','c','k','o','\\','p','l','u','g','i','n',0};
294 
295  len = GetSystemDirectoryW(plugin_path, (sizeof(plugin_path)-sizeof(gecko_pluginW))/sizeof(WCHAR)+1);
296  if(!len)
297  return NS_ERROR_UNEXPECTED;
298 
299  strcpyW(plugin_path+len, gecko_pluginW);
300  nsres = create_nsfile(plugin_path, &plugin_directory);
301  if(NS_FAILED(nsres)) {
302  *_retval = NULL;
303  return nsres;
304  }
305  }
306 
307  nsres = nsIFile_Clone(plugin_directory, &file);
308  if(NS_FAILED(nsres))
309  return nsres;
310 
312  nsIFile_Release(file);
313  if(!*_retval)
314  return NS_ERROR_OUT_OF_MEMORY;
315 
316  return NS_OK;
317  }
318 
319  *_retval = NULL;
320  return NS_ERROR_FAILURE;
321 }
static nsISimpleEnumerator * create_singleton_enumerator(nsISupports *value)
Definition: nsembed.c:175
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
#define NS_ERROR_FAILURE
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define MAX_PATH
Definition: compat.h:34
const char file[]
Definition: icontest.c:11
nsresult create_nsfile(const PRUnichar *path, nsIFile **ret)
Definition: nsembed.c:72
GLenum GLsizei len
Definition: glext.h:6722
static nsIFile * plugin_directory
Definition: nsembed.c:64
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
#define NS_ERROR_OUT_OF_MEMORY
HRESULT nsresult
Definition: nsiface.idl:39
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define NS_ERROR_UNEXPECTED
Definition: fci.c:126

◆ nsDirectoryServiceProvider2_QueryInterface()

static nsresult NSAPI nsDirectoryServiceProvider2_QueryInterface ( nsIDirectoryServiceProvider2 iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 192 of file nsembed.c.

194 {
195  if(IsEqualGUID(&IID_nsISupports, riid)) {
196  TRACE("(IID_nsISupports %p)\n", result);
197  *result = iface;
198  }else if(IsEqualGUID(&IID_nsIDirectoryServiceProvider, riid)) {
199  TRACE("(IID_nsIDirectoryServiceProvider %p)\n", result);
200  *result = iface;
201  }else if(IsEqualGUID(&IID_nsIDirectoryServiceProvider2, riid)) {
202  TRACE("(IID_nsIDirectoryServiceProvider2 %p)\n", result);
203  *result = iface;
204  }else {
205  WARN("(%s %p)\n", debugstr_guid(riid), result);
206  *result = NULL;
207  return NS_NOINTERFACE;
208  }
209 
210  nsISupports_AddRef((nsISupports*)*result);
211  return NS_OK;
212 }
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define NS_NOINTERFACE
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
GLuint64EXT * result
Definition: glext.h:11304

◆ nsDirectoryServiceProvider2_Release()

static nsrefcnt NSAPI nsDirectoryServiceProvider2_Release ( nsIDirectoryServiceProvider2 iface)
static

Definition at line 219 of file nsembed.c.

220 {
221  return 1;
222 }

◆ nsembed_proc()

static LRESULT WINAPI nsembed_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 334 of file nsembed.c.

335 {
336  NSContainer *This;
337  nsresult nsres;
338 
339  static const WCHAR wszTHIS[] = {'T','H','I','S',0};
340 
341  if(msg == WM_CREATE) {
342  This = *(NSContainer**)lParam;
343  SetPropW(hwnd, wszTHIS, This);
344  }else {
345  This = GetPropW(hwnd, wszTHIS);
346  }
347 
348  switch(msg) {
349  case WM_SIZE:
350  TRACE("(%p)->(WM_SIZE)\n", This);
351 
352  nsres = nsIBaseWindow_SetSize(This->window,
354  if(NS_FAILED(nsres))
355  WARN("SetSize failed: %08x\n", nsres);
356  break;
357 
358  case WM_PARENTNOTIFY:
359  TRACE("WM_PARENTNOTIFY %x\n", (unsigned)wParam);
360 
361  switch(wParam) {
362  case WM_LBUTTONDOWN:
363  case WM_RBUTTONDOWN:
364  nsIWebBrowserFocus_Activate(This->focus);
365  }
366  }
367 
368  return DefWindowProcW(hwnd, msg, wParam, lParam);
369 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_PARENTNOTIFY
Definition: winuser.h:1785
#define NS_FAILED(res)
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WM_SIZE
Definition: winuser.h:1593
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
HRESULT nsresult
Definition: nsiface.idl:39
#define HIWORD(l)
Definition: typedefs.h:247
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by register_nscontainer_class().

◆ nsEmbeddingSiteWindow_AddRef()

static nsrefcnt NSAPI nsEmbeddingSiteWindow_AddRef ( nsIEmbeddingSiteWindow iface)
static

Definition at line 1703 of file nsembed.c.

1704 {
1706  return nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1707 }
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_GetDimensions()

static nsresult NSAPI nsEmbeddingSiteWindow_GetDimensions ( nsIEmbeddingSiteWindow iface,
UINT32  flags,
LONG x,
LONG y,
LONG cx,
LONG cy 
)
static

Definition at line 1723 of file nsembed.c.

1725 {
1727  RECT r;
1728 
1729  TRACE("(%p)->(%x %p %p %p %p)\n", This, flags, x, y, cx, cy);
1730 
1731  if(!GetWindowRect(This->hwnd, &r)) {
1732  ERR("GetWindowRect failed\n");
1733  return NS_ERROR_FAILURE;
1734  }
1735 
1736  if(x)
1737  *x = r.left;
1738  if(y)
1739  *y = r.top;
1740  if(cx)
1741  *cx = r.right-r.left;
1742  if(cy)
1743  *cy = r.bottom-r.top;
1744  return NS_OK;
1745 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define NS_OK
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
#define NS_ERROR_FAILURE
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
#define ERR(fmt,...)
Definition: debug.h:110
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:581
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

◆ nsEmbeddingSiteWindow_GetSiteWindow()

static nsresult NSAPI nsEmbeddingSiteWindow_GetSiteWindow ( nsIEmbeddingSiteWindow iface,
void **  aSiteWindow 
)
static

Definition at line 1793 of file nsembed.c.

1795 {
1797 
1798  TRACE("(%p)->(%p)\n", This, aSiteWindow);
1799 
1800  *aSiteWindow = This->hwnd;
1801  return NS_OK;
1802 }
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_GetTitle()

static nsresult NSAPI nsEmbeddingSiteWindow_GetTitle ( nsIEmbeddingSiteWindow iface,
PRUnichar **  aTitle 
)
static

Definition at line 1777 of file nsembed.c.

1779 {
1781  WARN("(%p)->(%p)\n", This, aTitle);
1782  return NS_ERROR_NOT_IMPLEMENTED;
1783 }
#define WARN(fmt,...)
Definition: debug.h:112
#define NS_ERROR_NOT_IMPLEMENTED
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_GetVisibility()

static nsresult NSAPI nsEmbeddingSiteWindow_GetVisibility ( nsIEmbeddingSiteWindow iface,
cpp_bool aVisibility 
)
static

Definition at line 1756 of file nsembed.c.

1758 {
1760 
1761  TRACE("(%p)->(%p)\n", This, aVisibility);
1762 
1763  *aVisibility = This->doc && This->doc->hwnd && IsWindowVisible(This->doc->hwnd);
1764  return NS_OK;
1765 }
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI IsWindowVisible(_In_ HWND)
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_QueryInterface()

static nsresult NSAPI nsEmbeddingSiteWindow_QueryInterface ( nsIEmbeddingSiteWindow iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1696 of file nsembed.c.

1698 {
1700  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1701 }
REFIID riid
Definition: precomp.h:44
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691
GLuint64EXT * result
Definition: glext.h:11304

◆ nsEmbeddingSiteWindow_Release()

static nsrefcnt NSAPI nsEmbeddingSiteWindow_Release ( nsIEmbeddingSiteWindow iface)
static

Definition at line 1709 of file nsembed.c.

1710 {
1712  return nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
1713 }
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_SetDimensions()

static nsresult NSAPI nsEmbeddingSiteWindow_SetDimensions ( nsIEmbeddingSiteWindow iface,
UINT32  flags,
LONG  x,
LONG  y,
LONG  cx,
LONG  cy 
)
static

Definition at line 1715 of file nsembed.c.

1717 {
1719  WARN("(%p)->(%08x %d %d %d %d)\n", This, flags, x, y, cx, cy);
1720  return NS_ERROR_NOT_IMPLEMENTED;
1721 }
#define WARN(fmt,...)
Definition: debug.h:112
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
#define NS_ERROR_NOT_IMPLEMENTED
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_Out_opt_ int * cx
Definition: commctrl.h:581
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_SetFocus()

static nsresult NSAPI nsEmbeddingSiteWindow_SetFocus ( nsIEmbeddingSiteWindow iface)
static

Definition at line 1747 of file nsembed.c.

1748 {
1750 
1751  TRACE("(%p)\n", This);
1752 
1753  return nsIBaseWindow_SetFocus(This->window);
1754 }
#define TRACE(s)
Definition: solgame.cpp:4
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_SetTitle()

static nsresult NSAPI nsEmbeddingSiteWindow_SetTitle ( nsIEmbeddingSiteWindow iface,
const PRUnichar aTitle 
)
static

Definition at line 1785 of file nsembed.c.

1787 {
1789  WARN("(%p)->(%s)\n", This, debugstr_w(aTitle));
1790  return NS_ERROR_NOT_IMPLEMENTED;
1791 }
#define WARN(fmt,...)
Definition: debug.h:112
#define debugstr_w
Definition: kernel32.h:32
#define NS_ERROR_NOT_IMPLEMENTED
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsEmbeddingSiteWindow_SetVisibility()

static nsresult NSAPI nsEmbeddingSiteWindow_SetVisibility ( nsIEmbeddingSiteWindow iface,
cpp_bool  aVisibility 
)
static

Definition at line 1767 of file nsembed.c.

1769 {
1771 
1772  TRACE("(%p)->(%x)\n", This, aVisibility);
1773 
1774  return NS_OK;
1775 }
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
static NSContainer * impl_from_nsIEmbeddingSiteWindow(nsIEmbeddingSiteWindow *iface)
Definition: nsembed.c:1691

◆ nsfree()

void nsfree ( void mem)

Definition at line 783 of file nsembed.c.

784 {
785  NS_Free(mem);
786 }
Definition: mem.c:156

Referenced by exec_fontname(), and is_supported_doc_mime().

◆ nsInterfaceRequestor_AddRef()

static nsrefcnt NSAPI nsInterfaceRequestor_AddRef ( nsIInterfaceRequestor iface)
static

Definition at line 1883 of file nsembed.c.

1884 {
1886  return nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1887 }
static NSContainer * impl_from_nsIInterfaceRequestor(nsIInterfaceRequestor *iface)
Definition: nsembed.c:1871

◆ nsInterfaceRequestor_GetInterface()

static nsresult NSAPI nsInterfaceRequestor_GetInterface ( nsIInterfaceRequestor iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1895 of file nsembed.c.

1897 {
1899 
1900  if(IsEqualGUID(&IID_nsIDOMWindow, riid)) {
1901  TRACE("(%p)->(IID_nsIDOMWindow %p)\n", This, result);
1902  return nsIWebBrowser_GetContentDOMWindow(This->webbrowser, (nsIDOMWindow**)result);
1903  }
1904 
1905  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1906 }
REFIID riid
Definition: precomp.h:44
#define TRACE(s)
Definition: solgame.cpp:4
static NSContainer * impl_from_nsIInterfaceRequestor(nsIInterfaceRequestor *iface)
Definition: nsembed.c:1871
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
GLuint64EXT * result
Definition: glext.h:11304

◆ nsInterfaceRequestor_QueryInterface()

static nsresult NSAPI nsInterfaceRequestor_QueryInterface ( nsIInterfaceRequestor iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1876 of file nsembed.c.

1878 {
1880  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1881 }
REFIID riid
Definition: precomp.h:44
static NSContainer * impl_from_nsIInterfaceRequestor(nsIInterfaceRequestor *iface)
Definition: nsembed.c:1871
GLuint64EXT * result
Definition: glext.h:11304

◆ nsInterfaceRequestor_Release()

static nsrefcnt NSAPI nsInterfaceRequestor_Release ( nsIInterfaceRequestor iface)
static

Definition at line 1889 of file nsembed.c.

1890 {
1892  return nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
1893 }
static NSContainer * impl_from_nsIInterfaceRequestor(nsIInterfaceRequestor *iface)
Definition: nsembed.c:1871

◆ nsnode_to_nsstring()

HRESULT nsnode_to_nsstring ( nsIDOMNode nsnode,
nsAString str 
)

Definition at line 1000 of file nsembed.c.

1001 {
1002  nsIContentSerializer *serializer;
1003  nsresult nsres;
1004  HRESULT hres;
1005 
1006  nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
1007  NS_HTMLSERIALIZER_CONTRACTID, NULL, &IID_nsIContentSerializer,
1008  (void**)&serializer);
1009  if(NS_FAILED(nsres)) {
1010  ERR("Could not get nsIContentSerializer: %08x\n", nsres);
1011  return E_FAIL;
1012  }
1013 
1014  nsres = nsIContentSerializer_Init(serializer, 0, 100, NULL, FALSE, FALSE /* FIXME */);
1015  if(NS_FAILED(nsres))
1016  ERR("Init failed: %08x\n", nsres);
1017 
1018  hres = nsnode_to_nsstring_rec(serializer, nsnode, str);
1019  if(SUCCEEDED(hres)) {
1020  nsres = nsIContentSerializer_Flush(serializer, str);
1021  if(NS_FAILED(nsres))
1022  ERR("Flush failed: %08x\n", nsres);
1023  }
1024 
1025  nsIContentSerializer_Release(serializer);
1026  return hres;
1027 }
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
static nsIComponentManager * pCompMgr
Definition: nsembed.c:62
#define NS_FAILED(res)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:79
static HRESULT nsnode_to_nsstring_rec(nsIContentSerializer *serializer, nsIDOMNode *nsnode, nsAString *str)
Definition: nsembed.c:922
#define ERR(fmt,...)
Definition: debug.h:110
#define NS_HTMLSERIALIZER_CONTRACTID
Definition: nsembed.c:29
HRESULT nsresult
Definition: nsiface.idl:39
#define SUCCEEDED(hr)
Definition: intsafe.h:49

Referenced by get_doc_string(), HTMLElement_get_outerHTML(), and HTMLTxtRange_get_htmlText().

◆ nsnode_to_nsstring_rec()

static HRESULT nsnode_to_nsstring_rec ( nsIContentSerializer serializer,
nsIDOMNode nsnode,
nsAString str 
)
static

Definition at line 922 of file nsembed.c.

923 {
924  nsIDOMNodeList *node_list = NULL;
925  cpp_bool has_children = FALSE;
926  nsIContent *nscontent;
927  UINT16 type;
928  nsresult nsres;
929 
930  nsIDOMNode_HasChildNodes(nsnode, &has_children);
931 
932  nsres = nsIDOMNode_GetNodeType(nsnode, &type);
933  if(NS_FAILED(nsres)) {
934  ERR("GetType failed: %08x\n", nsres);
935  return E_FAIL;
936  }
937 
938  if(type != DOCUMENT_NODE) {
939  nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIContent, (void**)&nscontent);
940  if(NS_FAILED(nsres)) {
941  ERR("Could not get nsIContent interface: %08x\n", nsres);
942  return E_FAIL;
943  }
944  }
945 
946  switch(type) {
947  case ELEMENT_NODE:
948  nsIContentSerializer_AppendElementStart(serializer, nscontent, nscontent, str);
949  break;
950  case TEXT_NODE:
951  nsIContentSerializer_AppendText(serializer, nscontent, 0, -1, str);
952  break;
953  case COMMENT_NODE:
954  nsres = nsIContentSerializer_AppendComment(serializer, nscontent, 0, -1, str);
955  break;
956  case DOCUMENT_NODE: {
957  nsIDocument *nsdoc;
958  nsIDOMNode_QueryInterface(nsnode, &IID_nsIDocument, (void**)&nsdoc);
959  nsIContentSerializer_AppendDocumentStart(serializer, nsdoc, str);
960  nsIDocument_Release(nsdoc);
961  break;
962  }
963  case DOCUMENT_TYPE_NODE:
964  nsIContentSerializer_AppendDoctype(serializer, nscontent, str);
965  break;
966  case DOCUMENT_FRAGMENT_NODE:
967  break;
968  default:
969  FIXME("Unhandled type %u\n", type);
970  }
971 
972  if(has_children) {
973  UINT32 child_cnt, i;
974  nsIDOMNode *child_node;
975 
976  nsIDOMNode_GetChildNodes(nsnode, &node_list);
977  nsIDOMNodeList_GetLength(node_list, &child_cnt);
978 
979  for(i=0; i<child_cnt; i++) {
980  nsres = nsIDOMNodeList_Item(node_list, i, &child_node);
981  if(NS_SUCCEEDED(nsres)) {
982  nsnode_to_nsstring_rec(serializer, child_node, str);
983  nsIDOMNode_Release(child_node);
984  }else {
985  ERR("Item failed: %08x\n", nsres);
986  }
987  }
988 
989  nsIDOMNodeList_Release(node_list);
990  }
991 
992  if(type == ELEMENT_NODE)
993  nsIContentSerializer_AppendElementEnd(serializer, nscontent, str);
994 
995  if(type != DOCUMENT_NODE)
996  nsIContent_Release(nscontent);
997  return S_OK;
998 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_FAIL
Definition: ddrawi.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
unsigned int UINT32
#define FIXME(fmt,...)
Definition: debug.h:111
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
unsigned char cpp_bool
Definition: atl.c:38
static HRESULT nsnode_to_nsstring_rec(nsIContentSerializer *serializer, nsIDOMNode *nsnode, nsAString *str)
Definition: nsembed.c:922
#define NS_SUCCEEDED(res)
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:51
unsigned short UINT16
HRESULT nsresult
Definition: nsiface.idl:39

Referenced by nsnode_to_nsstring().

◆ nsresult()

static nsresult ( CDECL NS_InitXPCOM2)
static

◆ nsSingletonEnumerator_AddRef()

static nsrefcnt NSAPI nsSingletonEnumerator_AddRef ( nsISimpleEnumerator iface)
static

Definition at line 117 of file nsembed.c.

118 {
121 
122  TRACE("(%p) ref=%d\n", This, ref);
123 
124  return ref;
125 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static nsSingletonEnumerator * impl_from_nsISimpleEnumerator(nsISimpleEnumerator *iface)
Definition: nsembed.c:92
ULONG nsrefcnt
Definition: nsiface.idl:40

◆ nsSingletonEnumerator_GetNext()

static nsresult NSAPI nsSingletonEnumerator_GetNext ( nsISimpleEnumerator iface,
nsISupports **  _retval 
)
static

Definition at line 153 of file nsembed.c.

154 {
156 
157  TRACE("(%p)->()\n", This);
158 
159  if(!This->value)
160  return NS_ERROR_UNEXPECTED;
161 
162  *_retval = This->value;
163  This->value = NULL;
164  return NS_OK;
165 }
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static nsSingletonEnumerator * impl_from_nsISimpleEnumerator(nsISimpleEnumerator *iface)
Definition: nsembed.c:92
#define NS_ERROR_UNEXPECTED

◆ nsSingletonEnumerator_HasMoreElements()

static nsresult NSAPI nsSingletonEnumerator_HasMoreElements ( nsISimpleEnumerator iface,
cpp_bool _retval 
)
static

Definition at line 143 of file nsembed.c.

144 {
146 
147  TRACE("(%p)->()\n", This);
148 
149  *_retval = This->value != NULL;
150  return NS_OK;
151 }
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static nsSingletonEnumerator * impl_from_nsISimpleEnumerator(nsISimpleEnumerator *iface)
Definition: nsembed.c:92

◆ nsSingletonEnumerator_QueryInterface()

static nsresult NSAPI nsSingletonEnumerator_QueryInterface ( nsISimpleEnumerator iface,
nsIIDRef  riid,
void **  ppv 
)
static

Definition at line 97 of file nsembed.c.

98 {
100 
101  if(IsEqualGUID(&IID_nsISupports, riid)) {
102  TRACE("(%p)->(IID_nsISupports %p)\n", This, ppv);
103  *ppv = &This->nsISimpleEnumerator_iface;
104  }else if(IsEqualGUID(&IID_nsISimpleEnumerator, riid)) {
105  TRACE("(%p)->(IID_nsISimpleEnumerator %p)\n", This, ppv);
106  *ppv = &This->nsISimpleEnumerator_iface;
107  }else {
108  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
109  *ppv = NULL;
110  return NS_NOINTERFACE;
111  }
112 
113  nsISupports_AddRef((nsISupports*)*ppv);
114  return NS_OK;
115 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static nsSingletonEnumerator * impl_from_nsISimpleEnumerator(nsISimpleEnumerator *iface)
Definition: nsembed.c:92
#define NS_NOINTERFACE
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ nsSingletonEnumerator_Release()

static nsrefcnt NSAPI nsSingletonEnumerator_Release ( nsISimpleEnumerator iface)
static

Definition at line 127 of file nsembed.c.

128 {
131 
132  TRACE("(%p) ref=%d\n", This, ref);
133 
134  if(!ref) {
135  if(This->value)
136  nsISupports_Release(This->value);
137  heap_free(This);
138  }
139 
140  return ref;
141 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static nsSingletonEnumerator * impl_from_nsISimpleEnumerator(nsISimpleEnumerator *iface)
Definition: nsembed.c:92
ULONG nsrefcnt
Definition: nsiface.idl:40
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ nsSupportsWeakReference_AddRef()

static nsrefcnt NSAPI nsSupportsWeakReference_AddRef ( nsISupportsWeakReference iface)
static

Definition at line 1927 of file nsembed.c.

1928 {
1930  return nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1931 }
static NSContainer * impl_from_nsISupportsWeakReference(nsISupportsWeakReference *iface)
Definition: nsembed.c:1915

◆ nsSupportsWeakReference_GetWeakReference()

static nsresult NSAPI nsSupportsWeakReference_GetWeakReference ( nsISupportsWeakReference iface,
nsIWeakReference **  _retval 
)
static

Definition at line 1939 of file nsembed.c.

1941 {
1943 
1944  TRACE("(%p)->(%p)\n", This, _retval);
1945 
1946  if(!This->weak_reference) {
1947  This->weak_reference = heap_alloc(sizeof(nsWeakReference));
1948  if(!This->weak_reference)
1949  return NS_ERROR_OUT_OF_MEMORY;
1950 
1951  This->weak_reference->nsIWeakReference_iface.lpVtbl = &nsWeakReferenceVtbl;
1952  This->weak_reference->ref = 1;
1953  This->weak_reference->nscontainer = This;
1954  }
1955 
1956  *_retval = &This->weak_reference->nsIWeakReference_iface;
1957  nsIWeakReference_AddRef(*_retval);
1958  return NS_OK;
1959 }
static const nsIWeakReferenceVtbl nsWeakReferenceVtbl
Definition: nsembed.c:1222
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define NS_OK
static NSContainer * impl_from_nsISupportsWeakReference(nsISupportsWeakReference *iface)
Definition: nsembed.c:1915
#define TRACE(s)
Definition: solgame.cpp:4
#define NS_ERROR_OUT_OF_MEMORY

◆ nsSupportsWeakReference_QueryInterface()

static nsresult NSAPI nsSupportsWeakReference_QueryInterface ( nsISupportsWeakReference iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1920 of file nsembed.c.

1922 {
1924  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1925 }
REFIID riid
Definition: precomp.h:44
static NSContainer * impl_from_nsISupportsWeakReference(nsISupportsWeakReference *iface)
Definition: nsembed.c:1915
GLuint64EXT * result
Definition: glext.h:11304

◆ nsSupportsWeakReference_Release()

static nsrefcnt NSAPI nsSupportsWeakReference_Release ( nsISupportsWeakReference iface)
static

Definition at line 1933 of file nsembed.c.

1934 {
1936  return nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
1937 }
static NSContainer * impl_from_nsISupportsWeakReference(nsISupportsWeakReference *iface)
Definition: nsembed.c:1915

◆ nsTooltipListener_AddRef()

static nsrefcnt NSAPI nsTooltipListener_AddRef ( nsITooltipListener iface)
static

Definition at line 1830 of file nsembed.c.

1831 {
1833  return nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1834 }
static NSContainer * impl_from_nsITooltipListener(nsITooltipListener *iface)
Definition: nsembed.c:1818

◆ nsTooltipListener_OnHideTooltip()

static nsresult NSAPI nsTooltipListener_OnHideTooltip ( nsITooltipListener iface)
static

Definition at line 1853 of file nsembed.c.

1854 {
1856 
1857  if (This->doc)
1858  hide_tooltip(This->doc);
1859 
1860  return NS_OK;
1861 }
void hide_tooltip(HTMLDocumentObj *) DECLSPEC_HIDDEN
Definition: view.c:386
#define NS_OK
static NSContainer * impl_from_nsITooltipListener(nsITooltipListener *iface)
Definition: nsembed.c:1818

◆ nsTooltipListener_OnShowTooltip()

static nsresult NSAPI nsTooltipListener_OnShowTooltip ( nsITooltipListener iface,
LONG  aXCoord,
LONG  aYCoord,
const PRUnichar aTipText 
)
static

Definition at line 1842 of file nsembed.c.

1844 {
1846 
1847  if (This->doc)
1848  show_tooltip(This->doc, aXCoord, aYCoord, aTipText);
1849 
1850  return NS_OK;
1851 }
#define NS_OK
static NSContainer * impl_from_nsITooltipListener(nsITooltipListener *iface)
Definition: nsembed.c:1818
void show_tooltip(HTMLDocumentObj *, DWORD, DWORD, LPCWSTR) DECLSPEC_HIDDEN
Definition: view.c:368

◆ nsTooltipListener_QueryInterface()

static nsresult NSAPI nsTooltipListener_QueryInterface ( nsITooltipListener iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1823 of file nsembed.c.

1825 {
1827  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1828 }
REFIID riid
Definition: precomp.h:44
static NSContainer * impl_from_nsITooltipListener(nsITooltipListener *iface)
Definition: nsembed.c:1818
GLuint64EXT * result
Definition: glext.h:11304

◆ nsTooltipListener_Release()

static nsrefcnt NSAPI nsTooltipListener_Release ( nsITooltipListener iface)
static

Definition at line 1836 of file nsembed.c.

1837 {
1839  return nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
1840 }
static NSContainer * impl_from_nsITooltipListener(nsITooltipListener *iface)
Definition: nsembed.c:1818

◆ nsURIContentListener_AddRef()

static nsrefcnt NSAPI nsURIContentListener_AddRef ( nsIURIContentListener iface)
static

Definition at line 1532 of file nsembed.c.

1533 {
1535  return nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1536 }
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_CanHandleContent()

static nsresult NSAPI nsURIContentListener_CanHandleContent ( nsIURIContentListener iface,
const char aContentType,
cpp_bool  aIsContentPreferred,
char **  aDesiredContentType,
cpp_bool _retval 
)
static

Definition at line 1600 of file nsembed.c.

1603 {
1605 
1606  TRACE("(%p)->(%s %x %p %p)\n", This, debugstr_a(aContentType), aIsContentPreferred,
1607  aDesiredContentType, _retval);
1608 
1609  return This->content_listener
1610  ? nsIURIContentListener_CanHandleContent(This->content_listener, aContentType,
1611  aIsContentPreferred, aDesiredContentType, _retval)
1613 }
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
#define NS_ERROR_NOT_IMPLEMENTED
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_DoContent()

static nsresult NSAPI nsURIContentListener_DoContent ( nsIURIContentListener iface,
const nsACString aContentType,
cpp_bool  aIsContentPreferred,
nsIRequest aRequest,
nsIStreamListener **  aContentHandler,
cpp_bool _retval 
)
static

Definition at line 1569 of file nsembed.c.

1572 {
1574 
1575  TRACE("(%p)->(%p %x %p %p %p)\n", This, aContentType, aIsContentPreferred,
1576  aRequest, aContentHandler, _retval);
1577 
1578  return This->content_listener
1579  ? nsIURIContentListener_DoContent(This->content_listener, aContentType,
1580  aIsContentPreferred, aRequest, aContentHandler, _retval)
1582 }
#define TRACE(s)
Definition: solgame.cpp:4
#define NS_ERROR_NOT_IMPLEMENTED
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_GetLoadCookie()

static nsresult NSAPI nsURIContentListener_GetLoadCookie ( nsIURIContentListener iface,
nsISupports **  aLoadCookie 
)
static

Definition at line 1615 of file nsembed.c.

1617 {
1619 
1620  WARN("(%p)->(%p)\n", This, aLoadCookie);
1621 
1622  return This->content_listener
1623  ? nsIURIContentListener_GetLoadCookie(This->content_listener, aLoadCookie)
1625 }
#define WARN(fmt,...)
Definition: debug.h:112
#define NS_ERROR_NOT_IMPLEMENTED
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_GetParentContentListener()

static nsresult NSAPI nsURIContentListener_GetParentContentListener ( nsIURIContentListener iface,
nsIURIContentListener **  aParentContentListener 
)
static

Definition at line 1639 of file nsembed.c.

1641 {
1643 
1644  TRACE("(%p)->(%p)\n", This, aParentContentListener);
1645 
1646  if(This->content_listener)
1647  nsIURIContentListener_AddRef(This->content_listener);
1648 
1649  *aParentContentListener = This->content_listener;
1650  return NS_OK;
1651 }
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_IsPreferred()

static nsresult NSAPI nsURIContentListener_IsPreferred ( nsIURIContentListener iface,
const char aContentType,
char **  aDesiredContentType,
cpp_bool _retval 
)
static

Definition at line 1584 of file nsembed.c.

1586 {
1588 
1589  TRACE("(%p)->(%s %p %p)\n", This, debugstr_a(aContentType), aDesiredContentType, _retval);
1590 
1591  /* FIXME: Should we do something here? */
1592  *_retval = TRUE;
1593 
1594  return This->content_listener
1595  ? nsIURIContentListener_IsPreferred(This->content_listener, aContentType,
1596  aDesiredContentType, _retval)
1597  : NS_OK;
1598 }
#define TRUE
Definition: types.h:120
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_OnStartURIOpen()

static nsresult NSAPI nsURIContentListener_OnStartURIOpen ( nsIURIContentListener iface,
nsIURI aURI,
cpp_bool _retval 
)
static

Definition at line 1544 of file nsembed.c.

1546 {
1548  nsACString spec_str;
1549  const char *spec;
1550  nsresult nsres;
1551 
1552  nsACString_Init(&spec_str, NULL);
1553  nsIURI_GetSpec(aURI, &spec_str);
1554  nsACString_GetData(&spec_str, &spec);
1555 
1556  TRACE("(%p)->(%p(%s) %p)\n", This, aURI, debugstr_a(spec), _retval);
1557 
1558  nsACString_Finish(&spec_str);
1559 
1560  nsres = on_start_uri_open(This, aURI, _retval);
1561  if(NS_FAILED(nsres))
1562  return nsres;
1563 
1564  return !*_retval && This->content_listener
1565  ? nsIURIContentListener_OnStartURIOpen(This->content_listener, aURI, _retval)
1566  : NS_OK;
1567 }
UINT32 nsACString_GetData(const nsACString *str, const char **data)
Definition: nsembed.c:807
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
void nsACString_Finish(nsACString *str)
Definition: nsembed.c:812
nsresult on_start_uri_open(NSContainer *, nsIURI *, cpp_bool *) DECLSPEC_HIDDEN
Definition: nsio.c:4019
BOOL nsACString_Init(nsACString *str, const char *data)
Definition: nsembed.c:788
HRESULT nsresult
Definition: nsiface.idl:39
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_QueryInterface()

static nsresult NSAPI nsURIContentListener_QueryInterface ( nsIURIContentListener iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1525 of file nsembed.c.

1527 {
1529  return nsIWebBrowserChrome_QueryInterface(&This->nsIWebBrowserChrome_iface, riid, result);
1530 }
REFIID riid
Definition: precomp.h:44
GLuint64EXT * result
Definition: glext.h:11304
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_Release()

static nsrefcnt NSAPI nsURIContentListener_Release ( nsIURIContentListener iface)
static

Definition at line 1538 of file nsembed.c.

1539 {
1541  return nsIWebBrowserChrome_Release(&This->nsIWebBrowserChrome_iface);
1542 }
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_SetLoadCookie()

static nsresult NSAPI nsURIContentListener_SetLoadCookie ( nsIURIContentListener iface,
nsISupports aLoadCookie 
)
static

Definition at line 1627 of file nsembed.c.

1629 {
1631 
1632  WARN("(%p)->(%p)\n", This, aLoadCookie);
1633 
1634  return This->content_listener
1635  ? nsIURIContentListener_SetLoadCookie(This->content_listener, aLoadCookie)
1637 }
#define WARN(fmt,...)
Definition: debug.h:112
#define NS_ERROR_NOT_IMPLEMENTED
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsURIContentListener_SetParentContentListener()

static nsresult NSAPI nsURIContentListener_SetParentContentListener ( nsIURIContentListener iface,
nsIURIContentListener aParentContentListener 
)
static

Definition at line 1653 of file nsembed.c.

1655 {
1657 
1658  TRACE("(%p)->(%p)\n", This, aParentContentListener);
1659 
1660  if(aParentContentListener == &This->nsIURIContentListener_iface)
1661  return NS_OK;
1662 
1663  if(This->content_listener)
1664  nsIURIContentListener_Release(This->content_listener);
1665 
1666  This->content_listener = aParentContentListener;
1667  if(This->content_listener)
1668  nsIURIContentListener_AddRef(This->content_listener);
1669 
1670  return NS_OK;
1671 }
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
static NSContainer * impl_from_nsIURIContentListener(nsIURIContentListener *iface)
Definition: nsembed.c:1520

◆ nsWeakReference_AddRef()

static nsrefcnt NSAPI nsWeakReference_AddRef ( nsIWeakReference iface)
static

Definition at line 1186 of file nsembed.c.

1187 {
1189  LONG ref = InterlockedIncrement(&This->ref);
1190 
1191  TRACE("(%p) ref=%d\n", This, ref);
1192 
1193  return ref;
1194 }
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static nsWeakReference * impl_from_nsIWeakReference(nsIWeakReference *iface)
Definition: nsembed.c:1160
#define InterlockedIncrement
Definition: armddk.h:53

◆ nsWeakReference_QueryInterface()

static nsresult NSAPI nsWeakReference_QueryInterface ( nsIWeakReference iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1165 of file nsembed.c.

1167 {
1169 
1170  if(IsEqualGUID(&IID_nsISupports, riid)) {
1171  TRACE("(%p)->(IID_nsISupports %p)\n", This, result);
1172  *result = &This->nsIWeakReference_iface;
1173  }else if(IsEqualGUID(&IID_nsIWeakReference, riid)) {
1174  TRACE("(%p)->(IID_nsIWeakReference %p)\n", This, result);
1175  *result = &This->nsIWeakReference_iface;
1176  }else {
1177  WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
1178  *result = NULL;
1179  return NS_NOINTERFACE;
1180  }
1181 
1182  nsISupports_AddRef((nsISupports*)*result);
1183  return NS_OK;
1184 }
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static nsWeakReference * impl_from_nsIWeakReference(nsIWeakReference *iface)
Definition: nsembed.c:1160
#define NS_NOINTERFACE
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
GLuint64EXT * result
Definition: glext.h:11304

◆ nsWeakReference_QueryReferent()

static nsresult NSAPI nsWeakReference_QueryReferent ( nsIWeakReference iface,
const nsIID riid,
void **  result 
)
static

Definition at line 1211 of file nsembed.c.

1213 {
1215 
1216  if(!This->nscontainer)
1217  return NS_ERROR_NULL_POINTER;
1218 
1219  return nsIWebBrowserChrome_QueryInterface(&This->nscontainer->nsIWebBrowserChrome_iface, riid, result);
1220 }
REFIID riid
Definition: precomp.h:44
#define NS_ERROR_NULL_POINTER
static nsWeakReference * impl_from_nsIWeakReference(nsIWeakReference *iface)
Definition: nsembed.c:1160
GLuint64EXT * result
Definition: glext.h:11304

◆ nsWeakReference_Release()

static nsrefcnt NSAPI nsWeakReference_Release ( nsIWeakReference iface)
static

Definition at line 1196 of file nsembed.c.

1197 {
1199  LONG ref = InterlockedIncrement(&This->ref);
1200 
1201  TRACE("(%p) ref=%d\n", This, ref);
1202 
1203  if(!ref) {
1204  assert(!This->nscontainer);
1205  heap_free(This);
1206  }
1207 
1208  return ref;
1209 }
#define assert(x)
Definition: debug.h:53
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static nsWeakReference * impl_from_nsIWeakReference(nsIWeakReference *iface)
Definition: nsembed.c:1160
#define InterlockedIncrement
Definition: armddk.h:53
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ nsWebBrowserChrome_AddRef()

static nsrefcnt NSAPI nsWebBrowserChrome_AddRef ( nsIWebBrowserChrome iface)
static

Definition at line 1279 of file nsembed.c.

1280 {
1282  LONG ref = InterlockedIncrement(&This->ref);
1283 
1284  TRACE("(%p) ref=%d\n", This, ref);
1285 
1286  return ref;
1287 }
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ nsWebBrowserChrome_DestroyBrowserWindow()

static nsresult NSAPI nsWebBrowserChrome_DestroyBrowserWindow ( nsIWebBrowserChrome iface)
static

Definition at line 1362 of file nsembed.c.

1363 {
1365  TRACE("(%p)\n", This);
1366  return NS_ERROR_NOT_IMPLEMENTED;
1367 }
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define TRACE(s)
Definition: solgame.cpp:4
#define NS_ERROR_NOT_IMPLEMENTED

◆ nsWebBrowserChrome_ExitModalEventLoop()

static nsresult NSAPI nsWebBrowserChrome_ExitModalEventLoop ( nsIWebBrowserChrome iface,
nsresult  aStatus 
)
static

Definition at line 1391 of file nsembed.c.

1393 {
1395  WARN("(%p)->(%08x)\n", This, aStatus);
1396  return NS_ERROR_NOT_IMPLEMENTED;
1397 }
#define WARN(fmt,...)
Definition: debug.h:112
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_ERROR_NOT_IMPLEMENTED

◆ nsWebBrowserChrome_GetChromeFlags()

static nsresult NSAPI nsWebBrowserChrome_GetChromeFlags ( nsIWebBrowserChrome iface,
UINT32 aChromeFlags 
)
static

Definition at line 1346 of file nsembed.c.

1348 {
1350  WARN("(%p)->(%p)\n", This, aChromeFlags);
1351  return NS_ERROR_NOT_IMPLEMENTED;
1352 }
#define WARN(fmt,...)
Definition: debug.h:112
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_ERROR_NOT_IMPLEMENTED

◆ nsWebBrowserChrome_GetWebBrowser()

static nsresult NSAPI nsWebBrowserChrome_GetWebBrowser ( nsIWebBrowserChrome iface,
nsIWebBrowser **  aWebBrowser 
)
static

Definition at line 1317 of file nsembed.c.

1319 {
1321 
1322  TRACE("(%p)->(%p)\n", This, aWebBrowser);
1323 
1324  if(!aWebBrowser)
1325  return NS_ERROR_INVALID_ARG;
1326 
1327  if(This->webbrowser)
1328  nsIWebBrowser_AddRef(This->webbrowser);
1329  *aWebBrowser = This->webbrowser;
1330  return S_OK;
1331 }
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define TRACE(s)
Definition: solgame.cpp:4
#define NS_ERROR_INVALID_ARG
#define S_OK
Definition: intsafe.h:51

◆ nsWebBrowserChrome_IsWindowModal()

static nsresult NSAPI nsWebBrowserChrome_IsWindowModal ( nsIWebBrowserChrome iface,
cpp_bool _retval 
)
static

Definition at line 1384 of file nsembed.c.

1385 {
1387  WARN("(%p)->(%p)\n", This, _retval);
1388  return NS_ERROR_NOT_IMPLEMENTED;
1389 }
#define WARN(fmt,...)
Definition: debug.h:112
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_ERROR_NOT_IMPLEMENTED

◆ nsWebBrowserChrome_QueryInterface()

static nsresult NSAPI nsWebBrowserChrome_QueryInterface ( nsIWebBrowserChrome iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 1238 of file nsembed.c.

1240 {
1242 
1243  *result = NULL;
1244  if(IsEqualGUID(&IID_nsISupports, riid)) {
1245  TRACE("(%p)->(IID_nsISupports, %p)\n", This, result);
1246  *result = &This->nsIWebBrowserChrome_iface;
1247  }else if(IsEqualGUID(&IID_nsIWebBrowserChrome, riid)) {
1248  TRACE("(%p)->(IID_nsIWebBrowserChrome, %p)\n", This, result);
1249  *result = &This->nsIWebBrowserChrome_iface;
1250  }else if(IsEqualGUID(&IID_nsIContextMenuListener, riid)) {
1251  TRACE("(%p)->(IID_nsIContextMenuListener, %p)\n", This, result);
1252  *result = &This->nsIContextMenuListener_iface;
1253  }else if(IsEqualGUID(&IID_nsIURIContentListener, riid)) {
1254  TRACE("(%p)->(IID_nsIURIContentListener %p)\n", This, result);
1255  *result = &This->nsIURIContentListener_iface;
1256  }else if(IsEqualGUID(&IID_nsIEmbeddingSiteWindow, riid)) {
1257  TRACE("(%p)->(IID_nsIEmbeddingSiteWindow %p)\n", This, result);
1258  *result = &This->nsIEmbeddingSiteWindow_iface;
1259  }else if(IsEqualGUID(&IID_nsITooltipListener, riid)) {
1260  TRACE("(%p)->(IID_nsITooltipListener %p)\n", This, result);
1261  *result = &This->nsITooltipListener_iface;
1262  }else if(IsEqualGUID(&IID_nsIInterfaceRequestor, riid)) {
1263  TRACE("(%p)->(IID_nsIInterfaceRequestor %p)\n", This, result);
1264  *result = &This->nsIInterfaceRequestor_iface;
1265  }else if(IsEqualGUID(&IID_nsISupportsWeakReference, riid)) {
1266  TRACE("(%p)->(IID_nsISupportsWeakReference %p)\n", This, result);
1267  *result = &This->nsISupportsWeakReference_iface;
1268  }
1269 
1270  if(*result) {
1271  nsIWebBrowserChrome_AddRef(&This->nsIWebBrowserChrome_iface);
1272  return NS_OK;
1273  }
1274 
1275  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
1276  return NS_NOINTERFACE;
1277 }
REFIID riid
Definition: precomp.h:44
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_OK
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define NS_NOINTERFACE
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
GLuint64EXT * result
Definition: glext.h:11304

◆ nsWebBrowserChrome_Release()

static nsrefcnt NSAPI nsWebBrowserChrome_Release ( nsIWebBrowserChrome iface)
static

Definition at line 1289 of file nsembed.c.

1290 {
1292  LONG ref = InterlockedDecrement(&This->ref);
1293 
1294  TRACE("(%p) ref=%d\n", This, ref);
1295 
1296  if(!ref) {
1297  if(This->parent)
1298  nsIWebBrowserChrome_Release(&This->parent->nsIWebBrowserChrome_iface);
1299  if(This->weak_reference) {
1300  This->weak_reference->nscontainer = NULL;
1301  nsIWeakReference_Release(&This->weak_reference->nsIWeakReference_iface);
1302  }
1303  heap_free(This);
1304  }
1305 
1306  return ref;
1307 }
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
Definition: send.c:48
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ nsWebBrowserChrome_SetChromeFlags()

static nsresult NSAPI nsWebBrowserChrome_SetChromeFlags ( nsIWebBrowserChrome iface,
UINT32  aChromeFlags 
)
static

Definition at line 1354 of file nsembed.c.

1356 {
1358  WARN("(%p)->(%08x)\n", This, aChromeFlags);
1359  return NS_ERROR_NOT_IMPLEMENTED;
1360 }
#define WARN(fmt,...)
Definition: debug.h:112
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_ERROR_NOT_IMPLEMENTED

◆ nsWebBrowserChrome_SetStatus()

static nsresult NSAPI nsWebBrowserChrome_SetStatus ( nsIWebBrowserChrome iface,
UINT32  statusType,
const PRUnichar status 
)
static

Definition at line 1309 of file nsembed.c.

1311 {
1313  TRACE("(%p)->(%d %s)\n", This, statusType, debugstr_w(status));
1314  return NS_OK;
1315 }
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_OK
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
Definition: ps.c:97

◆ nsWebBrowserChrome_SetWebBrowser()

static nsresult NSAPI nsWebBrowserChrome_SetWebBrowser ( nsIWebBrowserChrome iface,
nsIWebBrowser aWebBrowser 
)
static

Definition at line 1333 of file nsembed.c.

1335 {
1337 
1338  TRACE("(%p)->(%p)\n", This, aWebBrowser);
1339 
1340  if(aWebBrowser != This->webbrowser)
1341  ERR("Wrong nsWebBrowser!\n");
1342 
1343  return NS_OK;
1344 }
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_OK
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110

◆ nsWebBrowserChrome_ShowAsModal()

static nsresult NSAPI nsWebBrowserChrome_ShowAsModal ( nsIWebBrowserChrome iface)
static

Definition at line 1377 of file nsembed.c.

1378 {
1380  WARN("(%p)\n", This);
1381  return NS_ERROR_NOT_IMPLEMENTED;
1382 }
#define WARN(fmt,...)
Definition: debug.h:112
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_ERROR_NOT_IMPLEMENTED

◆ nsWebBrowserChrome_SizeBrowserTo()

static nsresult NSAPI nsWebBrowserChrome_SizeBrowserTo ( nsIWebBrowserChrome iface,
LONG  aCX,
LONG  aCY 
)
static

Definition at line 1369 of file nsembed.c.

1371 {
1373  WARN("(%p)->(%d %d)\n", This, aCX, aCY);
1374  return NS_ERROR_NOT_IMPLEMENTED;
1375 }
#define WARN(fmt,...)
Definition: debug.h:112
static NSContainer * impl_from_nsIWebBrowserChrome(nsIWebBrowserChrome *iface)
Definition: nsembed.c:1233
#define NS_ERROR_NOT_IMPLEMENTED

◆ PRUint32()

static nsIFile** static PRUint32 ( CDECL NS_StringGetData) const
static

◆ register_nscontainer_class()

static void register_nscontainer_class ( void  )
static

Definition at line 372 of file nsembed.c.

373 {
374  static WNDCLASSEXW wndclass = {
375  sizeof(WNDCLASSEXW),
376  CS_DBLCLKS,
377  nsembed_proc,
378  0, 0, NULL, NULL, NULL, NULL, NULL,
380  NULL,
381  };
382  wndclass.hInstance = hInst;
383  nscontainer_class = RegisterClassExW(&wndclass);
384 }
static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: nsembed.c:334
struct _WNDCLASSEXW WNDCLASSEXW
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
static ATOM nscontainer_class
Definition: nsembed.c:68
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR wszNsContainer[]
Definition: nsembed.c:66
HINSTANCE hInstance
Definition: winuser.h:3196
#define CS_DBLCLKS
Definition: winuser.h:646
HINSTANCE hInst
Definition: dxdiag.c:13

Referenced by init_nscontainer().

◆ return_nsstr()

HRESULT return_nsstr ( nsresult  nsres,
nsAString nsstr,
BSTR p 
)

Definition at line 841 of file nsembed.c.

842 {
843  const PRUnichar *str;
844 
845  if(NS_FAILED(nsres)) {
846  ERR("failed: %08x\n", nsres);
847  nsAString_Finish(nsstr);
848  return E_FAIL;
849  }
850 
851  nsAString_GetData(nsstr, &str);
852  TRACE("ret %s\n", debugstr_w(str));
853  if(*str) {
854  *p = SysAllocString(str);
855  if(!*p)
856  return E_OUTOFMEMORY;
857  }else {
858  *p = NULL;
859  }
860 
861  nsAString_Finish(nsstr);
862  return S_OK;
863 }
UINT32 nsAString_GetData(const nsAString *str, const PRUnichar **data)
Definition: nsembed.c:831
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:51
void nsAString_Finish(nsAString *str)
Definition: nsembed.c:836
WCHAR PRUnichar
Definition: nsiface.idl:48
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by HTMLAnchorElement_get_hash(), HTMLAnchorElement_get_hostname(), HTMLAnchorElement_get_name(), HTMLAnchorElement_get_rel(), HTMLAnchorElement_get_search(), HTMLAnchorElement_get_target(), HTMLBodyElement_get_background(), HTMLButtonElement_get_name(), HTMLDocument5_get_compatMode(), HTMLDocument_get_charset(), HTMLDOMNode_get_nodeName(), HTMLDOMTextNode_get_data(), HTMLElement2_get_dir(), HTMLElement3_get_contentEditable(), HTMLElement_get_className(), HTMLElement_get_id(), HTMLElement_get_innerHTML(), HTMLElement_get_tagName(), HTMLElement_get_title(), HTMLFormElement_get_encoding(), HTMLFormElement_get_method(), HTMLFormElement_get_name(), HTMLFormElement_get_target(), HTMLFrameBase_get_frameBorder(), HTMLFrameBase_get_name(), HTMLFrameBase_get_src(), HTMLIFrameElement2_get_height(), HTMLIFrameElement2_get_width(), HTMLImgElement_get_align(), HTMLImgElement_get_alt(), HTMLImgElement_get_name(), HTMLInputElement_get_defaultValue(), HTMLInputElement_get_name(), HTMLInputElement_get_type(), HTMLInputElement_get_value(), HTMLLinkElement_get_href(), HTMLLinkElement_get_media(), HTMLLinkElement_get_rel(), HTMLLinkElement_get_rev(), HTMLLinkElement_get_type(), HTMLObjectElement_get_name(), HTMLOptionElement_get_text(), HTMLOptionElement_get_value(), HTMLScriptElement_get_src(), HTMLScriptElement_get_text(), HTMLScriptElement_get_type(), HTMLSelectElement_get_name(), HTMLSelectElement_get_type(), HTMLSelectElement_get_value(), HTMLStyleElement_get_media(), HTMLStyleElement_get_type(), HTMLStyleSheet_get_cssText(), HTMLStyleSheet_get_href(), HTMLTable3_get_summary(), HTMLTable_get_align(), HTMLTable_get_cellSpacing(), HTMLTable_get_frame(), HTMLTableCell_get_align(), HTMLTableRow_get_align(), HTMLTableRow_get_vAlign(), HTMLTextAreaElement_get_defaultValue(), HTMLTextAreaElement_get_name(), HTMLTextAreaElement_get_value(), HTMLWindow2_get_name(), HTMLXMLHttpRequest_get_responseText(), and return_nsstr_variant().

◆ set_bool_pref()

static void set_bool_pref ( nsIPrefBranch pref,
const char pref_name,
BOOL  val 
)
static

Definition at line 604 of file nsembed.c.

605 {
606