ReactOS 0.4.15-dev-5664-g3bf4ef6
nsevents.c File Reference
#include "mshtml_private.h"
Include dependency graph for nsevents.c:

Go to the source code of this file.

Classes

struct  nsEventListener
 
struct  nsDocumentEventListener
 

Macros

#define EVENTLISTENER_VTBL(handler)
 

Functions

static LONG release_listener (nsDocumentEventListener *This)
 
static nsEventListenerimpl_from_nsIDOMEventListener (nsIDOMEventListener *iface)
 
static nsresult NSAPI nsDOMEventListener_QueryInterface (nsIDOMEventListener *iface, nsIIDRef riid, void **result)
 
static nsrefcnt NSAPI nsDOMEventListener_AddRef (nsIDOMEventListener *iface)
 
static nsrefcnt NSAPI nsDOMEventListener_Release (nsIDOMEventListener *iface)
 
static BOOL is_doc_child_focus (NSContainer *nscontainer)
 
static nsresult NSAPI handle_blur (nsIDOMEventListener *iface, nsIDOMEvent *event)
 
static nsresult NSAPI handle_focus (nsIDOMEventListener *iface, nsIDOMEvent *event)
 
static nsresult NSAPI handle_keypress (nsIDOMEventListener *iface, nsIDOMEvent *event)
 
static void handle_docobj_load (HTMLDocumentObj *doc)
 
static nsresult NSAPI handle_load (nsIDOMEventListener *iface, nsIDOMEvent *event)
 
static nsresult NSAPI handle_htmlevent (nsIDOMEventListener *iface, nsIDOMEvent *event)
 
static void init_event (nsIDOMEventTarget *target, const PRUnichar *type, nsIDOMEventListener *listener, BOOL capture)
 
static void init_listener (nsEventListener *This, nsDocumentEventListener *listener, const nsIDOMEventListenerVtbl *vtbl)
 
void add_nsevent_listener (HTMLDocumentNode *doc, nsIDOMNode *nsnode, LPCWSTR type)
 
static void detach_nslistener (HTMLDocumentNode *doc, const WCHAR *type, nsEventListener *listener, cpp_bool is_capture)
 
void detach_nsevent (HTMLDocumentNode *doc, const WCHAR *type)
 
void release_nsevents (HTMLDocumentNode *doc)
 
void init_nsevents (HTMLDocumentNode *doc)
 

Variables

static const PRUnichar blurW [] = {'b','l','u','r',0}
 
static const PRUnichar focusW [] = {'f','o','c','u','s',0}
 
static const PRUnichar keypressW [] = {'k','e','y','p','r','e','s','s',0}
 
static const PRUnichar loadW [] = {'l','o','a','d',0}
 
static const nsIDOMEventListenerVtbl blur_vtbl = EVENTLISTENER_VTBL(handle_blur)
 
static const nsIDOMEventListenerVtbl focus_vtbl = EVENTLISTENER_VTBL(handle_focus)
 
static const nsIDOMEventListenerVtbl keypress_vtbl = EVENTLISTENER_VTBL(handle_keypress)
 
static const nsIDOMEventListenerVtbl load_vtbl = EVENTLISTENER_VTBL(handle_load)
 
static const nsIDOMEventListenerVtbl htmlevent_vtbl = EVENTLISTENER_VTBL(handle_htmlevent)
 

Macro Definition Documentation

◆ EVENTLISTENER_VTBL

#define EVENTLISTENER_VTBL (   handler)
Value:
{ \
}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
static nsresult NSAPI nsDOMEventListener_QueryInterface(nsIDOMEventListener *iface, nsIIDRef riid, void **result)
Definition: nsevents.c:60
static nsrefcnt NSAPI nsDOMEventListener_Release(nsIDOMEventListener *iface)
Definition: nsevents.c:94
static nsrefcnt NSAPI nsDOMEventListener_AddRef(nsIDOMEventListener *iface)
Definition: nsevents.c:84

Definition at line 311 of file nsevents.c.

Function Documentation

◆ add_nsevent_listener()

void add_nsevent_listener ( HTMLDocumentNode doc,
nsIDOMNode nsnode,
LPCWSTR  type 
)

Definition at line 346 of file nsevents.c.

