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
672bca55
Commit
672bca55
authored
Oct 13, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Create nsIDOMEvent in create_event if not available.
parent
3e0fa120
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
21 deletions
+76
-21
htmlevent.c
dlls/mshtml/htmlevent.c
+64
-21
nsiface.idl
dlls/mshtml/nsiface.idl
+12
-0
No files found.
dlls/mshtml/htmlevent.c
View file @
672bca55
...
...
@@ -96,9 +96,28 @@ static const WCHAR onreadystatechangeW[] = {'o','n','r','e','a','d','y','s','t',
static
const
WCHAR
selectstartW
[]
=
{
's'
,
'e'
,
'l'
,
'e'
,
'c'
,
't'
,
's'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
onselectstartW
[]
=
{
'o'
,
'n'
,
's'
,
'e'
,
'l'
,
'e'
,
'c'
,
't'
,
's'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
HTMLEventsW
[]
=
{
'H'
,
'T'
,
'M'
,
'L'
,
'E'
,
'v'
,
'e'
,
'n'
,
't'
,
's'
,
0
};
static
const
WCHAR
KeyboardEventW
[]
=
{
'K'
,
'e'
,
'y'
,
'b'
,
'o'
,
'a'
,
'r'
,
'd'
,
'E'
,
'v'
,
'e'
,
'n'
,
't'
,
0
};
static
const
WCHAR
MouseEventW
[]
=
{
'M'
,
'o'
,
'u'
,
's'
,
'e'
,
'E'
,
'v'
,
'e'
,
'n'
,
't'
,
0
};
enum
{
EVENTT_NONE
,
EVENTT_HTML
,
EVENTT_KEY
,
EVENTT_MOUSE
};
static
const
WCHAR
*
event_types
[]
=
{
NULL
,
HTMLEventsW
,
KeyboardEventW
,
MouseEventW
};
typedef
struct
{
LPCWSTR
name
;
LPCWSTR
attr_name
;
DWORD
type
;
DWORD
flags
;
}
event_info_t
;
...
...
@@ -107,24 +126,24 @@ typedef struct {
#define EVENT_FORWARDBODY 0x0004
static
const
event_info_t
event_info
[]
=
{
{
beforeunloadW
,
onbeforeunloadW
,
EVENT_DEFAULTLISTENER
|
EVENT_FORWARDBODY
},
{
blurW
,
onblurW
,
EVENT_DEFAULTLISTENER
},
{
changeW
,
onchangeW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
clickW
,
onclickW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
dblclickW
,
ondblclickW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
dragW
,
ondragW
,
0
},
{
dragstartW
,
ondragstartW
,
0
},
{
focusW
,
onfocusW
,
EVENT_DEFAULTLISTENER
},
{
keydownW
,
onkeydownW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
keyupW
,
onkeyupW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
loadW
,
onloadW
,
0
},
{
mousedownW
,
onmousedownW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
mouseoutW
,
onmouseoutW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
mouseoverW
,
onmouseoverW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
mouseupW
,
onmouseupW
,
EVENT_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
pasteW
,
onpasteW
,
0
},
{
readystatechangeW
,
onreadystatechangeW
,
0
},
{
selectstartW
,
onselectstartW
,
0
}
{
beforeunloadW
,
onbeforeunloadW
,
EVENT
T_NONE
,
EVENT
_DEFAULTLISTENER
|
EVENT_FORWARDBODY
},
{
blurW
,
onblurW
,
EVENT
T_HTML
,
EVENT
_DEFAULTLISTENER
},
{
changeW
,
onchangeW
,
EVENT
T_HTML
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
clickW
,
onclickW
,
EVENT
T_MOUSE
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
dblclickW
,
ondblclickW
,
EVENT
T_MOUSE
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
dragW
,
ondragW
,
EVENTT_MOUSE
,
0
},
{
dragstartW
,
ondragstartW
,
EVENTT_MOUSE
,
0
},
{
focusW
,
onfocusW
,
EVENT
T_HTML
,
EVENT
_DEFAULTLISTENER
},
{
keydownW
,
onkeydownW
,
EVENT
T_KEY
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
keyupW
,
onkeyupW
,
EVENT
T_KEY
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
loadW
,
onloadW
,
EVENTT_HTML
,
0
},
{
mousedownW
,
onmousedownW
,
EVENT
T_MOUSE
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
mouseoutW
,
onmouseoutW
,
EVENT
T_MOUSE
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
mouseoverW
,
onmouseoverW
,
EVENT
T_MOUSE
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
mouseupW
,
onmouseupW
,
EVENT
T_MOUSE
,
EVENT
_DEFAULTLISTENER
|
EVENT_BUBBLE
},
{
pasteW
,
onpasteW
,
EVENTT_NONE
,
0
},
{
readystatechangeW
,
onreadystatechangeW
,
EVENTT_NONE
,
0
},
{
selectstartW
,
onselectstartW
,
EVENTT_MOUSE
,
0
}
};
eventid_t
str_to_eid
(
LPCWSTR
str
)
...
...
@@ -680,15 +699,39 @@ static IHTMLEventObj *create_event(HTMLDOMNode *target, eventid_t eid, nsIDOMEve
HTMLEventObj
*
ret
;
ret
=
heap_alloc
(
sizeof
(
*
ret
));
if
(
!
ret
)
return
NULL
;
ret
->
lpIHTMLEventObjVtbl
=
&
HTMLEventObjVtbl
;
ret
->
ref
=
1
;
ret
->
type
=
event_info
+
eid
;
ret
->
target
=
target
;
IHTMLDOMNode_AddRef
(
HTMLDOMNODE
(
target
));
ret
->
nsevent
=
nsevent
;
if
(
nsevent
)
if
(
nsevent
)
{
nsIDOMEvent_AddRef
(
nsevent
);
}
else
if
(
event_types
[
event_info
[
eid
].
type
])
{
nsIDOMDocumentEvent
*
doc_event
;
nsresult
nsres
;
nsres
=
nsIDOMHTMLDocument_QueryInterface
(
target
->
doc
->
basedoc
.
nsdoc
,
&
IID_nsIDOMDocumentEvent
,
(
void
**
)
&
doc_event
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString
type_str
;
nsAString_Init
(
&
type_str
,
event_types
[
event_info
[
eid
].
type
]);
nsres
=
nsIDOMDocumentEvent_CreateEvent
(
doc_event
,
&
type_str
,
&
ret
->
nsevent
);
nsAString_Finish
(
&
type_str
);
nsIDOMDocumentEvent_Release
(
doc_event
);
}
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not create event: %08x
\n
"
,
nsres
);
IHTMLEventObj_Release
(
HTMLEVENTOBJ
(
ret
));
return
NULL
;
}
}
ret
->
target
=
target
;
IHTMLDOMNode_AddRef
(
HTMLDOMNODE
(
target
));
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
HTMLEVENTOBJ
(
ret
),
&
HTMLEventObj_dispex
);
...
...
dlls/mshtml/nsiface.idl
View file @
672bca55
...
...
@@ -1013,6 +1013,18 @@ interface nsIDOMDocumentView : nsISupports
[
object,
uuid(46b91d66-28e2-11d4-ab1e-0010830123b4),
local
/* FROZEN */
]
interface nsIDOMDocumentEvent : nsISupports
{
cpp_quote("#undef CreateEvent")
nsresult CreateEvent(const nsAString *eventType, nsIDOMEvent **_retval);
}
[
object,
uuid(a6cf90ce-15b3-11d2-932e-00805f8add32),
local
/* FROZEN */
...
...
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