add a function list to docs
lists all C functions and their vips operators
This commit is contained in:
parent
6c35ae5540
commit
29fa54444e
@ -136,6 +136,7 @@ content_files = \
|
|||||||
using-python.xml \
|
using-python.xml \
|
||||||
using-cpp.xml \
|
using-cpp.xml \
|
||||||
extending.xml \
|
extending.xml \
|
||||||
|
function-list.xml \
|
||||||
binding.xml
|
binding.xml
|
||||||
|
|
||||||
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
|
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
|
||||||
@ -147,6 +148,7 @@ expand_content_files = \
|
|||||||
using-python.xml \
|
using-python.xml \
|
||||||
using-cpp.xml \
|
using-cpp.xml \
|
||||||
extending.xml \
|
extending.xml \
|
||||||
|
function-list.xml \
|
||||||
binding.xml
|
binding.xml
|
||||||
|
|
||||||
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
|
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
|
||||||
@ -163,7 +165,8 @@ include gtk-doc.make
|
|||||||
# Other files to distribute
|
# Other files to distribute
|
||||||
# e.g. EXTRA_DIST += version.xml.in
|
# e.g. EXTRA_DIST += version.xml.in
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
images
|
images \
|
||||||
|
gen-function-list.py
|
||||||
|
|
||||||
# Files not to distribute
|
# Files not to distribute
|
||||||
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
|
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
|
||||||
|
1104
doc/reference/function-list.xml
Normal file
1104
doc/reference/function-list.xml
Normal file
File diff suppressed because it is too large
Load Diff
46
doc/reference/gen-function-list.py
Executable file
46
doc/reference/gen-function-list.py
Executable 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)
|
||||||
|
|
@ -36,6 +36,7 @@
|
|||||||
<xi:include href="xml/using-cpp.xml"/>
|
<xi:include href="xml/using-cpp.xml"/>
|
||||||
<xi:include href="xml/binding.xml"/>
|
<xi:include href="xml/binding.xml"/>
|
||||||
<xi:include href="xml/extending.xml"/>
|
<xi:include href="xml/extending.xml"/>
|
||||||
|
<xi:include href="xml/function-list.xml"/>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
<chapter>
|
<chapter>
|
||||||
|
@ -135,7 +135,8 @@ typedef struct _VipsBlockCache {
|
|||||||
|
|
||||||
typedef VipsConversionClass VipsBlockCacheClass;
|
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())
|
#define VIPS_TYPE_BLOCK_CACHE (vips_block_cache_get_type())
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ vips_draw_circle_class_init( VipsDrawCircleClass *class )
|
|||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
|
||||||
vobject_class->nickname = "draw_circle";
|
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;
|
vobject_class->build = vips_draw_circle_build;
|
||||||
|
|
||||||
VIPS_ARG_INT( class, "cx", 3,
|
VIPS_ARG_INT( class, "cx", 3,
|
||||||
|
@ -277,7 +277,7 @@ vips_draw_line_class_init( VipsDrawLineClass *class )
|
|||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
|
||||||
vobject_class->nickname = "draw_line";
|
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;
|
vobject_class->build = vips_draw_line_build;
|
||||||
|
|
||||||
VIPS_ARG_INT( class, "x1", 3,
|
VIPS_ARG_INT( class, "x1", 3,
|
||||||
|
Loading…
Reference in New Issue
Block a user