Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
27eb80cc
Commit
27eb80cc
authored
Oct 09, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Get rid of setup_nswindow.
It's no longer needed.
parent
8162797a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
104 deletions
+0
-104
htmlwindow.c
dlls/mshtml/htmlwindow.c
+0
-102
mshtml_private.h
dlls/mshtml/mshtml_private.h
+0
-1
nsevents.c
dlls/mshtml/nsevents.c
+0
-1
No files found.
dlls/mshtml/htmlwindow.c
View file @
27eb80cc
...
...
@@ -1177,108 +1177,6 @@ static dispex_static_data_t HTMLWindow_dispex = {
HTMLWindow_iface_tids
};
static
const
char
wineConfig_func
[]
=
"window.__defineGetter__(
\"
external
\"
,function() {
\n
"
" return window.__wineWindow__.external;
\n
"
"});
\n
"
"window.__wineWindow__ = wineWindow;
\n
"
;
static
void
astr_to_nswstr
(
const
char
*
str
,
nsAString
*
nsstr
)
{
LPWSTR
wstr
;
int
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
wstr
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
wstr
,
len
);
nsAString_Init
(
nsstr
,
wstr
);
heap_free
(
wstr
);
}
static
nsresult
call_js_func
(
nsIScriptContainer
*
script_container
,
nsISupports
*
target
,
const
char
*
name
,
const
char
*
body
,
PRUint32
argc
,
const
char
**
arg_names
,
nsIArray
*
argv
)
{
nsACString
name_str
;
nsAString
body_str
;
JSObject
func_obj
,
jsglobal
;
nsIVariant
*
jsret
;
nsresult
nsres
;
nsres
=
nsIScriptContainer_GetGlobalObject
(
script_container
,
&
jsglobal
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetGlobalObject: %08x
\n
"
,
nsres
);
nsACString_Init
(
&
name_str
,
name
);
astr_to_nswstr
(
body
,
&
body_str
);
nsres
=
nsIScriptContainer_CompileFunction
(
script_container
,
jsglobal
,
&
name_str
,
argc
,
arg_names
,
&
body_str
,
NULL
,
1
,
FALSE
,
&
func_obj
);
nsACString_Finish
(
&
name_str
);
nsAString_Finish
(
&
body_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CompileFunction failed: %08x
\n
"
,
nsres
);
return
nsres
;
}
nsres
=
nsIScriptContainer_CallFunction
(
script_container
,
target
,
jsglobal
,
func_obj
,
argv
,
&
jsret
);
nsIScriptContainer_DropScriptObject
(
script_container
,
func_obj
);
nsIScriptContainer_DropScriptObject
(
script_container
,
jsglobal
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CallFunction failed: %08x
\n
"
,
nsres
);
return
nsres
;
}
nsIVariant_Release
(
jsret
);
return
NS_OK
;
}
void
setup_nswindow
(
HTMLWindow
*
This
)
{
nsIScriptContainer
*
script_container
;
nsIDOMWindow
*
nswindow
;
nsIDOMDocument
*
domdoc
;
nsIWritableVariant
*
nsvar
;
nsIMutableArray
*
argv
;
nsresult
nsres
;
static
const
char
*
args
[]
=
{
"wineWindow"
};
TRACE
(
"(%p)
\n
"
,
This
);
nsIWebNavigation_GetDocument
(
This
->
doc
->
nscontainer
->
navigation
,
&
domdoc
);
nsres
=
nsIDOMDocument_QueryInterface
(
domdoc
,
&
IID_nsIScriptContainer
,
(
void
**
)
&
script_container
);
nsIDOMDocument_Release
(
domdoc
);
if
(
NS_FAILED
(
nsres
))
{
TRACE
(
"Could not get nsIDOMScriptContainer: %08x
\n
"
,
nsres
);
return
;
}
nsIWebBrowser_GetContentDOMWindow
(
This
->
doc
->
nscontainer
->
webbrowser
,
&
nswindow
);
nsvar
=
create_nsvariant
();
nsres
=
nsIWritableVariant_SetAsInterface
(
nsvar
,
&
IID_IDispatch
,
HTMLWINDOW2
(
This
));
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetAsInterface failed: %08x
\n
"
,
nsres
);
argv
=
create_nsarray
();
nsres
=
nsIMutableArray_AppendElement
(
argv
,
(
nsISupports
*
)
nsvar
,
FALSE
);
nsIWritableVariant_Release
(
nsvar
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"AppendElement failed: %08x
\n
"
,
nsres
);
call_js_func
(
script_container
,
(
nsISupports
*
)
nswindow
/*HTMLWINDOW2(This)*/
,
"wineConfig"
,
wineConfig_func
,
1
,
args
,
(
nsIArray
*
)
argv
);
nsIMutableArray_Release
(
argv
);
nsIScriptContainer_Release
(
script_container
);
}
HTMLWindow
*
HTMLWindow_Create
(
HTMLDocument
*
doc
)
{
HTMLWindow
*
ret
=
heap_alloc_zero
(
sizeof
(
HTMLWindow
));
...
...
dlls/mshtml/mshtml_private.h
View file @
27eb80cc
...
...
@@ -467,7 +467,6 @@ HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLDocument
*
);
HTMLLocation
*
HTMLLocation_Create
(
HTMLDocument
*
);
IOmNavigator
*
OmNavigator_Create
(
void
);
void
setup_nswindow
(
HTMLWindow
*
);
void
HTMLDocument_HTMLDocument3_Init
(
HTMLDocument
*
);
void
HTMLDocument_HTMLDocument5_Init
(
HTMLDocument
*
);
...
...
dlls/mshtml/nsevents.c
View file @
27eb80cc
...
...
@@ -139,7 +139,6 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
update_nsdocument
(
This
->
doc
);
connect_scripts
(
This
->
doc
);
setup_nswindow
(
This
->
doc
->
window
);
if
(
This
->
editor_controller
)
{
nsIController_Release
(
This
->
editor_controller
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment