From 65ecfdf3d9d923949b2f2d47f4ab0129f0f61278 Mon Sep 17 00:00:00 2001 From: karurochari Date: Sat, 14 Dec 2024 14:44:59 +0000 Subject: [PATCH] Testing system fltk --- .github/workflows/build.yml | 5 +++-- meson.build | 28 ++++++++++++++++++++++++---- scripts/build-default.sh | 2 +- src/themes/default-cute.cpp | 22 ++++++++++++---------- 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51f7e401..dd7a5764 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,8 +85,9 @@ jobs: freeglut \ libpng \ meson \ - ninja - brew install --cask xquartz + ninja \ + fltk + #brew install --cask xquartz cd /opt/homebrew/opt/llvm/bin #ln -s clang++ clang++-19 PATH=/opt/homebrew/opt/llvm/bin:$PATH diff --git a/meson.build b/meson.build index 762e6606..42e810ce 100644 --- a/meson.build +++ b/meson.build @@ -61,11 +61,31 @@ if need_pugixml or get_option('use_system_pugixml') == false endif if get_option('use_system_fltk') - libfltk_dep = dependency('fltk', version: '>=1.4', required: false) - libfltk_images_dep = dependency('fltk-images', version: '>=1.4', required: false) - libfltk_forms_dep = dependency('fltk-forms', version: '>=1.4', required: false) + libfltk_dep = dependency('fltk', required: false) + libfltk_images_dep = dependency('fltk-images', required: false) + libfltk_forms_dep = dependency('fltk-forms', required: false) if libfltk_dep.found() == false or libfltk_images_dep.found() == false or libfltk_forms_dep.found() == false - need_fltk = true + libfltk_dep = dependency( + 'FLTK', + method: 'cmake', + modules: ['fltk-shared'], + required: false, + ) #cc.find_library('fltk', dirs: ['/usr/lib'], required: false) + libfltk_images_dep = dependency( + 'FLTK', + method: 'cmake', + modules: ['fltk-images-shared'], + required: false, + ) #cc.find_library('fltk_images', dirs: ['/usr/lib'], required: false) + libfltk_forms_dep = dependency( + 'FLTK', + method: 'cmake', + modules: ['fltk-forms-shared'], + required: false, + ) #cc.find_library('fltk_forms', dirs: ['/usr/lib'], required: false) + if libfltk_dep.found() == false or libfltk_images_dep.found() == false or libfltk_forms_dep.found() == false + need_fltk = true + endif endif endif if need_fltk == true or get_option('use_system_fltk') == false diff --git a/scripts/build-default.sh b/scripts/build-default.sh index 78f91a31..ae611567 100755 --- a/scripts/build-default.sh +++ b/scripts/build-default.sh @@ -53,7 +53,7 @@ else if [ "$(uname)" != "Darwin" ]; then bun run meson-setup.clang-release else - meson setup -Dforce_x11_backend=true --reconfigure build --buildtype=release --native-file toolchains/flatpak.ini + meson setup -Dforce_x11_backend=false --reconfigure build --buildtype=release --native-file toolchains/flatpak.ini # Unclear fix to be investigated rm subprojects/libtcc/VERSION fi diff --git a/src/themes/default-cute.cpp b/src/themes/default-cute.cpp index 7d6e425a..8288e3a4 100644 --- a/src/themes/default-cute.cpp +++ b/src/themes/default-cute.cpp @@ -2,7 +2,7 @@ #include "FL/Fl.H" #include "FL/Fl_SVG_Image.H" #include "FL/fl_draw.H" -#include "nanosvg/nanosvg.h" +//#include "nanosvg/nanosvg.h" #include #include #include @@ -10,6 +10,7 @@ namespace vs{ namespace theme_cute{ + /* void up_box(int x, int y, int w, int h, Fl_Color c){ std::string s = std::format("\ \ @@ -18,9 +19,9 @@ void up_box(int x, int y, int w, int h, Fl_Color c){ Fl_SVG_Image img (">",s.c_str()); img.draw(x,y,w,h); //fl_draw_box(Fl_Boxtype::FL_FLAT_BOX, x, y, w, h, c); - /* let col1 = c.to_rgb(); - let col = Color::color_average(c, Color::Background, 0.8).to_rgb(); - draw::draw_rbox(x, y, w, h, 5, true, Color::from_rgb(col.0, col.1, col.2));*/ + // let col1 = c.to_rgb(); + //let col = Color::color_average(c, Color::Background, 0.8).to_rgb(); + //draw::draw_rbox(x, y, w, h, 5, true, Color::from_rgb(col.0, col.1, col.2)); } void diamondup_box(int x, int y, int w, int h, Fl_Color c){ @@ -30,12 +31,13 @@ void diamondup_box(int x, int y, int w, int h, Fl_Color c){ Fl_SVG_Image img (">>",s.c_str()); img.draw(x,y,w,h); - /* let col1 = c.to_rgb(); - let col = Color::color_average(c, Color::Background, 0.8).to_rgb(); - draw::draw_rbox(x, y, w, h, 5, true, Color::from_rgb(col.0, col.1, col.2));*/ - //fl_draw_box(Fl_Boxtype::FL_FLAT_BOX, x, y, w, h, c); + // let col1 = c.to_rgb(); + //let col = Color::color_average(c, Color::Background, 0.8).to_rgb(); + //draw::draw_rbox(x, y, w, h, 5, true, Color::from_rgb(col.0, col.1, col.2)); + // //fl_draw_box(Fl_Boxtype::FL_FLAT_BOX, x, y, w, h, c); } +*/ /* #define cmap(i,r,g,b) [i]={r,g,b} @@ -98,14 +100,14 @@ constexpr uint8_t colors[][3] = { void apply(){ //for(int i =0;i