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
7dd4f5e2
Commit
7dd4f5e2
authored
Jun 22, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move load event listener to separated object.
parent
8b3086a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
25 deletions
+40
-25
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
nsembed.c
dlls/mshtml/nsembed.c
+1
-25
nsevents.c
dlls/mshtml/nsevents.c
+37
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
7dd4f5e2
...
...
@@ -143,6 +143,7 @@ struct NSContainer {
const
nsIDOMEventListenerVtbl
*
lpDOMEventListenerVtbl
;
nsEventListener
keypress_listener
;
nsEventListener
load_listener
;
nsIWebBrowser
*
webbrowser
;
nsIWebNavigation
*
navigation
;
...
...
@@ -357,6 +358,7 @@ void nsAString_Finish(nsAString*);
nsIInputStream
*
create_nsstream
(
const
char
*
,
PRInt32
);
nsICommandParams
*
create_nscommand_params
(
void
);
void
nsnode_to_nsstring
(
nsIDOMNode
*
,
nsAString
*
);
nsIController
*
get_editor_controller
(
NSContainer
*
);
void
init_nsevents
(
NSContainer
*
);
BSCallback
*
create_bscallback
(
IMoniker
*
);
...
...
dlls/mshtml/nsembed.c
View file @
7dd4f5e2
...
...
@@ -589,7 +589,7 @@ void nsnode_to_nsstring(nsIDOMNode *nsdoc, nsAString *str)
nsIContentSerializer_Release
(
serializer
);
}
static
nsIController
*
get_editor_controller
(
NSContainer
*
This
)
nsIController
*
get_editor_controller
(
NSContainer
*
This
)
{
nsIController
*
ret
=
NULL
;
nsIEditingSession
*
editing_session
=
NULL
;
...
...
@@ -1532,7 +1532,6 @@ static const nsISupportsWeakReferenceVtbl nsSupportsWeakReferenceVtbl = {
NSContainer
*
NSContainer_Create
(
HTMLDocument
*
doc
,
NSContainer
*
parent
)
{
nsIDOMWindow
*
dom_window
;
nsIWebBrowserSetup
*
wbsetup
;
nsIScrollable
*
scrollable
;
NSContainer
*
ret
;
...
...
@@ -1621,29 +1620,6 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetParentURIContentListener failed: %08x
\n
"
,
nsres
);
nsres
=
nsIWebBrowser_GetContentDOMWindow
(
ret
->
webbrowser
,
&
dom_window
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsIDOMEventTarget
*
target
;
nsres
=
nsIDOMWindow_QueryInterface
(
dom_window
,
&
IID_nsIDOMEventTarget
,
(
void
**
)
&
target
);
nsIDOMWindow_Release
(
dom_window
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString
load_str
;
static
const
PRUnichar
wsz_load
[]
=
{
'l'
,
'o'
,
'a'
,
'd'
,
0
};
nsAString_Init
(
&
load_str
,
wsz_load
);
nsres
=
nsIDOMEventTarget_AddEventListener
(
target
,
&
load_str
,
NSEVENTLIST
(
ret
),
TRUE
);
nsAString_Finish
(
&
load_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"AddEventTarget failed: %08x
\n
"
,
nsres
);
nsIDOMEventTarget_Release
(
target
);
}
else
{
ERR
(
"Could not get nsIDOMEventTarget interface: %08x
\n
"
,
nsres
);
}
}
else
{
ERR
(
"GetContentDOMWindow failed: %08x
\n
"
,
nsres
);
}
init_nsevents
(
ret
);
nsres
=
nsIWebBrowser_QueryInterface
(
ret
->
webbrowser
,
&
IID_nsIScrollable
,
(
void
**
)
&
scrollable
);
...
...
dlls/mshtml/nsevents.c
View file @
7dd4f5e2
...
...
@@ -86,6 +86,39 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
return
NS_OK
;
}
static
nsresult
NSAPI
handle_load
(
nsIDOMEventListener
*
iface
,
nsIDOMEvent
*
event
)
{
NSContainer
*
This
=
NSEVENTLIST_THIS
(
iface
)
->
This
;
task_t
*
task
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
doc
)
return
NS_OK
;
if
(
This
->
editor_controller
)
{
nsIController_Release
(
This
->
editor_controller
);
This
->
editor_controller
=
NULL
;
}
if
(
This
->
doc
->
usermode
==
EDITMODE
)
This
->
editor_controller
=
get_editor_controller
(
This
);
task
=
mshtml_alloc
(
sizeof
(
task_t
));
task
->
doc
=
This
->
doc
;
task
->
task_id
=
TASK_PARSECOMPLETE
;
task
->
next
=
NULL
;
/*
* This should be done in the worker thread that parses HTML,
* but we don't have such thread (Gecko parses HTML for us).
*/
push_task
(
task
);
return
NS_OK
;
}
#undef NSEVENTLIST_THIS
#define EVENTLISTENER_VTBL(handler) \
...
...
@@ -97,6 +130,7 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
};
static
const
nsIDOMEventListenerVtbl
keypress_vtbl
=
EVENTLISTENER_VTBL
(
handle_keypress
);
static
const
nsIDOMEventListenerVtbl
load_vtbl
=
EVENTLISTENER_VTBL
(
handle_load
);
static
void
init_event
(
nsIDOMEventTarget
*
target
,
const
PRUnichar
*
type
,
nsIDOMEventListener
*
listener
,
BOOL
capture
)
...
...
@@ -126,8 +160,10 @@ void init_nsevents(NSContainer *This)
nsresult
nsres
;
static
const
PRUnichar
wsz_keypress
[]
=
{
'k'
,
'e'
,
'y'
,
'p'
,
'r'
,
'e'
,
's'
,
's'
,
0
};
static
const
PRUnichar
wsz_load
[]
=
{
'l'
,
'o'
,
'a'
,
'd'
,
0
};
init_listener
(
&
This
->
keypress_listener
,
This
,
&
keypress_vtbl
);
init_listener
(
&
This
->
load_listener
,
This
,
&
load_vtbl
);
nsres
=
nsIWebBrowser_GetContentDOMWindow
(
This
->
webbrowser
,
&
dom_window
);
if
(
NS_FAILED
(
nsres
))
{
...
...
@@ -143,6 +179,7 @@ void init_nsevents(NSContainer *This)
}
init_event
(
target
,
wsz_keypress
,
NSEVENTLIST
(
&
This
->
keypress_listener
),
FALSE
);
init_event
(
target
,
wsz_load
,
NSEVENTLIST
(
&
This
->
load_listener
),
TRUE
);
nsIDOMEventTarget_Release
(
target
);
}
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