347{
349 nsresult nsres;
350
351 if(nsnode)
352 nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMEventTarget, (void**)&target);
353 else
354 nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
355 if(NS_FAILED(nsres)) {
356 ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
357 return;
358 }
359
361 TRUE);
362 nsIDOMEventTarget_Release(target);
363}
#define ERR(fmt,...)
Definition: debug.h:110
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum target
Definition: glext.h:7315
#define NS_FAILED(res)
static void init_event(nsIDOMEventTarget *target, const PRUnichar *type, nsIDOMEventListener *listener, BOOL capture)
Definition: nsevents.c:325
HTMLDocument basedoc
nsDocumentEventListener * nsevent_listener
HTMLOuterWindow * window
nsIDOMWindow * nswindow
nsEventListener htmlevent_listener
Definition: nsevents.c:36
nsIDOMEventListener nsIDOMEventListener_iface
Definition: nsevents.c:27

Referenced by ensure_doc_nsevent_handler().

◆ detach_nsevent()

void detach_nsevent ( HTMLDocumentNode doc,
const WCHAR type 
)

Definition at line 389 of file nsevents.c.

390{
392}
static void detach_nslistener(HTMLDocumentNode *doc, const WCHAR *type, nsEventListener *listener, cpp_bool is_capture)
Definition: nsevents.c:365

Referenced by detach_events().

◆ detach_nslistener()

static void detach_nslistener ( HTMLDocumentNode doc,
const WCHAR type,
nsEventListener listener,
cpp_bool  is_capture 
)
static

Definition at line 365 of file nsevents.c.

366{
368 nsAString type_str;
369 nsresult nsres;
370
371 if(!doc->basedoc.window)
372 return;
373
374 nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
375 if(NS_FAILED(nsres)) {
376 ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
377 return;
378 }
379
380 nsAString_InitDepend(&type_str, type);
381 nsres = nsIDOMEventTarget_RemoveEventListener(target, &type_str,
382 &listener->nsIDOMEventListener_iface, is_capture);
383 nsAString_Finish(&type_str);
384 nsIDOMEventTarget_Release(target);
385 if(NS_FAILED(nsres))
386 ERR("RemoveEventTarget failed: %08x\n", nsres);
387}
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826

Referenced by detach_nsevent(), and release_nsevents().

◆ handle_blur()

static nsresult NSAPI handle_blur ( nsIDOMEventListener iface,
nsIDOMEvent event 
)
static

Definition at line 110 of file nsevents.c.

111{
113 HTMLDocumentNode *doc = This->This->doc;
114 HTMLDocumentObj *doc_obj;
115
116 TRACE("(%p)\n", doc);
117
118 if(!doc || !doc->basedoc.doc_obj)
119 return NS_ERROR_FAILURE;
120 doc_obj = doc->basedoc.doc_obj;
121
122 if(doc_obj->focus && !is_doc_child_focus(doc_obj->nscontainer)) {
123 doc_obj->focus = FALSE;
124 notif_focus(doc_obj);
125 }
126
127 return NS_OK;
128}
#define FALSE
Definition: types.h:117
#define NS_OK
#define NS_ERROR_FAILURE
void notif_focus(HTMLDocumentObj *) DECLSPEC_HIDDEN
Definition: view.c:130
static BOOL is_doc_child_focus(NSContainer *nscontainer)
Definition: nsevents.c:101
static nsEventListener * impl_from_nsIDOMEventListener(nsIDOMEventListener *iface)
Definition: nsevents.c:55
#define TRACE(s)
Definition: solgame.cpp:4
NSContainer * nscontainer
HTMLDocumentObj * doc_obj

◆ handle_docobj_load()

static void handle_docobj_load ( HTMLDocumentObj doc)
static

Definition at line 170 of file nsevents.c.

