1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: hid_TouchPanelReader.h 4 5 Copyright (C)2009 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: 35919 $ 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 improvements, note 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 protected: 90 TouchPanel& m_TouchPanel; 91 s32 m_IndexOfRead; 92 s64 m_TickOfRead; 93 }; 94 95 } // namespace CTR { 96 } // namespace hid { 97 } // namespace nn { 98 99 #endif // #ifndef NN_HID_CTR_HID_TOUCHPANELREADER_H_ 100