/*
 * this code is auto generated. do not edit. change the sources in tools/introspection/ instead.
 *
 * the parse tree:
 *
 * typedef
 *   struct dt_iop_watermark_params_t
 *     float
 *     opacity 
 *       default: 100.0
 *       range: 0.0 .. 100.0
 * 
 *     float
 *     scale 
 *       default: 100.0
 *       range: 1.0 .. 500.0
 * 
 *     float
 *     xoffset 
 *       description: x offset
 *       default: 0.0
 *       range: -1.0 .. 1.0
 * 
 *     float
 *     yoffset 
 *       description: y offset
 *       default: 0.0
 *       range: -1.0 .. 1.0
 * 
 *     int
 *     alignment 
 *       default: 4
 *       range: G_MININT .. G_MAXINT
 * 
 *     float
 *     rotate 
 *       description: rotation
 *       default: 0.0
 *       range: -180.0 .. 180.0
 * 
 *     enum dt_iop_watermark_base_scale_t
 *       DT_SCALE_IMAGE : image
 *       DT_SCALE_LARGER_BORDER : larger border
 *       DT_SCALE_SMALLER_BORDER : smaller border
 *     sizeto 
 *       description: scale on
 *       default: DT_SCALE_IMAGE
 * 
 *     char
 *     filename [64]
 *       default: 0
 *       range: CHAR_MIN .. CHAR_MAX
 * 
 *     char
 *     text [512]
 *       default: 0
 *       range: CHAR_MIN .. CHAR_MAX
 * 
 *     float
 *     color [3]
 *       default: 0.0
 *       range: -G_MAXFLOAT .. G_MAXFLOAT
 * 
 *     char
 *     font [64]
 *       default: 0
 *       range: CHAR_MIN .. CHAR_MAX
 * 
 * dt_iop_watermark_params_t
 *
 */

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

#ifdef __cplusplus
extern "C"
{
#endif

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

static dt_introspection_field_t introspection_linear[16+1]
#if !( defined(__cplusplus) && !defined(__clang__) && defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) <= 406) )
= {
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"opacity", (char*)"opacity", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->opacity), G_STRUCT_OFFSET(dt_iop_watermark_params_t, opacity), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 100.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"scale", (char*)"scale", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->scale), G_STRUCT_OFFSET(dt_iop_watermark_params_t, scale), NULL },
    /*Min*/ 1.0, /*Max*/ 500.0, /*Default*/ 100.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"xoffset", (char*)"xoffset", N_((char*)"x offset"), sizeof(((dt_iop_watermark_params_t*)NULL)->xoffset), G_STRUCT_OFFSET(dt_iop_watermark_params_t, xoffset), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"yoffset", (char*)"yoffset", N_((char*)"y offset"), sizeof(((dt_iop_watermark_params_t*)NULL)->yoffset), G_STRUCT_OFFSET(dt_iop_watermark_params_t, yoffset), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  }
},
{
  .Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"alignment", (char*)"alignment", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->alignment), G_STRUCT_OFFSET(dt_iop_watermark_params_t, alignment), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 4
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"rotate", (char*)"rotate", N_((char*)"rotation"), sizeof(((dt_iop_watermark_params_t*)NULL)->rotate), G_STRUCT_OFFSET(dt_iop_watermark_params_t, rotate), NULL },
    /*Min*/ -180.0, /*Max*/ 180.0, /*Default*/ 0.0
  }
},
{
  .Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_watermark_base_scale_t", (char*)"sizeto", (char*)"sizeto", N_((char*)"scale on"), sizeof(((dt_iop_watermark_params_t*)NULL)->sizeto), G_STRUCT_OFFSET(dt_iop_watermark_params_t, sizeto), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_SCALE_IMAGE
  }
},
{
  .Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"filename[0]", (char*)"filename[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->filename[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, filename), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"filename", (char*)"filename", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->filename), G_STRUCT_OFFSET(dt_iop_watermark_params_t, filename), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->filename), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[7]
  }
},
{
  .Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"text[0]", (char*)"text[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->text[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, text), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"text", (char*)"text", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->text), G_STRUCT_OFFSET(dt_iop_watermark_params_t, text), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->text), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[9]
  }
},
{
  .Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"color[0]", (char*)"color[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->color[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, color), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"color", (char*)"color", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->color), G_STRUCT_OFFSET(dt_iop_watermark_params_t, color), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->color), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[11]
  }
},
{
  .Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"font[0]", (char*)"font[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->font[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, font), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  }
},
{
  .Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"font", (char*)"font", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->font), G_STRUCT_OFFSET(dt_iop_watermark_params_t, font), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->font), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[13]
  }
},
{
  .Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_watermark_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_watermark_params_t), 0, NULL },
    /*entries*/ 11, /*fields*/ NULL
  }
},
  { .header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL} }
}
#endif
;

