Skip to content

Commit

Permalink
Auot-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
rerdavies committed Jan 27, 2025
1 parent 3d45687 commit 1a8f748
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 7 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,32 @@ project(nwindows
)
set(NWINDOWS_RELEASE_QUALIFIER "-beta1")



set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(NWINDOWS_BUILD_DOCUMENTATION ON CACHE BOOL "Build the Vite Documentation website?")
set(NWINDOWS_BUILD_EXAMPLES ON CACHE BOOL "Build the example projects?")
# Set to ON if you wish to set compler options froma parent CMakeList.txt file.
set(NWINDOWS_DEFAULT_COMPILER_OPTIONS OFF CACHE BOOL "Use default compiler options?")

# Set version numbers in source files.
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config/NWindowsVersionInfo.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/include/NWindows/NWindowsVersionInfo.hpp"
)

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config/NWindowsVersionInfo.tsx.in"
"${CMAKE_CURRENT_SOURCE_DIR}/docs/src/NWindowsVersionInfo.tsx"
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config/README.md"
"${CMAKE_CURRENT_SOURCE_DIR}/README.md"
)





if (NOT NWINDOWS_DEFAULT_COMPILER_OPTIONS)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Documentation](https://img.shields.io/badge/documentation-Examples-blue)](https://github.com/rerdavies/nwindows/tree/main/examples)
<!--[![Documentation](https://img.shields.io/badge/documentation-Release%20Notes-blue)](https://reravies.github.io/nwindows/) -->

INITIAL DEPLOYMENT IN PROGRESS. NOT YET READY FOR USE!!!
*0.0.1-beta1*

The *NWindows* library is a C++ text user interface (TUI) library for building console applications on Linux.
The library uses elements to compose user interfaces using an innovative and concise manipulator system. The library provides a rich set of elements with which to build user interfaces.
Expand Down
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Release Notes

### NWindows 0.0.1-beta1

Initial release of the NWindows Library.
File renamed without changes.
24 changes: 24 additions & 0 deletions config/NWindowsVersionInfo.tsx.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2025 Robin E. R. Davies
* All rights reserved.

* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:

* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.

* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

export const NWindowsVersion = "${PROJECT_VERSION}${NWINDOWS_RELEASE_QUALIFIER}";
47 changes: 47 additions & 0 deletions config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#### NWindows TUI Library
![Build Status](https://github.com/rerdavies/nwindows/actions/workflows/cmake-multi-platform.yml/badge.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation](https://img.shields.io/badge/documentation-Developer%20Guide-blue)](https://rerdavies.github.io/nwindows/documentation/)
[![Documentation](https://img.shields.io/badge/documentation-Examples-blue)](https://github.com/rerdavies/nwindows/tree/main/examples)
<!--[![Documentation](https://img.shields.io/badge/documentation-Release%20Notes-blue)](https://reravies.github.io/nwindows/) -->

*${PROJECT_VERSION}${NWINDOWS_RELEASE_QUALIFIER}*

The *NWindows* library is a C++ text user interface (TUI) library for building console applications on Linux.
The library uses elements to compose user interfaces using an innovative and concise manipulator system. The library provides a rich set of elements with which to build user interfaces.

Built on top of the *ncursesw* library, *NWindows* works on both xterm and raw linux terminal windows, and also works over ssh.

&nbsp;&nbsp;![image](docs/public/image/screenshot.png)

Here is a simple example of an *NWindows* application that demonstrates the use of NWindow's manipulator syntax to create users interfaces. The program creates a window with a button that closes the window when clicked:

```
#include "NWindows/NWindows.hpp"
using namespace nwindows;
int main(void) {
NWindow::ptr window = NWindow::create(AUTO_SIZE, AUTO_SIZE);
window
| title("Hello")
| add_child(
NButtonElement::create("Hello world!")
| margin({ 2,1,2,1 })
| on_click([window](int button, NClickedEventArgs& event)
{
event.handled = true;
event.window->close();
}
)
);
window->run();
}
```

which displays the following output when executed.

&nbsp;&nbsp;![image](docs/public/image/hello_world.png)

See the [documentation](https://github.io/rerdavies/nwindows> for more information, and for instructions on installing, and using *NWindows*.
24 changes: 24 additions & 0 deletions docs/src/NWindowsVersionInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2025 Robin E. R. Davies
* All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

export const NWindowsVersion = "0.0.1-beta1";
36 changes: 36 additions & 0 deletions docs/src/ReleaseNotes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2025 Robin E. R. Davies
* All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import ReleaseNodesMd from "./assets/ReleaseNotes.txt";


export default function ReleaseNotes() {
return (
<div className="docs_page" style={{ background: "#FFF",display: "flex", flex: "1 1 1px",flexFlow: "column nowrap", position: "relative" }}>
<div style={{padding: 32}}>
<h1>Release Notes</h1>
<div dangerouslySetInnerHTML={{__html: ReleaseNodesMd}}></div>
</div>
</div>
);
}
3 changes: 3 additions & 0 deletions docs/src/assets/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello World

This a test file for the release notes.
3 changes: 2 additions & 1 deletion docs/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { WhereToGoFromHere } from '../DocsNav';
import Paper from '@mui/material/Paper';
import IconButton from '@mui/material/IconButton';
import PersistentScrollDiv from '../PersistentScrollDiv';
import { NWindowsVersion } from '../NWindowsVersionInfo';

function HomePage() {

Expand All @@ -43,7 +44,7 @@ function HomePage() {
<PageColumn>
<div>
<Banner subtitle="TUI Library" />
<p>INITIAL DEPLOYMENT IN PROGRESS. NOT YET READY FOR USE!!!</p>
<p><i>NWindows {NWindowsVersion}</i></p>
<p>
The <span className="name">NWindows</span> library is a C++ text user interface (TUI) library for building console applications.
The library uses elements to compose user interfaces using an innovative and concise manipulator system. The library provides a
Expand Down
5 changes: 0 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ set(CMAKE_CXX_STANDARD 20)

# add_compile_definitions(_GLIBCXX_DEBUG)

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/NWindowsVersionInfo.hpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/include/NWindows/NWindowsVersionInfo.hpp"
)


add_library(nwindows
include/NWindows/NClipboard.hpp
Expand Down

0 comments on commit 1a8f748

Please sign in to comment.