From 7b5608225185938e0de9bdf9eea2865972369024 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 4 Jun 2024 00:45:55 +0300 Subject: [PATCH] added `osdialog` example --- projects/C/osdialog-example/.gitignore | 6 ++++++ projects/C/osdialog-example/README.md | 1 + projects/C/osdialog-example/include/osdialog.h | 1 + projects/C/osdialog-example/src/main.c | 18 ++++++++++++++++++ projects/C/osdialog-example/src/osdialog.c | 1 + .../C/osdialog-example/src/osdialog_zenity.c | 1 + projects/C/osdialog-example/xmake.lua | 9 +++++++++ 7 files changed, 37 insertions(+) create mode 100644 projects/C/osdialog-example/.gitignore create mode 100644 projects/C/osdialog-example/README.md create mode 120000 projects/C/osdialog-example/include/osdialog.h create mode 100644 projects/C/osdialog-example/src/main.c create mode 120000 projects/C/osdialog-example/src/osdialog.c create mode 120000 projects/C/osdialog-example/src/osdialog_zenity.c create mode 100644 projects/C/osdialog-example/xmake.lua diff --git a/projects/C/osdialog-example/.gitignore b/projects/C/osdialog-example/.gitignore new file mode 100644 index 0000000..ed4e21b --- /dev/null +++ b/projects/C/osdialog-example/.gitignore @@ -0,0 +1,6 @@ +# xmake +.xmake/ +build/ + +# 3rd party +third/ diff --git a/projects/C/osdialog-example/README.md b/projects/C/osdialog-example/README.md new file mode 100644 index 0000000..641b3d1 --- /dev/null +++ b/projects/C/osdialog-example/README.md @@ -0,0 +1 @@ +https://github.com/AndrewBelt/osdialog.git diff --git a/projects/C/osdialog-example/include/osdialog.h b/projects/C/osdialog-example/include/osdialog.h new file mode 120000 index 0000000..ab61ef2 --- /dev/null +++ b/projects/C/osdialog-example/include/osdialog.h @@ -0,0 +1 @@ +../third/osdialog/osdialog.h \ No newline at end of file diff --git a/projects/C/osdialog-example/src/main.c b/projects/C/osdialog-example/src/main.c new file mode 100644 index 0000000..2002311 --- /dev/null +++ b/projects/C/osdialog-example/src/main.c @@ -0,0 +1,18 @@ +#include + +#include "osdialog.h" + +int main(int argc, char const *argv[]) { + int res; + + res = osdialog_message(OSDIALOG_INFO, OSDIALOG_OK, "Info こんにちは"); + printf("Result: %d\n", res); + + res = osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK_CANCEL, "Warning こんにちは"); + printf("Result: %d\n", res); + + res = osdialog_message(OSDIALOG_ERROR, OSDIALOG_YES_NO, "Error こんにちは"); + printf("Result: %d\n", res); + + return 0; +} diff --git a/projects/C/osdialog-example/src/osdialog.c b/projects/C/osdialog-example/src/osdialog.c new file mode 120000 index 0000000..a07f251 --- /dev/null +++ b/projects/C/osdialog-example/src/osdialog.c @@ -0,0 +1 @@ +../third/osdialog/osdialog.c \ No newline at end of file diff --git a/projects/C/osdialog-example/src/osdialog_zenity.c b/projects/C/osdialog-example/src/osdialog_zenity.c new file mode 120000 index 0000000..02c8fd3 --- /dev/null +++ b/projects/C/osdialog-example/src/osdialog_zenity.c @@ -0,0 +1 @@ +../third/osdialog/osdialog_zenity.c \ No newline at end of file diff --git a/projects/C/osdialog-example/xmake.lua b/projects/C/osdialog-example/xmake.lua new file mode 100644 index 0000000..27a6324 --- /dev/null +++ b/projects/C/osdialog-example/xmake.lua @@ -0,0 +1,9 @@ +set_project("osdialog-example") +set_languages("c99") +add_rules("mode.release") + +add_includedirs("include") + +target("osdialog-example") + set_kind("binary") + add_files("src/*.c")