• Stars
    star
    784
  • Rank 58,032 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Free open-source modern C++17 / C++20 framework to create console, GUI (forms like WinForms) and unit test applications and libraries on Microsoft Windows, Apple macOS and Linux.

xtd

xtd (pronounced "extend") is a modern C++17/20 framework to create console, GUI (forms like WinForms) and unit test applications on Microsoft Windows, Apple macOS,ย Linux, iOS and android (*).

logo

(*) See portability for more information.

License Language web Reference Guide wiki discord Download xtd

Latest news

Features

xtd libraries architecture

architecture_logo

xtd is composed of several libraries.

xtd.core

core The xtd.core library is modern C++17/20 libraries of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which c++ applications, components, and controls are built.

xtd.drawing

drawing The xtd.drawing library contains types that support basic GDI+ graphics functionality. Child namespaces support advanced two-dimensional and vector graphics functionality, advanced imaging functionality, and print-related and typographical services. A child namespace also contains types that extend design-time user-interface logic and drawing.

xtd.forms

forms The xtd.forms library contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and linux base operating system.

xtd.tunit

tunit The xtd.tunit library is a unit-testing framework for modern C++17/20, inspired by Microsoft.VisualStudio.TestTools.Cpp.

Getting Started

  • Installation provides download, install and uninstall documentation.
  • Guides provides xtd guides and tutorials.
  • Examples provides over 750 examples to help you use xtd, grouped by libraries and topics.

Development status

  • Release notes provides release notes information.
  • Roadmap provides a view of the xtd roadmap.
  • Kanban board provides a Kanban view for all tasks (enhancements, pull requests, bugs, questions,...).
  • Development status provides information about classes and libraries development status.
  • Translation status provides information about translations status.

Current release status

GitHub milestone GitHub milestone

This project is an open source project. The developers who participate do so on their own time. It is therefore difficult to fix realese dates.

But you can follow the evolution of the development. We keep the status up to date.

Continuous Integration build status

At each commit, a build and unit tests are performed for the following configurations :

Operating system Debug Release
Windows (x64) Windows (x64) Debug Windows (x64) Release
Windows (x86) Windows (x86) Debug Windows (x86) Release
macOS macOS Debug macOS Release
Ubuntu Ubuntu Debug Ubuntu Release
iOS (**) Coming soon Coming soon
Android (**) Coming soon Coming soon

(**) xtd.core and xtd.tunit only.

Deploy to GitHub Pages status
Deployment of the website Ubuntu Debug
Deployment of the latest reference guide Ubuntu Debug

Issues status

As xtd is managed by a Kanban project, the number of open issues can be quite large. The table below gives a clearer view on the number of open bugs/questions and enhancements.

Issues Open Closed
Bugs / Questions from users GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.1.0 - Enhancements / Developments (*) GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.1.1 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.2.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.3.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.4.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 1.0.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo

(*) There is only one enhancement for xtd 0.1.0, as project management was not yet available.

Examples

The classic first application 'Hello World'.

Console (CLI)

hello_world_console.cpp

#include <xtd/xtd>

using namespace xtd;

auto main()->int {
  console::background_color(console_color::blue);
  console::foreground_color(console_color::white);
  console::write_line("Hello, World!");
}

or simply

#include <xtd/xtd>

using namespace xtd;

