Code

Extensions. XAML export improvements.
[inkscape.git] / src / desktop-style.h
1 #ifndef __SP_DESKTOP_STYLE_H__
2 #define __SP_DESKTOP_STYLE_H__
4 /*
5  * Desktop style management
6  *
7  * Authors:
8  *   bulia byak
9  *   verbalshadow
10  *
11  * Copyright (C) 2004, 2006 authors
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #include <glib/gtypes.h>
18 class ColorRGBA;
19 struct SPCSSAttr;
20 struct SPDesktop;
21 struct SPObject;
22 struct SPStyle;
23 namespace Inkscape {
24 namespace XML {
25 struct Node;
26 }
27 }
28 namespace Glib { class ustring; }
30 enum { // what kind of a style the query is returning
31     QUERY_STYLE_NOTHING,   // nothing was queried - e.g. no selection
32     QUERY_STYLE_SINGLE,  // single object was queried
33     QUERY_STYLE_MULTIPLE_SAME, // multiple objects were queried, the results were the same
34     QUERY_STYLE_MULTIPLE_DIFFERENT, // multiple objects were queried, the results could NOT be meaningfully averaged
35     QUERY_STYLE_MULTIPLE_AVERAGED // multiple objects were queried, the results were meaningfully averaged
36 };
38 enum { // which property was queried (add when you need more)
39     QUERY_STYLE_PROPERTY_EVERYTHING,
40     QUERY_STYLE_PROPERTY_FILL,  // fill, fill-opacity
41     QUERY_STYLE_PROPERTY_STROKE,  // stroke, stroke-opacity
42     QUERY_STYLE_PROPERTY_STROKEWIDTH,  // stroke-width
43     QUERY_STYLE_PROPERTY_STROKEMITERLIMIT,  // miter limit
44     QUERY_STYLE_PROPERTY_STROKEJOIN,  // stroke join
45     QUERY_STYLE_PROPERTY_STROKECAP,  // stroke cap
46     QUERY_STYLE_PROPERTY_STROKESTYLE, // markers, dasharray, miterlimit, stroke-width, stroke-cap, stroke-join
47     QUERY_STYLE_PROPERTY_FONT_SPECIFICATION, //-inkscape-font-specification
48     QUERY_STYLE_PROPERTY_FONTFAMILY, // font-family
49     QUERY_STYLE_PROPERTY_FONTSTYLE, // font style 
50     QUERY_STYLE_PROPERTY_FONTNUMBERS, // size, spacings
51     QUERY_STYLE_PROPERTY_BASELINES, // baseline-shift
52     QUERY_STYLE_PROPERTY_MASTEROPACITY, // opacity
53     QUERY_STYLE_PROPERTY_BLEND, // blend
54     QUERY_STYLE_PROPERTY_BLUR // blur
55 };
57 void sp_desktop_apply_css_recursive(SPObject *o, SPCSSAttr *css, bool skip_lines);
58 void sp_desktop_set_color(SPDesktop *desktop, ColorRGBA const &color, bool is_relative, bool fill);
59 void sp_desktop_set_style(SPDesktop *desktop, SPCSSAttr *css, bool change = true, bool write_current = true);
60 SPCSSAttr *sp_desktop_get_style(SPDesktop *desktop, bool with_text);
61 guint32 sp_desktop_get_color (SPDesktop *desktop, bool is_fill);
62 double sp_desktop_get_master_opacity_tool(SPDesktop *desktop, Glib::ustring const &tool, bool* has_opacity = NULL);
63 double sp_desktop_get_opacity_tool(SPDesktop *desktop, Glib::ustring const &tool, bool is_fill);
64 guint32 sp_desktop_get_color_tool(SPDesktop *desktop, Glib::ustring const &tool, bool is_fill, bool* has_color = NULL);
65 double sp_desktop_get_font_size_tool (SPDesktop *desktop);
66 void sp_desktop_apply_style_tool(SPDesktop *desktop, Inkscape::XML::Node *repr, Glib::ustring const &tool, bool with_text);
68 gdouble stroke_average_width (GSList const *objects);
70 int objects_query_fillstroke (GSList *objects, SPStyle *style_res, bool const isfill);
71 int objects_query_fontnumbers (GSList *objects, SPStyle *style_res);
72 int objects_query_fontstyle (GSList *objects, SPStyle *style_res);
73 int objects_query_fontfamily (GSList *objects, SPStyle *style_res);
74 int objects_query_opacity (GSList *objects, SPStyle *style_res);
75 int objects_query_strokewidth (GSList *objects, SPStyle *style_res);
76 int objects_query_miterlimit (GSList *objects, SPStyle *style_res);
77 int objects_query_strokecap (GSList *objects, SPStyle *style_res);
78 int objects_query_strokejoin (GSList *objects, SPStyle *style_res);
80 int objects_query_blur (GSList *objects, SPStyle *style_res);
82 int sp_desktop_query_style_from_list (GSList *list, SPStyle *style, int property);
83 int sp_desktop_query_style(SPDesktop *desktop, SPStyle *style, int property);
84 bool sp_desktop_query_style_all (SPDesktop *desktop, SPStyle *query);
86 #endif
89 /*
90   Local Variables:
91   mode:c++
92   c-file-style:"stroustrup"
93   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
94   indent-tabs-mode:nil
95   fill-column:99
96   End:
97 */
98 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :