File indexing completed on 2024-05-19 04:32:40
0001 /* 0002 * SPDX-FileCopyrightText: 2015 Jouni Pentikäinen <joupent@gmail.com> 0003 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef __TESTING_TIMED_DEFAULT_BOUNDS_H 0009 #define __TESTING_TIMED_DEFAULT_BOUNDS_H 0010 0011 #include "kis_default_bounds_base.h" 0012 0013 0014 namespace TestUtil { 0015 0016 struct TestingTimedDefaultBounds : public KisDefaultBoundsBase { 0017 TestingTimedDefaultBounds(const QRect &bounds = QRect(0,0,100,100)) 0018 : m_time(0), 0019 m_lod(0), 0020 m_bounds(bounds) 0021 { 0022 } 0023 0024 QRect bounds() const override { 0025 return m_bounds; 0026 } 0027 0028 bool wrapAroundMode() const override { 0029 return false; 0030 } 0031 0032 WrapAroundAxis wrapAroundModeAxis() const override { 0033 return WRAPAROUND_BOTH; 0034 } 0035 0036 int currentLevelOfDetail() const override { 0037 return m_lod; 0038 } 0039 0040 int currentTime() const override { 0041 return m_time; 0042 } 0043 0044 bool externalFrameActive() const override { 0045 return false; 0046 } 0047 0048 void testingSetTime(int time) { 0049 m_time = time; 0050 } 0051 0052 void testingSetLod(int lod) { 0053 m_lod = lod; 0054 } 0055 0056 void * sourceCookie() const override { 0057 return 0; 0058 } 0059 0060 private: 0061 int m_time; 0062 int m_lod; 0063 QRect m_bounds; 0064 }; 0065 0066 } 0067 0068 #endif /* __TESTING_TIMED_DEFAULT_BOUNDS_H */