summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-23 17:09:12 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-23 17:09:32 +0100
commitdcac79d5b6e3d282319bf441871d0453163e53c2 (patch)
tree24c3e7470816af3dcffdfd24d79859207023dd5b /src
parent96c1c30db43fb2bfbd1899839c9960dc9623c6bc (diff)
docgen: add "Others" section with all remaining callables to class pages
Diffstat (limited to 'src')
-rw-r--r--src/scripts/elua/apps/gendoc.lua42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index f86bf41718..7b0b3f4172 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -698,15 +698,26 @@ find_parent_briefdoc = function(fulln, cl)
698 return pdoc:brief_get(pdocf) 698 return pdoc:brief_get(pdocf)
699end 699end
700 700
701local build_functable = function(f, title, cl, tbl, over) 701local build_functable = function(f, title, cl, tbl)
702 if #tbl == 0 then 702 if #tbl == 0 then
703 return 703 return
704 end 704 end
705 f:write_h(title, 2) 705 f:write_h(title, 2)
706 local nt = {} 706 local nt = {}
707 local oclass = not cl
707 for i, impl in ipairs(tbl) do 708 for i, impl in ipairs(tbl) do
708 local lbuf = writer.Buffer() 709 local lbuf = writer.Buffer()
710
711 if oclass then
712 local impt = impl
713 cl, impl = impt[1], impt[2]
714 lbuf:write_link(cl:nspaces_get(true), cl:full_name_get())
715 lbuf:write_raw(".")
716 end
717
709 local func = impl:function_get() 718 local func = impl:function_get()
719 local over = impl:is_overridden(cl)
720
710 local llbuf = writer.Buffer() 721 local llbuf = writer.Buffer()
711 llbuf:write_link(func:nspaces_get(cl, true), func:name_get()) 722 llbuf:write_link(func:nspaces_get(cl, true), func:name_get())
712 lbuf:write_b(llbuf:finish()) 723 lbuf:write_b(llbuf:finish())
@@ -781,6 +792,24 @@ local build_functable = function(f, title, cl, tbl, over)
781 f:write_nl() 792 f:write_nl()
782end 793end
783 794
795-- finds all stuff that is callable on a class, respecting
796-- overrides and not duplicating, does a depth-first search
797local find_callables
798find_callables = function(cl, omeths, written)
799 for i, inh in ipairs(cl:inherits_get()) do
800 local pcl = dtree.Class.by_name_get(inh)
801 for j, impl in ipairs(pcl:implements_get()) do
802 local func = impl:function_get()
803 local fid = func:id_get()
804 if not written[fid] then
805 omeths[#omeths + 1] = { pcl, impl }
806 written[fid] = true
807 end
808 end
809 find_callables(pcl, omeths, written)
810 end
811end
812
784local build_class = function(cl) 813local build_class = function(cl)
785 local cln = cl:nspaces_get() 814 local cln = cl:nspaces_get()
786 local fulln = cl:full_name_get() 815 local fulln = cl:full_name_get()
@@ -808,17 +837,22 @@ local build_class = function(cl)
808 f:write_editable(cln, "description") 837 f:write_editable(cln, "description")
809 f:write_nl() 838 f:write_nl()
810 839
811 local meths, methos = {}, {} 840 local written = {}
841 local meths, methos, omeths = {}, {}, {}
812 for i, impl in ipairs(cl:implements_get()) do 842 for i, impl in ipairs(cl:implements_get()) do
843 local func = impl:function_get()
844 written[func:id_get()] = true
813 if impl:is_overridden(cl) then 845 if impl:is_overridden(cl) then
814 methos[#methos + 1] = impl 846 methos[#methos + 1] = impl
815 else 847 else
816 meths[#meths + 1] = impl 848 meths[#meths + 1] = impl
817 end 849 end
818 end 850 end
851 find_callables(cl, omeths, written)
819 852
820 build_functable(f, "Members", cl, meths, false) 853 build_functable(f, "Members", cl, meths)
821 build_functable(f, "Overrides", cl, methos, true) 854 build_functable(f, "Overrides", cl, methos)
855 build_functable(f, "Others", nil, omeths)
822 856
823 f:write_h("Events", 2) 857 f:write_h("Events", 2)
824 local evs = cl:events_get() 858 local evs = cl:events_get()