/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_cacorrect_params_t
 *     boolean
 *     avoidshift 
 *       description: avoid colorshift
 *       default: 0
 * 
 *     enum dt_iop_cacorrect_multi_t
 *       CACORRETC_MULTI_1 : once
 *       CACORRETC_MULTI_2 : twice
 *       CACORRETC_MULTI_3 : three times
 *       CACORRETC_MULTI_4 : four times
 *       CACORRETC_MULTI_5 : five times
 *     iterations 
 *       description: iterations
 *       default: CACORRETC_MULTI_2
 * 
 * dt_iop_cacorrect_params_t
 *
 */

#include "/build/darktable/src/darktable-4.0.0/src/iop/cacorrect.c"

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[3+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"avoidshift", (char*)"avoidshift", N_((char*)"avoid colorshift"), sizeof(((dt_iop_cacorrect_params_t*)NULL)->avoidshift), G_STRUCT_OFFSET(dt_iop_cacorrect_params_t, avoidshift), NULL },
    /*Default*/ 0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_cacorrect_multi_t", (char*)"iterations", (char*)"iterations", N_((char*)"iterations"), sizeof(((dt_iop_cacorrect_params_t*)NULL)->iterations), G_STRUCT_OFFSET(dt_iop_cacorrect_params_t, iterations), NULL },
    /*entries*/ 5, /*values*/ NULL, /*Default*/ CACORRETC_MULTI_2
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_cacorrect_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_cacorrect_params_t), 0, NULL },
    /*entries*/ 2, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  2,
  "dt_iop_cacorrect_params_t",
  sizeof(dt_iop_cacorrect_params_t),
  &introspection_linear[3-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].Bool = {
    { DT_INTROSPECTION_TYPE_BOOL, (char*)"bool", (char*)"avoidshift", (char*)"avoidshift", N_((char*)"avoid colorshift"), sizeof(((dt_iop_cacorrect_params_t*)NULL)->avoidshift), G_STRUCT_OFFSET(dt_iop_cacorrect_params_t, avoidshift), NULL },
    /*Default*/ 0
  };
  introspection_linear[1].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_cacorrect_multi_t", (char*)"iterations", (char*)"iterations", N_((char*)"iterations"), sizeof(((dt_iop_cacorrect_params_t*)NULL)->iterations), G_STRUCT_OFFSET(dt_iop_cacorrect_params_t, iterations), NULL },
    /*entries*/ 5, /*values*/ NULL, /*Default*/ CACORRETC_MULTI_2
  };
  introspection_linear[2].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_cacorrect_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_cacorrect_params_t), 0, NULL },
    /*entries*/ 2, /*fields*/ NULL
  };
  introspection_linear[3].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f1[] = { 
    { "CACORRETC_MULTI_1", CACORRETC_MULTI_1, N_((char*)"once") },
    { "CACORRETC_MULTI_2", CACORRETC_MULTI_2, N_((char*)"twice") },
    { "CACORRETC_MULTI_3", CACORRETC_MULTI_3, N_((char*)"three times") },
    { "CACORRETC_MULTI_4", CACORRETC_MULTI_4, N_((char*)"four times") },
    { "CACORRETC_MULTI_5", CACORRETC_MULTI_5, N_((char*)"five times") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f2[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    NULL
  };

  introspection_linear[1].Enum.values = f1;
  introspection_linear[2].Struct.fields = f2;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_cacorrect_params_t * p = (dt_iop_cacorrect_params_t*)param;
  if(!strcmp(name, "avoidshift"))
    return &(p->avoidshift);
  else if(!strcmp(name, "iterations"))
    return &(p->iterations);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "avoidshift"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "iterations"))
    return &(introspection_linear[1]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