171{
172 IOleCommandTarget *olecmd = NULL;
174
176 nsIController_Release(doc->nscontainer->editor_controller);
178 }
179
180 if(doc->usermode == EDITMODE)
182
183 if(doc->client) {
184 hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
185 if(FAILED(hres))
186 olecmd = NULL;
187 }
188
189 if(doc->download_state) {
190 if(olecmd) {
192
193 V_VT(&progress) = VT_I4;
194 V_I4(&progress) = 0;
195 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS,
196 OLECMDEXECOPT_DONTPROMPTUSER, &progress, NULL);
197 }
198
199 set_download_state(doc, 0);
200 }
201
202 if(olecmd) {
203 IOleCommandTarget_Exec(olecmd, &CGID_ShellDocView, 103, 0, NULL, NULL);
204 IOleCommandTarget_Exec(olecmd, &CGID_MSHTML, IDM_PARSECOMPLETE, 0, NULL, NULL);
205 IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_HTTPEQUIV_DONE, 0, NULL, NULL);
206
207 IOleCommandTarget_Release(olecmd);
208 }
209}
cd_progress_ptr progress
Definition: cdjpeg.h:152
#define NULL
Definition: types.h:112
@ VT_I4
Definition: compat.h:2298
void handle_edit_load(HTMLDocument *This)
Definition: editor.c:482
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
#define IDM_PARSECOMPLETE
Definition: mshtmcid.h:305
@ EDITMODE
void set_download_state(HTMLDocumentObj *, int) DECLSPEC_HIDDEN
Definition: persist.c:170
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247
IOleClientSite * client
HTMLDocument basedoc
nsIController * editor_controller

Referenced by handle_load().

◆ handle_focus()

static nsresult NSAPI handle_focus ( nsIDOMEventListener iface,
nsIDOMEvent event 
)
static

Definition at line 130 of file nsevents.c.

131{
133 HTMLDocumentNode *doc = This->This->doc;
134 HTMLDocumentObj *doc_obj;
135
136 TRACE("(%p)\n", doc);
137
138 if(!doc)
139 return NS_ERROR_FAILURE;
140 doc_obj = doc->basedoc.doc_obj;
141
142 if(!doc_obj->focus) {
143 doc_obj->focus = TRUE;
144 notif_focus(doc_obj);
145 }
146
147 return NS_OK;
148}

◆ handle_htmlevent()

static nsresult NSAPI handle_htmlevent ( nsIDOMEventListener iface,
nsIDOMEvent event 
)
static

Definition at line 267 of file nsevents.c.

268{
270 HTMLDocumentNode *doc = This->This->doc;
271 const PRUnichar *type;
272 nsIDOMEventTarget *event_target;
273 nsIDOMNode *nsnode;
274 nsAString type_str;
275 eventid_t eid;
276 nsresult nsres;
277
278 TRACE("%p\n", This->This);
279
280 if(!doc) {
281 WARN("NULL doc\n");
282 return NS_OK;
283 }
284
285 nsAString_Init(&type_str, NULL);
286 nsIDOMEvent_GetType(event, &type_str);
287 nsAString_GetData(&type_str, &type);
288 eid = str_to_eid(type);
289 nsAString_Finish(&type_str);
290
291 nsres = nsIDOMEvent_GetTarget(event, &event_target);
292 if(NS_FAILED(nsres) || !event_target) {
293 ERR("GetEventTarget failed: %08x\n", nsres);
294 return NS_OK;
295 }
296
297 nsres = nsIDOMEventTarget_QueryInterface(event_target, &IID_nsIDOMNode, (void**)&nsnode);
298 nsIDOMEventTarget_Release(event_target);
299 if(NS_FAILED(nsres)) {
300 ERR("Could not get nsIDOMNode: %08x\n", nsres);
301 return NS_OK;
302 }
303
304 fire_event(doc, eid, TRUE, nsnode, event, NULL);
305
306 nsIDOMNode_Release(nsnode);
307
308 return NS_OK;
309}
#define WARN(fmt,...)
Definition: debug.h:112
struct _cl_event * event
Definition: glext.h:7739
eventid_t str_to_eid(LPCWSTR str)
Definition: htmlevent.c:217
void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode *target, nsIDOMEvent *nsevent, IDispatch *script_this)
Definition: htmlevent.c:1195
eventid_t
Definition: htmlevent.h:21
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
WCHAR PRUnichar
Definition: nsiface.idl:48

◆ handle_keypress()

static nsresult NSAPI handle_keypress ( nsIDOMEventListener iface,
nsIDOMEvent event 
)
static

Definition at line 150 of file nsevents.c.

