File indexing completed on 2024-05-12 15:56:41
0001 /* 0002 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOFLAKECOORDINATE_SYSTEM_H 0008 #define KOFLAKECOORDINATE_SYSTEM_H 0009 0010 #include <QString> 0011 0012 namespace KoFlake { 0013 0014 enum CoordinateSystem { 0015 UserSpaceOnUse, 0016 ObjectBoundingBox 0017 }; 0018 0019 inline CoordinateSystem coordinatesFromString(const QString &value, CoordinateSystem defaultValue) 0020 { 0021 CoordinateSystem result = defaultValue; 0022 0023 if (value == "userSpaceOnUse") { 0024 result = UserSpaceOnUse; 0025 } else if (value == "objectBoundingBox") { 0026 result = ObjectBoundingBox; 0027 } 0028 0029 return result; 0030 } 0031 0032 inline QString coordinateToString(CoordinateSystem value) 0033 { 0034 return 0035 value == ObjectBoundingBox? 0036 "objectBoundingBox" : 0037 "userSpaceOnUse"; 0038 } 0039 } 0040 0041 #endif // KOFLAKECOORDINATE_SYSTEM_H 0042