|
94
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
3 |
* All rights reserved.
|
|
|
4 |
* This component and the accompanying materials are made available
|
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
|
6 |
* which accompanies this distribution, and is available
|
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
|
8 |
*
|
|
|
9 |
* Initial Contributors:
|
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
|
11 |
*
|
|
|
12 |
* Contributors:
|
|
|
13 |
*
|
|
|
14 |
* Description: Applies CSS property
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
// INCLUDE FILES
|
|
|
21 |
#include "CSSPropertyTable.h"
|
|
|
22 |
|
|
|
23 |
#include "nw_text_ascii.h"
|
|
|
24 |
#include "nw_image_virtualimage.h"
|
|
|
25 |
#include "nwx_string.h"
|
|
|
26 |
|
|
|
27 |
// EXTERNAL DATA STRUCTURES
|
|
|
28 |
|
|
|
29 |
// EXTERNAL FUNCTION PROTOTYPES
|
|
|
30 |
|
|
|
31 |
// CONSTANTS
|
|
|
32 |
|
|
|
33 |
// MACROS
|
|
|
34 |
|
|
|
35 |
// LOCAL CONSTANTS AND MACROS
|
|
|
36 |
|
|
|
37 |
#define INTEGER_MASK ((TUint32)(1<<NW_CSS_ValueType_Integer))
|
|
|
38 |
#define NUMBER_MASK ((TUint32)(1<<NW_CSS_ValueType_Number))
|
|
|
39 |
#define PX_MASK ((TUint32)(1<<NW_CSS_ValueType_Px))
|
|
|
40 |
#define EM_MASK ((TUint32)(1<<NW_CSS_ValueType_Em))
|
|
|
41 |
#define EX_MASK ((TUint32)(1<<NW_CSS_ValueType_Ex))
|
|
|
42 |
#define IN_MASK ((TUint32)(1<<NW_CSS_ValueType_In))
|
|
|
43 |
#define CM_MASK ((TUint32)(1<<NW_CSS_ValueType_Cm))
|
|
|
44 |
#define MM_MASK ((TUint32)(1<<NW_CSS_ValueType_Mm))
|
|
|
45 |
#define PT_MASK ((TUint32)(1<<NW_CSS_ValueType_Pt))
|
|
|
46 |
#define PC_MASK ((TUint32)(1<<NW_CSS_ValueType_Pc))
|
|
|
47 |
#define LENGTH_MASK ((TUint32)(PX_MASK | EM_MASK | EX_MASK | IN_MASK | CM_MASK | MM_MASK | PT_MASK | PC_MASK))
|
|
|
48 |
#define PERCENTAGE_MASK ((TUint32)(1<<NW_CSS_ValueType_Percentage))
|
|
|
49 |
#define COLOR_MASK ((TUint32)(1<<NW_CSS_ValueType_Color))
|
|
|
50 |
#define TOKEN_MASK ((TUint32)(1<<NW_CSS_ValueType_Token))
|
|
|
51 |
#define TEXT_MASK ((TUint32)(1<<NW_CSS_ValueType_Text))
|
|
|
52 |
#define IMAGE_MASK ((TUint32)(1<<NW_CSS_ValueType_Image))
|
|
|
53 |
#define OBJECT_MASK ((TUint32)(1<<NW_CSS_ValueType_Object))
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
static const TText16 PropName_background[] = {'b','a','c','k','g','r','o','u','n','d','\0'};
|
|
|
57 |
|
|
|
58 |
static const TText16 PropName_border[] = {'b','o','r','d','e','r','\0'};
|
|
|
59 |
|
|
|
60 |
static const TText16 PropName_border_top[] = {'b','o','r','d','e','r','-','t','o','p','\0'};
|
|
|
61 |
static const TText16 PropName_border_right[] = {'b','o','r','d','e','r','-','r','i','g','h','t','\0'};
|
|
|
62 |
static const TText16 PropName_border_bottom[] = {'b','o','r','d','e','r','-','b','o','t','t','o','m','\0'};
|
|
|
63 |
static const TText16 PropName_border_left[] = {'b','o','r','d','e','r','-','l','e','f','t','\0'};
|
|
|
64 |
|
|
|
65 |
static const TText16 PropName_border_width[] = {'b','o','r','d','e','r','-','w','i','d','t','h','\0'};
|
|
|
66 |
static const TText16 PropName_border_left_width[] = {'b','o','r','d','e','r','-','l','e','f','t','-','w','i','d','t','h','\0'};
|
|
|
67 |
static const TText16 PropName_border_right_width[] = {'b','o','r','d','e','r','-','r','i','g','h','t','-','w','i','d','t','h','\0'};
|
|
|
68 |
static const TText16 PropName_border_top_width[] = {'b','o','r','d','e','r','-','t','o','p','-','w','i','d','t','h','\0'};
|
|
|
69 |
static const TText16 PropName_border_bottom_width[] = {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','w','i','d','t','h','\0'};
|
|
|
70 |
|
|
|
71 |
static const TText16 PropName_border_color[] = {'b','o','r','d','e','r','-','c','o','l','o','r','\0'};
|
|
|
72 |
static const TText16 PropName_border_left_color[] = {'b','o','r','d','e','r','-','l','e','f','t','-','c','o','l','o','r','\0'};
|
|
|
73 |
static const TText16 PropName_border_right_color[] = {'b','o','r','d','e','r','-','r','i','g','h','t','-','c','o','l','o','r','\0'};
|
|
|
74 |
static const TText16 PropName_border_top_color[] = {'b','o','r','d','e','r','-','t','o','p','-','c','o','l','o','r','\0'};
|
|
|
75 |
static const TText16 PropName_border_bottom_color[] = {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','c','o','l','o','r','\0'};
|
|
|
76 |
|
|
|
77 |
static const TText16 PropName_border_style[] = {'b','o','r','d','e','r','-','s','t','y','l','e','\0'};
|
|
|
78 |
static const TText16 PropName_border_left_style[] = {'b','o','r','d','e','r','-','l','e','f','t','-','s','t','y','l','e','\0'};
|
|
|
79 |
static const TText16 PropName_border_right_style[] = {'b','o','r','d','e','r','-','r','i','g','h','t','-','s','t','y','l','e','\0'};
|
|
|
80 |
static const TText16 PropName_border_top_style[] = {'b','o','r','d','e','r','-','t','o','p','-','s','t','y','l','e','\0'};
|
|
|
81 |
static const TText16 PropName_border_bottom_style[] = {'b','o','r','d','e','r','-','b','o','t','t','o','m','-','s','t','y','l','e','\0'};
|
|
|
82 |
|
|
|
83 |
static const TText16 PropName_color[] = {'c','o','l','o','r','\0'};
|
|
|
84 |
static const TText16 PropName_display[] = {'d','i','s','p','l','a','y','\0'};
|
|
|
85 |
static const TText16 PropName_float[] = {'f','l','o','a','t','\0'};
|
|
|
86 |
static const TText16 PropName_font[] = {'f','o','n','t','\0'};
|
|
|
87 |
static const TText16 PropName_font_family[] = {'f','o','n','t','-','f','a','m','i','l','y','\0'};
|
|
|
88 |
static const TText16 PropName_font_size[] = {'f','o','n','t','-','s','i','z','e','\0'};
|
|
|
89 |
static const TText16 PropName_font_style[] = {'f','o','n','t','-','s','t','y','l','e','\0'};
|
|
|
90 |
static const TText16 PropName_font_weight[] = {'f','o','n','t','-','w','e','i','g','h','t','\0'};
|
|
|
91 |
static const TText16 PropName_font_variant[] = {'f','o','n','t','-','v','a','r','i','a','n','t','\0'};
|
|
|
92 |
|
|
|
93 |
static const TText16 PropName_list_style[] = {'l','i','s','t','-','s','t','y','l','e','\0'};
|
|
|
94 |
static const TText16 PropName_list_style_image[] = {'l','i','s','t','-','s','t','y','l','e','-','i','m','a','g','e','\0'};
|
|
|
95 |
static const TText16 PropName_list_style_type[] = {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e','\0'};
|
|
|
96 |
static const TText16 PropName_list_style_position[] = {'l','i','s','t','-','s','t','y','l','e','-','p','o','s','i','t','i','o','n','\0'};
|
|
|
97 |
static const TText16 PropName_list_margin[] = {'l','i','s','t','-','m','a','r','g','i','n','\0'};
|
|
|
98 |
|
|
|
99 |
static const TText16 PropName_padding[] = {'p','a','d','d','i','n','g','\0'};
|
|
|
100 |
static const TText16 PropName_page_break_after[] = {'p','a','g','e','-','b','r','e','a','k','-','a','f','t','e','r','\0'};
|
|
|
101 |
static const TText16 PropName_text_align[] = {'t','e','x','t','-','a','l','i','g','n','\0'};
|
|
|
102 |
static const TText16 PropName_text_decoration[] = {'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n','\0'};
|
|
|
103 |
static const TText16 PropName_text_indent[] = {'t','e','x','t','-','i','n','d','e','n','t','\0'};
|
|
|
104 |
static const TText16 PropName_margin[] = {'m','a','r','g','i','n','\0'};
|
|
|
105 |
static const TText16 PropName_padding_left[] = {'p','a','d','d','i','n','g','-','l','e','f','t','\0'};
|
|
|
106 |
static const TText16 PropName_padding_right[] = {'p','a','d','d','i','n','g','-','r','i','g','h','t','\0'};
|
|
|
107 |
static const TText16 PropName_padding_top[] = {'p','a','d','d','i','n','g','-','t','o','p','\0'};
|
|
|
108 |
static const TText16 PropName_padding_bottom[] = {'p','a','d','d','i','n','g','-','b','o','t','t','o','m','\0'};
|
|
|
109 |
static const TText16 PropName_margin_left[] = {'m','a','r','g','i','n','-','l','e','f','t','\0'};
|
|
|
110 |
static const TText16 PropName_margin_right[] = {'m','a','r','g','i','n','-','r','i','g','h','t','\0'};
|
|
|
111 |
static const TText16 PropName_margin_top[] = {'m','a','r','g','i','n','-','t','o','p','\0'};
|
|
|
112 |
static const TText16 PropName_margin_bottom[] = {'m','a','r','g','i','n','-','b','o','t','t','o','m','\0'};
|
|
|
113 |
static const TText16 PropName_vertical_align[] = {'v','e','r','t','i','c','a','l','-','a','l','i','g','n','\0'};
|
|
|
114 |
static const TText16 PropName_height[] = {'h','e','i','g','h','t','\0'};
|
|
|
115 |
static const TText16 PropName_width[] = {'w','i','d','t','h','\0'};
|
|
|
116 |
static const TText16 PropName_text_transform[] = {'t','e','x','t','-','t','r','a','n','s','f','o','r','m','\0'};
|
|
|
117 |
static const TText16 PropName_white_space[] = {'w','h','i','t','e','-','s','p','a','c','e','\0'};
|
|
|
118 |
static const TText16 PropName_background_color[] = {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r','\0'};
|
|
|
119 |
static const TText16 PropName_background_image[] = {'b','a','c','k','g','r','o','u','n','d','-','i','m','a','g','e','\0'};
|
|
|
120 |
static const TText16 PropName_background_repeat[] = {'b','a','c','k','g','r','o','u','n','d','-','r','e','p','e','a','t','\0'};
|
|
|
121 |
static const TText16 PropName_background_position[] = {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','\0'};
|
|
|
122 |
static const TText16 PropName_background_attachment[] = {'b','a','c','k','g','r','o','u','n','d','-','a','t','t','a','c','h','m','e','n','t','\0'};
|
|
|
123 |
static const TText16 PropName_background_position_x[] = {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','x','\0'};
|
|
|
124 |
static const TText16 PropName_background_position_y[] = {'b','a','c','k','g','r','o','u','n','d','-','p','o','s','i','t','i','o','n','-','y','\0'};
|
|
|
125 |
static const TText16 PropName_clear[] = {'c','l','e','a','r','\0'};
|
|
|
126 |
static const TText16 PropName_visibility[] = {'v','i','s','i','b','i','l','i','t','y','\0'};
|
|
|
127 |
static const TText16 PropName_caption_side[] = {'c','a','p','t','i','o','n','-','s','i','d','e','\0'};
|
|
|
128 |
static const TText16 PropName_line_height[] = {'l','i','n','e','-','h','e','i','g','h','t','\0'};
|
|
|
129 |
static const TText16 PropName_overflow[] = {'o','v','e','r','f','l','o','w','\0'};
|
|
|
130 |
static const TText16 PropName_accesskey[] = {'-','w','a','p','-','a','c','c','e','s','s','k','e','y','\0'};
|
|
|
131 |
static const TText16 PropName_marquee_style[] = {'-','w','a','p','-','m','a','r','q','u','e','e','-','s','t','y','l','e','\0'};
|
|
|
132 |
static const TText16 PropName_marquee_loop[] = {'-','w','a','p','-','m','a','r','q','u','e','e','-','l','o','o','p','\0'};
|
|
|
133 |
static const TText16 PropName_marquee_dir[] = {'-','w','a','p','-','m','a','r','q','u','e','e','-','d','i','r','\0'};
|
|
|
134 |
static const TText16 PropName_marquee_speed[] = {'-','w','a','p','-','m','a','r','q','u','e','e','-','s','p','e','e','d','\0'};
|
|
|
135 |
static const TText16 PropName_marquee_amount[] = {'-','x','y','z','-','m','a','r','q','u','e','e','-','a','m','o','u','n','t','\0'};
|
|
|
136 |
static const TText16 PropName_focus_behavior[] = {'-','x','y','z','-','f','o','c','u','s','-','b','e','h','a','v','i','o','r','\0'};
|
|
|
137 |
static const TText16 PropName_input_format[] = {'-','w','a','p','-','i','n','p','u','t','-','f','o','r','m','a','t','\0'};
|
|
|
138 |
static const TText16 PropName_input_required[] = {'-','w','a','p','-','i','n','p','u','t','-','r','e','q','u','i','r','e','d','\0'};
|
|
|
139 |
static const TText16 PropName_imode_quotes[] = {'-','x','y','z','-','i','m','o','d','e','-','q','u','o','t','e','s','\0'};
|
|
|
140 |
static const TText16 PropName_table_align[] = {'-','x','y','z','-','t','a','b','l','e','-','a','l','i','g','n','\0'};
|
|
|
141 |
static const TText16 PropName_noshade[] = {'-','x','y','z','-','n','o','s','h','a','d','e','\0'};
|
|
|
142 |
static const TText16 PropName_text_dir[] = {'d','i','r','e','c','t','i','o','n','\0'};
|
|
|
143 |
|
|
|
144 |
/* ------------------------------------------------------------------------- */
|
|
|
145 |
static const
|
|
|
146 |
TCSSPropertyTablePropEntry TCSSPropertyTablePropEntries[] =
|
|
|
147 |
{
|
|
|
148 |
{PropName_display, NW_CSS_Prop_display, TOKEN_MASK},
|
|
|
149 |
{PropName_border, NW_CSS_Prop_border, LENGTH_MASK | PERCENTAGE_MASK | COLOR_MASK | TOKEN_MASK },
|
|
|
150 |
{PropName_border_top, NW_CSS_Prop_borderTop, LENGTH_MASK | PERCENTAGE_MASK | COLOR_MASK | TOKEN_MASK },
|
|
|
151 |
{PropName_border_right, NW_CSS_Prop_borderRight, LENGTH_MASK | PERCENTAGE_MASK | COLOR_MASK | TOKEN_MASK },
|
|
|
152 |
{PropName_border_bottom, NW_CSS_Prop_borderBottom, LENGTH_MASK | PERCENTAGE_MASK | COLOR_MASK | TOKEN_MASK },
|
|
|
153 |
{PropName_border_left, NW_CSS_Prop_borderLeft, LENGTH_MASK | PERCENTAGE_MASK | COLOR_MASK | TOKEN_MASK },
|
|
|
154 |
{PropName_border_width, NW_CSS_Prop_borderWidth, LENGTH_MASK | PERCENTAGE_MASK },
|
|
|
155 |
{PropName_border_left_width, NW_CSS_Prop_leftBorderWidth, LENGTH_MASK | PERCENTAGE_MASK },
|
|
|
156 |
{PropName_border_right_width, NW_CSS_Prop_rightBorderWidth, LENGTH_MASK | PERCENTAGE_MASK },
|
|
|
157 |
{PropName_border_top_width, NW_CSS_Prop_topBorderWidth, LENGTH_MASK | PERCENTAGE_MASK },
|
|
|
158 |
{PropName_border_bottom_width, NW_CSS_Prop_bottomBorderWidth, LENGTH_MASK | PERCENTAGE_MASK },
|
|
|
159 |
{PropName_border_style, NW_CSS_Prop_borderStyle, TOKEN_MASK },
|
|
|
160 |
{PropName_border_left_style, NW_CSS_Prop_leftBorderStyle, TOKEN_MASK },
|
|
|
161 |
{PropName_border_right_style, NW_CSS_Prop_rightBorderStyle, TOKEN_MASK },
|
|
|
162 |
{PropName_border_top_style, NW_CSS_Prop_topBorderStyle, TOKEN_MASK },
|
|
|
163 |
{PropName_border_bottom_style, NW_CSS_Prop_bottomBorderStyle, TOKEN_MASK },
|
|
|
164 |
{PropName_border_color, NW_CSS_Prop_borderColor, COLOR_MASK | TOKEN_MASK },
|
|
|
165 |
{PropName_border_left_color, NW_CSS_Prop_leftBorderColor, COLOR_MASK | TOKEN_MASK },
|
|
|
166 |
{PropName_border_right_color, NW_CSS_Prop_rightBorderColor, COLOR_MASK | TOKEN_MASK },
|
|
|
167 |
{PropName_border_top_color, NW_CSS_Prop_topBorderColor, COLOR_MASK | TOKEN_MASK },
|
|
|
168 |
{PropName_border_bottom_color, NW_CSS_Prop_bottomBorderColor, COLOR_MASK | TOKEN_MASK },
|
|
|
169 |
{PropName_float, NW_CSS_Prop_float, TOKEN_MASK},
|
|
|
170 |
{PropName_font, NW_CSS_Prop_font, TOKEN_MASK | LENGTH_MASK | TEXT_MASK | PERCENTAGE_MASK},
|
|
|
171 |
{PropName_font_family, NW_CSS_Prop_fontFamily, TEXT_MASK},
|
|
|
172 |
{PropName_font_style, NW_CSS_Prop_fontStyle, TOKEN_MASK},
|
|
|
173 |
{PropName_font_variant, NW_CSS_Prop_fontVariant, TOKEN_MASK},
|
|
|
174 |
{PropName_font_size, NW_CSS_Prop_fontSize, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
175 |
{PropName_font_weight, NW_CSS_Prop_fontWeight, INTEGER_MASK },
|
|
|
176 |
{PropName_list_style, NW_CSS_Prop_listStyle, TOKEN_MASK | IMAGE_MASK },
|
|
|
177 |
{PropName_list_style_type, NW_CSS_Prop_listStyleType, TOKEN_MASK },
|
|
|
178 |
{PropName_list_style_image, NW_CSS_Prop_listStyleImage, TOKEN_MASK | IMAGE_MASK },
|
|
|
179 |
{PropName_list_margin, NW_CSS_Prop_listMargin, LENGTH_MASK | PERCENTAGE_MASK | TOKEN_MASK },
|
|
|
180 |
{PropName_noshade, NW_CSS_Prop_noshade, TOKEN_MASK },
|
|
|
181 |
{PropName_padding, NW_CSS_Prop_padding, LENGTH_MASK | PERCENTAGE_MASK },
|
|
|
182 |
{PropName_padding_left, NW_CSS_Prop_leftPadding, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
183 |
{PropName_padding_right, NW_CSS_Prop_rightPadding, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
184 |
{PropName_padding_top, NW_CSS_Prop_topPadding, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
185 |
{PropName_padding_bottom, NW_CSS_Prop_bottomPadding, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
186 |
{PropName_margin, NW_CSS_Prop_margin, LENGTH_MASK | PERCENTAGE_MASK | TOKEN_MASK },
|
|
|
187 |
{PropName_margin_left, NW_CSS_Prop_leftMargin, LENGTH_MASK | PERCENTAGE_MASK | TOKEN_MASK },
|
|
|
188 |
{PropName_margin_right, NW_CSS_Prop_rightMargin, LENGTH_MASK | PERCENTAGE_MASK | TOKEN_MASK },
|
|
|
189 |
{PropName_margin_top, NW_CSS_Prop_topMargin, LENGTH_MASK | PERCENTAGE_MASK | TOKEN_MASK },
|
|
|
190 |
{PropName_margin_bottom, NW_CSS_Prop_bottomMargin, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
191 |
{PropName_page_break_after, NW_CSS_Prop_pageBreakAfter, TOKEN_MASK},
|
|
|
192 |
{PropName_text_align, NW_CSS_Prop_textAlign, TOKEN_MASK},
|
|
|
193 |
{PropName_text_decoration, NW_CSS_Prop_textDecoration, TOKEN_MASK},
|
|
|
194 |
{PropName_text_indent, NW_CSS_Prop_textIndent, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
195 |
{PropName_text_transform, NW_CSS_Prop_textTransform, TOKEN_MASK},
|
|
|
196 |
{PropName_white_space, NW_CSS_Prop_whitespace, TOKEN_MASK},
|
|
|
197 |
{PropName_vertical_align, NW_CSS_Prop_verticalAlign, TOKEN_MASK | LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
198 |
{PropName_height, NW_CSS_Prop_height, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
199 |
{PropName_width, NW_CSS_Prop_width, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
200 |
{PropName_color, NW_CSS_Prop_color, COLOR_MASK},
|
|
|
201 |
{PropName_background, NW_CSS_Prop_background, COLOR_MASK | IMAGE_MASK},
|
|
|
202 |
{PropName_background_color, NW_CSS_Prop_backgroundColor, TOKEN_MASK | COLOR_MASK},
|
|
|
203 |
{PropName_background_image, NW_CSS_Prop_backgroundImage, TOKEN_MASK | IMAGE_MASK },
|
|
|
204 |
{PropName_background_repeat, NW_CSS_Prop_backgroundRepeat, TOKEN_MASK },
|
|
|
205 |
{PropName_background_attachment, NW_CSS_Prop_backgroundAttachment, TOKEN_MASK },
|
|
|
206 |
{PropName_background_position, NW_CSS_Prop_backgroundPosition, TOKEN_MASK | NUMBER_MASK | LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
207 |
{PropName_background_position_x, NW_CSS_Prop_backgroundPosition_x, TOKEN_MASK | NUMBER_MASK | LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
208 |
{PropName_background_position_y, NW_CSS_Prop_backgroundPosition_y, TOKEN_MASK | NUMBER_MASK | LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
209 |
{PropName_clear, NW_CSS_Prop_clear, TOKEN_MASK},
|
|
|
210 |
{PropName_visibility, NW_CSS_Prop_visibility, TOKEN_MASK},
|
|
|
211 |
{PropName_list_style_position, NW_CSS_Prop_listStylePosition, TOKEN_MASK},
|
|
|
212 |
{PropName_caption_side, NW_CSS_Prop_captionSide, TOKEN_MASK},
|
|
|
213 |
{PropName_line_height, NW_CSS_Prop_lineHeight, TOKEN_MASK | NUMBER_MASK | LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
214 |
{PropName_overflow, NW_CSS_Prop_overflow, TOKEN_MASK},
|
|
|
215 |
{PropName_accesskey, NW_CSS_Prop_accesskey, OBJECT_MASK},
|
|
|
216 |
{PropName_marquee_style, NW_CSS_Prop_marqueeStyle, TOKEN_MASK},
|
|
|
217 |
{PropName_marquee_loop, NW_CSS_Prop_marqueeLoop, INTEGER_MASK | TOKEN_MASK},
|
|
|
218 |
{PropName_marquee_dir, NW_CSS_Prop_marqueeDir, TOKEN_MASK},
|
|
|
219 |
{PropName_marquee_speed, NW_CSS_Prop_marqueeSpeed, TOKEN_MASK | INTEGER_MASK},
|
|
|
220 |
{PropName_marquee_amount, NW_CSS_Prop_marqueeAmount, LENGTH_MASK | PERCENTAGE_MASK},
|
|
|
221 |
{PropName_focus_behavior, NW_CSS_Prop_focusBehavior, TOKEN_MASK},
|
|
|
222 |
{PropName_input_format, NW_CSS_Prop_inputFormat, TEXT_MASK},
|
|
|
223 |
{PropName_input_required, NW_CSS_Prop_inputRequired, TOKEN_MASK},
|
|
|
224 |
{PropName_imode_quotes, NW_CSS_Prop_imodeQuotes, TEXT_MASK},
|
|
|
225 |
{PropName_table_align, NW_CSS_Prop_tableAlign, TOKEN_MASK},
|
|
|
226 |
{PropName_text_dir, NW_CSS_Prop_textDirection, TOKEN_MASK}
|
|
|
227 |
};
|
|
|
228 |
|
|
|
229 |
/* ------------------------------------------------------------------------- */
|
|
|
230 |
static const TText16 PropVal_none[] = {'n','o','n','e','\0'};
|
|
|
231 |
static const TText16 PropVal_left[] = {'l','e','f','t','\0'};
|
|
|
232 |
static const TText16 PropVal_right[] = {'r','i','g','h','t','\0'};
|
|
|
233 |
static const TText16 PropVal_normal[] = {'n','o','r','m','a','l','\0'};
|
|
|
234 |
|
|
|
235 |
static const TText16 PropVal_always[] = {'a','l','w','a','y','s','\0'};
|
|
|
236 |
static const TText16 PropVal_avoid[] = {'a','v','o','i','d','\0'};
|
|
|
237 |
static const TText16 PropVal_center[] = {'c','e','n','t','e','r','\0'};
|
|
|
238 |
static const TText16 PropVal_justify[] = {'j','u','s','t','i','f','y','\0'};
|
|
|
239 |
static const TText16 PropVal_underline[] = {'u','n','d','e','r','l','i','n','e','\0'};
|
|
|
240 |
static const TText16 PropVal_blink[] = {'b','l','i','n','k','\0'};
|
|
|
241 |
|
|
|
242 |
static const TText16 PropVal_top[] = {'t','o','p','\0'};
|
|
|
243 |
static const TText16 PropVal_bottom[] = {'b','o','t','t','o','m','\0'};
|
|
|
244 |
static const TText16 PropVal_baseline[] = {'b','a','s','e','l','i','n','e','\0'};
|
|
|
245 |
static const TText16 PropVal_sub[] = {'s','u','b','\0'};
|
|
|
246 |
static const TText16 PropVal_super[] = {'s','u','p','e','r','\0'};
|
|
|
247 |
static const TText16 PropVal_middle[] = {'m','i','d','d','l','e','\0'};
|
|
|
248 |
|
|
|
249 |
/* list-style-type properties */
|
|
|
250 |
static const TText16 PropVal_disc[] = {'d','i','s','c','\0'};
|
|
|
251 |
static const TText16 PropVal_circle[] = {'c','i','r','c','l','e','\0'};
|
|
|
252 |
static const TText16 PropVal_square[] = {'s','q','u','a','r','e','\0'};
|
|
|
253 |
static const TText16 PropVal_decimal[] = {'d','e','c','i','m','a','l','\0'};
|
|
|
254 |
static const TText16 PropVal_lowerRoman[] = {'l','o','w','e','r','-','r','o','m','a','n','\0'};
|
|
|
255 |
static const TText16 PropVal_upperRoman[] = {'u','p','p','e','r','-','r','o','m','a','n','\0'};
|
|
|
256 |
static const TText16 PropVal_lowerAlpha[] = {'l','o','w','e','r','-','a','l','p','h','a','\0'};
|
|
|
257 |
static const TText16 PropVal_upperAlpha[] = {'u','p','p','e','r','-','a','l','p','h','a','\0'};
|
|
|
258 |
|
|
|
259 |
/* additional prop vals */
|
|
|
260 |
static const TText16 PropVal_inherit[] = {'i','n','h','e','r','i','t','\0'};
|
|
|
261 |
static const TText16 PropVal_auto[] = {'a','u','t','o','\0'};
|
|
|
262 |
static const TText16 PropVal_both[] = {'b','o','t','h','\0'};
|
|
|
263 |
|
|
|
264 |
/* visibility prop vals */
|
|
|
265 |
static const TText16 PropVal_visible[] = {'v','i','s','i','b','l','e','\0'};
|
|
|
266 |
static const TText16 PropVal_hidden[] = {'h','i','d','d','e','n','\0'};
|
|
|
267 |
static const TText16 PropVal_collapse[] = {'c','o','l','l','a','p','s','e','\0'};
|
|
|
268 |
|
|
|
269 |
/* white-space prop vals */
|
|
|
270 |
static const TText16 PropVal_pre[] = {'p','r','e','\0'};
|
|
|
271 |
static const TText16 PropVal_nowrap[] = {'n','o','w','r','a','p','\0'};
|
|
|
272 |
|
|
|
273 |
/* text-transform prop vals */
|
|
|
274 |
static const TText16 PropVal_capitalize[] = {'c','a','p','i','t','a','l','i','z','e','\0'};
|
|
|
275 |
static const TText16 PropVal_uppercase[] = {'u','p','p','e','r','c','a','s','e','\0'};
|
|
|
276 |
static const TText16 PropVal_lowercase[] = {'l','o','w','e','r','c','a','s','e','\0'};
|
|
|
277 |
|
|
|
278 |
/* border-style vals */
|
|
|
279 |
static const TText16 PropVal_double[] = {'d','o','u','b','l','e','\0'};
|
|
|
280 |
static const TText16 PropVal_solid[] = {'s','o','l','i','d','\0'};
|
|
|
281 |
static const TText16 PropVal_dashed[] = {'d','a','s','h','e','d','\0'};
|
|
|
282 |
static const TText16 PropVal_dotted[] = {'d','o','t','t','e','d','\0'};
|
|
|
283 |
static const TText16 PropVal_ridge[] = {'r','i','d','g','e','\0'};
|
|
|
284 |
static const TText16 PropVal_groove[] = {'g','r','o','o','v','e','\0'};
|
|
|
285 |
static const TText16 PropVal_inset[] = {'i','n','s','e','t','\0'};
|
|
|
286 |
static const TText16 PropVal_outset[] = {'o','u','t','s','e','t','\0'};
|
|
|
287 |
|
|
|
288 |
/* border-width vals */
|
|
|
289 |
static const TText16 PropVal_thin[] = {'t','h','i','n','\0'};
|
|
|
290 |
static const TText16 PropVal_thick[] = {'t','h','i','c','k','\0'};
|
|
|
291 |
|
|
|
292 |
/* list position values */
|
|
|
293 |
static const TText16 PropVal_inside[] = {'i','n','s','i','d','e','\0'};
|
|
|
294 |
static const TText16 PropVal_outside[] = {'o','u','t','s','i','d','e','\0'};
|
|
|
295 |
|
|
|
296 |
/* background-color vals */
|
|
|
297 |
static const TText16 PropVal_transparent[] = {'t','r','a','n','s','p','a','r','e','n','t','\0'};
|
|
|
298 |
|
|
|
299 |
/* font-size prop vals */
|
|
|
300 |
const TText16 PropVal_xxSmall[] = {'x','x','-','s','m','a','l','l','\0'};
|
|
|
301 |
const TText16 PropVal_xSmall[] = {'x','-','s','m','a','l','l','\0'};
|
|
|
302 |
const TText16 PropVal_small[] = {'s','m','a','l','l','\0'};
|
|
|
303 |
const TText16 PropVal_xxLarge[] = {'x','x','-','l','a','r','g','e','\0'};
|
|
|
304 |
const TText16 PropVal_xLarge[] = {'x','-','l','a','r','g','e','\0'};
|
|
|
305 |
const TText16 PropVal_large[] = {'l','a','r','g','e','\0'};
|
|
|
306 |
const TText16 PropVal_smaller[] = {'s','m','a','l','l','e','r','\0'};
|
|
|
307 |
const TText16 PropVal_larger[] = {'l','a','r','g','e','r','\0'};
|
|
|
308 |
const TText16 PropVal_medium[] = {'m','e','d','i','u','m','\0'};
|
|
|
309 |
|
|
|
310 |
/* font-style prop vals */
|
|
|
311 |
static const TText16 PropVal_italic[] = {'i','t','a','l','i','c','\0'};
|
|
|
312 |
static const TText16 PropVal_oblique[] = {'o','b','l','i','q','u','e','\0'};
|
|
|
313 |
|
|
|
314 |
/* font-weight prop vals */
|
|
|
315 |
static const TText16 PropVal_bold[] = {'b','o','l','d','\0'};
|
|
|
316 |
static const TText16 PropVal_bolder[] = {'b','o','l','d','e','r','\0'};
|
|
|
317 |
static const TText16 PropVal_lighter[] = {'l','i','g','h','t','e','r','\0'};
|
|
|
318 |
|
|
|
319 |
/* font-variant prop vals */
|
|
|
320 |
static const TText16 PropVal_smallcaps[] = {'s','m','a','l','l','-','c','a','p','s','\0'};
|
|
|
321 |
|
|
|
322 |
/* color vals */
|
|
|
323 |
static const TText16 PropVal_aqua[] = {'a','q','u','a','\0'};
|
|
|
324 |
static const TText16 PropVal_black[] = {'b','l','a','c','k','\0'};
|
|
|
325 |
static const TText16 PropVal_blue[] = {'b','l','u','e','\0'};
|
|
|
326 |
static const TText16 PropVal_cyan[] = {'c','y','a','n','\0'};
|
|
|
327 |
static const TText16 PropVal_fuchsia[] = {'f','u','c','h','s','i','a','\0'};
|
|
|
328 |
static const TText16 PropVal_gray[] = {'g','r','a','y','\0'};
|
|
|
329 |
static const TText16 PropVal_green[] = {'g','r','e','e','n','\0'};
|
|
|
330 |
static const TText16 PropVal_lime[] = {'l','i','m','e','\0'};
|
|
|
331 |
static const TText16 PropVal_maroon[] = {'m','a','r','o','o','n','\0'};
|
|
|
332 |
static const TText16 PropVal_navy[] = {'n','a','v','y','\0'};
|
|
|
333 |
static const TText16 PropVal_olive[] = {'o','l','i','v','e','\0'};
|
|
|
334 |
static const TText16 PropVal_pink[] = {'p','i','n','k','\0'};
|
|
|
335 |
static const TText16 PropVal_purple[] = {'p','u','r','p','l','e','\0'};
|
|
|
336 |
static const TText16 PropVal_red[] = {'r','e','d','\0'};
|
|
|
337 |
static const TText16 PropVal_silver[] = {'s','i','l','v','e','r','\0'};
|
|
|
338 |
static const TText16 PropVal_teal[] = {'t','e','a','l','\0'};
|
|
|
339 |
static const TText16 PropVal_white[] = {'w','h','i','t','e','\0'};
|
|
|
340 |
static const TText16 PropVal_yellow[] = {'y','e','l','l','o','w','\0'};
|
|
|
341 |
|
|
|
342 |
/* marquee vals */
|
|
|
343 |
static const TText16 PropVal_scroll[] = {'s','c','r','o','l','l','\0'};
|
|
|
344 |
static const TText16 PropVal_slide[] = {'s','l','i','d','e','\0'};
|
|
|
345 |
static const TText16 PropVal_alternate[] = {'a','l','t','e','r','n','a','t','e','\0'};
|
|
|
346 |
static const TText16 PropVal_infinite[] = {'i','n','f','i','n','i','t','e','\0'};
|
|
|
347 |
static const TText16 PropVal_ltr[] = {'l','t','r','\0'};
|
|
|
348 |
static const TText16 PropVal_rtl[] = {'r','t','l','\0'};
|
|
|
349 |
static const TText16 PropVal_slow[] = {'s','l','o','w','\0'};
|
|
|
350 |
static const TText16 PropVal_fast[] = {'f','a','s','t','\0'};
|
|
|
351 |
|
|
|
352 |
/* display vals */
|
|
|
353 |
static const TText16 PropVal_inline[] = {'i','n','l','i','n','e','\0'};
|
|
|
354 |
static const TText16 PropVal_block[] = {'b','l','o','c','k','\0'};
|
|
|
355 |
static const TText16 PropVal_listItem[] = {'l','i','s','t','-','i','t','e','m','\0'};
|
|
|
356 |
static const TText16 PropVal_marquee[] = {'-','w','a','p','-','m','a','r','q','u','e','e','\0'};
|
|
|
357 |
|
|
|
358 |
/* Boolean values */
|
|
|
359 |
static const TText16 PropVal_true[] = {'t','r','u','e','\0'};
|
|
|
360 |
static const TText16 PropVal_false[] = {'f','a','l','s','e','\0'};
|
|
|
361 |
|
|
|
362 |
/* background-repeat values */
|
|
|
363 |
static const TText16 PropVal_background_repeat[] = {'r','e','p','e','a','t','\0'};
|
|
|
364 |
static const TText16 PropVal_background_repeat_x[] = {'r','e','p','e','a','t','-','x','\0'};
|
|
|
365 |
static const TText16 PropVal_background_repeat_y[] = {'r','e','p','e','a','t','-','y','\0'};
|
|
|
366 |
static const TText16 PropVal_background_norepeat[] = {'n','o','-','r','e','p','e','a','t','\0'};
|
|
|
367 |
|
|
|
368 |
/* background-attachment values */
|
|
|
369 |
static const TText16 PropVal_background_fixed[] = {'f','i','x','e','d','\0'};
|
|
|
370 |
|
|
|
371 |
/* ------------------------------------------------------------------------- */
|
|
|
372 |
static const
|
|
|
373 |
TCSSPropertyTablePropValEntry TCSSPropertyTablePropValEntries[] =
|
|
|
374 |
{
|
|
|
375 |
{PropVal_none, NW_CSS_PropValue_none},
|
|
|
376 |
{PropVal_left, NW_CSS_PropValue_left},
|
|
|
377 |
{PropVal_right, NW_CSS_PropValue_right},
|
|
|
378 |
{PropVal_normal, NW_CSS_PropValue_normal},
|
|
|
379 |
{PropVal_disc, NW_CSS_PropValue_disc},
|
|
|
380 |
{PropVal_circle, NW_CSS_PropValue_circle},
|
|
|
381 |
{PropVal_square, NW_CSS_PropValue_square},
|
|
|
382 |
{PropVal_decimal, NW_CSS_PropValue_decimal},
|
|
|
383 |
{PropVal_lowerRoman, NW_CSS_PropValue_lowerRoman},
|
|
|
384 |
{PropVal_upperRoman, NW_CSS_PropValue_upperRoman},
|
|
|
385 |
{PropVal_lowerAlpha, NW_CSS_PropValue_lowerAlpha},
|
|
|
386 |
{PropVal_upperAlpha, NW_CSS_PropValue_upperAlpha},
|
|
|
387 |
{PropVal_always, NW_CSS_PropValue_always},
|
|
|
388 |
{PropVal_avoid, NW_CSS_PropValue_avoid},
|
|
|
389 |
{PropVal_center, NW_CSS_PropValue_center},
|
|
|
390 |
{PropVal_justify, NW_CSS_PropValue_justify},
|
|
|
391 |
{PropVal_underline, NW_CSS_PropValue_underline},
|
|
|
392 |
{PropVal_blink, NW_CSS_PropValue_blink},
|
|
|
393 |
{PropVal_top, NW_CSS_PropValue_top},
|
|
|
394 |
{PropVal_bottom, NW_CSS_PropValue_bottom},
|
|
|
395 |
{PropVal_sub, NW_CSS_PropValue_sub},
|
|
|
396 |
{PropVal_super, NW_CSS_PropValue_super},
|
|
|
397 |
{PropVal_baseline, NW_CSS_PropValue_baseline},
|
|
|
398 |
{PropVal_middle, NW_CSS_PropValue_middle},
|
|
|
399 |
{PropVal_inherit, NW_CSS_PropValue_inherit},
|
|
|
400 |
{PropVal_auto, NW_CSS_PropValue_auto},
|
|
|
401 |
{PropVal_both, NW_CSS_PropValue_both},
|
|
|
402 |
{PropVal_visible, NW_CSS_PropValue_visible},
|
|
|
403 |
{PropVal_hidden, NW_CSS_PropValue_hidden},
|
|
|
404 |
{PropVal_collapse, NW_CSS_PropValue_collapse},
|
|
|
405 |
{PropVal_pre, NW_CSS_PropValue_pre},
|
|
|
406 |
{PropVal_nowrap, NW_CSS_PropValue_nowrap},
|
|
|
407 |
{PropVal_capitalize, NW_CSS_PropValue_capitalize},
|
|
|
408 |
{PropVal_uppercase, NW_CSS_PropValue_uppercase},
|
|
|
409 |
{PropVal_lowercase, NW_CSS_PropValue_lowercase},
|
|
|
410 |
{PropVal_solid, NW_CSS_PropValue_solid},
|
|
|
411 |
{PropVal_double, NW_CSS_PropValue_solid}, /* Not supported */
|
|
|
412 |
{PropVal_dashed, NW_CSS_PropValue_dashed},
|
|
|
413 |
{PropVal_dotted, NW_CSS_PropValue_dotted},
|
|
|
414 |
{PropVal_ridge, NW_CSS_PropValue_solid}, /* Not supported */
|
|
|
415 |
{PropVal_groove, NW_CSS_PropValue_solid}, /* Not supported */
|
|
|
416 |
{PropVal_inset, NW_CSS_PropValue_solid}, /* Not supported */
|
|
|
417 |
{PropVal_outset, NW_CSS_PropValue_solid}, /* Not supported */
|
|
|
418 |
{PropVal_xxSmall, NW_CSS_PropValue_xxSmall},
|
|
|
419 |
{PropVal_xSmall, NW_CSS_PropValue_xSmall},
|
|
|
420 |
{PropVal_small, NW_CSS_PropValue_small},
|
|
|
421 |
{PropVal_xxLarge, NW_CSS_PropValue_xxLarge},
|
|
|
422 |
{PropVal_xLarge, NW_CSS_PropValue_xLarge},
|
|
|
423 |
{PropVal_large, NW_CSS_PropValue_large},
|
|
|
424 |
{PropVal_smaller, NW_CSS_PropValue_smaller},
|
|
|
425 |
{PropVal_larger, NW_CSS_PropValue_larger},
|
|
|
426 |
{PropVal_medium, NW_CSS_PropValue_medium},
|
|
|
427 |
{PropVal_thin, NW_CSS_PropValue_thin},
|
|
|
428 |
{PropVal_thick, NW_CSS_PropValue_thick},
|
|
|
429 |
{PropVal_bold, NW_CSS_PropValue_bold},
|
|
|
430 |
{PropVal_bolder, NW_CSS_PropValue_bolder},
|
|
|
431 |
{PropVal_lighter, NW_CSS_PropValue_lighter},
|
|
|
432 |
{PropVal_italic, NW_CSS_PropValue_italic},
|
|
|
433 |
{PropVal_oblique, NW_CSS_PropValue_oblique},
|
|
|
434 |
{PropVal_smallcaps, NW_CSS_PropValue_smallcaps},
|
|
|
435 |
{PropVal_inside, NW_CSS_PropValue_inside},
|
|
|
436 |
{PropVal_outside, NW_CSS_PropValue_outside},
|
|
|
437 |
{PropVal_transparent, NW_CSS_PropValue_transparent},
|
|
|
438 |
{PropVal_aqua, NW_CSS_PropValue_aqua},
|
|
|
439 |
{PropVal_black, NW_CSS_PropValue_black},
|
|
|
440 |
{PropVal_blue, NW_CSS_PropValue_blue},
|
|
|
441 |
{PropVal_cyan, NW_CSS_PropValue_cyan},
|
|
|
442 |
{PropVal_fuchsia, NW_CSS_PropValue_fuchsia},
|
|
|
443 |
{PropVal_gray, NW_CSS_PropValue_gray},
|
|
|
444 |
{PropVal_green, NW_CSS_PropValue_green},
|
|
|
445 |
{PropVal_lime, NW_CSS_PropValue_lime},
|
|
|
446 |
{PropVal_maroon, NW_CSS_PropValue_maroon},
|
|
|
447 |
{PropVal_navy, NW_CSS_PropValue_navy},
|
|
|
448 |
{PropVal_olive, NW_CSS_PropValue_olive},
|
|
|
449 |
{PropVal_pink, NW_CSS_PropValue_pink},
|
|
|
450 |
{PropVal_purple, NW_CSS_PropValue_purple},
|
|
|
451 |
{PropVal_red, NW_CSS_PropValue_red},
|
|
|
452 |
{PropVal_silver, NW_CSS_PropValue_silver},
|
|
|
453 |
{PropVal_teal, NW_CSS_PropValue_teal},
|
|
|
454 |
{PropVal_white, NW_CSS_PropValue_white},
|
|
|
455 |
{PropVal_yellow, NW_CSS_PropValue_yellow},
|
|
|
456 |
{PropVal_scroll, NW_CSS_PropValue_scroll},
|
|
|
457 |
{PropVal_slide, NW_CSS_PropValue_slide},
|
|
|
458 |
{PropVal_alternate, NW_CSS_PropValue_alternate},
|
|
|
459 |
{PropVal_infinite, NW_CSS_PropValue_infinite},
|
|
|
460 |
{PropVal_ltr, NW_CSS_PropValue_ltr},
|
|
|
461 |
{PropVal_rtl, NW_CSS_PropValue_rtl},
|
|
|
462 |
{PropVal_slow, NW_CSS_PropValue_slow},
|
|
|
463 |
{PropVal_fast, NW_CSS_PropValue_fast},
|
|
|
464 |
{PropVal_inline, NW_CSS_PropValue_display_inline},
|
|
|
465 |
{PropVal_block, NW_CSS_PropValue_display_block},
|
|
|
466 |
{PropVal_listItem, NW_CSS_PropValue_display_listItem},
|
|
|
467 |
{PropVal_marquee, NW_CSS_PropValue_display_marquee},
|
|
|
468 |
{PropVal_background_repeat, NW_CSS_PropValue_background_repeat},
|
|
|
469 |
{PropVal_background_repeat_x, NW_CSS_PropValue_background_repeat_x},
|
|
|
470 |
{PropVal_background_repeat_y, NW_CSS_PropValue_background_repeat_y},
|
|
|
471 |
{PropVal_background_norepeat, NW_CSS_PropValue_background_norepeat},
|
|
|
472 |
{PropVal_background_fixed, NW_CSS_PropValue_background_fixed },
|
|
|
473 |
{PropVal_true, NW_CSS_PropValue_true},
|
|
|
474 |
{PropVal_false, NW_CSS_PropValue_false}
|
|
|
475 |
};
|
|
|
476 |
|
|
|
477 |
/* ------------------------------------------------------------------------- */
|
|
|
478 |
/*
|
|
|
479 |
These values are used to create value type strings for debug purposes. If it is
|
|
|
480 |
obvious from the context( e.g. color) a null string will b used
|
|
|
481 |
*/
|
|
|
482 |
static const TText16 ValueType_Integer[] = {'\0'};
|
|
|
483 |
static const TText16 ValueType_Number[] = {'(','n','u','m','b','e','r',')','\0'};
|
|
|
484 |
static const TText16 ValueType_Px[] = {'p','x','\0'};
|
|
|
485 |
static const TText16 ValueType_Em[] = {'e','m','\0'};
|
|
|
486 |
static const TText16 ValueType_Ex[] = {'e','x','\0'};
|
|
|
487 |
static const TText16 ValueType_In[] = {'i','n','\0'};
|
|
|
488 |
static const TText16 ValueType_Cm[] = {'c','m','\0'};
|
|
|
489 |
static const TText16 ValueType_Mm[] = {'m','m','\0'};
|
|
|
490 |
static const TText16 ValueType_Pt[] = {'p','t','\0'};
|
|
|
491 |
static const TText16 ValueType_Pc[] = {'p','c','\0'};
|
|
|
492 |
static const TText16 ValueType_Percentage[] = {'%','\0'};
|
|
|
493 |
static const TText16 ValueType_Token[] = {'\0'};
|
|
|
494 |
static const TText16 ValueType_Color[] = {'\0'};
|
|
|
495 |
static const TText16 ValueType_Object[] = {'(','o','b','j','e','c','t',')','\0'};
|
|
|
496 |
static const TText16 ValueType_Text[] = {'\0'};
|
|
|
497 |
static const TText16 ValueType_Image[] = {'(','i','m','a','g','e',')','\0'};
|
|
|
498 |
static const TText16 ValueType_Font[] = {'(','f','o','n','t',')','\0'};
|
|
|
499 |
static const TText16 ValueType_Copy[] = {'(','c','o','p','y',')','\0'};
|
|
|
500 |
static const TText16 ValueType_DefaultStyle[] = {'(','d','e','f','a','u','l','t','S','t','y','l','e',')','\0'};
|
|
|
501 |
static const TText16 ValueType_Mask[] = {'(','m','a','s','k',')','\0'};
|
|
|
502 |
|
|
|
503 |
// MODULE DATA STRUCTURES
|
|
|
504 |
|
|
|
505 |
// FORWARD DECLARATIONS
|
|
|
506 |
|
|
|
507 |
// LOCAL FUNCTION PROTOTYPES
|
|
|
508 |
|
|
|
509 |
// FORWARD DECLARATIONS
|
|
|
510 |
|
|
|
511 |
// ============================= LOCAL FUNCTIONS ===============================
|
|
|
512 |
|
|
|
513 |
|
|
|
514 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
|
515 |
|
|
|
516 |
const TCSSPropertyTablePropEntry*
|
|
|
517 |
TCSSPropertyTable::GetPropertyEntry(const TText16* aStrName)
|
|
|
518 |
{
|
|
|
519 |
TUint32 numPropertyNames = sizeof(TCSSPropertyTablePropEntries)/sizeof(TCSSPropertyTablePropEntry);
|
|
|
520 |
const TCSSPropertyTablePropEntry* propertyNames = TCSSPropertyTablePropEntries;
|
|
|
521 |
|
|
|
522 |
TUint32 length = (NW_Str_Strlen(aStrName)+1)*2;
|
|
|
523 |
|
|
|
524 |
/* traverse our list of token entries looking for a match for our token */
|
|
|
525 |
for (TUint32 index = 0; index < numPropertyNames; index++)
|
|
|
526 |
{
|
|
|
527 |
if(!NW_Str_Strnicmp(aStrName, propertyNames[index].strName, length))
|
|
|
528 |
{
|
|
|
529 |
return &(propertyNames[index]);
|
|
|
530 |
}
|
|
|
531 |
}
|
|
|
532 |
/* if no token entry is found we must return 0 */
|
|
|
533 |
return NULL;
|
|
|
534 |
}
|
|
|
535 |
|
|
|
536 |
/* ------------------------------------------------------------------------- */
|
|
|
537 |
TBool
|
|
|
538 |
TCSSPropertyTable::GetPropertyValToken(const TText16* aVal,
|
|
|
539 |
NW_LMgr_PropertyValueToken_t *aToken)
|
|
|
540 |
{
|
|
|
541 |
TUint32 numPropertyVals = sizeof(TCSSPropertyTablePropValEntries)/sizeof(TCSSPropertyTablePropValEntry);
|
|
|
542 |
const TCSSPropertyTablePropValEntry* propertyVals = TCSSPropertyTablePropValEntries;
|
|
|
543 |
|
|
|
544 |
TUint32 length = (NW_Str_Strlen(aVal)+1)*2;
|
|
|
545 |
|
|
|
546 |
/* traverse our list of token entries looking for a match for our token */
|
|
|
547 |
for (TUint32 index = 0; index < numPropertyVals; index++)
|
|
|
548 |
{
|
|
|
549 |
if(!NW_Str_Strnicmp(aVal, propertyVals[index].strVal, length))
|
|
|
550 |
{
|
|
|
551 |
*aToken = propertyVals[index].tokenVal;
|
|
|
552 |
return ETrue;
|
|
|
553 |
}
|
|
|
554 |
}
|
|
|
555 |
/* if no token entry is found we must return NOT_FOUND */
|
|
|
556 |
return EFalse;
|
|
|
557 |
}
|
|
|
558 |
|
|
|
559 |
/* ------------------------------------------------------------------------- */
|
|
|
560 |
const TCSSPropertyTablePropEntry*
|
|
|
561 |
TCSSPropertyTable::GetPropEntryByToken(NW_LMgr_PropertyName_t aTokenName)
|
|
|
562 |
{
|
|
|
563 |
TUint32 numPropertyNames = sizeof(TCSSPropertyTablePropEntries)/sizeof(TCSSPropertyTablePropEntry);
|
|
|
564 |
const TCSSPropertyTablePropEntry* propertyNames = TCSSPropertyTablePropEntries;
|
|
|
565 |
|
|
|
566 |
/* traverse our list of token entries looking for a match for our token */
|
|
|
567 |
for (TUint32 index = 0; index < numPropertyNames; index++)
|
|
|
568 |
{
|
|
|
569 |
if (propertyNames[index].tokenName == aTokenName)
|
|
|
570 |
{
|
|
|
571 |
return &(propertyNames[index]);
|
|
|
572 |
}
|
|
|
573 |
}
|
|
|
574 |
/* if no token entry is found we must return 0 */
|
|
|
575 |
return NULL;
|
|
|
576 |
}
|
|
|
577 |
|
|
|
578 |
/* ------------------------------------------------------------------------- */
|
|
|
579 |
const TCSSPropertyTablePropValEntry*
|
|
|
580 |
TCSSPropertyTable::GetPropValEntryByToken(NW_LMgr_PropertyValueToken_t aTokenVal)
|
|
|
581 |
{
|
|
|
582 |
TUint32 numValueNames = sizeof(TCSSPropertyTablePropValEntries)/sizeof(TCSSPropertyTablePropValEntry);
|
|
|
583 |
const TCSSPropertyTablePropValEntry* valueNames = TCSSPropertyTablePropValEntries;
|
|
|
584 |
|
|
|
585 |
/* traverse our list of token entries looking for a match for our token */
|
|
|
586 |
for (TUint32 index = 0; index < numValueNames; index++)
|
|
|
587 |
{
|
|
|
588 |
if (valueNames[index].tokenVal == aTokenVal)
|
|
|
589 |
{
|
|
|
590 |
return &(valueNames[index]);
|
|
|
591 |
}
|
|
|
592 |
}
|
|
|
593 |
/* if no token entry is found we must return 0 */
|
|
|
594 |
return NULL;
|
|
|
595 |
}
|
|
|
596 |
|
|
|
597 |
|
|
|
598 |
/* ------------------------------------------------------------------------- */
|
|
|
599 |
const TText16*
|
|
|
600 |
TCSSPropertyTable::GetPropValType(TUint8 aValueType)
|
|
|
601 |
{
|
|
|
602 |
switch (aValueType){
|
|
|
603 |
|
|
|
604 |
case NW_CSS_ValueType_Integer: // integer
|
|
|
605 |
return ValueType_Integer;
|
|
|
606 |
case NW_CSS_ValueType_Number: // decimal
|
|
|
607 |
return ValueType_Number;
|
|
|
608 |
case NW_CSS_ValueType_Px: // integer
|
|
|
609 |
return ValueType_Px;
|
|
|
610 |
case NW_CSS_ValueType_Em: // decimal
|
|
|
611 |
return ValueType_Em;
|
|
|
612 |
case NW_CSS_ValueType_Ex: // decimal
|
|
|
613 |
return ValueType_Ex;
|
|
|
614 |
case NW_CSS_ValueType_In: // decimal
|
|
|
615 |
return ValueType_In;
|
|
|
616 |
case NW_CSS_ValueType_Cm: // decimal
|
|
|
617 |
return ValueType_Cm;
|
|
|
618 |
case NW_CSS_ValueType_Mm: // decimal
|
|
|
619 |
return ValueType_Mm;
|
|
|
620 |
case NW_CSS_ValueType_Pt: // decimal
|
|
|
621 |
return ValueType_Pt;
|
|
|
622 |
case NW_CSS_ValueType_Pc: // decimal
|
|
|
623 |
return ValueType_Pc;
|
|
|
624 |
case NW_CSS_ValueType_Percentage: // decimal
|
|
|
625 |
return ValueType_Percentage;
|
|
|
626 |
case NW_CSS_ValueType_Token: // integer
|
|
|
627 |
return ValueType_Token;
|
|
|
628 |
case NW_CSS_ValueType_Color: // integer
|
|
|
629 |
return ValueType_Color;
|
|
|
630 |
case NW_CSS_ValueType_Object: // object
|
|
|
631 |
return ValueType_Object;
|
|
|
632 |
case NW_CSS_ValueType_Text: // object
|
|
|
633 |
return ValueType_Text;
|
|
|
634 |
case NW_CSS_ValueType_Image: // object
|
|
|
635 |
return ValueType_Image;
|
|
|
636 |
case NW_CSS_ValueType_Font: // object
|
|
|
637 |
return ValueType_Font;
|
|
|
638 |
case NW_CSS_ValueType_Copy: // N/A
|
|
|
639 |
return ValueType_Copy;
|
|
|
640 |
case NW_CSS_ValueType_DefaultStyle://N/A
|
|
|
641 |
return ValueType_DefaultStyle;
|
|
|
642 |
case NW_CSS_ValueType_Mask: // N/A
|
|
|
643 |
return ValueType_Mask;
|
|
|
644 |
default: // invalid entry
|
|
|
645 |
return NULL;
|
|
|
646 |
}
|
|
|
647 |
}
|
|
|
648 |
|
|
|
649 |
|
|
|
650 |
|
|
|
651 |
|
|
|
652 |
#undef PX_MASK
|
|
|
653 |
#undef EM_MASK
|
|
|
654 |
#undef EX_MASK
|
|
|
655 |
#undef IN_MASK
|
|
|
656 |
#undef CM_MASK
|
|
|
657 |
#undef MM_MASK
|
|
|
658 |
#undef PT_MASK
|
|
|
659 |
#undef PC_MASK
|
|
|
660 |
#undef LENGTH_MASK
|
|
|
661 |
#undef PERCENTAGE_MASK
|
|
|
662 |
#undef COLOR_MASK
|
|
|
663 |
#undef TOKEN_MASK
|
|
|
664 |
#undef TEXT_MASK
|
|
|
665 |
#undef IMAGE_MASK
|
|
|
666 |
|