[Adaptation Layer] Added rive-tizen adaptation layer class.
[platform/core/uifw/rive-tizen.git] / submodule / include / shapes / path_space.hpp
1 #ifndef _RIVE_PATH_SPACE_HPP_
2 #define _RIVE_PATH_SPACE_HPP_
3
4 #include <type_traits>
5
6 namespace rive
7 {
8         enum class PathSpace : unsigned char
9         {
10                 Neither = 0,
11                 Local = 1 << 1,
12                 World = 1 << 2,
13                 Difference = 1 << 3,
14                 Clipping = 1 << 4
15         };
16
17         inline constexpr PathSpace operator&(PathSpace lhs, PathSpace rhs)
18         {
19                 return static_cast<PathSpace>(
20                     static_cast<std::underlying_type<PathSpace>::type>(lhs) &
21                     static_cast<std::underlying_type<PathSpace>::type>(rhs));
22         }
23
24         inline constexpr PathSpace operator^(PathSpace lhs, PathSpace rhs)
25         {
26                 return static_cast<PathSpace>(
27                     static_cast<std::underlying_type<PathSpace>::type>(lhs) ^
28                     static_cast<std::underlying_type<PathSpace>::type>(rhs));
29         }
30
31         inline constexpr PathSpace operator|(PathSpace lhs, PathSpace rhs)
32         {
33                 return static_cast<PathSpace>(
34                     static_cast<std::underlying_type<PathSpace>::type>(lhs) |
35                     static_cast<std::underlying_type<PathSpace>::type>(rhs));
36         }
37
38         inline constexpr PathSpace operator~(PathSpace rhs)
39         {
40                 return static_cast<PathSpace>(
41                     ~static_cast<std::underlying_type<PathSpace>::type>(rhs));
42         }
43
44         inline PathSpace& operator|=(PathSpace& lhs, PathSpace rhs)
45         {
46                 lhs = static_cast<PathSpace>(
47                     static_cast<std::underlying_type<PathSpace>::type>(lhs) |
48                     static_cast<std::underlying_type<PathSpace>::type>(rhs));
49
50                 return lhs;
51         }
52
53         inline PathSpace& operator&=(PathSpace& lhs, PathSpace rhs)
54         {
55                 lhs = static_cast<PathSpace>(
56                     static_cast<std::underlying_type<PathSpace>::type>(lhs) &
57                     static_cast<std::underlying_type<PathSpace>::type>(rhs));
58
59                 return lhs;
60         }
61
62         inline PathSpace& operator^=(PathSpace& lhs, PathSpace rhs)
63         {
64                 lhs = static_cast<PathSpace>(
65                     static_cast<std::underlying_type<PathSpace>::type>(lhs) ^
66                     static_cast<std::underlying_type<PathSpace>::type>(rhs));
67
68                 return lhs;
69         }
70 } // namespace rive
71
72 #endif