Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
CssSourceSyntax.h File Reference
#include <cstddef>
#include <functional>
#include <string>
#include <string_view>
#include <vector>
#include "donner/editor/TextBuffer.h"
Include dependency graph for CssSourceSyntax.h:

Classes

struct  donner::editor::CssSourceRegion
 One CSS-bearing byte range found by the XML tokenizer. More...
struct  donner::editor::CssColorSpan
 Syntax color for a half-open source byte range. More...
struct  donner::editor::CssTextPiece
 A decoded run of CSS text and its half-open byte range within the raw XML region. The text is borrowed for the duration of the visitor call. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::editor::CssSourceRegionKind {
  Stylesheet ,
  DeclarationList ,
  PropertyValue
}
 How a CSS source region is embedded in SVG source. More...

Functions

void donner::editor::VisitDecodedCssText (std::string_view raw, const std::function< void(const CssTextPiece &)> &visit)
 Visit literal CSS text, XML character references, and CDATA payloads in source order.
std::vector< CssSourceRegion > donner::editor::FindSvgCssSourceRegions (std::string_view source, const std::function< void(CssColorSpan)> &paintMarkup={})
 Locate every CSS-bearing region in SVG/XML source, in source order.
std::vector< std::string > donner::editor::CollectDeclaredCustomPropertyNames (std::string_view source)
 Collect distinct authored custom property names from stylesheets and style attributes.
void donner::editor::ClassifySvgCssRegion (std::string_view source, const CssSourceRegion &region, const std::function< void(CssColorSpan)> &paint)
 Visit the token colors for one CSS region, using absolute source byte offsets.

Enumeration Type Documentation

◆ CssSourceRegionKind

How a CSS source region is embedded in SVG source.

Enumerator
Stylesheet 

Text inside a style element.

DeclarationList 

The value of a style attribute.

PropertyValue 

The value of an SVG presentation attribute.

Function Documentation

◆ CollectDeclaredCustomPropertyNames()

std::vector< std::string > donner::editor::CollectDeclaredCustomPropertyNames ( std::string_view source)

Collect distinct authored custom property names from stylesheets and style attributes.

Parameters
sourceSVG/XML source bytes.

◆ FindSvgCssSourceRegions()

std::vector< CssSourceRegion > donner::editor::FindSvgCssSourceRegions ( std::string_view source,
const std::function< void(CssColorSpan)> & paintMarkup = {} )

Locate every CSS-bearing region in SVG/XML source, in source order.

Parameters
sourceSVG/XML source bytes.