Start on infastructure for Focus events and Keypress events. This is not part of the build.

This commit is contained in:
blizzard%redhat.com 1999-07-13 17:50:28 +00:00
Родитель 5064350158
Коммит c99eee033f
5 изменённых файлов: 48 добавлений и 5 удалений

Просмотреть файл

@ -321,7 +321,18 @@ nsAppShell::DispatchEvent(XEvent *event)
case MotionNotify:
HandleMotionNotifyEvent(event, widget);
break;
case KeyPress:
HandleKeyPressEvent(event, widget);
break;
case KeyRelease:
HandleKeyReleaseEvent(event, widget);
break;
case FocusIn:
HandleFocusInEvent(event, widget);
break;
case FocusOut:
HandleFocusOutEvent(event, widget);
break;
case NoExpose:
break;
@ -441,3 +452,31 @@ nsAppShell::HandleConfigureNotifyEvent(XEvent *event, nsWidget *aWidget)
NS_RELEASE(aWidget);
delete sevent.windowSize;
}
void
nsAppShell::HandleKeyPressEvent(XEvent *event, nsWidget *aWidget)
{
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("KeyPress event for window 0x%lx\n",
event->xkey.window));
}
void
nsAppShell::HandleKeyReleaseEvent(XEvent *event, nsWidget *aWidget)
{
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("KeyRelease event for window 0x%lx\n",
event->xkey.window));
}
void
nsAppShell::HandleFocusInEvent(XEvent *event, nsWidget *aWidget)
{
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("FocusIn event for window 0x%lx\n",
event->xfocus.window));
}
void
nsAppShell::HandleFocusOutEvent(XEvent *event, nsWidget *aWidget)
{
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("FocusOut event for window 0x%lx\n",
event->xfocus.window));
}

Просмотреть файл

@ -52,6 +52,10 @@ class nsAppShell : public nsIAppShell
static void HandleMotionNotifyEvent(XEvent *event, nsWidget *aWidget);
static void HandleExposeEvent(XEvent *event, nsWidget *aWidget);
static void HandleConfigureNotifyEvent(XEvent *event, nsWidget *aWidget);
static void HandleKeyPressEvent(XEvent *event, nsWidget *aWidget);
static void HandleKeyReleaseEvent(XEvent *event, nsWidget *aWidget);
static void HandleFocusInEvent(XEvent *event, nsWidget *aWidget);
static void HandleFocusOutEvent(XEvent *event, nsWidget *aWidget);
protected:
nsIEventQueueService * mEventQueueService;

Просмотреть файл

@ -225,7 +225,7 @@ void nsScrollbar::CreateNative(Window aParent, nsRect aRect)
// be discarded...
attr.bit_gravity = SouthEastGravity;
// make sure that we listen for events
attr.event_mask = StructureNotifyMask | ButtonPressMask | ButtonReleaseMask;
attr.event_mask = StructureNotifyMask | ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | FocusChangeMask;
// set the default background color and border to that awful gray
attr.background_pixel = mBackgroundPixel;
attr.border_pixel = mBorderPixel;
@ -240,7 +240,7 @@ void nsScrollbar::CreateNative(Window aParent, nsRect aRect)
CreateNativeWindow(aParent, mBounds, attr, attr_mask);
CreateGC();
// set up the scrolling bar.
attr.event_mask = Button1MotionMask | ButtonPressMask | ButtonReleaseMask;
attr.event_mask = Button1MotionMask | ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | FocusChangeMask;
attr.background_pixel = xlib_rgb_xpixel_from_rgb(NS_RGB(192,192,192));
attr.border_pixel = xlib_rgb_xpixel_from_rgb(NS_RGB(100,100,100));
// set up the size

Просмотреть файл

@ -453,7 +453,7 @@ 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;
attr.event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask | KeyReleaseMask | FocusChangeMask;
// set the default background color and border to that awful gray
attr.background_pixel = mBackgroundPixel;
attr.border_pixel = mBorderPixel;

Просмотреть файл

@ -54,7 +54,7 @@ void nsWindow::CreateNative(Window aParent, nsRect aRect)
// be discarded...
attr.bit_gravity = NorthWestGravity;
// make sure that we listen for events
attr.event_mask = StructureNotifyMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
attr.event_mask = StructureNotifyMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask | KeyReleaseMask | FocusChangeMask;
// set the default background color and border to that awful gray
attr.background_pixel = mBackgroundPixel;
attr.border_pixel = mBorderPixel;