Toshihiro Shimizu 890ddd
#include "pluginhost.h"
Toshihiro Shimizu 890ddd
#include "toonz_params.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
extern "C" {
Toshihiro Shimizu 890ddd
int set_parameter_pages(void *, int num, toonz_param_page_t *params);
Shinya Kitaoka 120a6e
int set_parameter_pages_with_error(void *, int num, toonz_param_page_t *params,
Shinya Kitaoka 120a6e
                                   int *, void **);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int set_parameter_pages_with_error(void *host, int num,
Shinya Kitaoka 120a6e
                                   toonz_param_page_t *params, int *err,
Shinya Kitaoka 120a6e
                                   void **position) {
Shinya Kitaoka 120a6e
  if (!host) return TOONZ_ERROR_NULL;
Shinya Kitaoka 120a6e
  if (num == 0) return TOONZ_OK; /* num==0 の場合は無視してよい */
Shinya Kitaoka 120a6e
  if (params == NULL) return TOONZ_ERROR_NULL;
Shinya Kitaoka 120a6e
  int e     = 0;
Shinya Kitaoka 120a6e
  void *pos = NULL;
Shinya Kitaoka 120a6e
  bool ret  = reinterpret_cast<rasterfxpluginhost *="">(host)->setParamStructure(</rasterfxpluginhost>
Shinya Kitaoka 120a6e
      num, params, e, pos);
Shinya Kitaoka 120a6e
  if (!ret) {
Shinya Kitaoka 120a6e
    if (err) {
Shinya Kitaoka 120a6e
      *err                    = e;
Shinya Kitaoka 120a6e
      if (position) *position = pos;
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
    return TOONZ_ERROR_INVALID_VALUE;
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
  return TOONZ_OK;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int set_parameter_pages(void *host, int num, toonz_param_page_t *params) {
Shinya Kitaoka 120a6e
  return set_parameter_pages_with_error(host, num, params, NULL, NULL);
Toshihiro Shimizu 890ddd
}