Blame gegl/gegl-chant.h

Packit Service 2781ba
/* gegl-chant contains incantations to that produce the boilerplate
Packit Service 2781ba
 * needed to write GEGL operation plug-ins. It abstracts away inheritance
Packit Service 2781ba
 * by giving a limited amount of base classes, and reduced creation of
Packit Service 2781ba
 * a properties struct and registration of properties for that structure to
Packit Service 2781ba
 * a minimum amount of code through use of the C preprocessor. You should
Packit Service 2781ba
 * look at the operations implemented using chanting (they #include this file)
Packit Service 2781ba
 * to see how it is used in practice.
Packit Service 2781ba
 *
Packit Service 2781ba
 * GEGL is free software; you can redistribute it and/or
Packit Service 2781ba
 * modify it under the terms of the GNU Lesser General Public
Packit Service 2781ba
 * License as published by the Free Software Foundation; either
Packit Service 2781ba
 * version 3 of the License, or (at your option) any later version.
Packit Service 2781ba
 *
Packit Service 2781ba
 * GEGL is distributed in the hope that it will be useful,
Packit Service 2781ba
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 2781ba
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 2781ba
 * Lesser General Public License for more details.
Packit Service 2781ba
 *
Packit Service 2781ba
 * You should have received a copy of the GNU Lesser General Public
Packit Service 2781ba
 * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
Packit Service 2781ba
 *
Packit Service 2781ba
 * 2006-2008 © Øyvind Kolås.
Packit Service 2781ba
 */
Packit Service 2781ba
Packit Service 2781ba
#ifndef GEGL_CHANT_C_FILE
Packit Service 2781ba
#error "GEGL_CHANT_C_FILE not defined"
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#include <gegl-plugin.h>
Packit Service 2781ba
Packit Service 2781ba
G_BEGIN_DECLS
Packit Service 2781ba
Packit Service 2781ba
GType gegl_chant_get_type (void);
Packit Service 2781ba
typedef struct _GeglChantO  GeglChantO;
Packit Service 2781ba
typedef struct _GeglChant   GeglChant;
Packit Service 2781ba
Packit Service 2781ba
static void gegl_chant_register_type       (GTypeModule *module);
Packit Service 2781ba
static void gegl_chant_init_properties     (GeglChant   *self);
Packit Service 2781ba
static void gegl_chant_class_intern_init   (gpointer     klass);
Packit Service 2781ba
static gpointer gegl_chant_parent_class = NULL;
Packit Service 2781ba
Packit Service 2781ba
#define GEGL_DEFINE_DYNAMIC_OPERATION(T_P)  GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED (GEGL_CHANT_C_FILE, GeglChant, gegl_chant, T_P, 0, {})
Packit Service 2781ba
#define GEGL_DEFINE_DYNAMIC_OPERATION_EXTENDED(C_FILE, TypeName, type_name, TYPE_PARENT, flags, CODE) \
Packit Service 2781ba
static void     type_name##_init              (TypeName        *self);  \
Packit Service 2781ba
static void     type_name##_class_init        (TypeName##Class *klass); \
Packit Service 2781ba
static void     type_name##_class_finalize    (TypeName##Class *klass); \
Packit Service 2781ba
static GType    type_name##_type_id = 0;                                \
Packit Service 2781ba
static void     type_name##_class_chant_intern_init (gpointer klass)    \
Packit Service 2781ba
  {                                                                     \
Packit Service 2781ba
    gegl_chant_parent_class = g_type_class_peek_parent (klass);         \
Packit Service 2781ba
    type_name##_class_init ((TypeName##Class*) klass);                  \
Packit Service 2781ba
    gegl_chant_class_intern_init (klass);                               \
Packit Service 2781ba
  }                                                                     \
Packit Service 2781ba
GType                                                                   \
Packit Service 2781ba
type_name##_get_type (void)                                             \
Packit Service 2781ba
  {                                                                     \
Packit Service 2781ba
    return type_name##_type_id;                                         \
Packit Service 2781ba
  }                                                                     \