152{
154 HTMLDocumentNode *doc = This->This->doc;
155 HTMLDocumentObj *doc_obj;
156
157 if(!doc)
158 return NS_ERROR_FAILURE;
159 doc_obj = doc->basedoc.doc_obj;
160
161 TRACE("(%p)->(%p)\n", doc, event);
162
163 update_doc(&doc_obj->basedoc, UPDATE_UI);
164 if(doc_obj->usermode == EDITMODE)
165 handle_edit_event(&doc_obj->basedoc, event);
166
167 return NS_OK;
168}
void handle_edit_event(HTMLDocument *This, nsIDOMEvent *event)
Definition: editor.c:384
#define UPDATE_UI
void update_doc(HTMLDocument *, DWORD) DECLSPEC_HIDDEN
Definition: view.c:62

◆ handle_load()

static nsresult NSAPI handle_load ( nsIDOMEventListener iface,
nsIDOMEvent event 
)
static

Definition at line 211 of file nsevents.c.

212{
214 HTMLDocumentNode *doc = This->This->doc;
215 HTMLDocumentObj *doc_obj = NULL;
216 nsresult nsres = NS_OK;
217
218 TRACE("(%p)\n", doc);
219
220 if(!doc || !doc->basedoc.window)
221 return NS_ERROR_FAILURE;
222 if(doc->basedoc.doc_obj && doc->basedoc.doc_obj->basedoc.doc_node == doc)
223 doc_obj = doc->basedoc.doc_obj;
224
226
227 htmldoc_addref(&doc->basedoc);
228
229 if(doc_obj)
230 handle_docobj_load(doc_obj);
231
232 set_ready_state(doc->basedoc.window, READYSTATE_COMPLETE);
233
234 if(doc_obj) {
235 if(doc_obj->view_sink)
236 IAdviseSink_OnViewChange(doc_obj->view_sink, DVASPECT_CONTENT, -1);
237
239
240 update_title(doc_obj);
241 }
242
243 if(doc_obj && doc_obj->usermode!=EDITMODE && doc_obj->doc_object_service
245 IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service,
247
248 if(doc->nsdoc) {
249 nsIDOMHTMLElement *nsbody;
250
252
253 nsres = nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody);
254 if(NS_SUCCEEDED(nsres) && nsbody) {
256 nsIDOMHTMLElement_Release(nsbody);
257 }
258 }else {
259 ERR("NULL nsdoc\n");
260 nsres = NS_ERROR_FAILURE;
261 }
262
264 return nsres;
265}
#define BINDING_REFRESH
Definition: binding.h:130
void set_statustext(HTMLDocumentObj *doc, INT id, LPCWSTR arg)
Definition: main.c:111
#define IDS_STATUS_DONE
Definition: resource.h:25
@ EVENTID_LOAD
Definition: htmlevent.h:39
void connect_scripts(HTMLInnerWindow *) DECLSPEC_HIDDEN
Definition: script.c:213
static ULONG htmldoc_addref(HTMLDocument *This)
void update_title(HTMLDocumentObj *) DECLSPEC_HIDDEN
Definition: view.c:70
void flush_pending_tasks(LONG) DECLSPEC_HIDDEN
Definition: task.c:88
static ULONG htmldoc_release(HTMLDocument *This)
#define NS_SUCCEEDED(res)
void set_ready_state(HTMLOuterWindow *, READYSTATE) DECLSPEC_HIDDEN
Definition: persist.c:450
static void handle_docobj_load(HTMLDocumentObj *doc)
Definition: nsevents.c:170
nsIDOMHTMLDocument * nsdoc
HTMLInnerWindow * window
IDocObjectService * doc_object_service
IAdviseSink * view_sink
HTMLDocumentNode * doc_node
IDispatchEx IDispatchEx_iface
IHTMLWindow2 IHTMLWindow2_iface

◆ impl_from_nsIDOMEventListener()

static nsEventListener * impl_from_nsIDOMEventListener ( nsIDOMEventListener iface)
inlinestatic

Definition at line 55 of file nsevents.c.

56{
57 return CONTAINING_RECORD(iface, nsEventListener, nsIDOMEventListener_iface);
58}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by handle_blur(), handle_focus(), handle_htmlevent(), handle_keypress(), handle_load(), nsDOMEventListener_AddRef(), nsDOMEventListener_QueryInterface(), and nsDOMEventListener_Release().

◆ init_event()

static void init_event ( nsIDOMEventTarget target,
const PRUnichar type,
nsIDOMEventListener listener,
BOOL  capture 
)
static

Definition at line 325 of file nsevents.c.

