1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: hid_TouchPanelReader.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 /* Please see man pages for details 17 18 19 */ 20 #ifndef NN_HID_CTR_HID_TOUCHPANELREADER_H_ 21 #define NN_HID_CTR_HID_TOUCHPANELREADER_H_ 22 23 #include <nn/Handle.h> 24 #include <nn/Result.h> 25 #include <nn/types.h> 26 #include <nn/hid/CTR/hid_Result.h> 27 #include <nn/hid/CTR/hid_Api.h> 28 #include <nn/hid/CTR/hid_TouchPanel.h> 29 #include <nn/hid/CTR/hid_DeviceStatus.h> 30 #include <nn/util/util_NonCopyable.h> 31 32 namespace nn { 33 namespace hid { 34 namespace CTR { 35 36 37 /* Please see man pages for details 38 39 40 41 */ 42 class TouchPanelReader : private nn::util::NonCopyable<TouchPanelReader> 43 { 44 public: 45 /* Please see man pages for details 46 47 48 49 50 51 52 53 */ 54 TouchPanelReader(TouchPanel& touchPanel = GetTouchPanel( )) m_TouchPanel(touchPanel)55 : m_TouchPanel(touchPanel) 56 , m_IndexOfRead(-1) 57 , m_TickOfRead(-1) 58 {}; 59 60 /* Please see man pages for details 61 62 63 */ ~TouchPanelReader()64 ~TouchPanelReader( ) {}; 65 66 // TODO: After improving, write the sampling period. 67 /* Please see man pages for details 68 69 70 71 72 73 74 75 */ 76 void Read(TouchPanelStatus* pBufs, s32* pReadLen, s32 bufLen); 77 78 /* Please see man pages for details 79 80 81 82 83 84 85 86 */ 87 bool ReadLatest(TouchPanelStatus* pBuf); 88 89 90 /* Please see man pages for details 91 92 */ 93 static const s8 MAX_READ_NUM = 7; 94 95 protected: 96 TouchPanel& m_TouchPanel; 97 s32 m_IndexOfRead; 98 s64 m_TickOfRead; 99 }; 100 101 } // namespace CTR { 102 } // namespace hid { 103 } // namespace nn { 104 105 #endif // #ifndef NN_HID_CTR_HID_TOUCHPANELREADER_H_ 106