Packit Service 2781ba
static void                                                             \
Packit Service 2781ba
type_name##_register_type (GTypeModule *type_module)                    \
Packit Service 2781ba
  {                                                                     \
Packit Service 2781ba
    gchar  tempname[256];                                               \
Packit Service 2781ba
    gchar *p;                                                           \
Packit Service 2781ba
    const GTypeInfo g_define_type_info =                                \
Packit Service 2781ba
    {                                                                   \
Packit Service 2781ba
      sizeof (TypeName##Class),                                         \
Packit Service 2781ba
      (GBaseInitFunc) NULL,                                             \
Packit Service 2781ba
      (GBaseFinalizeFunc) NULL,                                         \
Packit Service 2781ba
      (GClassInitFunc) type_name##_class_chant_intern_init,             \
Packit Service 2781ba
      (GClassFinalizeFunc) type_name##_class_finalize,                  \
Packit Service 2781ba
      NULL,   /* class_data */                                          \
Packit Service 2781ba
      sizeof (TypeName),                                                \
Packit Service 2781ba
      0,      /* n_preallocs */                                         \
Packit Service 2781ba
      (GInstanceInitFunc) type_name##_init,                             \
Packit Service 2781ba
      NULL    /* value_table */                                         \
Packit Service 2781ba
    };                                                                  \
Packit Service 2781ba
    g_snprintf (tempname, sizeof (tempname),                            \
Packit Service 2781ba
                "%s", #TypeName GEGL_CHANT_C_FILE);                     \
Packit Service 2781ba
    for (p = tempname; *p; p++)                                         \
Packit Service 2781ba
      if (*p=='.') *p='_';                                              \
Packit Service 2781ba
                                                                        \
Packit Service 2781ba
    type_name##_type_id = g_type_module_register_type (type_module,     \
Packit Service 2781ba
                                                       TYPE_PARENT,     \
Packit Service 2781ba
                                                       tempname,        \
Packit Service 2781ba
                                                       &g_define_type_info, \
Packit Service 2781ba
                                                       (GTypeFlags) flags); \
Packit Service 2781ba
    { CODE ; }                                                          \
Packit Service 2781ba
  }
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#define GEGL_CHANT_PROPERTIES(op) \
Packit Service 2781ba
    ((GeglChantO *) (((GeglChant *) (op))->properties))
Packit Service 2781ba
Packit Service 2781ba
/****************************************************************************/
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_OPERATION
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperation parent_instance;
Packit Service 2781ba
  gpointer      properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_META
Packit Service 2781ba
#include <operation/gegl-operation-meta.h>
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationMeta parent_instance;
Packit Service 2781ba
  gpointer          properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationMetaClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_META)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_SOURCE
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationSource parent_instance;
Packit Service 2781ba
  gpointer            properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationSourceClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_SOURCE)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_SINK
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationSink parent_instance;
Packit Service 2781ba
  gpointer          properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationSinkClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_SINK)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_FILTER
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationFilter parent_instance;
Packit Service 2781ba
  gpointer            properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationFilterClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_FILTER)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_COMPOSER
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationComposer parent_instance;
Packit Service 2781ba
  gpointer              properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationComposerClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_COMPOSER)
Packit Service 2781ba
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_COMPOSER3
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationComposer3 parent_instance;
Packit Service 2781ba
  gpointer               properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationComposer3Class parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_COMPOSER3)
Packit Service 2781ba
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_POINT_FILTER
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointFilter parent_instance;
Packit Service 2781ba
  gpointer                 properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointFilterClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_FILTER)
Packit Service 2781ba
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_POINT_RENDER
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointRender parent_instance;
Packit Service 2781ba
  gpointer                 properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointRenderClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_RENDER)
Packit Service 2781ba
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_TEMPORAL
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationTemporal parent_instance;
Packit Service 2781ba
  gpointer              properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationTemporalClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_TEMPORAL)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_AREA_FILTER
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationAreaFilter parent_instance;
Packit Service 2781ba
  gpointer                properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationAreaFilterClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_AREA_FILTER)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_POINT_COMPOSER
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointComposer parent_instance;
Packit Service 2781ba
  gpointer                   properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointComposerClass parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_COMPOSER)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#ifdef GEGL_CHANT_TYPE_POINT_COMPOSER3
