BSD build support

This commit is contained in:
DepressedTWM 2026-05-25 10:34:04 +04:00
parent ae51f718ce
commit 278f016684
3 changed files with 22 additions and 28 deletions

View file

@ -153,6 +153,15 @@ elseif(LINUX)
list(APPEND PLATFORM_LIBRARIES ${LINUXPKGS_LDFLAGS}) list(APPEND PLATFORM_LIBRARIES ${LINUXPKGS_LDFLAGS})
list(APPEND MAIN_SOURCE src/xdg-user-dir-lookup.c) list(APPEND MAIN_SOURCE src/xdg-user-dir-lookup.c)
list(APPEND MAIN_HEADERS src/xdg-user-dir-lookup.h) list(APPEND MAIN_HEADERS src/xdg-user-dir-lookup.h)
elseif(BSD)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LINUXPKGS REQUIRED gtk+-3.0 libxfconf-0)
include_directories(${LINUXPKGS_INCLUDE_DIRS})
add_compile_options(${LINUXPKGS_CFLAGS_OTHER})
list(APPEND PLATFORM_LIBRARIES ${LINUXPKGS_LDFLAGS})
list(APPEND MAIN_SOURCE src/xdg-user-dir-lookup.c)
list(APPEND MAIN_HEADERS src/xdg-user-dir-lookup.h)
set(STEAM OFF)
endif() endif()
if (STEAM) if (STEAM)
@ -283,7 +292,7 @@ set(BINDING_SOURCE
binding-mri/module_rpg.cpp binding-mri/module_rpg.cpp
binding-mri/filesystem-binding.cpp binding-mri/filesystem-binding.cpp
binding-mri/oneshot-binding.cpp binding-mri/oneshot-binding.cpp
binding-mri/sunshine-binding.cpp binding-mri/sunshine-binding.cpp
binding-mri/steam-binding.cpp binding-mri/steam-binding.cpp
binding-mri/wallpaper-binding.cpp binding-mri/wallpaper-binding.cpp
binding-mri/journal-binding.cpp binding-mri/journal-binding.cpp

View file

@ -125,8 +125,7 @@ struct BitmapPrivate{
void addTaintedArea(const IntRect &rect){ void addTaintedArea(const IntRect &rect){
IntRect norm = normalizedRect(rect); IntRect norm = normalizedRect(rect);
pixman_region_union_rect pixman_region_union_rect(&tainted, &tainted, norm.x, norm.y, norm.w, norm.h);
(&tainted, &tainted, norm.x, norm.y, norm.w, norm.h);
} }
void substractTaintedArea(const IntRect &rect){ void substractTaintedArea(const IntRect &rect){
@ -148,8 +147,7 @@ struct BitmapPrivate{
box.x2 = rect.x + rect.w; box.x2 = rect.x + rect.w;
box.y2 = rect.y + rect.h; box.y2 = rect.y + rect.h;
pixman_region_overlap_t result = pixman_region_overlap_t result = pixman_region_contains_rectangle(&tainted, &box);
pixman_region_contains_rectangle(&tainted, &box);
return result != PIXMAN_REGION_OUT; return result != PIXMAN_REGION_OUT;
} }
@ -1103,8 +1101,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align){
/* http://www.lemoda.net/c/utf8-to-ucs2/index.html */ /* http://www.lemoda.net/c/utf8-to-ucs2/index.html */
static uint16_t utf8_to_ucs2(const char *_input, const char **end_ptr){ static uint16_t utf8_to_ucs2(const char *_input, const char **end_ptr){
const unsigned char *input = const unsigned char *input = reinterpret_cast<const unsigned char*>(_input);
reinterpret_cast<const unsigned char*>(_input);
*end_ptr = _input; *end_ptr = _input;
if (input[0] == 0) if (input[0] == 0)

View file

@ -48,26 +48,17 @@ public:
int height() const; int height() const;
IntRect rect() const; IntRect rect() const;
void blt(int x, int y, void blt(int x, int y, const Bitmap &source, IntRect rect, int opacity = 255);
const Bitmap &source, IntRect rect,
int opacity = 255);
void stretchBlt(const IntRect &destRect, void stretchBlt(const IntRect &destRect, const Bitmap &source, const IntRect &sourceRect, int opacity = 255);
const Bitmap &source, const IntRect &sourceRect,
int opacity = 255); void fillRect(int x, int y, int width, int height, const Vec4 &color);
void fillRect(int x, int y,
int width, int height,
const Vec4 &color);
void fillRect(const IntRect &rect, const Vec4 &color); void fillRect(const IntRect &rect, const Vec4 &color);
void gradientFillRect(int x, int y, void gradientFillRect(int x, int y, int width, int height, const Vec4 &color1, const Vec4 &color2, bool vertical = false);
int width, int height,
const Vec4 &color1, const Vec4 &color2, void gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec4 &color2, bool vertical = false);
bool vertical = false);
void gradientFillRect(const IntRect &rect,
const Vec4 &color1, const Vec4 &color2,
bool vertical = false);
void clearRect(int x, int y, void clearRect(int x, int y,
int width, int height); int width, int height);
@ -89,12 +80,9 @@ public:
Right = 2 Right = 2
}; };
void drawText(int x, int y, void drawText(int x, int y, int width, int height, const char *str, int align = Left);
int width, int height,
const char *str, int align = Left);
void drawText(const IntRect &rect, void drawText(const IntRect &rect, const char *str, int align = Left);
const char *str, int align = Left);
IntRect textSize(const char *str); IntRect textSize(const char *str);