static dt_introspection_t introspection = {
  8,
  5,
  "dt_iop_watermark_params_t",
  sizeof(dt_iop_watermark_params_t),
  &introspection_linear[16-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*)"opacity", (char*)"opacity", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->opacity), G_STRUCT_OFFSET(dt_iop_watermark_params_t, opacity), NULL },
    /*Min*/ 0.0, /*Max*/ 100.0, /*Default*/ 100.0
  };
  introspection_linear[1].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"scale", (char*)"scale", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->scale), G_STRUCT_OFFSET(dt_iop_watermark_params_t, scale), NULL },
    /*Min*/ 1.0, /*Max*/ 500.0, /*Default*/ 100.0
  };
  introspection_linear[2].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"xoffset", (char*)"xoffset", N_((char*)"x offset"), sizeof(((dt_iop_watermark_params_t*)NULL)->xoffset), G_STRUCT_OFFSET(dt_iop_watermark_params_t, xoffset), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[3].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"yoffset", (char*)"yoffset", N_((char*)"y offset"), sizeof(((dt_iop_watermark_params_t*)NULL)->yoffset), G_STRUCT_OFFSET(dt_iop_watermark_params_t, yoffset), NULL },
    /*Min*/ -1.0, /*Max*/ 1.0, /*Default*/ 0.0
  };
  introspection_linear[4].Int = {
    { DT_INTROSPECTION_TYPE_INT, (char*)"int", (char*)"alignment", (char*)"alignment", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->alignment), G_STRUCT_OFFSET(dt_iop_watermark_params_t, alignment), NULL },
    /*Min*/ G_MININT, /*Max*/ G_MAXINT, /*Default*/ 4
  };
  introspection_linear[5].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"rotate", (char*)"rotate", N_((char*)"rotation"), sizeof(((dt_iop_watermark_params_t*)NULL)->rotate), G_STRUCT_OFFSET(dt_iop_watermark_params_t, rotate), NULL },
    /*Min*/ -180.0, /*Max*/ 180.0, /*Default*/ 0.0
  };
  introspection_linear[6].Enum = {
    { DT_INTROSPECTION_TYPE_ENUM, (char*)"dt_iop_watermark_base_scale_t", (char*)"sizeto", (char*)"sizeto", N_((char*)"scale on"), sizeof(((dt_iop_watermark_params_t*)NULL)->sizeto), G_STRUCT_OFFSET(dt_iop_watermark_params_t, sizeto), NULL },
    /*entries*/ 3, /*values*/ NULL, /*Default*/ DT_SCALE_IMAGE
  };
  introspection_linear[7].Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"filename[0]", (char*)"filename[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->filename[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, filename), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  };
  introspection_linear[8].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"filename", (char*)"filename", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->filename), G_STRUCT_OFFSET(dt_iop_watermark_params_t, filename), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->filename), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[7]
  };
  introspection_linear[9].Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"text[0]", (char*)"text[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->text[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, text), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  };
  introspection_linear[10].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"text", (char*)"text", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->text), G_STRUCT_OFFSET(dt_iop_watermark_params_t, text), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->text), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[9]
  };
  introspection_linear[11].Float = {
    { DT_INTROSPECTION_TYPE_FLOAT, (char*)"float", (char*)"color[0]", (char*)"color[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->color[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, color), NULL },
    /*Min*/ -G_MAXFLOAT, /*Max*/ G_MAXFLOAT, /*Default*/ 0.0
  };
  introspection_linear[12].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"float[]", (char*)"color", (char*)"color", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->color), G_STRUCT_OFFSET(dt_iop_watermark_params_t, color), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->color), /*type*/ DT_INTROSPECTION_TYPE_FLOAT, /*field*/ &introspection_linear[11]
  };
  introspection_linear[13].Char = {
    { DT_INTROSPECTION_TYPE_CHAR, (char*)"char", (char*)"font[0]", (char*)"font[0]", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->font[0]), G_STRUCT_OFFSET(dt_iop_watermark_params_t, font), NULL },
    /*Min*/ CHAR_MIN, /*Max*/ CHAR_MAX, /*Default*/ 0
  };
  introspection_linear[14].Array = {
    { DT_INTROSPECTION_TYPE_ARRAY, (char*)"char[]", (char*)"font", (char*)"font", (char*)"", sizeof(((dt_iop_watermark_params_t*)NULL)->font), G_STRUCT_OFFSET(dt_iop_watermark_params_t, font), NULL },
    /*count*/ G_N_ELEMENTS(((dt_iop_watermark_params_t*)NULL)->font), /*type*/ DT_INTROSPECTION_TYPE_CHAR, /*field*/ &introspection_linear[13]
  };
  introspection_linear[15].Struct = {
    { DT_INTROSPECTION_TYPE_STRUCT, (char*)"dt_iop_watermark_params_t", (char*)"", (char*)"", (char*)"", sizeof(dt_iop_watermark_params_t), 0, NULL },
    /*entries*/ 11, /*fields*/ NULL
  };
  introspection_linear[16].header = {DT_INTROSPECTION_TYPE_NONE, NULL, NULL, NULL, NULL, 0, 0, NULL};