Packit Service 2781ba
struct _GeglChant
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointComposer3 parent_instance;
Packit Service 2781ba
  gpointer                    properties;
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
typedef struct
Packit Service 2781ba
{
Packit Service 2781ba
  GeglOperationPointComposer3Class parent_class;
Packit Service 2781ba
} GeglChantClass;
Packit Service 2781ba
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_POINT_COMPOSER3)
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
#define GEGL_CHANT(obj)  ((GeglChant*)(obj))
Packit Service 2781ba
Packit Service 2781ba
/* if GEGL_CHANT_CUSTOM is defined you have to provide the following
Packit Service 2781ba
 * code or your own implementation of it
Packit Service 2781ba
 */
Packit Service 2781ba
#ifndef GEGL_CHANT_CUSTOM
Packit Service 2781ba
static void
Packit Service 2781ba
gegl_chant_init (GeglChant *self)
Packit Service 2781ba
{
Packit Service 2781ba
  gegl_chant_init_properties (self);
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
static void
Packit Service 2781ba
gegl_chant_class_finalize (GeglChantClass *self)
Packit Service 2781ba
{
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
static const GeglModuleInfo modinfo =
Packit Service 2781ba
{
Packit Service 2781ba
  GEGL_MODULE_ABI_VERSION
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
/* prototypes added to silence warnings from gcc for -Wmissing-prototypes*/
Packit Service 2781ba
gboolean                gegl_module_register (GTypeModule *module);
Packit Service 2781ba
const GeglModuleInfo  * gegl_module_query    (GTypeModule *module);
Packit Service 2781ba
Packit Service 2781ba
G_MODULE_EXPORT const GeglModuleInfo *
Packit Service 2781ba
gegl_module_query (GTypeModule *module)
Packit Service 2781ba
{
Packit Service 2781ba
  return &modinfo;
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
G_MODULE_EXPORT gboolean
Packit Service 2781ba
gegl_module_register (GTypeModule *module)
Packit Service 2781ba
{
Packit Service 2781ba
  gegl_chant_register_type (module);
Packit Service 2781ba
Packit Service 2781ba
  return TRUE;
Packit Service 2781ba
}
Packit Service 2781ba
#endif
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
struct _GeglChantO
Packit Service 2781ba
{
Packit Service 2781ba
  gpointer chant_data; /* Unused by the chanting framework can be used by operations
Packit Service 2781ba
                        * for storage of a private struct, (remember to clean up
Packit Service 2781ba
                        * in finalize). Also serves as a filler making sure that we
Packit Service 2781ba
                        * do not create an empty struct if there are no chanted properties.
Packit Service 2781ba
                        */
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)                        gint               name;
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)     gint               name;
Packit Service 2781ba
#define gegl_chant_double(name, nick, min, max, def, blurb)                     gdouble            name;
Packit Service 2781ba
#define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) gdouble   name;
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)                              gboolean           name;
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)                               gchar             *name;
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)                     enum               name;
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb)                            gchar             *name;
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)                            gchar             *name;
Packit Service 2781ba
#define gegl_chant_object(name,nick,  blurb)                                    GObject           *name;
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)                                   gpointer           name;
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)                                GeglColor         *name;
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)                                     GeglCurve         *name;
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)                                      GeglPath          *name;\
Packit Service 2781ba
                                                                                guint path_changed_handler;
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
#define GEGL_CHANT_OPERATION(obj) ((Operation*)(obj))
Packit Service 2781ba
Packit Service 2781ba
enum
Packit Service 2781ba
{
Packit Service 2781ba
  PROP_0,
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)                        PROP_##name,
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)     PROP_##name,
Packit Service 2781ba
#define gegl_chant_double(name, nick, min, max, def, blurb)                     PROP_##name,
Packit Service 2781ba
#define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) PROP_##name,
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)                              PROP_##name,
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)                               PROP_##name,
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)                     PROP_##name,
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb)                            PROP_##name,
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)                            PROP_##name,
Packit Service 2781ba
#define gegl_chant_object(name, nick, blurb)                                    PROP_##name,
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)                                   PROP_##name,
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)                                PROP_##name,
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)                                     PROP_##name,
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)                                      PROP_##name,
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
  PROP_LAST
