diff options
author | Adam Tkac <atkac@redhat.com> | 2009-08-28 12:04:20 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2009-08-28 12:04:20 +0000 |
commit | 62de8d75d2611924d2ba04406464f31371b93d97 (patch) | |
tree | 6d86b358de26a4a3d1c9dd6a5e837d2daa258fb5 /unix/xserver/hw/vnc/Input.h | |
parent | a7c223a2dc036f2ecb2c2045dd96237ca306a7a2 (diff) | |
download | tigervnc-62de8d75d2611924d2ba04406464f31371b93d97.tar.gz tigervnc-62de8d75d2611924d2ba04406464f31371b93d97.zip |
Add Input.h and Input.cc and move all mouse input related code there.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3886 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/xserver/hw/vnc/Input.h')
-rw-r--r-- | unix/xserver/hw/vnc/Input.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/Input.h b/unix/xserver/hw/vnc/Input.h new file mode 100644 index 00000000..49cedf29 --- /dev/null +++ b/unix/xserver/hw/vnc/Input.h @@ -0,0 +1,61 @@ +/* Copyright (C) 2009 TightVNC Team + * Copyright (C) 2009 Red Hat, Inc. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + */ + +/* Make sure macro doesn't conflict with macro in include/input.h. */ +#ifndef INPUT_H_ +#define INPUT_H_ + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#include <rfb/VNCServerST.h> + +extern "C" { +#include "input.h" +}; + +/* Represents pointer device. */ +class PointerDevice { +public: + /* Create new PointerDevice instance. */ + PointerDevice(rfb::VNCServerST *_server); + + /* + * Press or release buttons. Relationship between buttonMask and + * buttons is specified in RFB protocol. + */ + void ButtonAction(int buttonMask); + + /* Move pointer to target location (point coords are absolute). */ + void Move(const rfb::Point &point); + + /* + * Send pointer position to clients. If not called then Move() calls + * won't be visible to clients. + */ + void Sync(void); +private: + rfb::VNCServerST *server; + DeviceIntPtr dev; + int oldButtonMask; + rfb::Point cursorPos, oldCursorPos; +}; + +#endif |