327{
328 nsAString type_str;
329 nsresult nsres;
330
331 nsAString_InitDepend(&type_str, type);
332 nsres = nsIDOMEventTarget_AddEventListener(target, &type_str, listener, capture, FALSE, 1);
333 nsAString_Finish(&type_str);
334 if(NS_FAILED(nsres))
335 ERR("AddEventTarget failed: %08x\n", nsres);
336
337}

Referenced by add_nsevent_listener(), and init_nsevents().

◆ init_listener()

static void init_listener ( nsEventListener This,
nsDocumentEventListener listener,
const nsIDOMEventListenerVtbl *  vtbl 
)
static

Definition at line 339 of file nsevents.c.

341{
342 This->nsIDOMEventListener_iface.lpVtbl = vtbl;
343 This->This = listener;
344}

Referenced by init_nsevents().

◆ init_nsevents()

void init_nsevents ( HTMLDocumentNode doc)

Definition at line 413 of file nsevents.c.

414{
415 nsDocumentEventListener *listener;
417 nsresult nsres;
418
419 listener = heap_alloc(sizeof(nsDocumentEventListener));
420 if(!listener)
421 return;
422
423 TRACE("%p %p\n", doc, listener);
424
425 listener->ref = 1;
426 listener->doc = doc;
427
428 init_listener(&listener->blur_listener, listener, &blur_vtbl);
429 init_listener(&listener->focus_listener, listener, &focus_vtbl);
430 init_listener(&listener->keypress_listener, listener, &keypress_vtbl);
431 init_listener(&listener->load_listener, listener, &load_vtbl);
432 init_listener(&listener->htmlevent_listener, listener, &htmlevent_vtbl);
433
434 doc->nsevent_listener = listener;
435
436 nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
437 if(NS_FAILED(nsres)) {
438 ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
439 return;
440 }
441
446
447 nsIDOMEventTarget_Release(target);
448}
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static const nsIDOMEventListenerVtbl blur_vtbl
Definition: nsevents.c:319
static void init_listener(nsEventListener *This, nsDocumentEventListener *listener, const nsIDOMEventListenerVtbl *vtbl)
Definition: nsevents.c:339
static const PRUnichar keypressW[]
Definition: nsevents.c:23
static const nsIDOMEventListenerVtbl keypress_vtbl
Definition: nsevents.c:321
static const PRUnichar blurW[]
Definition: nsevents.c:21
static const nsIDOMEventListenerVtbl htmlevent_vtbl
Definition: nsevents.c:323
static const nsIDOMEventListenerVtbl focus_vtbl
Definition: nsevents.c:320
static const nsIDOMEventListenerVtbl load_vtbl
Definition: nsevents.c:322
static const PRUnichar focusW[]
Definition: nsevents.c:22
static const PRUnichar loadW[]
Definition: nsevents.c:24
nsEventListener blur_listener
Definition: nsevents.c:32
HTMLDocumentNode * doc
Definition: nsevents.c:40
nsEventListener keypress_listener
Definition: nsevents.c:34
nsEventListener load_listener
Definition: nsevents.c:35
nsEventListener focus_listener
Definition: nsevents.c:33

Referenced by doc_init_events().

◆ is_doc_child_focus()

static BOOL is_doc_child_focus ( NSContainer nscontainer)
static

Definition at line 101 of file nsevents.c.

102{
103 HWND hwnd;
104
105 for(hwnd = GetFocus(); hwnd && hwnd != nscontainer->hwnd; hwnd = GetParent(hwnd));
106
107 return hwnd != NULL;
108}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HWND WINAPI GetFocus(void)
Definition: window.c:1894
HWND WINAPI GetParent(_In_ HWND)

Referenced by handle_blur().

◆ nsDOMEventListener_AddRef()

static nsrefcnt NSAPI nsDOMEventListener_AddRef ( nsIDOMEventListener iface)
static

Definition at line 84 of file nsevents.c.

85{
87 LONG ref = InterlockedIncrement(&This->This->ref);
88
89 TRACE("(%p) ref=%d\n", This->This, ref);
90
91 return ref;
92}
#define InterlockedIncrement
Definition: armddk.h:53
long LONG
Definition: pedump.c:60
Definition: send.c:48

◆ nsDOMEventListener_QueryInterface()

