| 1 |
/* ************************************************************************ */ |
| 2 |
/* */ |
| 3 |
/* This file is part of Frama-C. */ |
| 4 |
/* */ |
| 5 |
/* Copyright (C) 2007-2022 */ |
| 6 |
/* CEA (Commissariat à l'énergie atomique et aux énergies */ |
| 7 |
/* alternatives) */ |
| 8 |
/* */ |
| 9 |
/* you can redistribute it and/or modify it under the terms of the GNU */ |
| 10 |
/* Lesser General Public License as published by the Free Software */ |
| 11 |
/* Foundation, version 2.1. */ |
| 12 |
/* */ |
| 13 |
/* It is distributed in the hope that it will be useful, */ |
| 14 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 15 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 16 |
/* GNU Lesser General Public License for more details. */ |
| 17 |
/* */ |
| 18 |
/* See the GNU Lesser General Public License version 2.1 */ |
| 19 |
/* for more details (enclosed in the file licenses/LGPLv2.1). */ |
| 20 |
/* */ |
| 21 |
/* ************************************************************************ */ |
| 22 |
|
| 23 |
// -------------------------------------------------------------------------- |
| 24 |
// --- Electron renderer-process entry-point for Dome. |
| 25 |
// -------------------------------------------------------------------------- |
| 26 |
|
| 27 |
/* |
| 28 |
Template of ./src/renderer/index.js |
| 29 |
Imported from $(DOME)/template/renderer.js |
| 30 |
|
| 31 |
You can modify this template and add your own code before or |
| 32 |
after rendering the main components. |
| 33 |
|
| 34 |
However, please note that React hot-reloading is fragile. |
| 35 |
Component that are not imported by <Application/> or <Preferences/> |
| 36 |
may suffer from well known limitations of hot-reloading and |
| 37 |
may lead to state losses or complete application reloads. |
| 38 |
*/ |
| 39 |
|
| 40 |
// Enable live-editing in React: |
| 41 |
import 'react-hot-loader/patch' ; |
| 42 |
import React from 'react' ; |
| 43 |
import { |
| 44 |
setApplicationWindow, |
| 45 |
setPreferencesWindow, |
| 46 |
isApplicationWindow, |
| 47 |
isPreferencesWindow, |
| 48 |
} from 'dome' ; |
| 49 |
|
| 50 |
// You can change the name of the main components, |
| 51 |
// provided you define the makefile variable |
| 52 |
// `DOME_CUSTOM_ENTRIES` to prevent files 'Application.js' and 'Preferences.js' |
| 53 |
// from being generated by the template makefile. |
| 54 |
|
| 55 |
import Application from './Application' ; |
| 56 |
import Preferences from './Preferences' ; |
| 57 |
|
| 58 |
// Define the application main components for each window: |
| 59 |
setApplicationWindow(Application); |
| 60 |
setPreferencesWindow(Preferences); |
| 61 |
|
| 62 |
// Mark the main application reloadable and enable live updates: |
| 63 |
module.hot && isApplicationWindow() && |
| 64 |
module.hot.accept('./Application',() => setApplicationWindow(Application)); |
| 65 |
module.hot && isPreferencesWindow() && |
| 66 |
module.hot.accept('./Preferences',() => setPreferencesWindow(Preferences)); |
| 67 |
|
| 68 |
// -------------------------------------------------------------------------- |