@@ -33,47 +33,54 @@ struct LayoutDocEntry
3333{
3434 ABSTRACT_BASE_CLASS (LayoutDocEntry)
3535
36- enum Kind {
37- // Generic items for all pages
38- MemberGroups,
39- MemberDeclStart, MemberDeclEnd, MemberDecl,
40- MemberDefStart, MemberDefEnd, MemberDef,
41- BriefDesc, DetailedDesc,
42- AuthorSection,
43-
44- // Class specific items
45- ClassIncludes, ClassInlineClasses,
46- ClassInheritanceGraph, ClassNestedClasses,
47- ClassCollaborationGraph, ClassAllMembersLink,
48- ClassUsedFiles,
49-
50- // Concept specific items
51- ConceptDefinition,
52-
53- // Namespace specific items
54- NamespaceNestedNamespaces, NamespaceNestedConstantGroups,
55- NamespaceClasses, NamespaceConcepts, NamespaceInterfaces, NamespaceStructs, NamespaceExceptions,
56- NamespaceInlineClasses,
57-
58- // File specific items
59- FileClasses, FileConcepts, FileInterfaces, FileStructs, FileExceptions, FileConstantGroups, FileNamespaces,
60- FileIncludes, FileIncludeGraph,
61- FileIncludedByGraph, FileSourceLink,
62- FileInlineClasses,
63-
64- // C++20 Modules
65- ModuleExports, ModuleClasses, ModuleConcepts, ModuleUsedFiles,
66-
67- // Group specific items
68- GroupClasses, GroupConcepts, GroupModules, GroupInlineClasses, GroupNamespaces,
69- GroupDirs, GroupNestedGroups, GroupFiles,
70- GroupGraph, GroupPageDocs,
71-
72- // Directory specific items
73- DirSubDirs, DirFiles, DirGraph
36+ #define ENTRY_SPECIFICATIONS \
37+ /* Generic items for all pages */ \
38+ ESPEC (MemberGroups) \
39+ ESPEC (MemberDeclStart) ESPEC(MemberDeclEnd) ESPEC(MemberDecl) \
40+ ESPEC (MemberDefStart) ESPEC(MemberDefEnd) ESPEC(MemberDef) \
41+ ESPEC (BriefDesc) ESPEC(DetailedDesc) \
42+ ESPEC (AuthorSection) \
43+ /* Class specific items */ \
44+ ESPEC (ClassIncludes) ESPEC(ClassInlineClasses) \
45+ ESPEC (ClassInheritanceGraph) ESPEC(ClassNestedClasses) \
46+ ESPEC (ClassCollaborationGraph) ESPEC(ClassAllMembersLink) \
47+ ESPEC (ClassUsedFiles) \
48+ /* Concept specific items */ \
49+ ESPEC (ConceptDefinition) \
50+ /* Namespace specific items */ \
51+ ESPEC (NamespaceNestedNamespaces) ESPEC(NamespaceNestedConstantGroups) \
52+ ESPEC (NamespaceClasses) ESPEC(NamespaceConcepts) ESPEC(NamespaceInterfaces) ESPEC(NamespaceStructs) ESPEC(NamespaceExceptions) \
53+ ESPEC (NamespaceInlineClasses) \
54+ /* File specific items */ \
55+ ESPEC (FileClasses) ESPEC(FileConcepts) ESPEC(FileInterfaces) ESPEC(FileStructs) ESPEC(FileExceptions) ESPEC(FileConstantGroups) ESPEC(FileNamespaces) \
56+ ESPEC (FileIncludes) ESPEC(FileIncludeGraph) \
57+ ESPEC (FileIncludedByGraph) ESPEC(FileSourceLink) \
58+ ESPEC (FileInlineClasses) \
59+ /* C++20 Modules */ \
60+ ESPEC (ModuleExports) ESPEC(ModuleClasses) ESPEC(ModuleConcepts) ESPEC(ModuleUsedFiles) \
61+ /* Group specific items */ \
62+ ESPEC (GroupClasses) ESPEC(GroupConcepts) ESPEC(GroupModules) ESPEC(GroupInlineClasses) ESPEC(GroupNamespaces) \
63+ ESPEC (GroupDirs) ESPEC(GroupNestedGroups) ESPEC(GroupFiles) \
64+ ESPEC (GroupGraph) ESPEC(GroupPageDocs) \
65+ /* Directory specific items */ \
66+ ESPEC (DirSubDirs) ESPEC(DirFiles) ESPEC(DirGraph)
7467
68+ enum Kind {
69+ #define ESPEC (x ) x,
70+ ENTRY_SPECIFICATIONS
71+ #undef ESPEC
7572 };
7673 virtual Kind kind () const = 0;
74+ std::string entryToString ()
75+ {
76+ switch (kind ())
77+ {
78+ #define ESPEC (x ) case x: return #x; break ;
79+ ENTRY_SPECIFICATIONS
80+ #undef ESPEC
81+ default : return " unknown" ; // to satisfy compiler
82+ }
83+ }
7784};
7885
7986/* * @brief Represents of a piece of a documentation page without configurable parts */
@@ -131,42 +138,58 @@ using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >;
131138/* * @brief Base class for the layout of a navigation item at the top of the HTML pages. */
132139struct LayoutNavEntry
133140{
141+ #define NAV_SPECIFICATIONS \
142+ NSPEC (None, = -1 ) \
143+ NSPEC (MainPage,) \
144+ NSPEC (Pages,) \
145+ NSPEC (Modules,) \
146+ NSPEC (ModuleList,) \
147+ NSPEC (ModuleMembers,) \
148+ NSPEC (Topics,) \
149+ NSPEC (Namespaces,) \
150+ NSPEC (NamespaceList,) \
151+ NSPEC (NamespaceMembers,) \
152+ NSPEC (Concepts,) \
153+ NSPEC (Classes,) \
154+ NSPEC (ClassList,) \
155+ NSPEC (ClassIndex,) \
156+ NSPEC (ClassHierarchy,) \
157+ NSPEC (ClassMembers,) \
158+ NSPEC (Interfaces,) \
159+ NSPEC (InterfaceList,) \
160+ NSPEC (InterfaceIndex,) \
161+ NSPEC (InterfaceHierarchy,) \
162+ NSPEC (Structs,) \
163+ NSPEC (StructList,) \
164+ NSPEC (StructIndex,) \
165+ NSPEC (Exceptions,) \
166+ NSPEC (ExceptionList,) \
167+ NSPEC (ExceptionIndex,) \
168+ NSPEC (ExceptionHierarchy,) \
169+ NSPEC (Files,) \
170+ NSPEC (FileList,) \
171+ NSPEC (FileGlobals,) \
172+ NSPEC (Examples,) \
173+ NSPEC (User,) \
174+ NSPEC (UserGroup,)
175+
134176 public:
135177 enum Kind {
136- None = -1 ,
137- MainPage,
138- Pages,
139- Modules,
140- ModuleList,
141- ModuleMembers,
142- Topics,
143- Namespaces,
144- NamespaceList,
145- NamespaceMembers,
146- Concepts,
147- Classes,
148- ClassList,
149- ClassIndex,
150- ClassHierarchy,
151- ClassMembers,
152- Interfaces,
153- InterfaceList,
154- InterfaceIndex,
155- InterfaceHierarchy,
156- Structs,
157- StructList,
158- StructIndex,
159- Exceptions,
160- ExceptionList,
161- ExceptionIndex,
162- ExceptionHierarchy,
163- Files,
164- FileList,
165- FileGlobals,
166- Examples,
167- User,
168- UserGroup
178+ #define NSPEC (x,y ) x y,
179+ NAV_SPECIFICATIONS
180+ #undef NSPEC
169181 };
182+ std::string navToString ()
183+ {
184+ switch (kind ())
185+ {
186+ #define NSPEC (x,y ) case x: return #x; break ;
187+ NAV_SPECIFICATIONS
188+ #undef NSPEC
189+ default : return " unknown" ; // to satisfy compiler
190+ }
191+ }
192+
170193 LayoutNavEntry (LayoutNavEntry *parent,Kind k,bool vs,const QCString &bf,
171194 const QCString &tl,const QCString &intro)
172195 : m_parent(parent), m_kind(k), m_visible(vs), m_baseFile(bf), m_title(tl), m_intro(intro) {}
@@ -201,20 +224,33 @@ struct LayoutNavEntry
201224using LayoutDocEntryPtr = std::unique_ptr<LayoutDocEntry>;
202225using LayoutDocEntryList = std::vector<LayoutDocEntryPtr>;
203226
227+ #define PART_SPECIFICATIONS \
228+ PSPEC (Undefined, = -1 ) \
229+ PSPEC(Class,) PSPEC(Concept,) PSPEC(Namespace,) PSPEC(File,) PSPEC(Group,) PSPEC(Directory,) PSPEC(Module,) \
230+ PSPEC(NrParts,)
204231/* * @brief Singleton providing access to the (user configurable) layout of the documentation */
205232class LayoutDocManager
206233{
207234 class Private ;
208235 public:
209236 enum LayoutPart
210237 {
211- Undefined = - 1 ,
212- Class, Concept, Namespace, File, Group, Directory, Module,
213- NrParts
238+ # define PSPEC ( x,y ) x y ,
239+ PART_SPECIFICATIONS
240+ # undef PSPEC
214241 };
215242 /* * Returns a reference to this singleton. */
216243 static LayoutDocManager &instance ();
217-
244+ static std::string partToString (int k)
245+ {
246+ switch (k)
247+ {
248+ #define PSPEC (x,y ) case x: return #x; break ;
249+ PART_SPECIFICATIONS
250+ #undef PSPEC
251+ default : return " unknown" ; // to satisfy compiler
252+ }
253+ }
218254 /* * Returns the list of LayoutDocEntry's in representation order for a given page identified by @a part. */
219255 const LayoutDocEntryList &docEntries (LayoutPart part) const ;
220256
0 commit comments