/*
 * Copyright © 2025 Red Hat, Inc
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: Matthias Clasen <mclasen@redhat.com>
 */

#pragma once

G_BEGIN_DECLS

typedef struct _SvgValue SvgValue;
typedef struct _SvgComputeContext SvgComputeContext;
typedef struct _SvgPathData SvgPathData;
typedef struct _SvgFilter SvgFilter;
typedef struct _SvgColorStop SvgColorStop;
typedef struct _SvgElement SvgElement;
typedef struct _SvgAnimation SvgAnimation;
typedef struct _Timeline Timeline;
typedef struct _TimeSpec TimeSpec;

typedef enum
{
  SVG_ELEMENT_LINE,
  SVG_ELEMENT_POLYLINE,
  SVG_ELEMENT_POLYGON,
  SVG_ELEMENT_RECT,
  SVG_ELEMENT_CIRCLE,
  SVG_ELEMENT_ELLIPSE,
  SVG_ELEMENT_PATH,
  SVG_ELEMENT_GROUP,
  SVG_ELEMENT_CLIP_PATH,
  SVG_ELEMENT_MASK,
  SVG_ELEMENT_DEFS,
  SVG_ELEMENT_USE,
  SVG_ELEMENT_LINEAR_GRADIENT,
  SVG_ELEMENT_RADIAL_GRADIENT,
  SVG_ELEMENT_PATTERN,
  SVG_ELEMENT_MARKER,
  SVG_ELEMENT_TEXT,
  SVG_ELEMENT_TSPAN,
  SVG_ELEMENT_SVG,
  SVG_ELEMENT_IMAGE,
  SVG_ELEMENT_FILTER,
  SVG_ELEMENT_SYMBOL,
  SVG_ELEMENT_SWITCH,
  SVG_ELEMENT_LINK,
  SVG_ELEMENT_VIEW,
} SvgElementType;

typedef enum
{
  SVG_PROPERTY_DISPLAY,
  SVG_PROPERTY_FONT_SIZE, /* must come before lengths */
  SVG_PROPERTY_VISIBILITY,
  SVG_PROPERTY_TRANSFORM,
  SVG_PROPERTY_TRANSFORM_ORIGIN,
  SVG_PROPERTY_TRANSFORM_BOX,
  SVG_PROPERTY_OPACITY,
  SVG_PROPERTY_COLOR,
  SVG_PROPERTY_COLOR_INTERPOLATION,
  SVG_PROPERTY_COLOR_INTERPOLATION_FILTERS,
  SVG_PROPERTY_CLIP_PATH,
  SVG_PROPERTY_CLIP_RULE,
  SVG_PROPERTY_MASK,
  SVG_PROPERTY_FONT_FAMILY,
  SVG_PROPERTY_FONT_STYLE,
  SVG_PROPERTY_FONT_VARIANT,
  SVG_PROPERTY_FONT_WEIGHT,
  SVG_PROPERTY_FONT_STRETCH,
  SVG_PROPERTY_FILTER,
  SVG_PROPERTY_FILL,
  SVG_PROPERTY_FILL_OPACITY,
  SVG_PROPERTY_FILL_RULE,
  SVG_PROPERTY_STROKE,
  SVG_PROPERTY_STROKE_OPACITY,
  SVG_PROPERTY_STROKE_WIDTH,
  SVG_PROPERTY_STROKE_LINECAP,
  SVG_PROPERTY_STROKE_LINEJOIN,
  SVG_PROPERTY_STROKE_MITERLIMIT,
  SVG_PROPERTY_STROKE_DASHARRAY,
  SVG_PROPERTY_STROKE_DASHOFFSET,
  SVG_PROPERTY_MARKER_START,
  SVG_PROPERTY_MARKER_MID,
  SVG_PROPERTY_MARKER_END,
  SVG_PROPERTY_PAINT_ORDER,
  SVG_PROPERTY_SHAPE_RENDERING,
  SVG_PROPERTY_TEXT_RENDERING,
  SVG_PROPERTY_IMAGE_RENDERING,
  SVG_PROPERTY_BLEND_MODE,
  SVG_PROPERTY_ISOLATION,
  SVG_PROPERTY_PATH_LENGTH,
  SVG_PROPERTY_HREF,
  SVG_PROPERTY_OVERFLOW,
  SVG_PROPERTY_VECTOR_EFFECT,
  SVG_PROPERTY_CONTENT_UNITS,
  SVG_PROPERTY_BOUND_UNITS,
  SVG_PROPERTY_PATH,
  SVG_PROPERTY_CX,
  SVG_PROPERTY_CY,
  SVG_PROPERTY_R,
  SVG_PROPERTY_X,
  SVG_PROPERTY_Y,
  SVG_PROPERTY_WIDTH,
  SVG_PROPERTY_HEIGHT,
  SVG_PROPERTY_RX,
  SVG_PROPERTY_RY,
  SVG_PROPERTY_X1,
  SVG_PROPERTY_Y1,
  SVG_PROPERTY_X2,
  SVG_PROPERTY_Y2,
  SVG_PROPERTY_POINTS,
  SVG_PROPERTY_SPREAD_METHOD,
  SVG_PROPERTY_FX,
  SVG_PROPERTY_FY,
  SVG_PROPERTY_FR,
  SVG_PROPERTY_MASK_TYPE,
  SVG_PROPERTY_VIEW_BOX,
  SVG_PROPERTY_CONTENT_FIT,
  SVG_PROPERTY_REF_X,
  SVG_PROPERTY_REF_Y,
  SVG_PROPERTY_MARKER_UNITS,
  SVG_PROPERTY_MARKER_ORIENT,
  SVG_PROPERTY_LANG,
  SVG_PROPERTY_TEXT_ANCHOR,
  SVG_PROPERTY_DOMINANT_BASELINE,
  SVG_PROPERTY_DX,
  SVG_PROPERTY_DY,
  SVG_PROPERTY_UNICODE_BIDI,
  SVG_PROPERTY_DIRECTION,
  SVG_PROPERTY_WRITING_MODE,
  SVG_PROPERTY_LETTER_SPACING,
  SVG_PROPERTY_TEXT_DECORATION,
  SVG_PROPERTY_REQUIRED_EXTENSIONS,
  SVG_PROPERTY_SYSTEM_LANGUAGE,
  SVG_PROPERTY_POINTER_EVENTS,
  SVG_PROPERTY_STROKE_MINWIDTH,
  SVG_PROPERTY_STROKE_MAXWIDTH,
  /* color stops */
  SVG_PROPERTY_STOP_OFFSET,
  SVG_PROPERTY_STOP_COLOR,
  SVG_PROPERTY_STOP_OPACITY,
  /* filters */
  SVG_PROPERTY_FE_X,
  SVG_PROPERTY_FE_Y,
  SVG_PROPERTY_FE_WIDTH,
  SVG_PROPERTY_FE_HEIGHT,
  SVG_PROPERTY_FE_RESULT,
  SVG_PROPERTY_FE_COLOR,
  SVG_PROPERTY_FE_OPACITY,
  SVG_PROPERTY_FE_IN,
  SVG_PROPERTY_FE_IN2,
  SVG_PROPERTY_FE_STD_DEV,
  SVG_PROPERTY_FE_DX,
  SVG_PROPERTY_FE_DY,
  SVG_PROPERTY_FE_BLUR_EDGE_MODE,
  SVG_PROPERTY_FE_BLEND_MODE,
  SVG_PROPERTY_FE_BLEND_COMPOSITE,
  SVG_PROPERTY_FE_COLOR_MATRIX_TYPE,
  SVG_PROPERTY_FE_COLOR_MATRIX_VALUES,
  SVG_PROPERTY_FE_COMPOSITE_OPERATOR,
  SVG_PROPERTY_FE_COMPOSITE_K1,
  SVG_PROPERTY_FE_COMPOSITE_K2,
  SVG_PROPERTY_FE_COMPOSITE_K3,
  SVG_PROPERTY_FE_COMPOSITE_K4,
  SVG_PROPERTY_FE_DISPLACEMENT_SCALE,
  SVG_PROPERTY_FE_DISPLACEMENT_X,
  SVG_PROPERTY_FE_DISPLACEMENT_Y,
  SVG_PROPERTY_FE_IMAGE_HREF,
  SVG_PROPERTY_FE_IMAGE_CONTENT_FIT,
  SVG_PROPERTY_FE_FUNC_TYPE,
  SVG_PROPERTY_FE_FUNC_VALUES,
  SVG_PROPERTY_FE_FUNC_SLOPE,
  SVG_PROPERTY_FE_FUNC_INTERCEPT,
  SVG_PROPERTY_FE_FUNC_AMPLITUDE,
  SVG_PROPERTY_FE_FUNC_EXPONENT,
  SVG_PROPERTY_FE_FUNC_OFFSET,
} SvgProperty;


