Added ModifiersChanged() hook to Window and [Default]WindowBehavior.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39622 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-25 00:38:32 +00:00
parent 61707abd33
commit 76107eeb11
7 changed files with 39 additions and 3 deletions

View File

@ -859,6 +859,12 @@ DefaultWindowBehaviour::MouseMoved(BMessage *message, BPoint where, bool isFake)
}
void
DefaultWindowBehaviour::ModifiersChanged(int32 modifiers)
{
}
bool
DefaultWindowBehaviour::_IsWindowModifier(int32 modifiers) const
{

View File

@ -34,6 +34,8 @@ public:
virtual void MouseMoved(BMessage *message, BPoint where,
bool isFake);
virtual void ModifiersChanged(int32 modifiers);
private:
enum Region {
REGION_NONE,

View File

@ -490,6 +490,19 @@ Desktop::BroadcastToAllWindows(int32 code)
void
Desktop::KeyEvent(uint32 what, int32 key, int32 modifiers)
{
if (LockAllWindows()) {
Window* window = MouseEventWindow();
if (window == NULL)
window = WindowAt(fLastMousePosition);
if (window != NULL) {
if (what == B_MODIFIERS_CHANGED)
window->ModifiersChanged(modifiers);
}
UnlockAllWindows();
}
NotifyKeyPressed(what, key, modifiers);
}

View File

@ -867,6 +867,13 @@ Window::MouseMoved(BMessage *message, BPoint where, int32* _viewToken,
}
void
Window::ModifiersChanged(int32 modifiers)
{
fWindowBehaviour->ModifiersChanged(modifiers);
}
// #pragma mark -
@ -1046,7 +1053,7 @@ Window::SetTabLocation(float location, BRegion& dirty)
{
if (fDecorator)
return fDecorator->SetTabLocation(location, &dirty);
return false;
}

View File

@ -151,6 +151,8 @@ public:
int32* _viewToken, bool isLatestMouseMoved,
bool isFake);
void ModifiersChanged(int32 modifiers);
// some hooks to inform the client window
// TODO: move this to ServerWindow maybe?
void WorkspaceActivated(int32 index, bool active);

View File

@ -15,11 +15,15 @@ WindowBehaviour::WindowBehaviour()
fIsResizing(false),
fIsDragging(false)
{
}
WindowBehaviour::~WindowBehaviour()
{
}
void
WindowBehaviour::ModifiersChanged(int32 modifiers)
{
}

View File

@ -26,6 +26,8 @@ public:
virtual void MouseMoved(BMessage *message, BPoint where,
bool isFake) = 0;
virtual void ModifiersChanged(int32 modifiers);
bool IsDragging() const { return fIsDragging; }
bool IsResizing() const { return fIsResizing; }