static nsresult NSAPI nsDOMEventListener_QueryInterface ( nsIDOMEventListener iface,
nsIIDRef  riid,
void **  result 
)
static

Definition at line 60 of file nsevents.c.

62{
64
65 *result = NULL;
66
67 if(IsEqualGUID(&IID_nsISupports, riid)) {
68 TRACE("(%p)->(IID_nsISupports, %p)\n", This, result);
69 *result = &This->nsIDOMEventListener_iface;
70 }else if(IsEqualGUID(&IID_nsIDOMEventListener, riid)) {
71 TRACE("(%p)->(IID_nsIDOMEventListener %p)\n", This, result);
72 *result = &This->nsIDOMEventListener_iface;
73 }
74
75 if(*result) {
76 nsIDOMEventListener_AddRef(&This->nsIDOMEventListener_iface);
77 return NS_OK;
78 }
79
80 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
81 return NS_NOINTERFACE;
82}
GLuint64EXT * result
Definition: glext.h:11304
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define NS_NOINTERFACE
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ nsDOMEventListener_Release()

static nsrefcnt NSAPI nsDOMEventListener_Release ( nsIDOMEventListener iface)
static

Definition at line 94 of file nsevents.c.

95{
97
98 return release_listener(This->This);
99}
static LONG release_listener(nsDocumentEventListener *This)
Definition: nsevents.c:43

◆ release_listener()

static LONG release_listener ( nsDocumentEventListener This)
static

Definition at line 43 of file nsevents.c.

44{
46
47 TRACE("(%p) ref=%d\n", This, ref);
48
49 if(!ref)
51
52 return ref;
53}
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by nsDOMEventListener_Release(), and release_nsevents().

◆ release_nsevents()

void release_nsevents ( HTMLDocumentNode doc)

Definition at line 394 of file nsevents.c.

395{
397
398 TRACE("%p %p\n", doc, doc->nsevent_listener);
399
400 if(!listener)
401 return;
402
403 detach_nslistener(doc, blurW, &listener->blur_listener, TRUE);
404 detach_nslistener(doc, focusW, &listener->focus_listener, TRUE);
406 detach_nslistener(doc, loadW, &listener->load_listener, TRUE);
407
408 listener->doc = NULL;
409 release_listener(listener);
410 doc->nsevent_listener = NULL;
411}

Referenced by detach_events().

Variable Documentation

◆ blur_vtbl

const nsIDOMEventListenerVtbl blur_vtbl = EVENTLISTENER_VTBL(handle_blur)
static

Definition at line 319 of file nsevents.c.

Referenced by init_nsevents().

◆ blurW

const PRUnichar blurW[] = {'b','l','u','r',0}
static

Definition at line 21 of file nsevents.c.

Referenced by init_nsevents(), and release_nsevents().

◆ focus_vtbl

const nsIDOMEventListenerVtbl focus_vtbl = EVENTLISTENER_VTBL(handle_focus)
static

Definition at line 320 of file nsevents.c.

Referenced by init_nsevents().

◆ focusW

const PRUnichar focusW[] = {'f','o','c','u','s',0}
static

Definition at line 22 of file nsevents.c.

Referenced by init_nsevents(), and release_nsevents().

◆ htmlevent_vtbl

const nsIDOMEventListenerVtbl htmlevent_vtbl = EVENTLISTENER_VTBL(handle_htmlevent)
static

Definition at line 323 of file nsevents.c.

Referenced by init_nsevents().

◆ keypress_vtbl

const nsIDOMEventListenerVtbl keypress_vtbl = EVENTLISTENER_VTBL(handle_keypress)
static

Definition at line 321 of file nsevents.c.

Referenced by init_nsevents().

◆ keypressW

const PRUnichar keypressW[] = {'k','e','y','p','r','e','s','s',0}
static

Definition at line 23 of file nsevents.c.

Referenced by init_nsevents(), and release_nsevents().

◆ load_vtbl

const nsIDOMEventListenerVtbl load_vtbl = EVENTLISTENER_VTBL(handle_load)
static

Definition at line 322 of file nsevents.c.

Referenced by init_nsevents().

◆ loadW

const PRUnichar loadW[] = {'l','o','a','d',0}
static

Definition at line 24 of file nsevents.c.

Referenced by init_nsevents(), and release_nsevents().