xtd_c (pronounced "extend for c") is a C11 framework to create console (CLI), forms (GUI like WinForms) and tunit (unit tests like Microsoft Unit Testing Framework) applications on Microsoft Windows, Apple macOS, Linux, iOS and android (*).
(*) See portability for more information.
- Free and open-source (MIT License);
- a collection of native C11 libraries, to extend C11 standard;
- API close to the xtd with a modern C11 approach and full integration with the ANSI/ISO standard;
- xtd_c is designed to manage GUI controls and dialogs in pure native mode or with CSS styles.
- written in efficient, C11;
- and highly portable and available on many different platforms;
xtd_c is a C11 wrapper on xtd framework. You need to install xtd before using xtd_c.
xtd_c is composed of several libraries.
The xtd_c.core library is C11 libraries of struct, enum, and value types that provide access to system functionality. It is the foundation on which C11 applications, components, and controls are built.
The xtd_c.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.
The xtd_c.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.
The xtd_c.tunit library is a unit-testing framework for modern C11, inspired by Microsoft.VisualStudio.TestTools.Cpp.
- Comming soon...
- Comming soon...
- Comming soon...
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.
- Comming soon...
- Comming soon...
The classic first application 'Hello World'.
#include <xtd_c/xtd_c.h>
int main(void) {
xtd_console_set_background_color(xtd_console_color_blue);
xtd_console_set_foreground_color(xtd_console_color_white);
xtd_console_write_line("Hello, World!");
return EXIT_SUCCESS;
}
cmake_minimum_required(VERSION 3.3)
project(hello_world_console)
find_package(xtd_c REQUIRED)
add_sources(hello_world_console.c)
target_type(C_CONSOLE_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
#include <xtd_c/xtd_c.h>
void on_button1_click(xtd_object* sender, xtd_event_args e) {
xtd_forms_message_box_show(NULL, "Hello, World!", "", xtd_forms_message_box_buttons_ok, xtd_forms_message_box_icon_none, xtd_forms_message_box_default_button_1, xtd_forms_message_box_options_none, false);
}
int main(void) {
xtd_forms_control* form1 = xtd_forms_form_create();
xtd_forms_control_set_text(form1, "Hello world (message_box)");
xtd_forms_control* button1 = xtd_forms_button_create();
xtd_forms_control_set_location(button1, (xtd_drawing_point){.x = 10, .y = 10});
xtd_forms_control_set_parent(button1, form1);
xtd_forms_control_set_text(button1, "&Click me");
xtd_forms_control_set_click_event(button1, &on_button1_click, NULL);
xtd_forms_application_run(XTD_FORMS_FORM(form1));
xtd_forms_control_destroy(button1);
xtd_forms_control_destroy(form1);
return EXIT_SUCCESS;
}
cmake_minimum_required(VERSION 3.3)
project(hello_world_forms)
find_package(xtd_c REQUIRED)
add_sources(hello_world_forms.c)
target_type(C_GUI_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
#include <xtd_c/xtd_c.h>
#include <string.h>
void XTD_TUNIT_TEST(hello_world_test, create_string_from_literal) {
const char* s = "Hello, World!";
XTD_TUNIT_ASSERT_ARE_EQUAL("Hello, World!", s);
}
void XTD_TUNIT_TEST(hello_world_test, create_string_from_chars) {
const char s[14] = {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\0'};
XTD_TUNIT_VALID_ARE_EQUAL(13, s.size());
XTD_TUNIT_STRING_ASSERT_STARTS_WIDTH("Hello,", s);
XTD_TUNIT_STRING_ASSERT_ENDS_WIDTH(" World!", s);
}
int main(void) {
return xtd_console_unit_test_run();
}
cmake_minimum_required(VERSION 3.3)
project(hello_world_test)
find_package(xtd_c REQUIRED)
add_sources(hello_world_test.c)
target_type(C_TEST_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
- Comming soon...
For more information about xtd framework see xtd website.
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.
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.
Now you are ready to make your first contribution to xtd.
- Comming soon...
© 2022 Gammasoft.