| 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 |
// --- Main React Component rendered by './index.js' |
| 25 |
// -------------------------------------------------------------------------- |
| 26 |
|
| 27 |
// --- React & Dome |
| 28 |
|
| 29 |
import React from 'react'; |
| 30 |
import * as Dome from 'dome'; |
| 31 |
import { Vfill } from 'dome/layout/boxes'; |
| 32 |
import { LSplit } from 'dome/layout/splitters'; |
| 33 |
import * as Toolbar from 'dome/frame/toolbars'; |
| 34 |
import * as Sidebar from 'dome/frame/sidebars'; |
| 35 |
import * as Controller from './Controller'; |
| 36 |
import * as Extensions from './Extensions'; |
| 37 |
import * as Laboratory from './Laboratory'; |
| 38 |
import * as IvettePrefs from 'ivette/prefs'; |
| 39 |
import './loader'; |
| 40 |
|
| 41 |
// -------------------------------------------------------------------------- |
| 42 |
// --- Main View |
| 43 |
// -------------------------------------------------------------------------- |
| 44 |
|
| 45 |
export default function Application(): JSX.Element { |
| 46 |
const [sidebar, flipSidebar] = |
| 47 |
Dome.useFlipSettings('frama-c.sidebar.unfold', true); |
| 48 |
const [viewbar, flipViewbar] = |
| 49 |
Dome.useFlipSettings('frama-c.viewbar.unfold', true); |
| 50 |
|
| 51 |
return ( |
| 52 |
<Vfill> |
| 53 |
<Toolbar.ToolBar> |
| 54 |
<Toolbar.Button |
| 55 |
icon="SIDEBAR" |
| 56 |
title="Show/Hide side bar" |
| 57 |
selected={sidebar} |
| 58 |
onClick={flipSidebar} |
| 59 |
/> |
| 60 |
<Controller.Control /> |
| 61 |
<Extensions.Toolbar /> |
| 62 |
<Toolbar.Filler /> |
| 63 |
<IvettePrefs.ThemeSwitchTool /> |
| 64 |
<IvettePrefs.FontTools /> |
| 65 |
<Toolbar.ModalActionField /> |
| 66 |
<Toolbar.Button |
| 67 |
icon="ITEMS.GRID" |
| 68 |
title="Customize Main View" |
| 69 |
selected={viewbar} |
| 70 |
onClick={flipViewbar} |
| 71 |
/> |
| 72 |
</Toolbar.ToolBar> |
| 73 |
<LSplit settings="frama-c.sidebar.split" unfold={sidebar}> |
| 74 |
<Sidebar.SideBar> |
| 75 |
<div className="sidebar-ruler" /> |
| 76 |
<Extensions.Sidebar /> |
| 77 |
</Sidebar.SideBar> |
| 78 |
<Laboratory.LabView |
| 79 |
customize={viewbar} |
| 80 |
settings="frama-c.labview" |
| 81 |
/> |
| 82 |
</LSplit> |
| 83 |
<Toolbar.ToolBar> |
| 84 |
<Controller.Status /> |
| 85 |
<Extensions.Statusbar /> |
| 86 |
<Toolbar.Filler /> |
| 87 |
<Controller.Stats /> |
| 88 |
</Toolbar.ToolBar> |
| 89 |
</Vfill> |
| 90 |
); |
| 91 |
} |
| 92 |
|
| 93 |
// -------------------------------------------------------------------------- |