Commit 2b001312 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved events declaration to separated file.

parent 70bb5b07
......@@ -32,6 +32,7 @@
#include "wine/unicode.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
......
......@@ -26,6 +26,7 @@
#include "ole2.h"
#include "mshtml_private.h"
#include "htmlevent.h"
#include "wine/debug.h"
......@@ -435,9 +436,17 @@ static HRESULT set_node_event_disp(HTMLDOMNode *node, eventid_t eid, IDispatch *
IDispatch_AddRef(disp);
node->event_target->event_table[eid] = disp;
if((event_info[eid].flags & EVENT_DEFAULTLISTENER) && !node->doc->nscontainer->event_vector[eid]) {
node->doc->nscontainer->event_vector[eid] = TRUE;
add_nsevent_listener(node->doc->nscontainer, event_info[eid].name);
if(event_info[eid].flags & EVENT_DEFAULTLISTENER) {
if(!node->doc->nscontainer->event_vector) {
node->doc->nscontainer->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL));
if(!node->doc->nscontainer->event_vector)
return E_OUTOFMEMORY;
}
if(!node->doc->nscontainer->event_vector[eid]) {
node->doc->nscontainer->event_vector[eid] = TRUE;
add_nsevent_listener(node->doc->nscontainer, event_info[eid].name);
}
}
return S_OK;
......
/*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
typedef enum {
EVENTID_CHANGE,
EVENTID_CLICK,
EVENTID_KEYUP,
EVENTID_LOAD,
EVENTID_LAST
} eventid_t;
eventid_t str_to_eid(LPCWSTR);
void check_event_attr(HTMLDocument*,nsIDOMElement*);
void release_event_target(event_target_t*);
void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*);
HRESULT set_node_event(HTMLDOMNode*,eventid_t,VARIANT*);
......@@ -28,6 +28,7 @@
#include "wine/debug.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
......
......@@ -28,6 +28,7 @@
#include "wine/debug.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
......
......@@ -116,14 +116,6 @@ typedef enum {
LAST_tid
} tid_t;
typedef enum {
EVENTID_CHANGE,
EVENTID_CLICK,
EVENTID_KEYUP,
EVENTID_LOAD,
EVENTID_LAST
} eventid_t;
typedef struct dispex_data_t dispex_data_t;
typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
......@@ -340,7 +332,7 @@ struct NSContainer {
nsChannelBSC *bscallback; /* hack */
HWND reset_focus; /* hack */
BOOL event_vector[EVENTID_LAST];
BOOL *event_vector;
};
typedef struct {
......@@ -537,12 +529,6 @@ void add_nsevent_listener(NSContainer*,LPCWSTR);
nsresult get_nsinterface(nsISupports*,REFIID,void**);
void update_nsdocument(HTMLDocument*);
void check_event_attr(HTMLDocument*,nsIDOMElement*);
void release_event_target(event_target_t*);
void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*);
HRESULT set_node_event(HTMLDOMNode*,eventid_t,VARIANT*);
eventid_t str_to_eid(LPCWSTR);
void set_document_bscallback(HTMLDocument*,nsChannelBSC*);
void set_current_mon(HTMLDocument*,IMoniker*);
HRESULT start_binding(HTMLDocument*,BSCallback*,IBindCtx*);
......
......@@ -984,6 +984,7 @@ static nsrefcnt NSAPI nsWebBrowserChrome_Release(nsIWebBrowserChrome *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
heap_free(This->event_vector);
if(This->parent)
nsIWebBrowserChrome_Release(NSWBCHROME(This->parent));
heap_free(This);
......
......@@ -31,6 +31,7 @@
#include "wine/unicode.h"
#include "mshtml_private.h"
#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment