| 55 | textFaces textFace[4]; //0-help 1-message 2-menu 3-test, far future it will be infinite list with id |
| 56 | |
| 57 | EFI_STATUS XTheme::ParseSVGXIcon(INTN Id, const XString8& IconNameX, OUT XImage* Image, OUT void **SVGIcon) |
| 58 | { |
| 59 | EFI_STATUS Status = EFI_NOT_FOUND; |
| 60 | NSVGimage *SVGimage; |
| 61 | NSVGparser *p = (NSVGparser *)SVGParser; |
| 62 | NSVGrasterizer* rast = nsvgCreateRasterizer(); |
| 63 | SVGimage = p->image; |
| 64 | NSVGshape *shape; |
| 65 | NSVGgroup *group; |
| 66 | NSVGimage *IconImage; |
| 67 | NSVGshape *shapeNext, *shapesTail = NULL, *shapePrev; |
| 68 | |
| 69 | NSVGparser* p2 = nsvg__createParser(); |
| 70 | IconImage = p2->image; |
| 71 | shape = SVGimage->shapes; |
| 72 | shapePrev = NULL; |
| 73 | while (shape) { |
| 74 | group = shape->group; |
| 75 | shapeNext = shape->next; |
| 76 | while (group) { |
| 77 | if (strcmp(group->id, IconNameX.c_str()) == 0) { |
| 78 | break; |
| 79 | } |
| 80 | group = group->next; |
| 81 | } |
| 82 | if (group) { //the shape is in the group |
| 83 | // keep this sample for debug purpose |
| 84 | /* DBG("found shape %s", shape->id); |
| 85 | DBG(" from group %s\n", group->id); |
| 86 | if ((Id == BUILTIN_SELECTION_BIG) || |
| 87 | (Id == BUILTIN_ICON_BACKGROUND) || |
| 88 | (Id == BUILTIN_ICON_BANNER)) { |
| 89 | shape->debug = TRUE; |
| 90 | } */ |
| 91 | // if (BootCampStyle && (strstr(IconName, "selection_big") != NULL)) { |
| 92 | // shape->opacity = 0.f; |
| 93 | // } |
| 94 | if (BootCampStyle && IconNameX.contains("selection_big")) { |
| 95 | shape->opacity = 0.f; |
| 96 | } |
| 97 | // if (strstr(shape->id, "BoundingRect") != NULL) { |
| 98 | if (XString8().takeValueFrom(shape->id).contains("BoundingRect")) { |
| 99 | //there is bounds after nsvgParse() |
| 100 | IconImage->width = shape->bounds[2] - shape->bounds[0]; |
| 101 | IconImage->height = shape->bounds[3] - shape->bounds[1]; |
| 102 | // DBG("parsed bounds: %f, %f\n", IconImage->width, IconImage->height); |
| 103 | if ( IconImage->height < 1.f ) { |
| 104 | IconImage->height = 200.f; |
| 105 | } |
| 106 | if (IconNameX.contains("selection_big") && (!SelectionOnTop)) { |
| 107 | MainEntriesSize = (int)(IconImage->width * Scale); //xxx |
| 108 | row0TileSize = MainEntriesSize + (int)(16.f * Scale); |
| 109 | // DBG("main entry size = %lld\n", MainEntriesSize); |
| 110 | } |
| 111 | if (IconNameX.contains("selection_small") && (!SelectionOnTop)) { |
| 112 | row1TileSize = (int)(IconImage->width * Scale); |
| 113 | } |
| 114 |
nothing calls this directly
no test coverage detected