Lines Matching refs:attributes

221 bool Svg2PictureView::HasAttribute(const XML_Char **attributes, const char *name) {
222 while (*attributes && strcasecmp(*attributes, name) != 0)
223 attributes += 2;
225 return (*attributes);
228 float Svg2PictureView::GetFloatAttribute(const XML_Char **attributes, const char *name) {
229 while (*attributes && strcasecmp(*attributes, name) != 0)
230 attributes += 2;
232 if (*attributes)
233 return atof(*(attributes + 1));
238 const char *Svg2PictureView::GetStringAttribute(const XML_Char **attributes, const char *name) {
239 while (*attributes && strcasecmp(*attributes, name) != 0)
240 attributes += 2;
242 if (*attributes)
243 return *(attributes + 1);
248 rgb_color Svg2PictureView::GetColorAttribute(const XML_Char **attributes, const char *name, uint8 alpha) {
249 const char *attr = GetStringAttribute(attributes, name);
328 void Svg2PictureView::GetPolygonAttribute(const XML_Char **attributes, const char *name, BShape &shape) {
331 while (*attributes && strcasecmp(*attributes, name) != 0)
332 attributes += 2;
334 if (*attributes)
335 attr = *(attributes + 1);
374 void Svg2PictureView::GetMatrixAttribute(const XML_Char **attributes, const char *name, BMatrix *matrix) {
377 while (*attributes && strcasecmp(*attributes, name) != 0)
378 attributes += 2;
380 if (*attributes)
381 attr = *(attributes + 1);
475 void Svg2PictureView::GetShapeAttribute(const XML_Char **attributes, const char *name, BShape &shape) {
476 const char *attr = GetStringAttribute(attributes, name);
874 void Svg2PictureView::CheckAttributes(const XML_Char **attributes) {
877 if (HasAttribute(attributes, "opacity")) {
878 float opacity = GetFloatAttribute(attributes, "opacity");
885 if (HasAttribute(attributes, "color")) {
886 fState.fCurrentColor = GetColorAttribute(attributes, "color", fState.fCurrentColor.alpha);
889 if (HasAttribute(attributes, "stroke")) {
890 const char *stroke = GetStringAttribute(attributes, "stroke");
898 fState.fStrokeColor = GetColorAttribute(attributes, "stroke", fState.fFillColor.alpha);
905 if (HasAttribute(attributes, "stroke-opacity")) {
906 fState.fStrokeColor.alpha = (uint8)(GetFloatAttribute(attributes, "stroke-opacity") * alpha);
910 if (HasAttribute(attributes, "fill")) {
911 const char *fill = GetStringAttribute(attributes, "fill");
919 fState.fFillColor = GetColorAttribute(attributes, "fill", fState.fFillColor.alpha);
925 if (HasAttribute(attributes, "fill-opacity")) {
926 fState.fFillColor.alpha = (uint8)(GetFloatAttribute(attributes, "fill-opacity") * alpha);
930 if (HasAttribute(attributes, "stroke-width")) {
931 fState.fStrokeWidth = GetFloatAttribute(attributes, "stroke-width");
936 if (HasAttribute(attributes, "stroke-linecap")) {
937 const char *stroke_linecap = GetStringAttribute(attributes, "stroke-linecap");
950 if (HasAttribute(attributes, "stroke-linejoin")) {
951 const char *stroke_linejoin = GetStringAttribute(attributes, "stroke-linejoin");
964 if (HasAttribute(attributes, "stroke-miterlimit")) {
965 fState.fLineMiterLimit = GetFloatAttribute(attributes, "stroke-miterlimit");
970 if (HasAttribute(attributes, "font-size")) {
971 fState.fFontSize = GetFloatAttribute(attributes, "font-size");
976 if (HasAttribute(attributes, "transform")) {
978 GetMatrixAttribute(attributes, "transform", &matrix);
984 void Svg2PictureView::StartElement(const XML_Char *name, const XML_Char **attributes) {
986 CheckAttributes(attributes);
989 BPoint c(GetFloatAttribute(attributes, "cx"), GetFloatAttribute(attributes, "cy"));
990 float r = GetFloatAttribute(attributes, "r");
1001 BPoint c(GetFloatAttribute(attributes, "cx"), GetFloatAttribute(attributes, "cy"));
1002 float rx = GetFloatAttribute(attributes, "rx");
1003 float ry = GetFloatAttribute(attributes, "ry");
1014 BPoint topLeft(GetFloatAttribute(attributes, "x"), GetFloatAttribute(attributes, "y"));
1015 BPoint bottomRight(topLeft.x + GetFloatAttribute(attributes, "width"),
1016 topLeft.y + GetFloatAttribute(attributes, "height"));
1021 const char *href = GetStringAttribute(attributes, "xlink:href");
1033 BPoint from(GetFloatAttribute(attributes, "x1"), GetFloatAttribute(attributes, "y1"));
1034 BPoint to(GetFloatAttribute(attributes, "x2"), GetFloatAttribute(attributes, "y2"));
1044 fGradient->name = strdup(GetStringAttribute(attributes, "id"));
1053 GetShapeAttribute(attributes, "d", shape);
1066 GetPolygonAttribute(attributes, "points", shape);
1080 GetPolygonAttribute(attributes, "points", shape);
1094 fGradient->name = strdup(GetStringAttribute(attributes, "id"));
1102 rgb_color color = GetColorAttribute(attributes, "stop-color", 255);
1119 points[0].x = points[3].x = GetFloatAttribute(attributes, "x");
1120 points[0].y= points[1].y = GetFloatAttribute(attributes, "y");
1121 points[1].x = points[2].x = points[0].x + GetFloatAttribute(attributes, "width");
1122 points[2].y = points[3].y = points[0].y + GetFloatAttribute(attributes, "height");
1184 fTextPosition.Set(GetFloatAttribute(attributes, "x"), GetFloatAttribute(attributes, "y"));
1258 void Svg2PictureView::_StartElement(Svg2PictureView *view, const XML_Char *name, const XML_Char **attributes) {
1259 view->StartElement(name, attributes);