Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
tags.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Author: PBS <pbs3141@gmail.com>
4 * Copyright (C) 2022 Authors
5 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
6 */
7
8#ifndef INKSCAPE_DRAWINGITEM_TAGS_H
9#define INKSCAPE_DRAWINGITEM_TAGS_H
10
11#include "util/cast.h"
12
13// Class hierarchy structure
14
15#define DRAWINGITEM_HIERARCHY_DATA(X)\
16X(DrawingItem,\
17 X(DrawingShape)\
18 X(DrawingImage)\
19 X(DrawingGroup,\
20 X(DrawingPattern)\
21 X(DrawingText)\
22 )\
23 X(DrawingGlyphs)\
24)
25
26namespace Inkscape {
27
28// Forward declarations
29
30#define X(n, ...) class n; __VA_ARGS__
31DRAWINGITEM_HIERARCHY_DATA(X)
32#undef X
33
34// Tag generation
35
36enum class DrawingItemTag : int
37{
38 #define X(n, ...) n##_first, __VA_ARGS__ n##_tmp, n##_last = n##_tmp - 1,
39 DRAWINGITEM_HIERARCHY_DATA(X)
40 #undef X
41};
42
43} // namespace Inkscape
44
45// Tag specialization
46
47#define X(n, ...) template <> inline constexpr int first_tag<Inkscape::n> = static_cast<int>(Inkscape::DrawingItemTag::n##_first); __VA_ARGS__
48DRAWINGITEM_HIERARCHY_DATA(X)
49#undef X
50
51#define X(n, ...) template <> inline constexpr int last_tag<Inkscape::n> = static_cast<int>(Inkscape::DrawingItemTag::n##_last); __VA_ARGS__
52DRAWINGITEM_HIERARCHY_DATA(X)
53#undef X
54
55#undef DRAWINGITEM_HIERARCHY_DATA
56
57#endif // INKSCAPE_DRAWINGITEM_TAGS_H
58
59/*
60 Local Variables:
61 mode:c++
62 c-file-style:"stroustrup"
63 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
64 indent-tabs-mode:nil
65 fill-column:99
66 End:
67*/
68// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Hand-rolled LLVM-style RTTI system for class hierarchies where dynamic_cast isn't fast enough.
Helper class to stream background task notifications as a series of messages.