summaryrefslogtreecommitdiffstats
path: root/src/input/inputEventHandler.cpp
diff options
context:
space:
mode:
authorSebastien Braun2010-11-04 00:38:24 +0100
committerSebastien Braun2010-11-04 00:38:24 +0100
commit4fcc0efae9738bb28922da592fff78cfef50277b (patch)
treeb3855b36abe874606a802ec75fc573543d2d7b35 /src/input/inputEventHandler.cpp
parent[PVSMGRTOUCH] resetall bug fixed (diff)
parentDocumentation fixes and code cleanup (diff)
downloadpvs-4fcc0efae9738bb28922da592fff78cfef50277b.tar.gz
pvs-4fcc0efae9738bb28922da592fff78cfef50277b.tar.xz
pvs-4fcc0efae9738bb28922da592fff78cfef50277b.zip
Merge input handling work to master
Diffstat (limited to 'src/input/inputEventHandler.cpp')
-rw-r--r--src/input/inputEventHandler.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/input/inputEventHandler.cpp b/src/input/inputEventHandler.cpp
index c16c358..5298aed 100644
--- a/src/input/inputEventHandler.cpp
+++ b/src/input/inputEventHandler.cpp
@@ -17,20 +17,17 @@
#include "inputEventHandler.h"
#include "pvsCheckPrivileges.h"
-bool policy::allowPrivilegedUser(InputEvent const& evt, InputEventContext const* ctx)
+InputEventHandlerBase::HandlerStatus InputEventHandlerBase::handle(InputEvent const& evt, InputEventContext const* ctx)
{
- if(ctx)
- return PVSCheckPrivileges::instance()->require(PVSCheckPrivileges::SESSION_UNKNOWN, PVSCheckPrivileges::USER_PRIVILEGED,
- ctx);
- else
- return false;
+ if(!isApplicable(evt, ctx))
+ return HANDLER_NOT_APPLICABLE;
+ if(!allow(evt, ctx))
+ return HANDLER_NOT_ALLOWED;
+ doHandle(evt, ctx);
+ return HANDLER_MATCHED;
}
-bool policy::allowPhysicalSeat(InputEvent const& evt, InputEventContext const* ctx)
+bool input_policy::AllowEverybody::allow(InputEventContext const*)
{
- if(ctx)
- return PVSCheckPrivileges::instance()->require(PVSCheckPrivileges::SESSION_LOCAL, PVSCheckPrivileges::USER_UNKNOWN,
- ctx);
- else
- return false;
+ return true;
}