-------------------------------------------------------------------------------
-- Name: genidocs.lua
-- Purpose: This script generates docs from the wxLua interface files
-- Author: John Labenski
-- Created: 19/05/2006
-- Copyright: John Labenski
-- Licence: wxWidgets licence
-------------------------------------------------------------------------------
completeClassRefTable = nil -- a table of names that is a complete list of classes
-- from a library the wrapper are for
-- For wxWidgets this is taken from the alphabetical
-- list of classes in the wxWidgets reference manual
-- This is used to print if a class is wrapped or not.
typedefTable = {} -- filled from the data cache files
dataTypeTable = {}
preprocConditionTable = {}
colours = {}
colours.class = "DD0000" -- red
colours.member = "CC6600" -- orange
colours.rename = "990099" -- dark pink
colours.override = "BB0055" -- reddish pink
colours.operator = "663300" -- brown
colours.enum = "0066CC" -- blue
colours.define = "006666" -- turquoise
colours.event = "660033" -- purple
colours.func = "AA0000" -- dark red
colours.comment = "009900" -- green
colours.blkcomment = "888888" -- grey
colours.in_manual = "AAFFAA" -- for table showing classes
colours.in_wxlua = "AAFFAA"
colours.not_in_manual = "FFAAAA"
colours.not_in_wxlua = "FFAAAA"
-- ----------------------------------------------------------------------------
-- Dummy function that genwxbind.lua has and the XXX_rules.lua might use
-- ----------------------------------------------------------------------------
function AllocDataType() end
-- ----------------------------------------------------------------------------
-- For testing and choosing pleasing colors
-- ----------------------------------------------------------------------------
function GenerateTestColours(fileTable)
table.insert(fileTable, "
Colours used to denote types
")
table.insert(fileTable, MakeColour("Comments - //", colours.comment).."
")
table.insert(fileTable, MakeColour("Block Comments - /* ... */", colours.blkcomment).."
")
table.insert(fileTable, MakeColour("Enums - %enum", colours.enum).."
")
table.insert(fileTable, MakeColour("Defines - %define [_string] [_object] [_pointer]", colours.define).."
")
table.insert(fileTable, MakeColour("Events - %define_event", colours.event).."
")
table.insert(fileTable, MakeColour("Functions - %function", colours.func).."
")
table.insert(fileTable, MakeColour("Classes - %class", colours.class).."
")
table.insert(fileTable, MakeColour("Class Members - %member", colours.member).."
")
table.insert(fileTable, MakeColour("Renamed Functions - %rename", colours.rename).."
")
table.insert(fileTable, MakeColour("Overridden Functions - %override", colours.override).."
")
table.insert(fileTable, MakeColour("Operator Functions - %operator", colours.operator).."
")
end
-- ----------------------------------------------------------------------------
-- Make simple HTML tag items
-- ----------------------------------------------------------------------------
-- color is "RRGGBB" in hex
function MakeColour(str, color, size)
if size then
return ""..str..""
end
return ""..str..""
end
function MakeBold(str)
return ""..str..""
end
function MakeItalic(str)
return ""..str..""
end
function MakeLink(link_name, str)
--papers
return ""..(str or link_name)..""
end
function MakeTag(link_name, str)
--Papers
return ""..(str or link_name)..""
end
-- convert invalid chars to something valid for use in ", ">")
s = string.gsub(s, "<", "<")
return s
end
-- ----------------------------------------------------------------------------
-- Make the HTML footer
-- ----------------------------------------------------------------------------
function GenerateFooter(fileTable)
table.insert(fileTable, "