#endif

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

  static dt_introspection_type_enum_tuple_t f6[] = { 
    { "DT_SCALE_IMAGE", DT_SCALE_IMAGE, N_((char*)"image") },
    { "DT_SCALE_LARGER_BORDER", DT_SCALE_LARGER_BORDER, N_((char*)"larger border") },
    { "DT_SCALE_SMALLER_BORDER", DT_SCALE_SMALLER_BORDER, N_((char*)"smaller border") },
    { NULL, 0 },
  };
  static dt_introspection_field_t *f15[] = {
    &introspection_linear[0],
    &introspection_linear[1],
    &introspection_linear[2],
    &introspection_linear[3],
    &introspection_linear[4],
    &introspection_linear[5],
    &introspection_linear[6],
    &introspection_linear[8],
    &introspection_linear[10],
    &introspection_linear[12],
    &introspection_linear[14],
    NULL
  };

  introspection_linear[6].Enum.values = f6;
  introspection_linear[15].Struct.fields = f15;

  return 0;
}

void * get_p(const void * param, const char * name)
{
  dt_iop_watermark_params_t * p = (dt_iop_watermark_params_t*)param;
  if(!strcmp(name, "opacity"))
    return &(p->opacity);
  else if(!strcmp(name, "scale"))
    return &(p->scale);
  else if(!strcmp(name, "xoffset"))
    return &(p->xoffset);
  else if(!strcmp(name, "yoffset"))
    return &(p->yoffset);
  else if(!strcmp(name, "alignment"))
    return &(p->alignment);
  else if(!strcmp(name, "rotate"))
    return &(p->rotate);
  else if(!strcmp(name, "sizeto"))
    return &(p->sizeto);
  else if(!strcmp(name, "filename[0]"))
    return &(p->filename[0]);
  else if(!strcmp(name, "filename"))
    return &(p->filename);
  else if(!strcmp(name, "text[0]"))
    return &(p->text[0]);
  else if(!strcmp(name, "text"))
    return &(p->text);
  else if(!strcmp(name, "color[0]"))
    return &(p->color[0]);
  else if(!strcmp(name, "color"))
    return &(p->color);
  else if(!strcmp(name, "font[0]"))
    return &(p->font[0]);
  else if(!strcmp(name, "font"))
    return &(p->font);
  else
    return NULL;
}

dt_introspection_field_t * get_f(const char * name)
{
  if(!strcmp(name, "opacity"))
    return &(introspection_linear[0]);
  else if(!strcmp(name, "scale"))
    return &(introspection_linear[1]);
  else if(!strcmp(name, "xoffset"))
    return &(introspection_linear[2]);
  else if(!strcmp(name, "yoffset"))
    return &(introspection_linear[3]);
  else if(!strcmp(name, "alignment"))
    return &(introspection_linear[4]);
  else if(!strcmp(name, "rotate"))
    return &(introspection_linear[5]);
  else if(!strcmp(name, "sizeto"))
    return &(introspection_linear[6]);
  else if(!strcmp(name, "filename[0]"))
    return &(introspection_linear[7]);
  else if(!strcmp(name, "filename"))
    return &(introspection_linear[8]);
  else if(!strcmp(name, "text[0]"))
    return &(introspection_linear[9]);
  else if(!strcmp(name, "text"))
    return &(introspection_linear[10]);
  else if(!strcmp(name, "color[0]"))
    return &(introspection_linear[11]);
  else if(!strcmp(name, "color"))
    return &(introspection_linear[12]);
  else if(!strcmp(name, "font[0]"))
    return &(introspection_linear[13]);
  else if(!strcmp(name, "font"))
    return &(introspection_linear[14]);
  else
    return NULL;
}

#ifdef __cplusplus
}
#endif