Packit Service 2781ba
};
Packit Service 2781ba
Packit Service 2781ba
static void
Packit Service 2781ba
get_property (GObject      *gobject,
Packit Service 2781ba
              guint         property_id,
Packit Service 2781ba
              GValue       *value,
Packit Service 2781ba
              GParamSpec   *pspec)
Packit Service 2781ba
{
Packit Service 2781ba
  GeglChantO *properties;
Packit Service 2781ba
Packit Service 2781ba
  properties = GEGL_CHANT_PROPERTIES(gobject);
Packit Service 2781ba
Packit Service 2781ba
  switch (property_id)
Packit Service 2781ba
  {
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)      \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_int (value, properties->name);              \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_int (value, properties->name);              \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_double(name,nick,  min, max, def, blurb)   \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_double (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_double_ui(name,nick,  min, max, def, ui_min, ui_max, ui_gamma, blurb)   \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_double (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)            \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_boolean (value, properties->name);          \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)             \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_string (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)   \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_enum (value, properties->name);             \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb)          \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_string (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)          \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_string (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_object(name, nick, blurb)                  \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_object (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)                 \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_pointer (value, properties->name);          \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)              \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_object (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)                   \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      g_value_set_object (value, properties->name);           \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)                    \
Packit Service 2781ba
    case PROP_##name:                                         \
Packit Service 2781ba
      if (!properties->name)properties->name = gegl_path_new (); /* this feels ugly */\
Packit Service 2781ba
      g_value_set_object (value, properties->name);           \
Packit Service 2781ba
      break;/*XXX*/
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
    default:
Packit Service 2781ba
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
Packit Service 2781ba
      break;
Packit Service 2781ba
  }
Packit Service 2781ba
  properties ++; /* evil hack to silence gcc */
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
static void
Packit Service 2781ba
set_property (GObject      *gobject,
Packit Service 2781ba
              guint         property_id,
Packit Service 2781ba
              const GValue *value,
Packit Service 2781ba
              GParamSpec   *pspec)
Packit Service 2781ba
{
Packit Service 2781ba
  GeglChantO *properties;
Packit Service 2781ba
Packit Service 2781ba
  properties = GEGL_CHANT_PROPERTIES(gobject);
Packit Service 2781ba
Packit Service 2781ba
  switch (property_id)
Packit Service 2781ba
  {
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)              \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_int (value);                     \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_int (value);                     \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_double(name, nick, min, max, def, blurb)           \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_double (value);                  \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb) \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_double (value);                  \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)                    \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_boolean (value);                 \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)                     \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name)                                           \
Packit Service 2781ba
        g_free (properties->name);                                    \
Packit Service 2781ba
      properties->name = g_strdup (g_value_get_string (value));       \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)           \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_enum (value);                    \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb)                  \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name)                                           \
Packit Service 2781ba
        g_free (properties->name);                                    \
Packit Service 2781ba
      properties->name = g_strdup (g_value_get_string (value));       \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)                  \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name)                                           \
Packit Service 2781ba
        g_free (properties->name);                                    \
Packit Service 2781ba
      properties->name = g_strdup (g_value_get_string (value));       \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_object(name, nick, blurb)                          \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name != NULL)                                   \
Packit Service 2781ba
         g_object_unref (properties->name);                           \
Packit Service 2781ba
      properties->name = g_value_dup_object (value);                  \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)                         \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      properties->name = g_value_get_pointer (value);                 \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)                      \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name != NULL)                                   \
Packit Service 2781ba
         g_object_unref (properties->name);                           \
Packit Service 2781ba
      properties->name = g_value_dup_object (value);                  \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)                           \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name != NULL)                                   \
Packit Service 2781ba
         g_object_unref (properties->name);                           \
Packit Service 2781ba
      properties->name = g_value_dup_object (value);                  \
