/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_enlargecanvas_params_t
 *     float
 *     percent_left 
 *       description: percent left
 *       default: 0
 *       range: 0 .. 100.0
 * 
 *     float
 *     percent_right 
 *       description: percent right
 *       default: 0
 *       range: 0 .. 100.0
 * 
 *     float
 *     percent_top 
 *       description: percent top
 *       default: 0
 *       range: 0 .. 100.0
 * 
 *     float
 *     percent_bottom 
 *       description: percent bottom
 *       default: 0
 *       range: 0 .. 100.0
 * 
 *     enum dt_iop_canvas_color_t
 *       DT_IOP_CANVAS_COLOR_GREEN : green
 *       DT_IOP_CANVAS_COLOR_RED : red
 *       DT_IOP_CANVAS_COLOR_BLUE : blue
 *       DT_IOP_CANVAS_COLOR_BLACK : black
 *       DT_IOP_CANVAS_COLOR_WHITE : white
 *       DT_IOP_CANVAS_COLOR_COUNT
 *     color 
 *       description: color
 *       default: 0
 * 
 * dt_iop_enlargecanvas_params_t
 *
 */

#include "/build/darktable/src/darktable-5.6.0/src/iop/enlargecanvas.c"

#ifdef __cplusplus
extern "C"
{
#endif

#include <string.h>
#include "common/introspection.h"

static dt_introspection_field_t introspection_linear[6+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_left", (char*)"percent_left", N_((char*)"percent left"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_left), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_left), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_right", (char*)"percent_right", N_((char*)"percent right"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_right), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_right), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_top", (char*)"percent_top", N_((char*)"percent top"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_top), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_top), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_bottom", (char*)"percent_bottom", N_((char*)"percent bottom"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_bottom), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_bottom), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_canvas_color_t", (char*)"color", (char*)"color", N_((char*)"color"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->color), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, color), NULL },
    /*entries*/ 6, /*values*/ NULL, /*Default*/ 0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_enlargecanvas_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_enlargecanvas_params_t), 0, NULL },
    /*entries*/ 5, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  1,
  "dt_iop_enlargecanvas_params_t",
  sizeof(dt_iop_enlargecanvas_params_t),
  &introspection_linear[6-1],
  sizeof(dt_iop_module_t),
  G_STRUCT_OFFSET(dt_iop_module_t, default_params)
};

dt_introspection_field_t* get_introspection_linear()
{
  return introspection_linear;
}

dt_introspection_t* get_introspection()
{
  return &introspection;
}

int introspection_init(struct dt_iop_module_so_t *self, int api_version)
{
  // here we check that the generated code matches the api at compile time and also at runtime
  if(introspection.api_version != DT_INTROSPECTION_VERSION || api_version != DT_INTROSPECTION_VERSION)
    return 1;

#if defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406)
  introspection_linear[0].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_left", (char*)"percent_left", N_((char*)"percent left"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_left), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_left), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_right", (char*)"percent_right", N_((char*)"percent right"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_right), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_right), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_top", (char*)"percent_top", N_((char*)"percent top"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_top), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_top), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"percent_bottom", (char*)"percent_bottom", N_((char*)"percent bottom"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->percent_bottom), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, percent_bottom), NULL },
    /*Min*/ 0, /*Max*/ 100.0, /*Default*/ 0
  };
  introspection_linear[4].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_canvas_color_t", (char*)"color", (char*)"color", N_((char*)"color"), sizeof(((dt_iop_enlargecanvas_params_t*)NULL)->color), G_STRUCT_OFFSET(dt_iop_enlargecanvas_params_t, color), NULL },
    /*entries*/ 6, /*values*/ NULL, /*Default*/ 0
  };
  introspection_linear[5].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_enlargecanvas_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_enlargecanvas_params_t), 0, NULL },
    /*entries*/ 5, /*fields*/ NULL
  };
  introspection_linear[6].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

  for(int i = 0; i <= 6; i++)
    introspection_linear[i].header.so = self;

  static dt_introspection_type_enum_tuple_t f4[] = { 
    { "DT_IOP_CANVAS_COLOR_GREEN", DT_IOP_CANVAS_COLOR_GREEN, N_((char*)"green") },
    { "DT_IOP_CANVAS_COLOR_RED", DT_IOP_CANVAS_COLOR_RED, N_((char*)"red") },
    { "DT_IOP_CANVAS_COLOR_BLUE", DT_IOP_CANVAS_COLOR_BLUE, N_((char*)"blue") },
    { "DT_IOP_CANVAS_COLOR_BLACK", DT_IOP_CANVAS_COLOR_BLACK, N_((char*)"black") },
    { "DT_IOP_CANVAS_COLOR_WHITE", DT_IOP_CANVAS_COLOR_WHITE, N_((char*)"white") },
    { "DT_IOP_CANVAS_COLOR_COUNT", DT_IOP_CANVAS_COLOR_COUNT, (char*)"" },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f5[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    NULL
  };

  introspection_linear[4].Enum.values = f4;
  introspection_linear[5].Struct.fields = f5;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_enlargecanvas_params_t * p = (dt_iop_enlargecanvas_params_t*)param;
  if(!strcmp(name, "percent_left"))
    return &(p->percent_left);
  else if(!strcmp(name, "percent_right"))
    return &(p->percent_right);
  else if(!strcmp(name, "percent_top"))
    return &(p->percent_top);
  else if(!strcmp(name, "percent_bottom"))
    return &(p->percent_bottom);
  else if(!strcmp(name, "color"))
    return &(p->color);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "percent_left"))
    return &(introspection_linear[0]);
  else if(!g_ascii_strcasecmp(name, "percent_right"))
    return &(introspection_linear[1]);
  else if(!g_ascii_strcasecmp(name, "percent_top"))
    return &(introspection_linear[2]);
  else if(!g_ascii_strcasecmp(name, "percent_bottom"))
    return &(introspection_linear[3]);
  else if(!g_ascii_strcasecmp(name, "color"))
    return &(introspection_linear[4]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

