diff options
author | Øyvind Kolås <pippin@gimp.org> | 2019-07-22 17:10:08 +0200 |
---|---|---|
committer | Øyvind Kolås <pippin@gimp.org> | 2019-07-22 17:10:10 +0200 |
commit | 615096b610b74bb24cab855866e3add42c48bac0 (patch) | |
tree | 884d2ae2fe8d250f473cbb1b58f444bdd905276d /babl/babl-component.c | |
parent | f1fdb86de56fb9b3066bf67b08f664a310181955 (diff) |
docs: improve generated reference
When registering types, models, formats and components one can now
specify override "doc" strings that end up in this reference.
Diffstat (limited to 'babl/babl-component.c')
-rw-r--r-- | babl/babl-component.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/babl/babl-component.c b/babl/babl-component.c index 2993e81..514ad26 100644 --- a/babl/babl-component.c +++ b/babl/babl-component.c @@ -29,7 +29,8 @@ component_new (const char *name, int id, int luma, int chroma, - int alpha) + int alpha, + const char *doc) { Babl *babl; @@ -39,6 +40,7 @@ component_new (const char *name, babl->class_type = BABL_COMPONENT; babl->instance.id = id; + babl->instance.doc = doc; babl->component.luma = luma; babl->component.chroma = chroma; babl->component.alpha = alpha; @@ -73,6 +75,7 @@ babl_component_new (void *first_arg, int alpha = 0; const char *name = first_arg; const char *arg; + const char *doc = NULL; va_start (varg, first_arg); @@ -87,6 +90,10 @@ babl_component_new (void *first_arg, { id = va_arg (varg, int); } + else if (!strcmp (arg, "doc")) + { + doc = va_arg (varg, const char *); + } else if (!strcmp (arg, "luma")) { @@ -136,7 +143,7 @@ babl_component_new (void *first_arg, return babl; } - babl = component_new (name, id, luma, chroma, alpha); + babl = component_new (name, id, luma, chroma, alpha, doc); /* Since there is not an already registered instance by the required * id/name, inserting newly created class into database. |