/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_flip_params_t
 *     enum dt_image_orientation_t
 *       ORIENTATION_NULL : autodetect
 *       ORIENTATION_NONE : no rotation
 *       ORIENTATION_FLIP_Y : flip vertically
 *       ORIENTATION_FLIP_X : flip horizontally
 *       ORIENTATION_SWAP_XY : transpose
 *       ORIENTATION_FLIP_HORIZONTALLY
 *       ORIENTATION_FLIP_VERTICALLY
 *       ORIENTATION_ROTATE_180_DEG : rotate 180°
 *       ORIENTATION_TRANSPOSE
 *       ORIENTATION_ROTATE_CCW_90_DEG : rotate 90°
 *       ORIENTATION_ROTATE_CW_90_DEG : rotate -90°
 *       ORIENTATION_TRANSVERSE : transverse
 *     orientation 
 *       default: 0
 * 
 * dt_iop_flip_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[2+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_image_orientation_t", (char*)"orientation", (char*)"orientation", (char*)"", sizeof(((dt_iop_flip_params_t*)NULL)->orientation), G_STRUCT_OFFSET(dt_iop_flip_params_t, orientation), NULL },
    /*entries*/ 12, /*values*/ NULL, /*Default*/ 0
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_flip_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_flip_params_t), 0, NULL },
    /*entries*/ 1, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  2,
  "dt_iop_flip_params_t",
  sizeof(dt_iop_flip_params_t),
  &introspection_linear[2-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].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_image_orientation_t", (char*)"orientation", (char*)"orientation", (char*)"", sizeof(((dt_iop_flip_params_t*)NULL)->orientation), G_STRUCT_OFFSET(dt_iop_flip_params_t, orientation), NULL },
    /*entries*/ 12, /*values*/ NULL, /*Default*/ 0
  };
  introspection_linear[1].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_flip_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_flip_params_t), 0, NULL },
    /*entries*/ 1, /*fields*/ NULL
  };
  introspection_linear[2].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f0[] = { 
    { "ORIENTATION_NULL", ORIENTATION_NULL, N_((char*)"autodetect") },
    { "ORIENTATION_NONE", ORIENTATION_NONE, N_((char*)"no rotation") },
    { "ORIENTATION_FLIP_Y", ORIENTATION_FLIP_Y, N_((char*)"flip vertically") },
    { "ORIENTATION_FLIP_X", ORIENTATION_FLIP_X, N_((char*)"flip horizontally") },
    { "ORIENTATION_SWAP_XY", ORIENTATION_SWAP_XY, N_((char*)"transpose") },
    { "ORIENTATION_FLIP_HORIZONTALLY", ORIENTATION_FLIP_HORIZONTALLY, (char*)"" },
    { "ORIENTATION_FLIP_VERTICALLY", ORIENTATION_FLIP_VERTICALLY, (char*)"" },
    { "ORIENTATION_ROTATE_180_DEG", ORIENTATION_ROTATE_180_DEG, N_((char*)"rotate 180°") },
    { "ORIENTATION_TRANSPOSE", ORIENTATION_TRANSPOSE, (char*)"" },
    { "ORIENTATION_ROTATE_CCW_90_DEG", ORIENTATION_ROTATE_CCW_90_DEG, N_((char*)"rotate 90°") },
    { "ORIENTATION_ROTATE_CW_90_DEG", ORIENTATION_ROTATE_CW_90_DEG, N_((char*)"rotate -90°") },
    { "ORIENTATION_TRANSVERSE", ORIENTATION_TRANSVERSE, N_((char*)"transverse") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f1[] = {
    &introspection_linear[0],
    NULL
  };

  introspection_linear[0].Enum.values = f0;
  introspection_linear[1].Struct.fields = f1;

  return 0;
}

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

dt_introspection_field_t * get_f(const char * name)
{
  if(!g_ascii_strcasecmp(name, "orientation"))
    return &(introspection_linear[0]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

