style.h revision d14a5bc27be928a05ae5e862ffa5b0acfa9dd36e
#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 <stddef.h>
#include <sigc++/connection.h>
#include <iostream>
#include <vector>
// #include <map>
// 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"
//struct CRDeclaration;
//struct CRPropList;
/// An SVG style object.
SPStyle(SPDocument *document = NULL, SPObject *object = NULL);// document is ignored if valid object given
~SPStyle();
void clear();
//FIXME: Make private
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 ------------------------- */
/* 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. */
/** First line indent of paragraphs (css2 16.1) */
/** text alignment (css2 16.2) (not to be confused with text-anchor) */
/** 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.
/** 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) */
/** clip-rule: 0 nonzero, 1 evenodd */
/** display */
/** overflow */
/** visibility */
/** opacity */
/** mix-blend-mode: CSS Compositing and Blending Level 1 */
// Could be shared with Filter blending mode
/** color */
/** color-interpolation */
/** color-interpolation-filters */
/** 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 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 */
/** 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;
gchar 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; }
gchar 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; }
gchar const *getStrokeURI() const { return (stroke.value.href) ? stroke.value.href->getURI()->toString() : NULL; }
};
void sp_style_read_from_object(SPStyle *style, SPObject *object); //SPStyle::read( SPObject * object);
void sp_style_merge_from_dying_parent(SPStyle *style, SPStyle const *parent); // SPStyle::merge( ... )
gchar *sp_style_write_string(SPStyle const *style, guint flags = SP_STYLE_FLAG_IFSET);//SPStyle::write
void sp_style_unset_property_attrs(SPObject *o);
void sp_style_set_property_url (SPObject *item, gchar 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 :