| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qcolor_p.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | static inline int hex2int(const char *s) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | const int hi = QtMiscUtils::fromHex(s[0]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 14 |     if (hi < 0
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 15 |         return never executed:   -1;return -1;never executed:  return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | const int lo = QtMiscUtils::fromHex(s[1]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 17 |     if (lo < 0
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 18 |         return never executed:   -1;return -1;never executed:  return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 19 |     return never executed:   (hi << 4) | lo;return (hi << 4) | lo;never executed:  return (hi << 4) | lo; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | static inline int hex2int(char s) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | const int h = QtMiscUtils::fromHex(s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 30 |     return never executed:   h < 0return h < 0 ? h : (h << 4) | h;
 never executed:  return h < 0 ? h : (h << 4) | h; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | bool qt_get_hex_rgb(const char *name, QRgb *rgb) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 35 |     if(name[0] != '#'
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 36 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | name++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | int len = qstrlen(name); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | int a, r, g, b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | a = 255; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 41 |     if (len == 12
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | r = hex2int(name); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | g = hex2int(name + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | b = hex2int(name + 8); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 45 |     } never executed:   else if (len == 9end of block
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | r = hex2int(name); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | g = hex2int(name + 3); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | b = hex2int(name + 6); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 49 |     } never executed:   else if (len == 8end of block
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | a = hex2int(name); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | r = hex2int(name + 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | g = hex2int(name + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | b = hex2int(name + 6); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 54 |     } never executed:   else if (len == 6end of block
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | r = hex2int(name); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | g = hex2int(name + 2); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | b = hex2int(name + 4); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 58 |     } never executed:   else if (len == 3end of block
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | r = hex2int(name[0]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | g = hex2int(name[1]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | b = hex2int(name[2]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 62 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | r = g = b = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 64 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 65 |     if ((
 
 
 
 
 
 
 
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | *rgb = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 67 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | *rgb = qRgba(r, g ,b, a); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 70 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 75 |     if (len > 13
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 76 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | char tmp[16]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 78 |     for(int i = 0; i < len
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 79 |         tmp[i] = str[i].toLatin1(); never executed:  tmp[i] = str[i].toLatin1(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | tmp[len] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 81 |     return never executed:   qt_get_hex_rgb(tmp, rgb);return qt_get_hex_rgb(tmp, rgb);never executed:  return qt_get_hex_rgb(tmp, rgb); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | static const struct RGBData { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | const char name[21]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | uint value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | } rgbTbl[] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | { "aliceblue", (0xff000000 | (240 << 16) | (248 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | { "antiquewhite", (0xff000000 | (250 << 16) | (235 << 8) | 215) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | { "aqua", (0xff000000 | (0 << 16) | (255 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | { "aquamarine", (0xff000000 | (127 << 16) | (255 << 8) | 212) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | { "azure", (0xff000000 | (240 << 16) | (255 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | { "beige", (0xff000000 | (245 << 16) | (245 << 8) | 220) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | { "bisque", (0xff000000 | (255 << 16) | (228 << 8) | 196) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | { "black", (0xff000000 | (0 << 16) | (0 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | { "blanchedalmond", (0xff000000 | (255 << 16) | (235 << 8) | 205) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | { "blue", (0xff000000 | (0 << 16) | (0 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | { "blueviolet", (0xff000000 | (138 << 16) | (43 << 8) | 226) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | { "brown", (0xff000000 | (165 << 16) | (42 << 8) | 42) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | { "burlywood", (0xff000000 | (222 << 16) | (184 << 8) | 135) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | { "cadetblue", (0xff000000 | (95 << 16) | (158 << 8) | 160) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | { "chartreuse", (0xff000000 | (127 << 16) | (255 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | { "chocolate", (0xff000000 | (210 << 16) | (105 << 8) | 30) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | { "coral", (0xff000000 | (255 << 16) | (127 << 8) | 80) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | { "cornflowerblue", (0xff000000 | (100 << 16) | (149 << 8) | 237) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | { "cornsilk", (0xff000000 | (255 << 16) | (248 << 8) | 220) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | { "crimson", (0xff000000 | (220 << 16) | (20 << 8) | 60) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | { "cyan", (0xff000000 | (0 << 16) | (255 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | { "darkblue", (0xff000000 | (0 << 16) | (0 << 8) | 139) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | { "darkcyan", (0xff000000 | (0 << 16) | (139 << 8) | 139) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | { "darkgoldenrod", (0xff000000 | (184 << 16) | (134 << 8) | 11) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | { "darkgray", (0xff000000 | (169 << 16) | (169 << 8) | 169) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | { "darkgreen", (0xff000000 | (0 << 16) | (100 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | { "darkgrey", (0xff000000 | (169 << 16) | (169 << 8) | 169) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | { "darkkhaki", (0xff000000 | (189 << 16) | (183 << 8) | 107) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | { "darkmagenta", (0xff000000 | (139 << 16) | (0 << 8) | 139) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | { "darkolivegreen", (0xff000000 | (85 << 16) | (107 << 8) | 47) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | { "darkorange", (0xff000000 | (255 << 16) | (140 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | { "darkorchid", (0xff000000 | (153 << 16) | (50 << 8) | 204) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | { "darkred", (0xff000000 | (139 << 16) | (0 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | { "darksalmon", (0xff000000 | (233 << 16) | (150 << 8) | 122) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | { "darkseagreen", (0xff000000 | (143 << 16) | (188 << 8) | 143) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | { "darkslateblue", (0xff000000 | (72 << 16) | (61 << 8) | 139) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | { "darkslategray", (0xff000000 | (47 << 16) | (79 << 8) | 79) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | { "darkslategrey", (0xff000000 | (47 << 16) | (79 << 8) | 79) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | { "darkturquoise", (0xff000000 | (0 << 16) | (206 << 8) | 209) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | { "darkviolet", (0xff000000 | (148 << 16) | (0 << 8) | 211) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | { "deeppink", (0xff000000 | (255 << 16) | (20 << 8) | 147) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | { "deepskyblue", (0xff000000 | (0 << 16) | (191 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | { "dimgray", (0xff000000 | (105 << 16) | (105 << 8) | 105) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | { "dimgrey", (0xff000000 | (105 << 16) | (105 << 8) | 105) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | { "dodgerblue", (0xff000000 | (30 << 16) | (144 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | { "firebrick", (0xff000000 | (178 << 16) | (34 << 8) | 34) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | { "floralwhite", (0xff000000 | (255 << 16) | (250 << 8) | 240) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | { "forestgreen", (0xff000000 | (34 << 16) | (139 << 8) | 34) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | { "fuchsia", (0xff000000 | (255 << 16) | (0 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | { "gainsboro", (0xff000000 | (220 << 16) | (220 << 8) | 220) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | { "ghostwhite", (0xff000000 | (248 << 16) | (248 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | { "gold", (0xff000000 | (255 << 16) | (215 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | { "goldenrod", (0xff000000 | (218 << 16) | (165 << 8) | 32) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | { "gray", (0xff000000 | (128 << 16) | (128 << 8) | 128) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | { "green", (0xff000000 | (0 << 16) | (128 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | { "greenyellow", (0xff000000 | (173 << 16) | (255 << 8) | 47) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | { "grey", (0xff000000 | (128 << 16) | (128 << 8) | 128) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | { "honeydew", (0xff000000 | (240 << 16) | (255 << 8) | 240) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | { "hotpink", (0xff000000 | (255 << 16) | (105 << 8) | 180) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | { "indianred", (0xff000000 | (205 << 16) | (92 << 8) | 92) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | { "indigo", (0xff000000 | (75 << 16) | (0 << 8) | 130) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | { "ivory", (0xff000000 | (255 << 16) | (255 << 8) | 240) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | { "khaki", (0xff000000 | (240 << 16) | (230 << 8) | 140) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | { "lavender", (0xff000000 | (230 << 16) | (230 << 8) | 250) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | { "lavenderblush", (0xff000000 | (255 << 16) | (240 << 8) | 245) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | { "lawngreen", (0xff000000 | (124 << 16) | (252 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | { "lemonchiffon", (0xff000000 | (255 << 16) | (250 << 8) | 205) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | { "lightblue", (0xff000000 | (173 << 16) | (216 << 8) | 230) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | { "lightcoral", (0xff000000 | (240 << 16) | (128 << 8) | 128) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | { "lightcyan", (0xff000000 | (224 << 16) | (255 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | { "lightgoldenrodyellow", (0xff000000 | (250 << 16) | (250 << 8) | 210) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | { "lightgray", (0xff000000 | (211 << 16) | (211 << 8) | 211) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | { "lightgreen", (0xff000000 | (144 << 16) | (238 << 8) | 144) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | { "lightgrey", (0xff000000 | (211 << 16) | (211 << 8) | 211) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | { "lightpink", (0xff000000 | (255 << 16) | (182 << 8) | 193) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | { "lightsalmon", (0xff000000 | (255 << 16) | (160 << 8) | 122) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | { "lightseagreen", (0xff000000 | (32 << 16) | (178 << 8) | 170) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | { "lightskyblue", (0xff000000 | (135 << 16) | (206 << 8) | 250) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | { "lightslategray", (0xff000000 | (119 << 16) | (136 << 8) | 153) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | { "lightslategrey", (0xff000000 | (119 << 16) | (136 << 8) | 153) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | { "lightsteelblue", (0xff000000 | (176 << 16) | (196 << 8) | 222) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | { "lightyellow", (0xff000000 | (255 << 16) | (255 << 8) | 224) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | { "lime", (0xff000000 | (0 << 16) | (255 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | { "limegreen", (0xff000000 | (50 << 16) | (205 << 8) | 50) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | { "linen", (0xff000000 | (250 << 16) | (240 << 8) | 230) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | { "magenta", (0xff000000 | (255 << 16) | (0 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | { "maroon", (0xff000000 | (128 << 16) | (0 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | { "mediumaquamarine", (0xff000000 | (102 << 16) | (205 << 8) | 170) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | { "mediumblue", (0xff000000 | (0 << 16) | (0 << 8) | 205) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | { "mediumorchid", (0xff000000 | (186 << 16) | (85 << 8) | 211) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | { "mediumpurple", (0xff000000 | (147 << 16) | (112 << 8) | 219) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | { "mediumseagreen", (0xff000000 | (60 << 16) | (179 << 8) | 113) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | { "mediumslateblue", (0xff000000 | (123 << 16) | (104 << 8) | 238) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | { "mediumspringgreen", (0xff000000 | (0 << 16) | (250 << 8) | 154) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | { "mediumturquoise", (0xff000000 | (72 << 16) | (209 << 8) | 204) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | { "mediumvioletred", (0xff000000 | (199 << 16) | (21 << 8) | 133) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | { "midnightblue", (0xff000000 | (25 << 16) | (25 << 8) | 112) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | { "mintcream", (0xff000000 | (245 << 16) | (255 << 8) | 250) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | { "mistyrose", (0xff000000 | (255 << 16) | (228 << 8) | 225) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | { "moccasin", (0xff000000 | (255 << 16) | (228 << 8) | 181) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | { "navajowhite", (0xff000000 | (255 << 16) | (222 << 8) | 173) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | { "navy", (0xff000000 | (0 << 16) | (0 << 8) | 128) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | { "oldlace", (0xff000000 | (253 << 16) | (245 << 8) | 230) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | { "olive", (0xff000000 | (128 << 16) | (128 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | { "olivedrab", (0xff000000 | (107 << 16) | (142 << 8) | 35) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | { "orange", (0xff000000 | (255 << 16) | (165 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | { "orangered", (0xff000000 | (255 << 16) | (69 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | { "orchid", (0xff000000 | (218 << 16) | (112 << 8) | 214) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | { "palegoldenrod", (0xff000000 | (238 << 16) | (232 << 8) | 170) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | { "palegreen", (0xff000000 | (152 << 16) | (251 << 8) | 152) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | { "paleturquoise", (0xff000000 | (175 << 16) | (238 << 8) | 238) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | { "palevioletred", (0xff000000 | (219 << 16) | (112 << 8) | 147) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | { "papayawhip", (0xff000000 | (255 << 16) | (239 << 8) | 213) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | { "peachpuff", (0xff000000 | (255 << 16) | (218 << 8) | 185) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | { "peru", (0xff000000 | (205 << 16) | (133 << 8) | 63) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | { "pink", (0xff000000 | (255 << 16) | (192 << 8) | 203) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | { "plum", (0xff000000 | (221 << 16) | (160 << 8) | 221) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | { "powderblue", (0xff000000 | (176 << 16) | (224 << 8) | 230) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | { "purple", (0xff000000 | (128 << 16) | (0 << 8) | 128) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | { "red", (0xff000000 | (255 << 16) | (0 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | { "rosybrown", (0xff000000 | (188 << 16) | (143 << 8) | 143) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | { "royalblue", (0xff000000 | (65 << 16) | (105 << 8) | 225) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | { "saddlebrown", (0xff000000 | (139 << 16) | (69 << 8) | 19) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | { "salmon", (0xff000000 | (250 << 16) | (128 << 8) | 114) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | { "sandybrown", (0xff000000 | (244 << 16) | (164 << 8) | 96) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | { "seagreen", (0xff000000 | (46 << 16) | (139 << 8) | 87) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | { "seashell", (0xff000000 | (255 << 16) | (245 << 8) | 238) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | { "sienna", (0xff000000 | (160 << 16) | (82 << 8) | 45) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | { "silver", (0xff000000 | (192 << 16) | (192 << 8) | 192) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | { "skyblue", (0xff000000 | (135 << 16) | (206 << 8) | 235) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | { "slateblue", (0xff000000 | (106 << 16) | (90 << 8) | 205) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | { "slategray", (0xff000000 | (112 << 16) | (128 << 8) | 144) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | { "slategrey", (0xff000000 | (112 << 16) | (128 << 8) | 144) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | { "snow", (0xff000000 | (255 << 16) | (250 << 8) | 250) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | { "springgreen", (0xff000000 | (0 << 16) | (255 << 8) | 127) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | { "steelblue", (0xff000000 | (70 << 16) | (130 << 8) | 180) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | { "tan", (0xff000000 | (210 << 16) | (180 << 8) | 140) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | { "teal", (0xff000000 | (0 << 16) | (128 << 8) | 128) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | { "thistle", (0xff000000 | (216 << 16) | (191 << 8) | 216) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | { "tomato", (0xff000000 | (255 << 16) | (99 << 8) | 71) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | { "transparent", 0 }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | { "turquoise", (0xff000000 | (64 << 16) | (224 << 8) | 208) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | { "violet", (0xff000000 | (238 << 16) | (130 << 8) | 238) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | { "wheat", (0xff000000 | (245 << 16) | (222 << 8) | 179) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | { "white", (0xff000000 | (255 << 16) | (255 << 8) | 255) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | { "whitesmoke", (0xff000000 | (245 << 16) | (245 << 8) | 245) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | { "yellow", (0xff000000 | (255 << 16) | (255 << 8) | 0) }, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | { "yellowgreen", (0xff000000 | (154 << 16) | (205 << 8) | 50) } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | inline bool operator<(const char *name, const RGBData &data) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | { return never executed:   qstrcmp(name, data.name) < 0;return qstrcmp(name, data.name) < 0;never executed:   }return qstrcmp(name, data.name) < 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | inline bool operator<(const RGBData &data, const char *name) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | { return never executed:   qstrcmp(data.name, name) < 0;return qstrcmp(data.name, name) < 0;never executed:   }return qstrcmp(data.name, name) < 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | static bool get_named_rgb(const char *name_no_space, QRgb *rgb) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 246 |     if ((
 
 
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | *rgb = r->value; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 248 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 250 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | bool qt_get_named_rgb(const char *name, QRgb* rgb) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | int len = int(strlen(name)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 256 |     if(len > 255
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 257 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | char name_no_space[256]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | int pos = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 260 |     for(int i = 0; i < len
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 |         if(name[i] != '\t'
 
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 262 |             name_no_space[pos++] = QChar::toLower(name[i]); never executed:  name_no_space[pos++] = QChar::toLower(name[i]); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 263 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | name_no_space[pos] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 266 |     return never executed:   get_named_rgb(name_no_space, rgb);return get_named_rgb(name_no_space, rgb);never executed:  return get_named_rgb(name_no_space, rgb); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 271 |     if(len > 255
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 272 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | char name_no_space[256]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | int pos = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 275 |     for(int i = 0; i < len
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 276 |         if(name[i] != QLatin1Char('\t')
 
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 277 |             name_no_space[pos++] = name[i].toLower().toLatin1(); never executed:  name_no_space[pos++] = name[i].toLower().toLatin1(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 278 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | name_no_space[pos] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 280 |     return never executed:   get_named_rgb(name_no_space, rgb);return get_named_rgb(name_no_space, rgb);never executed:  return get_named_rgb(name_no_space, rgb); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | uint qt_get_rgb_val(const char *name) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | QRgb r = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | qt_get_named_rgb(name,&r); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 288 |     return never executed:   r;return r;never executed:  return r; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | QStringList qt_get_colornames() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | int i = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | QStringList lst; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | lst.reserve(rgbTblSize); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 296 |     for (i = 0; i < rgbTblSize
  | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 297 |         lst << QLatin1String(rgbTbl[i].name); never executed:  lst << QLatin1String(rgbTbl[i].name); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 298 |     return never executed:   lst;return lst;never executed:  return lst; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |