Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cmake deps #71

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 25 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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: ['images-shared'],
required: false,
) #cc.find_library('fltk_images', dirs: ['/usr/lib'], required: false)
libfltk_forms_dep = dependency(
'FLTK',
method: 'cmake',
modules: ['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
Expand Down Expand Up @@ -375,4 +395,4 @@ pconf.generate(
description: 'VS fltk library (C interface only)',
url: 'https://github.com/KaruroChori/vs-fltk/',
version: meson.project_version(),
)
)
2 changes: 1 addition & 1 deletion scripts/build-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions src/themes/default-cute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#include "FL/Fl.H"
#include "FL/Fl_SVG_Image.H"
#include "FL/fl_draw.H"
#include "nanosvg/nanosvg.h"
//#include "nanosvg/nanosvg.h"
#include <cstdint>
#include <format>
#include <string>

namespace vs{

namespace theme_cute{
/*
void up_box(int x, int y, int w, int h, Fl_Color c){
std::string s = std::format("<svg viewBox='0 0 {} {}'>\
<rect x='1%' y='1%' stroke-width='2' rx='10%' width='96%' height='96%' stroke='rgb({}, {}, {})' fill='none' />\
Expand All @@ -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){
Expand All @@ -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}

Expand Down Expand Up @@ -98,14 +100,14 @@ constexpr uint8_t colors[][3] = {
void apply(){
//for(int i =0;i<sizeof(colors)/3;i++)Fl::set_color(i,colors[i][0],colors[i][1],colors[i][2]);
/**/
Fl::set_boxtype(FL_UP_BOX, up_box, 2, 2, 4, 4);
/*Fl::set_boxtype(FL_UP_BOX, up_box, 2, 2, 4, 4);
Fl::set_boxtype(FL_DIAMOND_UP_BOX, diamondup_box, 2, 2, 4, 4);

Fl::set_boxtype(FL_DOWN_BOX, up_box, 2, 2, 4, 4);
Fl::set_boxtype(FL_DIAMOND_DOWN_BOX, diamondup_box, 2, 2, 4, 4);

Fl::set_boxtype(FL_ROUND_DOWN_BOX, diamondup_box, 2, 2, 4, 4);
Fl::set_boxtype(FL_BORDER_BOX, diamondup_box, 2, 2, 4, 4);
Fl::set_boxtype(FL_BORDER_BOX, diamondup_box, 2, 2, 4, 4);*/
}

}
Expand Down
Loading