touchkit.hh revision 12656:335489e574f3
110037SARM gem5 Developers/*
210037SARM gem5 Developers * Copyright (c) 2010, 2017-2018 ARM Limited
310037SARM gem5 Developers * All rights reserved
410037SARM gem5 Developers *
510037SARM gem5 Developers * The license below extends only to copyright in the software and shall
610037SARM gem5 Developers * not be construed as granting a license to any other intellectual
710037SARM gem5 Developers * property including but not limited to intellectual property relating
810037SARM gem5 Developers * to a hardware implementation of the functionality of the software
910037SARM gem5 Developers * licensed hereunder.  You may use the software subject to the license
1010037SARM gem5 Developers * terms below provided that you ensure that this notice is replicated
1110037SARM gem5 Developers * unmodified and in its entirety in all distributions of the software,
1210037SARM gem5 Developers * modified or unmodified, in source code or in binary form.
1310037SARM gem5 Developers *
1410037SARM gem5 Developers * Redistribution and use in source and binary forms, with or without
1510037SARM gem5 Developers * modification, are permitted provided that the following conditions are
1610037SARM gem5 Developers * met: redistributions of source code must retain the above copyright
1710037SARM gem5 Developers * notice, this list of conditions and the following disclaimer;
1810037SARM gem5 Developers * redistributions in binary form must reproduce the above copyright
1910037SARM gem5 Developers * notice, this list of conditions and the following disclaimer in the
2010037SARM gem5 Developers * documentation and/or other materials provided with the distribution;
2110037SARM gem5 Developers * neither the name of the copyright holders nor the names of its
2210037SARM gem5 Developers * contributors may be used to endorse or promote products derived from
2310037SARM gem5 Developers * this software without specific prior written permission.
2410037SARM gem5 Developers *
2510037SARM gem5 Developers * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2610037SARM gem5 Developers * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2710037SARM gem5 Developers * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2810037SARM gem5 Developers * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2910037SARM gem5 Developers * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3010037SARM gem5 Developers * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3110037SARM gem5 Developers * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3210037SARM gem5 Developers * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3310037SARM gem5 Developers * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3410037SARM gem5 Developers * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3510037SARM gem5 Developers * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3610037SARM gem5 Developers *
3710037SARM gem5 Developers * Authors: Andreas Sandberg
3810037SARM gem5 Developers */
3910037SARM gem5 Developers
4010037SARM gem5 Developers#ifndef __DEV_PS2_TOUCHKIT_HH__
4110037SARM gem5 Developers#define __DEV_PS2_TOUCHKIT_HH__
4210037SARM gem5 Developers
4310037SARM gem5 Developers#include "base/vnc/vncinput.hh"
4410037SARM gem5 Developers#include "dev/ps2/device.hh"
4510037SARM gem5 Developers
4610037SARM gem5 Developersstruct PS2TouchKitParams;
4710037SARM gem5 Developers
4810037SARM gem5 Developersclass PS2TouchKit : public PS2Device, public VncMouse
4910037SARM gem5 Developers{
5010037SARM gem5 Developers  protected:
5110037SARM gem5 Developers    static const uint8_t ID[];
5210037SARM gem5 Developers
5310037SARM gem5 Developers  public:
5410037SARM gem5 Developers    PS2TouchKit(const PS2TouchKitParams *p);
5510037SARM gem5 Developers
5610037SARM gem5 Developers    void serialize(CheckpointOut &cp) const override;
5710037SARM gem5 Developers    void unserialize(CheckpointIn &cp) override;
5810037SARM gem5 Developers
5910037SARM gem5 Developers  protected: // PS2Device
6012616Sgabeblack@google.com    bool recv(const std::vector<uint8_t> &data) override;
6112616Sgabeblack@google.com
6210037SARM gem5 Developers  public: // VncMouse
6310037SARM gem5 Developers    void mouseAt(uint16_t x, uint16_t y, uint8_t buttons) override;
6410037SARM gem5 Developers
6510037SARM gem5 Developers  protected:
6610037SARM gem5 Developers    /** The vnc server we're connected to (if any) */
6710037SARM gem5 Developers    VncInput *const vnc;
6810037SARM gem5 Developers
6910037SARM gem5 Developers    /**
7010037SARM gem5 Developers     * Has the driver been initialized in TouchKit mode? The model
7110037SARM gem5 Developers     * suppresses touch event generation until this is true.
7210037SARM gem5 Developers     */
7310037SARM gem5 Developers    bool driverInitialized;
7410037SARM gem5 Developers};
7510037SARM gem5 Developers
7612616Sgabeblack@google.com#endif // __DEV_PS2_TOUCHKIT_HH__
7712616Sgabeblack@google.com
7810037SARM gem5 Developers