OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 | 3 |
4 This library is free software; you can redistribute it and/or | 4 This library is free software; you can redistribute it and/or |
5 modify it under the terms of the GNU Library General Public | 5 modify it under the terms of the GNU Library General Public |
6 License as published by the Free Software Foundation; either | 6 License as published by the Free Software Foundation; either |
7 version 2 of the License, or (at your option) any later version. | 7 version 2 of the License, or (at your option) any later version. |
8 | 8 |
9 This library is distributed in the hope that it will be useful, | 9 This library is distributed in the hope that it will be useful, |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 23 matching lines...) Expand all Loading... |
34 PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, | 34 PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, |
35 const HitTestRequest& request, | 35 const HitTestRequest& request, |
36 EPointerEvents pointerEvents) | 36 EPointerEvents pointerEvents) |
37 : requireVisible(false), | 37 : requireVisible(false), |
38 requireFill(false), | 38 requireFill(false), |
39 requireStroke(false), | 39 requireStroke(false), |
40 canHitStroke(false), | 40 canHitStroke(false), |
41 canHitFill(false), | 41 canHitFill(false), |
42 canHitBoundingBox(false) { | 42 canHitBoundingBox(false) { |
43 if (request.svgClipContent()) | 43 if (request.svgClipContent()) |
44 pointerEvents = PE_FILL; | 44 pointerEvents = EPointerEvents::PE_FILL; |
45 | 45 |
46 if (hitTesting == SVG_GEOMETRY_HITTESTING) { | 46 if (hitTesting == SVG_GEOMETRY_HITTESTING) { |
47 switch (pointerEvents) { | 47 switch (pointerEvents) { |
48 case PE_BOUNDINGBOX: | 48 case EPointerEvents::PE_BOUNDINGBOX: |
49 canHitBoundingBox = true; | 49 canHitBoundingBox = true; |
50 break; | 50 break; |
51 case PE_VISIBLE_PAINTED: | 51 case EPointerEvents::PE_VISIBLE_PAINTED: |
52 case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content | 52 case EPointerEvents::PE_AUTO: // "auto" is like "visiblePainted" when in |
| 53 // SVG content |
53 requireFill = true; | 54 requireFill = true; |
54 requireStroke = true; | 55 requireStroke = true; |
55 case PE_VISIBLE: | 56 case EPointerEvents::PE_VISIBLE: |
56 requireVisible = true; | 57 requireVisible = true; |
57 canHitFill = true; | 58 canHitFill = true; |
58 canHitStroke = true; | 59 canHitStroke = true; |
59 break; | 60 break; |
60 case PE_VISIBLE_FILL: | 61 case EPointerEvents::PE_VISIBLE_FILL: |
61 requireVisible = true; | 62 requireVisible = true; |
62 canHitFill = true; | 63 canHitFill = true; |
63 break; | 64 break; |
64 case PE_VISIBLE_STROKE: | 65 case EPointerEvents::PE_VISIBLE_STROKE: |
65 requireVisible = true; | 66 requireVisible = true; |
66 canHitStroke = true; | 67 canHitStroke = true; |
67 break; | 68 break; |
68 case PE_PAINTED: | 69 case EPointerEvents::PE_PAINTED: |
69 requireFill = true; | 70 requireFill = true; |
70 requireStroke = true; | 71 requireStroke = true; |
71 case PE_ALL: | 72 case EPointerEvents::PE_ALL: |
72 canHitFill = true; | 73 canHitFill = true; |
73 canHitStroke = true; | 74 canHitStroke = true; |
74 break; | 75 break; |
75 case PE_FILL: | 76 case EPointerEvents::PE_FILL: |
76 canHitFill = true; | 77 canHitFill = true; |
77 break; | 78 break; |
78 case PE_STROKE: | 79 case EPointerEvents::PE_STROKE: |
79 canHitStroke = true; | 80 canHitStroke = true; |
80 break; | 81 break; |
81 case PE_NONE: | 82 case EPointerEvents::PE_NONE: |
82 // nothing to do here, defaults are all false. | 83 // nothing to do here, defaults are all false. |
83 break; | 84 break; |
84 } | 85 } |
85 } else { | 86 } else { |
86 switch (pointerEvents) { | 87 switch (pointerEvents) { |
87 case PE_BOUNDINGBOX: | 88 case EPointerEvents::PE_BOUNDINGBOX: |
88 canHitBoundingBox = true; | 89 canHitBoundingBox = true; |
89 break; | 90 break; |
90 case PE_VISIBLE_PAINTED: | 91 case EPointerEvents::PE_VISIBLE_PAINTED: |
91 case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content | 92 case EPointerEvents::PE_AUTO: // "auto" is like "visiblePainted" when in |
| 93 // SVG content |
92 requireVisible = true; | 94 requireVisible = true; |
93 requireFill = true; | 95 requireFill = true; |
94 requireStroke = true; | 96 requireStroke = true; |
95 canHitFill = true; | 97 canHitFill = true; |
96 canHitStroke = true; | 98 canHitStroke = true; |
97 break; | 99 break; |
98 case PE_VISIBLE_FILL: | 100 case EPointerEvents::PE_VISIBLE_FILL: |
99 case PE_VISIBLE_STROKE: | 101 case EPointerEvents::PE_VISIBLE_STROKE: |
100 case PE_VISIBLE: | 102 case EPointerEvents::PE_VISIBLE: |
101 requireVisible = true; | 103 requireVisible = true; |
102 canHitFill = true; | 104 canHitFill = true; |
103 canHitStroke = true; | 105 canHitStroke = true; |
104 break; | 106 break; |
105 case PE_PAINTED: | 107 case EPointerEvents::PE_PAINTED: |
106 requireFill = true; | 108 requireFill = true; |
107 requireStroke = true; | 109 requireStroke = true; |
108 canHitFill = true; | 110 canHitFill = true; |
109 canHitStroke = true; | 111 canHitStroke = true; |
110 break; | 112 break; |
111 case PE_FILL: | 113 case EPointerEvents::PE_FILL: |
112 case PE_STROKE: | 114 case EPointerEvents::PE_STROKE: |
113 case PE_ALL: | 115 case EPointerEvents::PE_ALL: |
114 canHitFill = true; | 116 canHitFill = true; |
115 canHitStroke = true; | 117 canHitStroke = true; |
116 break; | 118 break; |
117 case PE_NONE: | 119 case EPointerEvents::PE_NONE: |
118 // nothing to do here, defaults are all false. | 120 // nothing to do here, defaults are all false. |
119 break; | 121 break; |
120 } | 122 } |
121 } | 123 } |
122 } | 124 } |
123 | 125 |
124 } // namespace blink | 126 } // namespace blink |
125 | 127 |
126 // vim:ts=4:noet | 128 // vim:ts=4:noet |
OLD | NEW |