Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Syntax Namespace Reference

Classes

struct  Style
 The style of a single element in a (Pango markup)-enabled widget. More...
 
class  TextEditView
 Base class for styled text editing widget. More...
 
class  XMLFormatter
 A formatter for XML syntax, based on Pango markup. More...
 
struct  XMLStyles
 The styles used for simple XML syntax highlighting. More...
 

Enumerations

enum class  SyntaxMode {
  PlainText , InlineCss , CssStyle , SvgPathData ,
  SvgPolyPoints , JavaScript
}
 Syntax highlighting mode (language). More...
 

Functions

Glib::ustring quote (const char *text)
 
XMLStyles build_xml_styles (const Glib::ustring &syntax_theme)
 Build XML styles from a GTKSourceView syntax color theme.
 
Glib::ustring prettify_css (Glib::ustring const &css)
 Reformat CSS for better readability.
 
Glib::ustring minify_css (Glib::ustring const &css)
 Undo the CSS prettification by stripping some whitespace from CSS markup.
 
Glib::ustring prettify_svgd (Glib::ustring const &d)
 Reformat a path 'd' attibute for better readability.
 
Glib::ustring minify_svgd (Glib::ustring const &d)
 Remove excessive space, including newlines, from a path 'd' attibute.
 
static void init_text_view (Gtk::TextView *textview)
 Set default options on a TextView widget used for syntax-colored editing.
 
static GtkSourceLanguageManager * get_language_manager ()
 Return a pointer to a language manager which is aware of both default and custom syntaxes.
 

Enumeration Type Documentation

◆ SyntaxMode

Syntax highlighting mode (language).

Enumerator
PlainText 

Plain text (no highlighting).

InlineCss 

Inline CSS (contents of a style="..." attribute).

CssStyle 

File-scope CSS (contents of a CSS file or a <style> tag).

SvgPathData 

Contents of the 'd' attribute of the SVG <path> element.

SvgPolyPoints 

Contents of the 'points' attribute of <polyline> or <polygon>.

JavaScript 

Definition at line 97 of file syntax.h.

Function Documentation

◆ build_xml_styles()

◆ get_language_manager()

static GtkSourceLanguageManager * Inkscape::UI::Syntax::get_language_manager ( )
static

Return a pointer to a language manager which is aware of both default and custom syntaxes.

Definition at line 286 of file syntax.cpp.

References Inkscape::IO::Resource::get_path_string(), result, Inkscape::IO::Resource::SYSTEM, and Inkscape::IO::Resource::UIS.

◆ init_text_view()

static void Inkscape::UI::Syntax::init_text_view ( Gtk::TextView *  textview)
static

Set default options on a TextView widget used for syntax-colored editing.

Definition at line 254 of file syntax.cpp.

◆ minify_css()

Glib::ustring Inkscape::UI::Syntax::minify_css ( Glib::ustring const &  css)

Undo the CSS prettification by stripping some whitespace from CSS markup.

Definition at line 215 of file syntax.cpp.

References css, and len.

Referenced by Inkscape::UI::Syntax::TextEditView::create().

◆ minify_svgd()

Glib::ustring Inkscape::UI::Syntax::minify_svgd ( Glib::ustring const &  d)

Remove excessive space, including newlines, from a path 'd' attibute.

Definition at line 245 of file syntax.cpp.

References result, and Inkscape::Util::trim().

Referenced by Inkscape::UI::Syntax::TextEditView::create().

◆ prettify_css()

Glib::ustring Inkscape::UI::Syntax::prettify_css ( Glib::ustring const &  css)

Reformat CSS for better readability.

Definition at line 199 of file syntax.cpp.

References css, and len.

Referenced by Inkscape::UI::Syntax::TextEditView::create().

◆ prettify_svgd()

Glib::ustring Inkscape::UI::Syntax::prettify_svgd ( Glib::ustring const &  d)

Reformat a path 'd' attibute for better readability.

Definition at line 227 of file syntax.cpp.

References result, and Inkscape::Util::trim().

Referenced by Inkscape::UI::Syntax::TextEditView::create().

◆ quote()

Glib::ustring Inkscape::UI::Syntax::quote ( const char *  text)