tahoma2d/toonz/sources/toonzqt/toonz_params.cpp

33 lines
1.1 KiB
C++
Raw Normal View History

2016-03-19 06:57:51 +13:00
#include "pluginhost.h"
#include "toonz_params.h"
extern "C" {
int set_parameter_pages(void *, int num, toonz_param_page_t *params);
2016-06-15 18:43:10 +12:00
int set_parameter_pages_with_error(void *, int num, toonz_param_page_t *params,
int *, void **);
2016-03-19 06:57:51 +13:00
}
2016-06-15 18:43:10 +12:00
int set_parameter_pages_with_error(void *host, int num,
toonz_param_page_t *params, int *err,
void **position) {
if (!host) return TOONZ_ERROR_NULL;
if (num == 0) return TOONZ_OK; /* num==0 の場合は無視してよい */
if (params == NULL) return TOONZ_ERROR_NULL;
int e = 0;
void *pos = NULL;
bool ret = reinterpret_cast<RasterFxPluginHost *>(host)->setParamStructure(
num, params, e, pos);
if (!ret) {
if (err) {
*err = e;
if (position) *position = pos;
}
return TOONZ_ERROR_INVALID_VALUE;
}
return TOONZ_OK;
2016-03-19 06:57:51 +13:00
}
2016-06-15 18:43:10 +12:00
int set_parameter_pages(void *host, int num, toonz_param_page_t *params) {
return set_parameter_pages_with_error(host, num, params, NULL, NULL);
2016-03-19 06:57:51 +13:00
}