forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontext_flags.h
52 lines (41 loc) · 1.29 KB
/
context_flags.h
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
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_CONTEXT_FLAGS_H_INCLUDED
#define APP_CONTEXT_FLAGS_H_INCLUDED
#pragma once
#include "base/ints.h"
namespace app {
class Context;
class Site;
class ContextFlags {
public:
enum {
HasActiveDocument = 1 << 0,
HasActiveSprite = 1 << 1,
HasVisibleMask = 1 << 2,
HasActiveLayer = 1 << 3,
HasActiveCel = 1 << 4,
HasActiveImage = 1 << 5,
HasBackgroundLayer = 1 << 6,
ActiveDocumentIsReadable = 1 << 7,
ActiveDocumentIsWritable = 1 << 8,
ActiveLayerIsImage = 1 << 9,
ActiveLayerIsBackground = 1 << 10,
ActiveLayerIsVisible = 1 << 11,
ActiveLayerIsEditable = 1 << 12,
ActiveLayerIsReference = 1 << 13,
HasSelectedColors = 1 << 14,
};
ContextFlags();
bool check(uint32_t flags) const { return (m_flags & flags) == flags; }
void update(Context* context);
private:
void updateFlagsFromSite(const Site& site);
uint32_t m_flags;
};
} // namespace app
#endif