style.h revision 1ac06411f541bbb4116bdecc9009cb732d2b7da1
#ifndef SEEN_SP_STYLE_H
#define SEEN_SP_STYLE_H
/** \file
* SPStyle - a style object for SPItem objects
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Jon A. Cruz <jon@joncruz.org>
* Tavmjong Bah <tavmjong@free.fr>
*
* Copyright (C) 2014 Tavmjong Bah
* Copyright (C) 2010 Jon A. Cruz
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "style-enums.h"
#include "style-internal.h"
#include <sigc++/connection.h>
#include <iostream>
#include <vector>
// Define SPIBasePtr, a Pointer to a data member of SPStyle of type SPIBase;
// Define SPPropMap, a map linking property name to property data
// typedef std::map<std::string, SPIBasePtr> SPPropMap;
}
}
#include "libcroco/cr-declaration.h"
#include "libcroco/cr-prop-list.h"
/// An SVG style object.
SPStyle(SPDocument *document = NULL, SPObject *object = NULL);// document is ignored if valid object given
~SPStyle();
void clear();
void mergeString( char const *const p );
void _mergeString( char const *const p );
int _refcount;
static int _count; // Poor man's leak detector
// FIXME: Make private
/** Object we are attached to */
/** Document we are associated with */
/// Pointers to all the properties (for looping through them)
// static SPPropMap _propmap;
/* ----------------------- THE PROPERTIES ------------------------- */
/* Match order in style.cpp. */
/* Font ---------------------------- */
/** Font style */
/** Which substyle of the font */
/** Weight of the font */
/** Stretch of the font */
/** Size of the font */
/** Line height (css2 10.8.1) */
/** Font family */
/** Font shorthand */
/** Full font name, as font_factory::ConstructFontSpecification would give, for internal use. */
/* Text ----------------------------- */
/** First line indent of paragraphs (css2 16.1) */
/** text alignment (css2 16.2) (not to be confused with text-anchor) */
/** letter spacing (css2 16.4) */
/** word spacing (also css2 16.4) */
/** capitalization (css2 16.5) */
/* CSS3 Text */
/** text direction (css3 text 3.2) */
/** block progression (css3 text 3.2) */
/** Writing mode (css3 text 3.2 and svg1.1 10.7.2) */
/** Baseline shift (svg1.1 10.9.2) */
/* SVG */
/** Anchor of the text (svg1.1 10.9.1) */
/** white space (svg2) */
/** SVG2 Text Wrapping */
// SPIString shape_outside;
// SPILength shape_margin;
/* Text Decoration ----------------------- */
/** text decoration (css2 16.3.1) */
/** CSS 3 2.1, 2.2, 2.3 */
/** Not done yet, test_decoration3 = css3 2.4*/
// used to implement text_decoration, not saved to or read from SVG file
// 16.3.2 is text-shadow. That's complicated.
/* General visual properties ------------- */
/** clip-rule: 0 nonzero, 1 evenodd */
/** display */
/** overflow */
/** visibility */
/** opacity */
/** mix-blend-mode: CSS Compositing and Blending Level 1 */
/** color */
/** color-interpolation */
/** color-interpolation-filters */
/** solid-color */
/** solid-opacity */
/** fill */
/** fill-opacity */
/** fill-rule: 0 nonzero, 1 evenodd */
/** stroke */
/** stroke-width */
/** stroke-linecap */
/** stroke-linejoin */
/** stroke-miterlimit */
/** stroke-dasharray */
/** stroke-dashoffset */
/** stroke-opacity */
/** Marker list */
/* Filter effects ------------------------ */
/** Filter effect */
/** Filter blend mode */
/** normally not used, but duplicates the Gaussian blur deviation (if any) from the attached
filter when the style is used for querying */
/** enable-background, used for defining where filter effects get their background image */
/* Rendering hints ----------------------- */
/** hints on how to render: e.g. speed vs. accuracy.
* As of April, 2013, only image_rendering used. */
/* ----------------------- END PROPERTIES ------------------------- */
/// style belongs to a cloned object
bool cloned;
/**
* Emitted when paint server object, fill paint refers to, is changed. That is
* when the reference starts pointing to a different address in memory.
*
* NB It is different from fill_ps_modified signal. When paint server is modified
* it means some of it's attributes or chilren change.
*/
/**
* Emitted when paint server object, fill paint refers to, is changed. That is
* when the reference starts pointing to a different address in memory.
*/
char const *getFilterURI() const { return (filter.href) ? filter.href->getURI()->toString() : NULL; }
SPPaintServer *getFillPaintServer() { return (fill.value.href) ? fill.value.href->getObject() : NULL; }
SPPaintServer const *getFillPaintServer() const { return (fill.value.href) ? fill.value.href->getObject() : NULL; }
char const *getFillURI() const { return (fill.value.href) ? fill.value.href->getURI()->toString() : NULL; }
SPPaintServer *getStrokePaintServer() { return (stroke.value.href) ? stroke.value.href->getObject() : NULL; }
SPPaintServer const *getStrokePaintServer() const { return (stroke.value.href) ? stroke.value.href->getObject() : NULL; }
char const *getStrokeURI() const { return (stroke.value.href) ? stroke.value.href->getURI()->toString() : NULL; }
};
void sp_style_unset_property_attrs(SPObject *o);
void sp_style_set_property_url (SPObject *item, char const *property, SPObject *linked, bool recursive);
void css_unquote( Glib::ustring &val ); // Remove quotes from CSS values (style-internal.cpp, xml/repr-css.cpp)
#endif // SEEN_SP_STYLE_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :