Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-polygon.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SP_POLYGON_H
3#define SEEN_SP_POLYGON_H
4
5/*
6 * SVG <polygon> implementation
7 *
8 * Authors:
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 *
11 * Copyright (C) 1999-2002 Lauris Kaplinski
12 * Copyright (C) 2000-2001 Ximian, Inc.
13 *
14 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
15 */
16
17#include "sp-shape.h"
18
19class SPPolygon : public SPShape
20{
21public:
22 SPPolygon();
23 ~SPPolygon() override;
24 int tag() const override { return tag_of<decltype(*this)>; }
25
27 Inkscape::XML::Node *write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override;
28 void set(SPAttr key, char const *value) override;
29 char const *typeName() const override;
30 char *description() const override;
31};
32
33// Functionality shared with SPPolyline
42SPPolyParseError sp_poly_get_value(char const **p, double *v);
43std::optional<Geom::Path> sp_poly_parse_curve(char const *points);
44
45#endif
SPAttr
Definition attributes.h:27
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
Interface for refcounted XML nodes.
Definition node.h:80
Typed SVG document implementation.
Definition document.h:101
Inkscape::XML::Node * repr
Definition sp-object.h:193
SPDocument * document
Definition sp-object.h:188
char * description() const override
~SPPolygon() override
int tag() const override
Definition sp-polygon.h:24
char const * typeName() const override
The item's type name, not node tag name.
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void build(SPDocument *document, Inkscape::XML::Node *repr) override
Base class for shapes, including <path> element.
Definition sp-shape.h:38
static cairo_user_data_key_t key
SPPolyParseError
Definition sp-polygon.h:35
@ POLY_INVALID_NUMBER
Definition sp-polygon.h:38
@ POLY_END_OF_STRING
Definition sp-polygon.h:37
@ POLY_NOT_A_NUMBER
Definition sp-polygon.h:40
@ POLY_INFINITE_VALUE
Definition sp-polygon.h:39
@ POLY_OK
Definition sp-polygon.h:36
SPPolyParseError sp_poly_get_value(char const **p, double *v)
Parse a double from the string passed by pointer and advance the string start.
std::optional< Geom::Path > sp_poly_parse_curve(char const *points)
Parse a 'points' attribute, printing a warning when an error occurs.
Interface for XML documents.
Definition document.h:43