diff --git a/mozilla/widget/src/xlib/nsAppShell.cpp b/mozilla/widget/src/xlib/nsAppShell.cpp index ff2e64f9c1e..bd0ec611b14 100644 --- a/mozilla/widget/src/xlib/nsAppShell.cpp +++ b/mozilla/widget/src/xlib/nsAppShell.cpp @@ -19,8 +19,11 @@ #include #include #include + #include "nsWidget.h" #include "nsAppShell.h" +#include "nsKeyCode.h" + #include "nsIWidget.h" #include "nsIEventQueueService.h" #include "nsIServiceManager.h" @@ -289,38 +292,57 @@ nsAppShell::DispatchEvent(XEvent *event) nsWidget *widget; XEvent config_event; widget = nsWidget::GetWidgetForWindow(event->xany.window); + // switch on the type of event - switch (event->type) { + switch (event->type) + { case Expose: - HandleExposeEvent(event, widget); + HandleExposeEvent(event, widget); break; + case ConfigureNotify: // we need to make sure that this is the LAST of the // config events. PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("DispatchEvent: ConfigureNotify event for window 0x%lx %d %d %d %d\n", event->xconfigure.window, - event->xconfigure.x, event->xconfigure.y, - event->xconfigure.width, event->xconfigure.height)); - while (XCheckWindowEvent(mDisplay, event->xany.window, StructureNotifyMask, &config_event) == True) { - // make sure that we don't get other types of events. StructureNotifyMask - // includes other kinds of events, too. - if (config_event.type == ConfigureNotify) { - *event = config_event; - PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("DispatchEvent: Extra ConfigureNotify event for window 0x%lx %d %d %d %d\n", - event->xconfigure.window, - event->xconfigure.x, event->xconfigure.y, - event->xconfigure.width, event->xconfigure.height)); - } + event->xconfigure.x, + event->xconfigure.y, + event->xconfigure.width, + event->xconfigure.height)); + + while (XCheckWindowEvent(mDisplay, + event->xany.window, + StructureNotifyMask, + &config_event) == True) + { + // make sure that we don't get other types of events. + // StructureNotifyMask includes other kinds of events, too. + if (config_event.type == ConfigureNotify) + { + *event = config_event; + + PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("DispatchEvent: Extra ConfigureNotify event for window 0x%lx %d %d %d %d\n", + event->xconfigure.window, + event->xconfigure.x, + event->xconfigure.y, + event->xconfigure.width, + event->xconfigure.height)); + } } + HandleConfigureNotifyEvent(event, widget); + break; + case ButtonPress: case ButtonRelease: HandleButtonEvent(event, widget); break; + case MotionNotify: HandleMotionNotifyEvent(event, widget); break; + case KeyPress: HandleKeyPressEvent(event, widget); break; @@ -333,11 +355,11 @@ nsAppShell::DispatchEvent(XEvent *event) case FocusOut: HandleFocusOutEvent(event, widget); break; + case NoExpose: break; default: - PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("Unhandled window event: Window 0x%lx Got a %s event\n", event->xany.window, event_names[event->type])); @@ -366,12 +388,16 @@ nsAppShell::HandleButtonEvent(XEvent *event, nsWidget *aWidget) nsMouseEvent mevent; PRUint32 eventType = 0; + // XXX hack for now + PRBool doFocus = PR_FALSE; + PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("Button event for window 0x%lx button %d type %s\n", event->xany.window, event->xbutton.button, (event->type == ButtonPress ? "ButtonPress" : "ButtonRelease"))); switch(event->type) { case ButtonPress: switch(event->xbutton.button) { case 1: + doFocus = PR_TRUE; eventType = NS_MOUSE_LEFT_BUTTON_DOWN; break; case 2: @@ -396,6 +422,31 @@ nsAppShell::HandleButtonEvent(XEvent *event, nsWidget *aWidget) } break; } + + // XXX This is a hack that lets the text widgets get focus + // XXX ill fix it later. + if (doFocus) + { + nsGUIEvent focusEvent; + + focusEvent.message = NS_GOTFOCUS; + focusEvent.widget = aWidget; + + focusEvent.eventStructType = NS_GUI_EVENT; + + focusEvent.time = 0; + focusEvent.point.x = 0; + focusEvent.point.y = 0; + + NS_ADDREF(aWidget); + + printf("Button, and doing focus too, dude\n"); + + aWidget->DispatchFocusEvent(focusEvent); + + NS_ADDREF(aWidget); + } + mevent.message = eventType; mevent.widget = aWidget; mevent.eventStructType = NS_MOUSE_EVENT; @@ -458,6 +509,28 @@ nsAppShell::HandleKeyPressEvent(XEvent *event, nsWidget *aWidget) { PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("KeyPress event for window 0x%lx\n", event->xkey.window)); + nsKeyEvent keyEvent; + KeySym keysym; + + keysym = XKeycodeToKeysym(event->xkey.display, event->xkey.keycode, 0); + + keyEvent.keyCode = nsKeyCode::ConvertKeySymToVirtualKey(keysym); + keyEvent.charCode = 0; + keyEvent.time = event->xkey.time; + keyEvent.isShift = event->xkey.state & ShiftMask; + keyEvent.isControl = event->xkey.state & ControlMask; + keyEvent.isAlt = event->xkey.state & Mod1Mask; + keyEvent.point.x = 0; + keyEvent.point.y = 0; + keyEvent.message = NS_KEY_DOWN; + keyEvent.widget = aWidget; + keyEvent.eventStructType = NS_KEY_EVENT; + + NS_ADDREF(aWidget); + + aWidget->DispatchKeyEvent(keyEvent); + + NS_ADDREF(aWidget); } void @@ -465,6 +538,29 @@ nsAppShell::HandleKeyReleaseEvent(XEvent *event, nsWidget *aWidget) { PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("KeyRelease event for window 0x%lx\n", event->xkey.window)); + + nsKeyEvent keyEvent; + KeySym keysym; + + keysym = XKeycodeToKeysym(event->xkey.display, event->xkey.keycode, 0); + + keyEvent.keyCode = nsKeyCode::ConvertKeySymToVirtualKey(keysym); + keyEvent.charCode = 0; + keyEvent.time = event->xkey.time; + keyEvent.isShift = event->xkey.state & ShiftMask; + keyEvent.isControl = event->xkey.state & ControlMask; + keyEvent.isAlt = event->xkey.state & Mod1Mask; + keyEvent.point.x = 0; + keyEvent.point.y = 0; + keyEvent.message = NS_KEY_UP; + keyEvent.widget = aWidget; + keyEvent.eventStructType = NS_KEY_EVENT; + + NS_ADDREF(aWidget); + + aWidget->DispatchKeyEvent(keyEvent); + + NS_ADDREF(aWidget); } void diff --git a/mozilla/widget/src/xlib/nsKeyCode.cpp b/mozilla/widget/src/xlib/nsKeyCode.cpp new file mode 100644 index 00000000000..7e119942db6 --- /dev/null +++ b/mozilla/widget/src/xlib/nsKeyCode.cpp @@ -0,0 +1,213 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#include "nsKeyCode.h" + +#include +#include +#include + +#include "nsGUIEvent.h" // For NS_VK + +struct nsKeyConverter +{ + int vkCode; // Platform independent key code + unsigned int keysym; // XK keysym key code +}; + +#if 0 +struct nsKeyConverter nsKeycodes[] = +{ + { NS_VK_CANCEL, XK_Cancel }, + { NS_VK_BACK, XK_BackSpace }, + { NS_VK_TAB, XK_Tab }, + { NS_VK_CLEAR, XK_Clear }, + { NS_VK_RETURN, XK_Return }, + { NS_VK_SHIFT, XK_Shift_L }, + { NS_VK_SHIFT, XK_Shift_R }, + { NS_VK_CONTROL, XK_Control_L }, + { NS_VK_CONTROL, XK_Control_R }, + { NS_VK_ALT, XK_Alt_L }, + { NS_VK_ALT, XK_Alt_R }, + { NS_VK_PAUSE, XK_Pause }, + { NS_VK_CAPS_LOCK, XK_Caps_Lock }, + { NS_VK_ESCAPE, XK_Escape }, + { NS_VK_SPACE, XK_space }, + { NS_VK_PAGE_UP, XK_Page_Up }, + { NS_VK_PAGE_DOWN, XK_Page_Down }, + { NS_VK_END, XK_End }, + { NS_VK_HOME, XK_Home }, + { NS_VK_LEFT, XK_Left }, + { NS_VK_UP, XK_Up }, + { NS_VK_RIGHT, XK_Right }, + { NS_VK_DOWN, XK_Down }, + { NS_VK_PRINTSCREEN, XK_Print }, + { NS_VK_INSERT, XK_Insert }, + { NS_VK_DELETE, XK_Delete }, + + { NS_VK_MULTIPLY, XK_KP_Multiply }, + { NS_VK_ADD, XK_KP_Add }, + { NS_VK_SEPARATOR, XK_KP_Separator }, + { NS_VK_SUBTRACT, XK_KP_Subtract }, + { NS_VK_DECIMAL, XK_KP_Decimal }, + { NS_VK_DIVIDE, XK_KP_Divide }, + { NS_VK_RETURN, XK_KP_Enter }, + + { NS_VK_COMMA, XK_comma }, + { NS_VK_PERIOD, XK_period }, + { NS_VK_SLASH, XK_slash }, +//XXX: How do you get a BACK_QUOTE? NS_VK_BACK_QUOTE, XK_backquote, + { NS_VK_OPEN_BRACKET, XK_bracketleft }, + { NS_VK_CLOSE_BRACKET, XK_bracketright }, + { NS_VK_QUOTE, XK_quotedbl } +}; +#else +struct nsKeyConverter nsKeycodes[] = { + { NS_VK_CANCEL, XK_Cancel }, + { NS_VK_BACK, XK_BackSpace }, + { NS_VK_TAB, XK_Tab }, + { NS_VK_CLEAR, XK_Clear }, + { NS_VK_RETURN, XK_Return }, + { NS_VK_SHIFT, XK_Shift_L }, + { NS_VK_SHIFT, XK_Shift_R }, + { NS_VK_CONTROL, XK_Control_L }, + { NS_VK_CONTROL, XK_Control_R }, + { NS_VK_ALT, XK_Alt_L }, + { NS_VK_ALT, XK_Alt_R }, + { NS_VK_PAUSE, XK_Pause }, + { NS_VK_CAPS_LOCK, XK_Caps_Lock }, + { NS_VK_ESCAPE, XK_Escape }, + { NS_VK_SPACE, XK_space }, + { NS_VK_PAGE_UP, XK_Page_Up }, + { NS_VK_PAGE_DOWN, XK_Page_Down }, + { NS_VK_END, XK_End }, + { NS_VK_HOME, XK_Home }, + { NS_VK_LEFT, XK_Left }, + { NS_VK_UP, XK_Up }, + { NS_VK_RIGHT, XK_Right }, + { NS_VK_DOWN, XK_Down }, + { NS_VK_PRINTSCREEN, XK_Print }, + { NS_VK_INSERT, XK_Insert }, + { NS_VK_DELETE, XK_Delete }, + + { NS_VK_NUMPAD0, XK_KP_0 }, + { NS_VK_NUMPAD1, XK_KP_1 }, + { NS_VK_NUMPAD2, XK_KP_2 }, + { NS_VK_NUMPAD3, XK_KP_3 }, + { NS_VK_NUMPAD4, XK_KP_4 }, + { NS_VK_NUMPAD5, XK_KP_5 }, + { NS_VK_NUMPAD6, XK_KP_6 }, + { NS_VK_NUMPAD7, XK_KP_7 }, + { NS_VK_NUMPAD8, XK_KP_8 }, + { NS_VK_NUMPAD9, XK_KP_9 }, + + { NS_VK_MULTIPLY, XK_KP_Multiply }, + { NS_VK_ADD, XK_KP_Add }, + { NS_VK_SEPARATOR, XK_KP_Separator }, + { NS_VK_SUBTRACT, XK_KP_Subtract }, + { NS_VK_DECIMAL, XK_KP_Decimal }, + { NS_VK_DIVIDE, XK_KP_Divide }, + { NS_VK_F1, XK_F1 }, + { NS_VK_F2, XK_F2 }, + { NS_VK_F3, XK_F3 }, + { NS_VK_F4, XK_F4 }, + { NS_VK_F5, XK_F5 }, + { NS_VK_F6, XK_F6 }, + { NS_VK_F7, XK_F7 }, + { NS_VK_F8, XK_F8 }, + { NS_VK_F9, XK_F9 }, + { NS_VK_F10, XK_F10 }, + { NS_VK_F11, XK_F11 }, + { NS_VK_F12, XK_F12 }, + { NS_VK_F13, XK_F13 }, + { NS_VK_F14, XK_F14 }, + { NS_VK_F15, XK_F15 }, + { NS_VK_F16, XK_F16 }, + { NS_VK_F17, XK_F17 }, + { NS_VK_F18, XK_F18 }, + { NS_VK_F19, XK_F19 }, + { NS_VK_F20, XK_F20 }, + { NS_VK_F21, XK_F21 }, + { NS_VK_F22, XK_F22 }, + { NS_VK_F23, XK_F23 }, + { NS_VK_F24, XK_F24 }, + + { NS_VK_COMMA, XK_comma }, + { NS_VK_PERIOD, XK_period }, + { NS_VK_SLASH, XK_slash }, +//XXX: How do you get a BACK_QUOTE? NS_VK_BACK_QUOTE, XK_backquote, + { NS_VK_OPEN_BRACKET, XK_bracketleft }, + { NS_VK_CLOSE_BRACKET, XK_bracketright }, + { NS_VK_QUOTE, XK_quotedbl } + +}; +#endif + +int +nsKeyCode::ConvertKeySymToVirtualKey(KeySym keysym) +{ +#if 0 + unsigned int i; + unsigned int length = sizeof(nsKeycodes) / sizeof(struct nsKeyConverter); + + // First, try to handle alphanumeric input, not listed in nsKeycodes: + // most likely, more letters will be getting typed in than things in + // the key list, so we will look through these first. + + // since X has different key symbols for upper and lowercase letters and + // mozilla does not, convert gdk's to mozilla's + if (keysym >= XK_a && keysym <= XK_z) + return keysym - XK_a + NS_VK_A; + if (keysym >= XK_A && keysym <= XK_Z) + return keysym - XK_A + NS_VK_A; + + // numbers + if (keysym >= XK_0 && keysym <= XK_9) + return keysym - XK_0 + NS_VK_0; + + // keypad numbers + if (keysym >= XK_KP_0 && keysym <= XK_KP_9) + return keysym - XK_KP_0 + NS_VK_NUMPAD0; + + // misc other things + for (i = 0; i < length; i++) { + if (nsKeycodes[i].keysym == keysym) + return(nsKeycodes[i].vkCode); + } + + // function keys + if (keysym >= XK_F1 && keysym <= XK_F24) + return keysym - XK_F1 + NS_VK_F1; + + return (KeySym) 0; +#else + + unsigned int i; + unsigned int length = sizeof(nsKeycodes) / sizeof(struct nsKeyConverter); + + for (i = 0; i < length; i++) + { + if (nsKeycodes[i].keysym == keysym) + { + return(nsKeycodes[i].vkCode); + } + } + + return((int)keysym); +#endif +} diff --git a/mozilla/widget/src/xlib/nsWidget.cpp b/mozilla/widget/src/xlib/nsWidget.cpp index 3163b23875c..efef6d72711 100644 --- a/mozilla/widget/src/xlib/nsWidget.cpp +++ b/mozilla/widget/src/xlib/nsWidget.cpp @@ -453,7 +453,8 @@ void nsWidget::CreateNative(Window aParent, nsRect aRect) // be discarded... attr.bit_gravity = NorthWestGravity; // make sure that we listen for events - attr.event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask | KeyReleaseMask | FocusChangeMask; + attr.event_mask = GetEventMask(); + // set the default background color and border to that awful gray attr.background_pixel = mBackgroundPixel; attr.border_pixel = mBorderPixel; @@ -467,9 +468,21 @@ void nsWidget::CreateNative(Window aParent, nsRect aRect) CreateNativeWindow(aParent, mBounds, attr, attr_mask); CreateGC(); - } - + +/* virtual */ long +nsWidget::GetEventMask() +{ + long event_mask; + + event_mask = + ExposureMask | + ButtonPressMask | + ButtonReleaseMask | + PointerMotionMask; + + return event_mask; +} void nsWidget::CreateNativeWindow(Window aParent, nsRect aRect, XSetWindowAttributes aAttr, unsigned long aMask) @@ -572,7 +585,7 @@ nsWidget::OnPaint(nsPaintEvent &event) kRenderingContextIID, (void **)&event.renderingContext)) { event.renderingContext->Init(mContext, this); - result = DispatchWindowEvent(&event); + result = DispatchWindowEvent(event); NS_RELEASE(event.renderingContext); } else { @@ -590,7 +603,7 @@ PRBool nsWidget::DispatchMouseEvent(nsMouseEvent& aEvent) } if (nsnull != mEventCallback) { - result = DispatchWindowEvent(&aEvent); + result = DispatchWindowEvent(aEvent); return result; } if (nsnull != mMouseListener) { @@ -619,39 +632,124 @@ nsWidget::OnResize(nsSizeEvent &event) { nsresult result = PR_FALSE; if (mEventCallback) { - result = DispatchWindowEvent(&event); + result = DispatchWindowEvent(event); } return result; } -PRBool nsWidget::DispatchWindowEvent(nsGUIEvent* event) +PRBool nsWidget::DispatchWindowEvent(nsGUIEvent & aEvent) { nsEventStatus status; - DispatchEvent(event, status); + DispatchEvent(&aEvent, status); return ConvertStatus(status); } +PRBool nsWidget::DispatchKeyEvent(nsKeyEvent & aKeyEvent) +{ + if (mEventCallback) + { + return DispatchWindowEvent(aKeyEvent); + } -NS_IMETHODIMP nsWidget::DispatchEvent(nsGUIEvent *event, + return PR_FALSE; +} + + +PRBool nsWidget::DispatchFocusEvent(nsGUIEvent & aEvent) +{ + if (mEventCallback) + { + return DispatchWindowEvent(aEvent); + } + + return PR_FALSE; +} + +////////////////////////////////////////////////////////////////// +// +// Turning TRACE_EVENTS on will cause printfs for all +// mouse events that are dispatched. +// +// These are extra noisy, and thus have their own switch: +// +// NS_MOUSE_MOVE +// NS_PAINT +// NS_MOUSE_ENTER, NS_MOUSE_EXIT +// +////////////////////////////////////////////////////////////////// + +#undef TRACE_EVENTS +#undef TRACE_EVENTS_MOTION +#undef TRACE_EVENTS_PAINT +#undef TRACE_EVENTS_CROSSING + +#ifdef DEBUG +void +nsWidget::DebugPrintEvent(nsGUIEvent & aEvent, + Window aWindow) +{ +#ifndef TRACE_EVENTS_MOTION + if (aEvent.message == NS_MOUSE_MOVE) + { + return; + } +#endif + +#ifndef TRACE_EVENTS_PAINT + if (aEvent.message == NS_PAINT) + { + return; + } +#endif + +#ifndef TRACE_EVENTS_CROSSING + if (aEvent.message == NS_MOUSE_ENTER || aEvent.message == NS_MOUSE_EXIT) + { + return; + } +#endif + + static int sPrintCount=0; + + printf("%4d %-26s(this=%-8p , window=%-8p", + sPrintCount++, + (const char *) nsAutoCString(GuiEventToString(aEvent)), + this, + (void *) aWindow); + + printf(" , x=%-3d, y=%d)",aEvent.point.x,aEvent.point.y); + + printf("\n"); +} +#endif // DEBUG +////////////////////////////////////////////////////////////////// + + +NS_IMETHODIMP nsWidget::DispatchEvent(nsGUIEvent * aEvent, nsEventStatus &aStatus) { - NS_ADDREF(event->widget); +#ifdef TRACE_EVENTS + DebugPrintEvent(*aEvent,mBaseWindow); +#endif + + NS_ADDREF(aEvent->widget); if (nsnull != mMenuListener) { - if (NS_MENU_EVENT == event->eventStructType) - aStatus = mMenuListener->MenuSelected(NS_STATIC_CAST(nsMenuEvent&, *event)); + if (NS_MENU_EVENT == aEvent->eventStructType) + aStatus = mMenuListener->MenuSelected(NS_STATIC_CAST(nsMenuEvent&, *aEvent)); } aStatus = nsEventStatus_eIgnore; if (nsnull != mEventCallback) { - aStatus = (*mEventCallback)(event); + aStatus = (*mEventCallback)(aEvent); } // Dispatch to event listener if event was not consumed if ((aStatus != nsEventStatus_eIgnore) && (nsnull != mEventListener)) { - aStatus = mEventListener->ProcessEvent(*event); + aStatus = mEventListener->ProcessEvent(*aEvent); } - NS_RELEASE(event->widget); + + NS_RELEASE(aEvent->widget); return NS_OK; } diff --git a/mozilla/widget/src/xlib/nsWidget.h b/mozilla/widget/src/xlib/nsWidget.h index 0477ca9dc5b..db7aaae6470 100644 --- a/mozilla/widget/src/xlib/nsWidget.h +++ b/mozilla/widget/src/xlib/nsWidget.h @@ -102,16 +102,23 @@ public: NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight); NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus); +#ifdef DEBUG + void DebugPrintEvent(nsGUIEvent & aEvent,Window aWindow); +#endif + virtual PRBool OnPaint(nsPaintEvent &event); virtual PRBool OnResize(nsSizeEvent &event); virtual PRBool DispatchMouseEvent(nsMouseEvent &aEvent); + virtual PRBool DispatchKeyEvent(nsKeyEvent &aKeyEvent); + virtual PRBool DispatchFocusEvent(nsGUIEvent &aEvent); + static nsWidget * GetWidgetForWindow(Window aWindow); protected: // private event functions - PRBool DispatchWindowEvent(nsGUIEvent* event); + PRBool DispatchWindowEvent(nsGUIEvent & aEvent); PRBool ConvertStatus(nsEventStatus aStatus); // create the native window for this class @@ -121,6 +128,9 @@ protected: virtual void DestroyNative(void); void CreateGC(void); + // Let each sublclass set the event mask according to their needs + virtual long GetEventMask(); + // these will add and delete a window static void AddWindowCallback (Window aWindow, nsWidget *aWidget); static void DeleteWindowCallback(Window aWindow); diff --git a/mozilla/widget/src/xlib/nsWindow.cpp b/mozilla/widget/src/xlib/nsWindow.cpp index f7b356f82dc..09bbf0dd40e 100644 --- a/mozilla/widget/src/xlib/nsWindow.cpp +++ b/mozilla/widget/src/xlib/nsWindow.cpp @@ -45,6 +45,7 @@ nsWindow::DestroyNative(void) } } +#if 0 void nsWindow::CreateNative(Window aParent, nsRect aRect) { XSetWindowAttributes attr; @@ -70,6 +71,26 @@ void nsWindow::CreateNative(Window aParent, nsRect aRect) CreateGC(); } +#endif + +/* virtual */ long +nsWindow::GetEventMask() +{ + long event_mask; + + event_mask = + StructureNotifyMask | + ExposureMask | + ButtonPressMask | + ButtonReleaseMask | + PointerMotionMask | + KeyPressMask | + KeyReleaseMask | + FocusChangeMask; + + return event_mask; +} + NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous) { diff --git a/mozilla/widget/src/xlib/nsWindow.h b/mozilla/widget/src/xlib/nsWindow.h index b0a891a8109..f4c103b6075 100644 --- a/mozilla/widget/src/xlib/nsWindow.h +++ b/mozilla/widget/src/xlib/nsWindow.h @@ -34,8 +34,13 @@ class nsWindow : public nsWidget NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect); NS_IMETHOD SetTitle(const nsString& aTitle); protected: - void DestroyNative(void); - void CreateNative(Window aParent, nsRect aRect); + virtual void DestroyNative(void); + + virtual long GetEventMask(); + +#if 0 + virtual void CreateNative(Window aParent, nsRect aRect); +#endif }; class ChildWindow : public nsWindow