#define FIRST_SVG_PROPERTY    SVG_PROPERTY_DISPLAY
#define FIRST_SHAPE_PROPERTY  SVG_PROPERTY_DISPLAY
#define LAST_SHAPE_PROPERTY   SVG_PROPERTY_STROKE_MAXWIDTH
#define FIRST_STOP_PROPERTY   SVG_PROPERTY_STOP_OFFSET
#define LAST_STOP_PROPERTY    SVG_PROPERTY_STOP_OPACITY
#define FIRST_FILTER_PROPERTY SVG_PROPERTY_FE_X
#define LAST_FILTER_PROPERTY  SVG_PROPERTY_FE_FUNC_OFFSET
#define LAST_SVG_PROPERTY     SVG_PROPERTY_FE_FUNC_OFFSET

#define N_SVG_PROPERTIES    (LAST_SVG_PROPERTY + 1 - FIRST_SVG_PROPERTY)
#define N_SHAPE_PROPERTIES  (LAST_SHAPE_PROPERTY + 1 - FIRST_SHAPE_PROPERTY)
#define N_STOP_PROPERTIES   (LAST_STOP_PROPERTY + 1 - FIRST_STOP_PROPERTY)
#define N_FILTER_PROPERTIES (LAST_FILTER_PROPERTY + 1 - FIRST_FILTER_PROPERTY)

typedef enum
{
  SVG_FILTER_FLOOD,
  SVG_FILTER_BLUR,
  SVG_FILTER_BLEND,
  SVG_FILTER_COLOR_MATRIX,
  SVG_FILTER_COMPOSITE,
  SVG_FILTER_OFFSET,
  SVG_FILTER_DISPLACEMENT,
  SVG_FILTER_TILE,
  SVG_FILTER_IMAGE,
  SVG_FILTER_MERGE,
  SVG_FILTER_MERGE_NODE,
  SVG_FILTER_COMPONENT_TRANSFER,
  SVG_FILTER_FUNC_R,
  SVG_FILTER_FUNC_G,
  SVG_FILTER_FUNC_B,
  SVG_FILTER_FUNC_A,
  SVG_FILTER_DROPSHADOW,
} SvgFilterType;

#define INDEFINITE G_MAXINT64
#define REPEAT_FOREVER INFINITY

G_END_DECLS