Packit Service 2781ba
      break;
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)                            \
Packit Service 2781ba
    case PROP_##name:                                                 \
Packit Service 2781ba
      if (properties->name != NULL)                                   \
Packit Service 2781ba
        {\
Packit Service 2781ba
          if (properties->path_changed_handler) \
Packit Service 2781ba
            g_signal_handler_disconnect (G_OBJECT (properties->name), properties->path_changed_handler);\
Packit Service 2781ba
         properties->path_changed_handler = 0;\
Packit Service 2781ba
        }                                                             \
Packit Service 2781ba
      properties->name = NULL;                                        \
Packit Service 2781ba
      if (g_value_peek_pointer (value))                               \
Packit Service 2781ba
        {                                                             \
Packit Service 2781ba
          properties->name = g_value_dup_object (value);              \
Packit Service 2781ba
          properties->path_changed_handler = g_signal_connect (G_OBJECT (properties->name), "changed",   \
Packit Service 2781ba
          G_CALLBACK(path_changed), gobject);     \
Packit Service 2781ba
         }\
Packit Service 2781ba
      break; /*XXX*/
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
Packit Service 2781ba
    default:
Packit Service 2781ba
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec);
Packit Service 2781ba
      break;
Packit Service 2781ba
  }
Packit Service 2781ba
Packit Service 2781ba
  properties ++; /* evil hack to silence gcc */
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
static void gegl_chant_destroy_notify (gpointer data)
Packit Service 2781ba
{
Packit Service 2781ba
  GeglChantO *properties = GEGL_CHANT_PROPERTIES (data);
Packit Service 2781ba
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
Packit Service 2781ba
#define gegl_chant_double(name, nick, min, max, def, blurb)
Packit Service 2781ba
#define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)   \
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {                                               \
Packit Service 2781ba
      g_free (properties->name);                    \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb) \
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {                                               \
Packit Service 2781ba
      g_free (properties->name);                    \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)\
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {                                               \
Packit Service 2781ba
      g_free (properties->name);                    \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
#define gegl_chant_object(name, nick, blurb)        \
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {                                               \
Packit Service 2781ba
      g_object_unref (properties->name);            \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)    \
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {                                               \
Packit Service 2781ba
      g_object_unref (properties->name);            \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)         \
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {\
Packit Service 2781ba
      g_object_unref (properties->name);            \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)          \
Packit Service 2781ba
  if (properties->name)                             \
Packit Service 2781ba
    {                                               \
Packit Service 2781ba
      g_object_unref (properties->name);            \
Packit Service 2781ba
      properties->name = NULL;                      \
Packit Service 2781ba
    }
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
Packit Service 2781ba
  g_slice_free (GeglChantO, properties);
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
static GObject *
Packit Service 2781ba
gegl_chant_constructor (GType                  type,
Packit Service 2781ba
                        guint                  n_construct_properties,
Packit Service 2781ba
                        GObjectConstructParam *construct_properties)
Packit Service 2781ba
{
Packit Service 2781ba
  GObject *obj;
Packit Service 2781ba
  GeglChantO *properties;
Packit Service 2781ba
Packit Service 2781ba
  obj = G_OBJECT_CLASS (gegl_chant_parent_class)->constructor (
Packit Service 2781ba
            type, n_construct_properties, construct_properties);
Packit Service 2781ba
Packit Service 2781ba
  /* create dummy colors and vectors */
Packit Service 2781ba
  properties = GEGL_CHANT_PROPERTIES (obj);
Packit Service 2781ba
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
Packit Service 2781ba
#define gegl_chant_double(name, nick, min, max, def, blurb)
Packit Service 2781ba
#define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb)
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)
Packit Service 2781ba
#define gegl_chant_object(name, nick, blurb)
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)              \
Packit Service 2781ba
    if (properties->name == NULL) \
Packit Service 2781ba
    {properties->name = gegl_color_new(def?def:"black");}
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
Packit Service 2781ba
  g_object_set_data_full (obj, "chant-data", obj, gegl_chant_destroy_notify);
Packit Service 2781ba
  properties ++; /* evil hack to silence gcc */
Packit Service 2781ba
  return obj;
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
static void
Packit Service 2781ba
gegl_chant_class_intern_init (gpointer klass)
Packit Service 2781ba
{
Packit Service 2781ba
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
Packit Service 2781ba
Packit Service 2781ba
  object_class->set_property = set_property;
Packit Service 2781ba
  object_class->get_property = get_property;
Packit Service 2781ba
  object_class->constructor  = gegl_chant_constructor;
Packit Service 2781ba
Packit Service 2781ba
#define gegl_chant_int(name, nick, min, max, def, blurb)                     \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_int (#name, nick, blurb,     \
Packit Service 2781ba
                                                     min, max, def,          \
Packit Service 2781ba
                                                     (GParamFlags) (         \
Packit Service 2781ba
                                                     G_PARAM_READWRITE |     \
Packit Service 2781ba
                                                     G_PARAM_CONSTRUCT |     \
Packit Service 2781ba
                                                     GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_int_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)  \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_int (#name, nick, blurb,     \
Packit Service 2781ba
                                                     min, max, def, ui_min, ui_max, ui_gamma, \
Packit Service 2781ba
                                                     (GParamFlags) (         \
Packit Service 2781ba
                                                     G_PARAM_READWRITE |     \
Packit Service 2781ba
                                                     G_PARAM_CONSTRUCT |     \
Packit Service 2781ba
                                                     GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_double(name, nick, min, max, def, blurb)                  \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_double (#name, nick, blurb,  \
Packit Service 2781ba
                                                        min, max, def,       \
Packit Service 2781ba
                                                        (GParamFlags) (      \
Packit Service 2781ba
                                                        G_PARAM_READWRITE |  \
Packit Service 2781ba
                                                        G_PARAM_CONSTRUCT |  \
Packit Service 2781ba
                                                        GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_double_ui(name, nick, min, max, def, ui_min, ui_max, ui_gamma, blurb)                  \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_double (#name, nick, blurb,  \
Packit Service 2781ba
                                                           min, max, def, ui_min, ui_max, ui_gamma, \
Packit Service 2781ba
                                                           (GParamFlags) (      \
Packit Service 2781ba
                                                           G_PARAM_READWRITE |  \
Packit Service 2781ba
                                                           G_PARAM_CONSTRUCT |  \
Packit Service 2781ba
                                                           GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_boolean(name, nick, def, blurb)                           \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_boolean (#name, nick, blurb, \
Packit Service 2781ba
                                                         def,                \
Packit Service 2781ba
                                                         (GParamFlags) (     \
Packit Service 2781ba
                                                         G_PARAM_READWRITE | \
Packit Service 2781ba
                                                         G_PARAM_CONSTRUCT | \
Packit Service 2781ba
                                                         GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_string(name, nick, def, blurb)                            \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_string (#name, nick, blurb,  \
Packit Service 2781ba
                                                        def,                 \
Packit Service 2781ba
                                                        (GParamFlags) (      \
Packit Service 2781ba
                                                        G_PARAM_READWRITE |  \
Packit Service 2781ba
                                                        G_PARAM_CONSTRUCT |  \
Packit Service 2781ba
                                                        GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_enum(name, nick, enum, type, def, blurb)                  \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_enum (#name, nick, blurb,    \
Packit Service 2781ba
                                                      type,                  \
Packit Service 2781ba
                                                      def,                   \
Packit Service 2781ba
                                                      (GParamFlags) (        \
Packit Service 2781ba
                                                      G_PARAM_READWRITE |    \
Packit Service 2781ba
                                                      G_PARAM_CONSTRUCT |    \
Packit Service 2781ba
                                                      GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_file_path(name, nick, def, blurb)                              \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_file_path (#name, nick, blurb, \
Packit Service 2781ba
                                                         FALSE, FALSE,       \
Packit Service 2781ba
                                                         def,                \
Packit Service 2781ba
                                                         (GParamFlags) (     \
Packit Service 2781ba
                                                         G_PARAM_READWRITE | \
Packit Service 2781ba
                                                         G_PARAM_CONSTRUCT | \
Packit Service 2781ba
                                                         GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_multiline(name, nick, def, blurb)                         \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_multiline (#name, nick, blurb, \
Packit Service 2781ba
                                                         def,                \
Packit Service 2781ba
                                                         (GParamFlags) (     \
Packit Service 2781ba
                                                         G_PARAM_READWRITE | \
Packit Service 2781ba
                                                         G_PARAM_CONSTRUCT | \
Packit Service 2781ba
                                                         GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_object(name, nick, blurb)                                 \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_object (#name, nick, blurb,  \
Packit Service 2781ba
                                                        G_TYPE_OBJECT,       \
Packit Service 2781ba
                                                        (GParamFlags) (      \
Packit Service 2781ba
                                                        G_PARAM_READWRITE |  \
Packit Service 2781ba
                                                        G_PARAM_CONSTRUCT |  \
Packit Service 2781ba
                                                        GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_pointer(name, nick, blurb)                                \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   g_param_spec_pointer (#name, nick, blurb, \
Packit Service 2781ba
                                                        (GParamFlags) (      \
Packit Service 2781ba
                                                        G_PARAM_READWRITE |  \
Packit Service 2781ba
                                                        G_PARAM_CONSTRUCT |  \
Packit Service 2781ba
                                                        GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_color(name, nick, def, blurb)                             \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_color_from_string (#name, nick, blurb,\
Packit Service 2781ba
                                                          def,               \
Packit Service 2781ba
                                                          (GParamFlags) (    \
Packit Service 2781ba
                                                          G_PARAM_READWRITE |\
Packit Service 2781ba
                                                          G_PARAM_CONSTRUCT | \
Packit Service 2781ba
                                                          GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_path(name, nick, blurb)                                 \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_path (#name, nick, blurb,\
Packit Service 2781ba
                                                           NULL,             \
Packit Service 2781ba
                                                          (GParamFlags) (    \
Packit Service 2781ba
                                                          G_PARAM_READWRITE |\
Packit Service 2781ba
                                                          G_PARAM_CONSTRUCT |\
Packit Service 2781ba
                                                          GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
#define gegl_chant_curve(name, nick, blurb)                                  \
Packit Service 2781ba
  g_object_class_install_property (object_class, PROP_##name,                \
Packit Service 2781ba
                                   gegl_param_spec_curve (#name, nick, blurb,\
Packit Service 2781ba
                                                          gegl_curve_default_curve(),\
Packit Service 2781ba
                                                          (GParamFlags) (    \
Packit Service 2781ba
                                                          G_PARAM_READWRITE |\
Packit Service 2781ba
                                                          G_PARAM_CONSTRUCT |\
Packit Service 2781ba
                                                          GEGL_PARAM_PAD_INPUT)));
Packit Service 2781ba
Packit Service 2781ba
#include GEGL_CHANT_C_FILE
Packit Service 2781ba
Packit Service 2781ba
#undef gegl_chant_int
Packit Service 2781ba
#undef gegl_chant_int_ui
Packit Service 2781ba
#undef gegl_chant_double
Packit Service 2781ba
#undef gegl_chant_double_ui
Packit Service 2781ba
#undef gegl_chant_boolean
Packit Service 2781ba
#undef gegl_chant_string
Packit Service 2781ba
#undef gegl_chant_enum
Packit Service 2781ba
#undef gegl_chant_file_path
Packit Service 2781ba
#undef gegl_chant_multiline
Packit Service 2781ba
#undef gegl_chant_object
Packit Service 2781ba
#undef gegl_chant_pointer
Packit Service 2781ba
#undef gegl_chant_color
Packit Service 2781ba
#undef gegl_chant_curve
Packit Service 2781ba
#undef gegl_chant_path
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
Packit Service 2781ba
static void
Packit Service 2781ba
gegl_chant_init_properties (GeglChant *self)
Packit Service 2781ba
{
Packit Service 2781ba
  self->properties = g_slice_new0 (GeglChantO);
Packit Service 2781ba
}
Packit Service 2781ba
Packit Service 2781ba
G_END_DECLS
Packit Service 2781ba
/****************************************************************************/