auto main()->int {
  console::out << background_color(console_color::blue) << foreground_color(console_color::white) << "Hello, World!" << environment::new_line();
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

project(hello_world_console)
find_package(xtd REQUIRED)
add_sources(hello_world_console.cpp)
target_type(CONSOLE_APPLICATION)

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

Screenshot

Forms (GUI like WinForms)

hello_world_forms.cpp

#include <xtd/xtd>

using namespace xtd::forms;

class main_form : public form {
public:
  main_form() {
    text("Hello world (message_box)");

    button1.location({10, 10});
    button1.parent(*this);
    button1.text("&Click me");
    button1.click += [] {
      message_box::show("Hello, World!");
    };
  }
  
private:
  button button1;
};

auto main()->int {
  application::run(main_form {});
}

or simply

#include <xtd/xtd>

auto main()->int {
  auto main_form = xtd::forms::form::create("Hello world (message_box)");
  auto button1 = xtd::forms::button::create(main_form, "&Click me", {10, 10});
  button1.click += [] {xtd::forms::message_box::show("Hello, World!");};
  xtd::forms::application::run(main_form);
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

project(hello_world_forms)
find_package(xtd REQUIRED)
add_sources(hello_world_forms.cpp)
target_type(GUI_APPLICATION)

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

Windows

Screenshot

Screenshot

macOS

Screenshot

Screenshot

Linux Gnome

Screenshot

Screenshot

tunit (Unit tests like Microsoft Unit Testing Framework)

hello_world_test.cpp

#include <xtd/xtd>
#include <string>

using namespace std;
using namespace xtd::tunit;

namespace unit_tests {
  class test_class_(hello_world_test) {
    void test_method_(create_string_from_literal) {
      auto s = string {"Hello, World!"};
      valid::are_equal(13, s.size());
      assert::are_equal("Hello, World!", s);
    }
    
    void test_method_(create_string_from_chars) {
      auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
      valid::are_equal(13, s.size());
      string_assert::starts_with("Hello,", s);
      string_assert::ends_with(" World!", s);
    }
  };
}

auto main()->int {
  return console_unit_test().run();
}

or without helpers

#include <xtd/xtd>
#include <string>

using namespace std;
using namespace xtd::tunit;

namespace unit_tests {
  class hello_world_test;
  
  auto hello_world_test_class_attr = test_class_attribute<hello_world_test> {"unit_tests::hello_world_test"};
  class hello_world_test : public test_class {
    test_method_attribute create_string_from_literal_attr {"create_string_from_literal", *this, &hello_world_test::create_string_from_literal};
    void create_string_from_literal() {
      auto s = string {"Hello, World!"};
      valid::are_equal(13, s.size());
      assert::are_equal("Hello, World!", s);
    }
    
    test_method_attribute create_string_from_chars_attr {"create_string_from_chars", *this, &hello_world_test::create_string_from_chars};
    void create_string_from_chars() {
      auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
      valid::are_equal(13, s.size());
      string_assert::starts_with("Hello,", s);
      string_assert::ends_with(" World!", s);
    }
  };
}

auto main()->int {
  return console_unit_test().run();
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)

project(hello_world_test)
find_package(xtd REQUIRED)
add_sources(hello_world_test.cpp)
target_type(TEST_APPLICATION)

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

Screenshot

Visual Studio Output

Screenshot

Gallery

Minesweeper

minesweeper

minesweeper (on Windows)


Game of Life

game_of_life

game_of_life (on macOS)


xtdc-gui

xtdc-gui

xtdc-gui - Create a new project (on macOS)


Calculator

calculator

calculator (on Ubuntu)


Stopwatch

stopwatch

stopwatch (on Windows)


Painting

painting

painting (on Ubuntu)

Contributing

The authors file lists contributors together with contact information. If you make a contribution, please add yourself to the list.

Your contributions are welcome.

  • First read Code of conduct and the design guidelines to make sure your contribution follows the rules.
  • Fork the project and use a pull request for adding your contribution.
  • If you face any problems feel free to open an issue at the issues tracker, If you feel like there is a missing feature, please raise a ticket on Github. Pull request are also welcome.

Your feedback is important for the evolution of the project.

Beginners

The following project aims to simplify and guide the way beginners make their first contribution. If you are looking to make your first contribution, check out the project below.

First Contributions

Now you are ready to make your first contribution to xtd.

See also


ยฉ 2024 Gammasoft.

More Repositories

1

Examples_wxWidgets

Shows how to use wxWidgets controls only by programming code (c++17).
C++
160
star
2

Examples_Cocoa

Shows how to use macOS AppKit Cocoa controls without StoryBoard only by programming code (objective-c)
Objective-C
90
star
3

Examples_Qt

Shows how to use Qt widgets only by programming code (c++17).
C++
76
star
4

Examples_Win32

Shows how to use Win32 controls by programming code (c++17).
C++
68
star
5

Examples_FLTK

Shows how to use Fltk controls only by programming code (c++17).
C++
53
star
6

Examples_Gtkmm

Shows how to use Gtkmm controls by programming code (c++17).
C++
46
star
7

properties

another c#-like property accessor for C++11 and above.
C++
20
star
8

Examples

Shows how to use Gui controls with some common toolkits.
15
star
9

delegates

Modern c ++17 library containing multicast delegate and event classes.
C++
13
star
10

tunit

Modern c++17 unit testing framework on Microsoft Windows, Apple macOS, Linux, iOS and android.
C++
11
star
11

Examples_Gtk

Shows how to use Gtk3 controls by programming code (c++17).
C++
10
star
12

xtd_c

Free open-source C11 framework to create console, forms (GUI like WinForms) and unit test applications on Microsoft Windows, Apple macOS and Linux.
C
9
star
13

Examples_CSharp

Shows how to use .Net Framework controls without RAD only by programming code : Console, Gui (WinForms) and unit tests (CSharp)
C#
7
star
14

cursors

windows, macOS and gtk cursors
5
star
15

xtd_tools

The xtd_tools project is a collection of tools to help xtd development.
C++
5
star
16

cron-gui

Simple GUI to managing your local crontab on Windows, macOS and linux.
C++
5
star
17

Examples_Cpp

Shows how to use c++17.
C++
4
star
18

Examples_Python

Shows how to use tkinter and wxPython only by programming code (Python).
Python
4
star
19

Exemples_SDL2

CMake
3
star
20

Examples_C

C
3
star
21

win32_gui

C++ Win32 gui draft project used to experiment with xtd.
C++
2
star
22

tunit_gui_win_forms

C#
2
star
23

xtd_forms

Modern c++17 library to create native gui for Microsoft Windows, Apple macOS and Linux.
C++
2
star
24

xtd_console

Modern c++17 library to manage console application on Microsoft Windows, Apple macOS and Linux.
C++
2
star
25

xtd_io

xtd.io is a modern c++17 library, that allow reading and writing to files and data streams, and that provide basic file and directory support, for Windows, macOS, Linux, iOS and android.
C++
1
star
26

xtd_emoticons_generator

C++
1
star
27

xtd_strings

Modern c++17 library to add string manipulations on Windows, macOS, Linux, iOS and android.
C++
1
star
28

xtd_diagnostics

Modern c++ 17 library providing classes that allow you to interact with system processes, event logs, and performance counters.
C++
1
star
29

xtd_threading

Modern c++17 library providing classes for multithreaded programming.
CMake
1
star
30

xtd_drawing

Modern c++17 library providing access to GDI+ basic graphics functionality. More advanced functionality is provided in the drawing 2D, imaging, and text.
C++
1
star
31

xtd_core

Modern c++17 library providing information about, and means to manipulate, the current environment and platform.
C++
1
star
32

Examples_JUCE

Shows how to use JUCE only by programming code (c++17) and CMake.
C++
1
star