| #ifndef TOONZ_PLUGIN_H__ |
| #define TOONZ_PLUGIN_H__ |
| |
| #include <stdint.h> |
| |
| #ifdef _MSC_VER |
| #define TOONZ_EXPORT __declspec(dllexport) |
| #define TOONZ_PACK |
| #else |
| #define TOONZ_EXPORT |
| #define TOONZ_PACK __attribute__((packed)) |
| #endif |
| |
| #if defined(_MSC_VER) |
| #pragma pack(push, 1) |
| #endif |
| |
| struct toonz_UUID_ { |
| uint32_t uid0; |
| uint16_t uid1; |
| uint16_t uid2; |
| uint16_t uid3; |
| uint64_t uid4; |
| } TOONZ_PACK; |
| |
| typedef toonz_UUID_ toonz_UUID; |
| |
| struct toonz_if_version_t_ { |
| int32_t major; |
| int32_t minor; |
| } TOONZ_PACK; |
| |
| typedef toonz_if_version_t_ toonz_if_version_t; |
| |
| struct toonz_plugin_version_t_ { |
| int32_t major; |
| int32_t minor; |
| } TOONZ_PACK; |
| |
| typedef toonz_plugin_version_t_ toonz_plugin_version_t; |
| |
| struct toonz_nodal_rasterfx_handler_t_; |
| |
| struct toonz_plugin_probe_t_ { |
| toonz_if_version_t ver; |
| toonz_plugin_version_t plugin_ver; |
| const char *name; |
| const char *vendor; |
| const char *id; |
| const char *note; |
| const char *helpurl; |
| void *reserved_ptr_[3]; |
| uint32_t clss; |
| uint32_t reserved_int_[7]; |
| toonz_nodal_rasterfx_handler_t_ *handler; |
| void *reserved_ptr_trail_[3]; |
| } TOONZ_PACK; |
| |
| typedef toonz_plugin_probe_t_ toonz_plugin_probe_t; |
| |
| struct toonz_plugin_probe_list_t_ { |
| toonz_if_version_t ver; |
| struct toonz_plugin_probe_t_ *begin; |
| struct toonz_plugin_probe_t_ *end; |
| } TOONZ_PACK; |
| |
| typedef toonz_plugin_probe_list_t_ toonz_plugin_probe_list_t; |
| |
| #if defined(_MSC_VER) |
| #pragma pack(pop) |
| #endif |
| |
| #if defined(__cplusplus) |
| namespace toonz |
| { |
| typedef toonz_UUID UUID; |
| typedef toonz_plugin_probe_t plugin_probe_t; |
| typedef toonz_plugin_probe_list_t plugin_probe_list_t; |
| } |
| #endif |
| |
| #define TOONZ_IF_VER(major, minor) \ |
| { \ |
| (major), (minor) \ |
| } |
| #define TOONZ_PLUGIN_VER(major, minor) \ |
| { \ |
| (major), (minor) \ |
| } |
| |
| #define TOONZ_PLUGIN_PROBE_BEGIN(ver) \ |
| static const toonz_if_version_t toonz_plugin_probe_ver_ = ver; \ |
| struct toonz_plugin_probe_t_ toonz_plugin_info_begin_[] = { |
| |
| #define TOONZ_PLUGIN_PROBE_DEFINE(plugin_ver, nm, vendor, ident, note, helpurl, cls, handler) \ |
| { \ |
| toonz_plugin_probe_ver_, \ |
| plugin_ver, \ |
| (nm), (vendor), (ident), (note), (helpurl), \ |
| {0}, \ |
| ((cls)), \ |
| {0}, \ |
| (handler), \ |
| { \ |
| 0 \ |
| } \ |
| } |
| |
| #define TOONZ_PLUGIN_PROBE_END \ |
| , { 0 } \ |
| } \ |
| ; \ |
| TOONZ_EXPORT struct toonz_plugin_probe_list_t_ toonz_plugin_info_list = {toonz_plugin_probe_ver_, toonz_plugin_info_begin_, &toonz_plugin_info_begin_[sizeof(toonz_plugin_info_begin_) / sizeof(struct toonz_plugin_probe_t_) - 1]}; |
| |
| |
| #define TOONZ_OK (0) |
| #define TOONZ_ERROR_UNKNOWN (-1) |
| #define TOONZ_ERROR_NOT_IMPLEMENTED (-2) |
| #define TOONZ_ERROR_VERSION_UNMATCH (-3) |
| #define TOONZ_ERROR_INVALID_HANDLE (-4) |
| #define TOONZ_ERROR_NULL (-5) |
| #define TOONZ_ERROR_POLLUTED (-6) |
| #define TOONZ_ERROR_OUT_OF_MEMORY (-7) |
| #define TOONZ_ERROR_INVALID_SIZE (-8) |
| #define TOONZ_ERROR_INVALID_VALUE (-9) |
| #define TOONZ_ERROR_BUSY (-10) |
| #define TOONZ_ERROR_NOT_FOUND (-11) |
| #define TOONZ_ERROR_FAILED_TO_CREATE (-12) |
| #define TOONZ_ERROR_PREREQUISITE (-13) |
| |
| #define TOONZ_PARAM_ERROR_NONE (0) |
| #define TOONZ_PARAM_ERROR_VERSION (1 << 0) |
| #define TOONZ_PARAM_ERROR_LABEL (1 << 1) |
| #define TOONZ_PARAM_ERROR_TYPE (1 << 2) |
| |
| #define TOONZ_PARAM_ERROR_PAGE_NUM (1 << 3) |
| #define TOONZ_PARAM_ERROR_GROUP_NUM (1 << 4) |
| #define TOONZ_PARAM_ERROR_TRAITS (1 << 5) |
| |
| #define TOONZ_PARAM_ERROR_NO_KEY (1 << 8) |
| #define TOONZ_PARAM_ERROR_KEY_DUP (1 << 9) |
| #define TOONZ_PARAM_ERROR_KEY_NAME (1 << 10) |
| #define TOONZ_PARAM_ERROR_POLLUTED (1 << 11) |
| |
| #define TOONZ_PARAM_ERROR_MIN_MAX (1 << 12) |
| #define TOONZ_PARAM_ERROR_ARRAY_NUM (1 << 13) |
| #define TOONZ_PARAM_ERROR_ARRAY (1 << 14) |
| #define TOONZ_PARAM_ERROR_UNKNOWN (1 << 31) |
| |
| enum toonz_param_type_enum { |
| TOONZ_PARAM_TYPE_DOUBLE, |
| TOONZ_PARAM_TYPE_RANGE, |
| TOONZ_PARAM_TYPE_PIXEL, |
| TOONZ_PARAM_TYPE_POINT, |
| TOONZ_PARAM_TYPE_ENUM, |
| TOONZ_PARAM_TYPE_INT, |
| TOONZ_PARAM_TYPE_BOOL, |
| TOONZ_PARAM_TYPE_SPECTRUM, |
| TOONZ_PARAM_TYPE_STRING, |
| TOONZ_PARAM_TYPE_TONECURVE, |
| |
| TOONZ_PARAM_TYPE_NB, |
| TOONZ_PARAM_TYPE_MAX = 0x7FFFFFFF |
| }; |
| |
| #endif |