SQLite compatibility and related fixes
[kworship.git] / design / css.txt
blob1b61246a4c242e4f11b3f46d65ff4b1e36e46016
1 Use a customisation structure similar to cascading stylesheets
3 Cascading customisations
4   each item has a list of class names
5   simple rules determine the styles based on the class names
6     global
7     nested
8   scopes manage most things
9     contain a stylesheet like a CSS file, a set of definitions
10       list of labels that must be applied to activate this style
11         what to apply the style to
12       list of classes that must be applied to activate this style
13         in what case to apply the style
14       list of style overrides
15         the style to apply
16   to resolve the styles we need
17     the scope to apply the styles
18     what we're applying it to
19       type of object {song, verse etc}
20     what classes are active
21       e.g. song_tag_creation
22            profile_traditional
23            profile_colourful
25 scopes
26   default  - program defaults
27   system   - system styles, global to all users
28     installed backgrounds
29   user     - user styles, specific to the user
30     user backgrounds
31   profile  - profile styles
32     
33   playlist - specific styles for the playlist
35 parameters
36   background
37     brush
38     image
39     video
40       path
41       loop
42   audio
43   font
44     face
45     decoration
46     color
47     shadow
48     outline
50 playlist tree
51   playlist
52     (styles)
53       [<apply here>] class: plain "[globalise]" <select and the properties are displayed in a separate tree>
54         (style refefrences)
55         <style tree modifications only>
56     (style references) [style drop down][add]
57       some_other_class [remove]
58     some item
59       (classes)
61 style tree
62   [ ] show modifications only
63   background (bold if modified)
64     name | <value> [revert button]
65 {{{
67 KwCssAbstractStyleState
69 template <typename T> KwCssStyleState : KwCssAbstractStyleState
70   QList<T> stack
71   operator KwCssStyle
73 KwCssAbstractStyle
75 template <typename T> KwCssStyle : KwCssAbstractStyle
76   enum {
77     override,
78     clear,
79     pop
80   } mode;
81   T value
82   operator KwCssStyleState
84 KwCssStyleDefinition
85   QString class;
86   KwCssPropertyMap styles;
88 typedef QMap<QString, KwCssAbstractStyleProperty> KwCssPropertyMap;
90 KwCssScope
91   KwCssStyleDefinition* findStyleDefinition(QString class);
92   KwCssPropertyMap* getStyles();
93   KwCssPropertyMap* recalculateStyles();
95   KwCssScope* parentScope;
96   QMap<QString,KwCssStyleDefinition*> styleDefinitions;
97   QStringList classes;
98   QSet<KwCssScope*> childScopes;
102 class AbstractStylePropertyState
104 template <T>
105 class StylePropertyState
106   stack<T> value;
108 class AbstractStyleCustomisation
109   virtual applyToState(AbstractStylePropertyState*) = 0;
111 template <T>
112 class StyleCustomisation
113   {clear, revert, override} type
114   T newValue
116 // apply a customisation to a state
117 operator << (StylePropertyState*, StyleCustomisation*)
119 class StyleBankState
120   Map<String, StylePropertyState> states
122 class StyleBank
123   Map<String, StyleCustomisation> properties