///////////////////////////////////////////////////////
| 126 | |
| 127 | //////////////////////////////////////////////////////////// |
| 128 | Atom getAtom(const std::string& name, bool onlyIfExists) |
| 129 | { |
| 130 | static std::unordered_map<std::string, Atom> atoms; |
| 131 | |
| 132 | if (const auto it = atoms.find(name); it != atoms.end()) |
| 133 | return it->second; |
| 134 | |
| 135 | const auto display = openDisplay(); |
| 136 | const Atom atom = XInternAtom(display.get(), name.c_str(), onlyIfExists ? True : False); |
| 137 | if (atom) |
| 138 | atoms[name] = atom; |
| 139 | |
| 140 | return atom; |
| 141 | } |
| 142 | |
| 143 | } // namespace sf::priv |
no test coverage detected