-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOBPathStorage.cpp
More file actions
54 lines (41 loc) · 1.25 KB
/
OBPathStorage.cpp
File metadata and controls
54 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// OBPathStorage.cpp
// OpenBox
#include "OBPathStorage.h"
#include "PathStorage.hpp"
#include "../Util/assert.hpp"
using namespace OB;
void OBPathStorageInit(OBPathStorageRef dst, uint32_t capacity, OBPathStorageRef source) {
if (source != nullptr) {
dst->storage = OB::Path::Storage(capacity, source->storage);
} else {
dst->storage = OB::Path::Storage(capacity);
}
}
void OBPathStorageDestroy(OBPathStorageRef storage) {
storage->storage.~Storage();
}
void OBPathStorageClear(OBPathStorageRef storage) {
storage->storage.clear();
}
// ...
bool OBPathStorageIsEmpty(OBPathStorageRef storage) {
return storage->storage.isEmpty();
}
bool OBPathStorageEqualToStorage(OBPathStorageRef lhs, OBPathStorageRef rhs) {
return lhs->storage == rhs->storage;
}
bool OBPathStorageIsSingleElement(OBPathStorageRef storage) {
return storage->storage.flags().isSingleElement();
}
uint32_t OBPathStorageGetBezierOrder(OBPathStorageRef storage) {
return storage->storage.flags().bezierOrder();
}
#if OB_TARGET_OS_DARWIN
CGRect OBPathStorageGetBoundingRect(OBPathStorageRef storage) {
precondition_failure("TODO");
}
CGPathRef OBPathStorageGetCGPath(OBPathStorageRef storage) {
precondition_failure("TODO");
}
#endif