Commit def244f488bc03b605071cf5270ef6cf63dc86a9
1 parent
1e493936
Add br_add_template_to_gallery to C API
Showing
3 changed files
with
15 additions
and
3 deletions
openbr/openbr.cpp
| ... | ... | @@ -435,7 +435,14 @@ br_template_list br_load_from_gallery(br_gallery gallery) |
| 435 | 435 | return (br_template_list)tl; |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | -void br_add_to_gallery(br_gallery gallery, br_template_list tl) | |
| 438 | +void br_add_template_to_gallery(br_gallery gallery, br_template tmpl) | |
| 439 | +{ | |
| 440 | + Gallery *gal = reinterpret_cast<Gallery*>(gallery); | |
| 441 | + Template *t = reinterpret_cast<Template*>(tmpl); | |
| 442 | + gal->write(*t); | |
| 443 | +} | |
| 444 | + | |
| 445 | +void br_add_template_list_to_gallery(br_gallery gallery, br_template_list tl) | |
| 439 | 446 | { |
| 440 | 447 | Gallery *gal = reinterpret_cast<Gallery*>(gallery); |
| 441 | 448 | TemplateList *realTL = reinterpret_cast<TemplateList*>(tl); | ... | ... |
openbr/openbr.h
| ... | ... | @@ -563,9 +563,13 @@ BR_EXPORT br_gallery br_make_gallery(const char *gallery); |
| 563 | 563 | */ |
| 564 | 564 | BR_EXPORT br_template_list br_load_from_gallery(br_gallery gallery); |
| 565 | 565 | /*! |
| 566 | + * \brief Write a br::Template to the br::Gallery on disk. | |
| 567 | + */ | |
| 568 | +BR_EXPORT void br_add_template_to_gallery(br_gallery gallery, br_template tmpl); | |
| 569 | +/*! | |
| 566 | 570 | * \brief Write a br::TemplateList to the br::Gallery on disk. |
| 567 | 571 | */ |
| 568 | -BR_EXPORT void br_add_to_gallery(br_gallery gallery, br_template_list tl); | |
| 572 | +BR_EXPORT void br_add_template_list_to_gallery(br_gallery gallery, br_template_list tl); | |
| 569 | 573 | /*! |
| 570 | 574 | * \brief Close the br::Gallery. |
| 571 | 575 | */ | ... | ... |
scripts/brpy/__init__.py
| ... | ... | @@ -143,7 +143,8 @@ def init_brpy(br_loc='/usr/local/lib'): |
| 143 | 143 | br.br_make_gallery.restype = c_void_p |
| 144 | 144 | br.br_load_from_gallery.argtypes = [c_void_p] |
| 145 | 145 | br.br_load_from_gallery.restype = c_void_p |
| 146 | - br.br_add_to_gallery.argtypes = [c_void_p, c_void_p] | |
| 146 | + br.br_add_template_to_gallery.argtypes = [c_void_p, c_void_p] | |
| 147 | + br.br_add_template_list_to_gallery.argtypes = [c_void_p, c_void_p] | |
| 147 | 148 | br.br_close_gallery.argtypes = [c_void_p] |
| 148 | 149 | |
| 149 | 150 | return br | ... | ... |