#!/usr/bin/env ruby # GEGL API creator Øyvind Kolås 2007, # # Use under a public domain license. # class Argument attr_accessor :name, :data_type, :doc def initialize @data_type="" @name="" end def data_type type = @data_type.gsub("const", "").gsub(/\**/,"").gsub(/\s*/, "") ret = @data_type.sub(/\s+/, " ") url = "" case type when "void" when "gint" when "guint" when "gchar" when "gdouble" when "gfloat" when "gboolean" when "gpointer" when "GList" url="http://developer.gnome.org/doc/API/2.0/glib/glib-Doubly-Linked-Lists.html#GList" when "GSList" url="http://developer.gnome.org/doc/API/2.0/glib/glib-Singly-Linked-Lists.html#GSList" when "GParamSpec" url="http://developer.gnome.org/doc/API/2.0/gobject/gobject-GParamSpec.html#GParamSpec" when "GOptionGroup" url="http://developer.gnome.org/doc/API/2.2/glib/glib-Commandline-option-parser.html#GOptionGroup" when "GValue" url="http://developer.gnome.org/doc/API/2.0/gobject/gobject-Generic-values.html#GValue" else url="##{type}" end if url!="" ret.sub(type, "#{type}") else ret end end end class String def htmlify self.gsub("\n\n","\n
").gsub("XXX","XXX").gsub("NULL","NULL").gsub(/#([a-zA-Z_]*)/, "\\1").gsub(/@([a-zA-Z_]*)/, "\\1").gsub("TRUE", "TRUE") end end class Section attr_accessor :name, :doc, :sample def initialize @doc="" @sample="" @name="" end def menu_entry if @name == "GeglBuffer" or @name == "GeglNode" or @name == "GeglColor" or @name == "GeglRectangle" or @name == "GeglProcessor" or @name == "XML" or @name == "The GEGL API" then return "
" ret += @doc.htmlify ret += "
" ret += "#{sample_html}" ret += "
" ret += @doc.htmlify; ret += "
" if @arguments.length > 0 ret += "Arguments:
" ret += "#{arg.name} | " ret += "#{arg.doc.htmlify} |
#{sample_html}" ret += "