Lines Matching refs:attributes

220 bool Svg2PictureView::HasAttribute(const XML_Char **attributes, const char *name) {

221 while (*attributes && strcasecmp(*attributes, name) != 0)
222 attributes += 2;
224 return (*attributes);
227 float Svg2PictureView::GetFloatAttribute(const XML_Char **attributes, const char *name) {
228 while (*attributes && strcasecmp(*attributes, name) != 0)
229 attributes += 2;
231 if (*attributes)
232 return atof(*(attributes + 1));
237 const char *Svg2PictureView::GetStringAttribute(const XML_Char **attributes, const char *name) {
238 while (*attributes && strcasecmp(*attributes, name) != 0)
239 attributes += 2;
241 if (*attributes)
242 return *(attributes + 1);
247 rgb_color Svg2PictureView::GetColorAttribute(const XML_Char **attributes, const char *name, uint8 alpha) {
248 const char *attr = GetStringAttribute(attributes, name);
327 void Svg2PictureView::GetPolygonAttribute(const XML_Char **attributes, const char *name, BShape &shape) {
330 while (*attributes && strcasecmp(*attributes, name) != 0)
331 attributes += 2;
333 if (*attributes)
334 attr = *(attributes + 1);
373 void Svg2PictureView::GetMatrixAttribute(const XML_Char **attributes, const char *name, BMatrix *matrix) {
376 while (*attributes && strcasecmp(*attributes, name) != 0)
377 attributes += 2;
379 if (*attributes)
380 attr = *(attributes + 1);
474 void Svg2PictureView::GetShapeAttribute(const XML_Char **attributes, const char *name, BShape &shape) {
475 const char *attr = GetStringAttribute(attributes, name);
873 void Svg2PictureView::CheckAttributes(const XML_Char **attributes) {
876 if (HasAttribute(attributes, "opacity")) {
877 float opacity = GetFloatAttribute(attributes, "opacity");
884 if (HasAttribute(attributes, "color")) {
885 fState.fCurrentColor = GetColorAttribute(attributes, "color", fState.fCurrentColor.alpha);
888 if (HasAttribute(attributes, "stroke")) {
889 const char *stroke = GetStringAttribute(attributes, "stroke");
897 fState.fStrokeColor = GetColorAttribute(attributes, "stroke", fState.fFillColor.alpha);
904 if (HasAttribute(attributes, "stroke-opacity")) {
905 fState.fStrokeColor.alpha = (uint8)(GetFloatAttribute(attributes, "stroke-opacity") * alpha);
909 if (HasAttribute(attributes, "fill")) {
910 const char *fill = GetStringAttribute(attributes, "fill");
918 fState.fFillColor = GetColorAttribute(attributes, "fill", fState.fFillColor.alpha);
924 if (HasAttribute(attributes, "fill-opacity")) {
925 fState.fFillColor.alpha = (uint8)(GetFloatAttribute(attributes, "fill-opacity") * alpha);
929 if (HasAttribute(attributes, "stroke-width")) {
930 fState.fStrokeWidth = GetFloatAttribute(attributes, "stroke-width");
935 if (HasAttribute(attributes, "stroke-linecap")) {
936 const char *stroke_linecap = GetStringAttribute(attributes, "stroke-linecap");
949 if (HasAttribute(attributes, "stroke-linejoin")) {
950 const char *stroke_linejoin = GetStringAttribute(attributes, "stroke-linejoin");
963 if (HasAttribute(attributes, "stroke-miterlimit")) {
964 fState.fLineMiterLimit = GetFloatAttribute(attributes, "stroke-miterlimit");
969 if (HasAttribute(attributes, "font-size")) {
970 fState.fFontSize = GetFloatAttribute(attributes, "font-size");
975 if (HasAttribute(attributes, "transform")) {
977 GetMatrixAttribute(attributes, "transform", &matrix);
983 void Svg2PictureView::StartElement(const XML_Char *name, const XML_Char **attributes) {
985 CheckAttributes(attributes);
988 BPoint c(GetFloatAttribute(attributes, "cx"), GetFloatAttribute(attributes, "cy"));
989 float r = GetFloatAttribute(attributes, "r");
1000 BPoint c(GetFloatAttribute(attributes, "cx"), GetFloatAttribute(attributes, "cy"));
1001 float rx = GetFloatAttribute(attributes, "rx");
1002 float ry = GetFloatAttribute(attributes, "ry");
1013 BPoint topLeft(GetFloatAttribute(attributes, "x"), GetFloatAttribute(attributes, "y"));
1014 BPoint bottomRight(topLeft.x + GetFloatAttribute(attributes, "width"),
1015 topLeft.y + GetFloatAttribute(attributes, "height"));
1020 const char *href = GetStringAttribute(attributes, "xlink:href");
1032 BPoint from(GetFloatAttribute(attributes, "x1"), GetFloatAttribute(attributes, "y1"));
1033 BPoint to(GetFloatAttribute(attributes, "x2"), GetFloatAttribute(attributes, "y2"));
1043 fGradient->name = strdup(GetStringAttribute(attributes, "id"));
1052 GetShapeAttribute(attributes, "d", shape);
1065 GetPolygonAttribute(attributes, "points", shape);
1079 GetPolygonAttribute(attributes, "points", shape);
1093 fGradient->name = strdup(GetStringAttribute(attributes, "id"));
1101 rgb_color color = GetColorAttribute(attributes, "stop-color", 255);
1118 points[0].x = points[3].x = GetFloatAttribute(attributes, "x");
1119 points[0].y= points[1].y = GetFloatAttribute(attributes, "y");
1120 points[1].x = points[2].x = points[0].x + GetFloatAttribute(attributes, "width");
1121 points[2].y = points[3].y = points[0].y + GetFloatAttribute(attributes, "height");
1183 fTextPosition.Set(GetFloatAttribute(attributes, "x"), GetFloatAttribute(attributes, "y"));
1257 void Svg2PictureView::_StartElement(Svg2PictureView *view, const XML_Char *name, const XML_Char **attributes) {
1258 view->StartElement(name, attributes);