add a function list to docs

lists all C functions and their vips operators
This commit is contained in:
John Cupitt 2015-01-02 12:39:20 +00:00
parent 6c35ae5540
commit 29fa54444e
7 changed files with 1159 additions and 4 deletions

View File

@ -136,6 +136,7 @@ content_files = \
using-python.xml \
using-cpp.xml \
extending.xml \
function-list.xml \
binding.xml
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
@ -147,6 +148,7 @@ expand_content_files = \
using-python.xml \
using-cpp.xml \
extending.xml \
function-list.xml \
binding.xml
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
@ -163,7 +165,8 @@ include gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
EXTRA_DIST += \
images
images \
gen-function-list.py
# Files not to distribute
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
#!/usr/bin/python
# walk vips and generate a list of all operators and their descriptions
# for docs
# sample output:
# <row>
# <entry>gamma</entry>
# <entry>gamma an image</entry>
# <entry>vips_gamma()</entry>
# </row>
from gi.repository import Vips, GObject
vips_type_operation = GObject.GType.from_name("VipsOperation")
def gen_function(cls):
op = Vips.Operation.new(cls.name)
gtype = Vips.type_find("VipsOperation", cls.name)
nickname = Vips.nickname_find(gtype)
print '<row>'
print ' <entry>%s</entry>' % nickname
print ' <entry>%s</entry>' % op.get_description()
print ' <entry>vips_%s()</entry>' % nickname
print '</row>'
# we have a few synonyms ... don't generate twice
generated = {}
def gen_function_list(cls):
if not cls.is_abstract():
gtype = Vips.type_find("VipsOperation", cls.name)
nickname = Vips.nickname_find(gtype)
if not nickname in generated:
gen_function(cls)
generated[nickname] = True
if len(cls.children) > 0:
for child in cls.children:
gen_function_list(child)
if __name__ == '__main__':
gen_function_list(vips_type_operation)

View File

@ -36,6 +36,7 @@
<xi:include href="xml/using-cpp.xml"/>
<xi:include href="xml/binding.xml"/>
<xi:include href="xml/extending.xml"/>
<xi:include href="xml/function-list.xml"/>
</chapter>
<chapter>

View File

@ -135,7 +135,8 @@ typedef struct _VipsBlockCache {
typedef VipsConversionClass VipsBlockCacheClass;
G_DEFINE_TYPE( VipsBlockCache, vips_block_cache, VIPS_TYPE_CONVERSION );
G_DEFINE_ABSTRACT_TYPE( VipsBlockCache, vips_block_cache,
VIPS_TYPE_CONVERSION );
#define VIPS_TYPE_BLOCK_CACHE (vips_block_cache_get_type())

View File

@ -227,7 +227,7 @@ vips_draw_circle_class_init( VipsDrawCircleClass *class )
gobject_class->get_property = vips_object_get_property;
vobject_class->nickname = "draw_circle";
vobject_class->description = _( "draw a draw_circle on an image" );
vobject_class->description = _( "draw a circle on an image" );
vobject_class->build = vips_draw_circle_build;
VIPS_ARG_INT( class, "cx", 3,

View File

@ -277,7 +277,7 @@ vips_draw_line_class_init( VipsDrawLineClass *class )
gobject_class->get_property = vips_object_get_property;
vobject_class->nickname = "draw_line";
vobject_class->description = _( "draw a draw_line on an image" );
vobject_class->description = _( "draw a line on an image" );
vobject_class->build = vips_draw_line_build;
VIPS_ARG_INT( class, "x1", 3,