Permalink
Browse files

Adding doxygendefine directive.

  • Loading branch information...
1 parent 298a061 commit e83fb5bb23163aa301022c71c12e7c03af151aa9 Marti Bolivar committed May 12, 2011
Showing with 35 additions and 0 deletions.
  1. +21 −0 breathe/__init__.py
  2. +2 −0 breathe/renderer/rst/doxygen/__init__.py
  3. +12 −0 breathe/renderer/rst/doxygen/compound.py
View
@@ -335,7 +335,19 @@ def create_matcher_stack(self, namespace, name):
"compound"
)
+class DoxygenDefineDirective(DoxygenBaseDirective):
+ kind = "define"
+
+ def create_matcher_stack(self, namespace, name):
+
+ return self.matcher_factory.create_matcher_stack(
+ {
+ "compound" : self.matcher_factory.create_name_matcher(namespace),
+ "member" : self.matcher_factory.create_name_type_matcher(name, self.kind)
+ },
+ "member"
+ )
class DoxygenEnumDirective(DoxygenBaseDirective):
@@ -516,6 +528,7 @@ class DoxygenDirectiveFactory(object):
"doxygenfunction" : DoxygenFunctionDirective,
"doxygenstruct" : DoxygenStructDirective,
"doxygenclass" : DoxygenClassDirective,
+ "doxygendefine" : DoxygenDefineDirective,
"doxygenenum" : DoxygenEnumDirective,
"doxygentypedef" : DoxygenTypedefDirective,
"doxygenfile" : DoxygenFileDirective,
@@ -560,6 +573,9 @@ def create_class_directive_container(self):
def create_file_directive_container(self):
return self.create_directive_container("doxygenfile")
+ def create_define_directive_container(self):
+ return self.create_directive_container("doxygendefine")
+
def create_directive_container(self, type_):
return DirectiveContainer(
@@ -685,6 +701,11 @@ def setup(app):
directive_factory.create_file_directive_container(),
)
+ app.add_directive(
+ "doxygendefine",
+ directive_factory.create_define_directive_container(),
+ )
+
app.add_config_value("breathe_projects", {}, True)
app.add_config_value("breathe_default_project", "", True)
app.add_config_value("breathe_domain_by_extension", {}, True)
@@ -159,6 +159,8 @@ def create_renderer(
Renderer = compoundrenderer.TypedefMemberDefTypeSubRenderer
elif data_object.kind == "variable":
Renderer = compoundrenderer.VariableMemberDefTypeSubRenderer
+ elif data_object.kind == "define":
+ Renderer = compoundrenderer.DefineMemberDefTypeSubRenderer
if node_type == "docsimplesect":
if data_object.kind == "par":
@@ -248,6 +248,18 @@ def title(self):
return args
+class DefineMemberDefTypeSubRenderer(MemberDefTypeSubRenderer):
+
+ def title(self):
+
+ name = self.node_factory.strong(text=self.data_object.name)
+ return [name]
+
+ def description(self):
+
+ return MemberDefTypeSubRenderer.description(self)
+
+
class EnumMemberDefTypeSubRenderer(MemberDefTypeSubRenderer):
def title(self):

0 comments on commit e83fb5b

Please sign in to comment.