SinesBox is a C++ library designed for [brief description of library purpose]. It provides [key features or functionality].
- C++ 17 or later
- CMake 3.10+
- Compatible compiler (GCC, Clang, MSVC)
- Clone the repository:
https://github.com/sinescode/SinesBox.git
cd SinesBox
- Create a build directory:
mkdir build
cd build
- Configure and build the project:
cmake ..
make
sudo make install
Add the following to your project's CMakeLists.txt
:
find_package(SinesBox REQUIRED)
target_link_libraries(YourProject SinesBox)
After installing the SinesBox library, compile your project using:
g++ -o test test.cpp -L/usr/local/lib -lSinesBox -I/usr/local/include -std=c++17
Breakdown of compilation flags:
-o test
: Output executable nametest.cpp
: Your source file-L/usr/local/lib
: Specify library search path-lSinesBox
: Link against SinesBox library-I/usr/local/include
: Specify include directory-std=c++17
: Use C++17 standard
In your C++ source files, include the necessary headers:
#include <SinesBox/SinesBox.h>
#include <SinesBox/SinesGlobalSettings.h>
#include <SinesBox/SinesBox.h>
#include <SinesBox/SinesGlobalSettings.h>
int main() {
// Initialize SinesBox library
SinesBoxLib::SinesGlobalSettings::initialize();
// Your application logic here
return 0;
}
You can customize the build with the following CMake options:
-DCMAKE_INSTALL_PREFIX=/path/to/install
: Specify a custom installation directory-DBUILD_TESTS=ON
: Build library tests (if applicable)
src/
: Source filesinclude/
: Header filesCMakeLists.txt
: CMake build configuration
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
SinesBox is a C++ library for creating colorful, customizable text boxes in terminal applications. It provides an easy-to-use interface for drawing text boxes with various styling options, including color selection, bold formatting, and rainbow-styled borders.
- Customizable text box drawing
- Support for multiple text colors
- Border styling (normal and bold)
- Background color options
- Automatic text wrapping
- Rainbow border mode
- UTF-8 compatible
- C++ compiler with C++11 support
- Linux or macOS (uses
sys/ioctl.h
for terminal width detection)
#include "SinesBox.h"
#include "SinesGlobalSettings.h"
int main() {
// Initialize global settings (UTF-8 support)
SinesBoxLib::SinesGlobalSettings::initialize();
// Create a SinesBox instance
SinesBoxLib::SinesBox box;
// Set text and styling
box.setText("Hello, World! This is a sample text box.");
box.setTextColor("green");
box.setBorderColor("blue");
box.setBorderBold(true);
// Draw the box
box.draw();
return 0;
}
SinesBox()
: Creates a new SinesBox instance with default settings
void setText(const std::string& text)
: Sets the text to be displayed in the box- Automatically wraps text to fit terminal width
void setBorderColor(const std::string& color)
: Sets the border colorvoid setTextColor(const std::string& color)
: Sets the text colorvoid setBackgroundColor(const std::string& color)
: Sets the background color
void setBorderBold(bool bold)
: Enables/disables bold bordervoid setTextBold(bool bold)
: Enables/disables bold text
void draw()
: Draws the text box with current settingsvoid drawRainbow()
: Draws the text box with rainbow-colored borders
The library supports the following colors:
- Basic colors: black, red, green, yellow, blue, magenta, cyan, white
- Bright colors: brightblack, brightred, brightgreen, brightyellow, brightblue, brightmagenta, brightcyan, brightwhite
SinesGlobalSettings::initialize()
sets the locale to UTF-8, ensuring proper character rendering on Linux systems.
SinesBoxLib::SinesBox rainbowBox;
rainbowBox.setText("Colorful rainbow border with text!");
rainbowBox.drawRainbow();
SinesBoxLib::SinesBox infoBox;
infoBox.setText("Important message with green border and yellow text");
infoBox.setBorderColor("green");
infoBox.setTextColor("yellow");
infoBox.setBorderBold(true);
infoBox.draw();
- Requires terminal support for ANSI color codes
- Works best on Unix-like systems (Linux, macOS)
- Terminal width detection might not work perfectly on all systems
Contributions are welcome! Please submit pull requests or open issues on the project repository.
The background color is still not perfect, so it is recommended to wait for the next update for an improved design.
Stay tuned for the updates!
Please avoid using emojis unless necessary. Using emojis in Sinesbox may cause disruptions.