| 190 | } |
| 191 | |
| 192 | void recompui::init_styling(const std::filesystem::path& rcss_file) { |
| 193 | std::string style{}; |
| 194 | { |
| 195 | std::ifstream style_stream{rcss_file}; |
| 196 | style_stream.seekg(0, std::ios::end); |
| 197 | style.resize(style_stream.tellg()); |
| 198 | style_stream.seekg(0, std::ios::beg); |
| 199 | |
| 200 | style_stream.read(style.data(), style.size()); |
| 201 | } |
| 202 | std::unique_ptr<Rml::StreamMemory> rml_stream = std::make_unique<Rml::StreamMemory>(reinterpret_cast<Rml::byte*>(style.data()), style.size()); |
| 203 | rml_stream->SetSourceURL(rcss_file.filename().string()); |
| 204 | context_state.style_sheet = Rml::Factory::InstanceStyleSheetStream(rml_stream.get()); |
| 205 | } |
| 206 | |
| 207 | recompui::ContextId recompui::create_context(const std::filesystem::path& path) { |
| 208 | ContextId new_context = create_context_impl(nullptr); |