From acf250310c0549b74afbfe19fbcbcb03492e9566 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Mon, 16 Nov 2020 21:51:24 +1000 Subject: Fix build diff --git a/CMakeLists.txt b/CMakeLists.txt index d184843..29a4b68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,7 +430,7 @@ include(CMakeLists_Dependencies.cmake) ############################################################################################################## ########## Include Setup ########## -TEST_BIG_ENDIAN(WORDS_BIGENDIAN) +#TEST_BIG_ENDIAN(WORDS_BIGENDIAN) CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) if(HAVE_DLFCN_H) diff --git a/scribus/scpaths.cpp b/scribus/scpaths.cpp index 0a0185a..8820364 100644 --- a/scribus/scpaths.cpp +++ b/scribus/scpaths.cpp @@ -327,6 +327,15 @@ QStringList ScPaths::spellDirs() const d.setPath(linuxLocalPath); if (d.exists()) spellDirs.append(linuxLocalPath); +#elif defined(Q_OS_HAIKU) + QString haikuSystemHunspellPath("/system/data/hunspell/"); + QString haikuUserHunspellPath("/boot/home/config/non-packaged/data/hunspell/"); + d.setPath(haikuSystemHunspellPath); + if (d.exists()) + spellDirs.append(haikuSystemHunspellPath); + d.setPath(haikuUserHunspellPath); + if (d.exists()) + spellDirs.append(haikuUserHunspellPath); #endif return spellDirs; } @@ -393,6 +402,19 @@ QStringList ScPaths::hyphDirs() const d.setPath(linuxLocalPath); if (d.exists()) hyphDirs.append(linuxLocalPath); +#elif defined(Q_OS_HAIKU) + QString haikuSystemHyphenPath("/system/data/hyphen/"); + QString haikuSystemHunspellPath("/system/data/hunspell/"); + QString haikuUserHunspellPath("/boot/home/config/non-packaged/data/hunspell/"); + d.setPath(haikuSystemHyphenPath); + if (d.exists()) + hyphDirs.append(haikuSystemHyphenPath); + d.setPath(haikuSystemHunspellPath); + if (d.exists()) + hyphDirs.append(haikuSystemHunspellPath); + d.setPath(haikuUserHunspellPath); + if (d.exists()) + hyphDirs.append(haikuUserHunspellPath); #endif return hyphDirs; } @@ -416,6 +438,9 @@ QStringList ScPaths::systemFontDirs() if (d.exists()) fontDirs.append(roamingFontDir); fontDirs.append(windowsSpecialDir(CSIDL_FONTS)); +#elif defined(Q_OS_HAIKU) + fontDirs.append("/system/data/fonts/ttfonts"); + fontDirs.append("/boot/home/config/non-packaged/data/fonts"); #endif return fontDirs; } diff --git a/scribus/third_party/pgf/PGFplatform.h b/scribus/third_party/pgf/PGFplatform.h index 55a5828..f421582 100644 --- a/scribus/third_party/pgf/PGFplatform.h +++ b/scribus/third_party/pgf/PGFplatform.h @@ -529,7 +529,7 @@ __inline OSError FileWrite(HANDLE hFile, int *count, void *buffPtr) { } __inline OSError GetFPos(HANDLE hFile, UINT64 *pos) { - #ifdef __APPLE__ + #if defined(__APPLE__) || defined(__HAIKU__) off_t ret; if ((ret = lseek(hFile, 0, SEEK_CUR)) == -1) { return errno; @@ -549,7 +549,7 @@ __inline OSError GetFPos(HANDLE hFile, UINT64 *pos) { } __inline OSError SetFPos(HANDLE hFile, int posMode, INT64 posOff) { - #ifdef __APPLE__ + #if defined(__APPLE__) || defined(__HAIKU__) if ((lseek(hFile, (off_t)posOff, posMode)) == -1) { return errno; } else { diff --git a/scribus/util_debug.cpp b/scribus/util_debug.cpp index 3c5b241..780c590 100644 --- a/scribus/util_debug.cpp +++ b/scribus/util_debug.cpp @@ -53,7 +53,7 @@ void tDebug(const QString& message) */ void printBacktrace ( int nFrames ) { -#if !defined(_WIN32) && !defined(Q_OS_MACOS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_FREEBSD) +#if !defined(_WIN32) && !defined(Q_OS_MACOS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_HAIKU) void ** trace = new void*[nFrames + 1]; char **messages = ( char ** ) nullptr; int i, trace_size = 0; -- 2.42.1 From b8b306f53f68c57c46cfd6b67e60efdd99549cac Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Fri, 8 Jan 2021 22:00:46 +1000 Subject: Fix for app font diff --git a/scribus/prefsmanager.cpp b/scribus/prefsmanager.cpp index 2d3a88e..eb72582 100644 --- a/scribus/prefsmanager.cpp +++ b/scribus/prefsmanager.cpp @@ -2797,9 +2797,11 @@ bool PrefsManager::readPref(const QString& filePath) else appPrefs.uiPrefs.style.clear(); } +#ifndef Q_OS_HAIKU QFont apf = QApplication::font(); apf.setPointSize(appPrefs.uiPrefs.applicationFontSize); QApplication::setFont(apf); +#endif return true; } diff --git a/scribus/scribus.cpp b/scribus/scribus.cpp index 24f0dc6..31d3464 100644 --- a/scribus/scribus.cpp +++ b/scribus/scribus.cpp @@ -6479,12 +6479,14 @@ void ScribusMainWindow::slotPrefsOrg() ScQApp->changeIconSet(newIconSet); int newUIFontSize = m_prefsManager.guiFontSize(); +#ifndef Q_OS_HAIKU if (oldPrefs.uiPrefs.applicationFontSize != newUIFontSize) { QFont apf = QApplication::font(); apf.setPointSize(newUIFontSize); QApplication::setFont(apf); } +#endif emit UpdateRequest(reqDefFontListUpdate); if (m_prefsManager.appPrefs.uiPrefs.useTabs) { -- 2.42.1 From e6a1e1c485659e33110215b156f4c27547eedf13 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Mon, 22 Nov 2021 20:40:09 +0100 Subject: Prefer the shared libpython3 diff --git a/CMakeLists_Dependencies.cmake b/CMakeLists_Dependencies.cmake index 05dd4fc..e16165c 100644 --- a/CMakeLists_Dependencies.cmake +++ b/CMakeLists_Dependencies.cmake @@ -200,6 +200,7 @@ endif() #<< PYTHON if (NOT WANT_PYTHON_2X) message("Python 3.x Selected") + set (Python3_USE_STATIC_LIBS FALSE) find_package (Python3 REQUIRED COMPONENTS Interpreter Development) if (Python3_Development_FOUND) message("Python 3.x Library Found OK (Version ${Python3_VERSION})") -- 2.42.1 From 39960d02011f1f4a910cbb4aa09f79871645f4ca Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 25 Feb 2022 20:42:38 +0100 Subject: fix uint32_t type for x86 diff --git a/scribus/imagedataloaders/scimgdataloader_tiff.cpp b/scribus/imagedataloaders/scimgdataloader_tiff.cpp index a73ca7a..260d837 100644 --- a/scribus/imagedataloaders/scimgdataloader_tiff.cpp +++ b/scribus/imagedataloaders/scimgdataloader_tiff.cpp @@ -49,7 +49,7 @@ void ScImgDataLoader_TIFF::loadEmbeddedProfile(const QString& fn, int /*page*/) if (!tif) return; - uint32_t EmbedLen = 0; + uint32 EmbedLen = 0; void* EmbedBuffer; if (TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer)) { @@ -302,19 +302,19 @@ bool ScImgDataLoader_TIFF::getImageData(TIFF* tif, RawImage *image, uint widtht, if (TIFFIsTiled(tif)) { - uint32_t columns, rows; - uint32_t *tile_buf; + uint32 columns, rows; + uint32 *tile_buf; TIFFGetField(tif, TIFFTAG_TILEWIDTH, &columns); TIFFGetField(tif, TIFFTAG_TILELENGTH, &rows); - tile_buf = (uint32_t*) _TIFFmalloc(columns * rows * sizeof(uint32_t)); + tile_buf = (uint32*) _TIFFmalloc(columns * rows * sizeof(uint32)); if (tile_buf == nullptr) { TIFFClose(tif); return false; } - uint32_t tileW = columns; - uint32_t tileH = rows; - for (uint32_t yt = 0; yt < (uint32_t) image->height(); yt += rows) + uint32 tileW = columns; + uint32 tileH = rows; + for (uint32 yt = 0; yt < (uint32) image->height(); yt += rows) { if (yt > (uint) image->height()) break; @@ -322,10 +322,10 @@ bool ScImgDataLoader_TIFF::getImageData(TIFF* tif, RawImage *image, uint widtht, tileH = image->height() - yt; tileW = columns; int chans = image->channels(); - for (uint32_t xt = 0; xt < (uint) image->width(); xt += columns) + for (uint32 xt = 0; xt < (uint) image->width(); xt += columns) { TIFFReadTile(tif, tile_buf, xt, yt, 0, 0); - for (uint32_t yi = 0; yi < tileH; yi++) + for (uint32 yi = 0; yi < tileH; yi++) { _TIFFmemcpy(image->scanLine(yt + (tileH - 1 - yi)) + xt, tile_buf + tileW * yi, tileW * chans); } @@ -337,7 +337,7 @@ bool ScImgDataLoader_TIFF::getImageData(TIFF* tif, RawImage *image, uint widtht, { int chans = image->channels(); tsize_t bytesperrow = TIFFScanlineSize(tif); - uint32_t *bits = (uint32_t *) _TIFFmalloc(bytesperrow); + uint32 *bits = (uint32 *) _TIFFmalloc(bytesperrow); if (bits) { for (unsigned int y = 0; y < heightt; y++) @@ -363,7 +363,7 @@ bool ScImgDataLoader_TIFF::getImageData(TIFF* tif, RawImage *image, uint widtht, bool ScImgDataLoader_TIFF::getImageData_RGBA(TIFF* tif, RawImage *image, uint widtht, uint heightt, uint size, const SampleFormatInfo& sampleInfo) { - uint32_t* bits = (uint32_t *) _TIFFmalloc(size * sizeof(uint32_t)); + uint32* bits = (uint32 *) _TIFFmalloc(size * sizeof(uint32)); if (!bits) return false; @@ -755,7 +755,7 @@ bool ScImgDataLoader_TIFF::loadPicture(const QString& fn, int page, int res, boo m_imageInfoRecord.profileName.clear(); m_imageInfoRecord.embeddedProfileName.clear(); - uint32_t EmbedLen = 0; + uint32 EmbedLen = 0; void* EmbedBuffer; if (TIFFGetField(tif, TIFFTAG_ICCPROFILE, &EmbedLen, &EmbedBuffer)) { -- 2.42.1 From ce882187467939b7bc69a4d270b8ec111f9e706c Mon Sep 17 00:00:00 2001 From: Begasus Date: Wed, 7 Feb 2024 14:39:53 +0100 Subject: Silence deprecated warnings diff --git a/CMakeLists.txt b/CMakeLists.txt index 29a4b68..8c5b8f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,6 +404,9 @@ if(WIN32) ) set(DLL_USE_NATIVE_API ON) endif() +if(HAIKU) + add_definitions(-Wno-deprecated-declarations) +endif() #C++11 Support #as of 1.5.5.svn, require C++11 -- 2.42.1 From c733b4c46aed6846baef952e7814c5695a96d45c Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 29 May 2024 18:48:34 +0200 Subject: Haiku: don't set platform plugin diff --git a/scribus/main_nix.cpp b/scribus/main_nix.cpp index 626be05..4fa712b 100644 --- a/scribus/main_nix.cpp +++ b/scribus/main_nix.cpp @@ -65,7 +65,7 @@ int mainApp(int argc, char **argv) { emergencyActivated = false; -#if !defined(Q_OS_MACOS) +#if !defined(Q_OS_MACOS) && !defined(Q_OS_HAIKU) qputenv("QT_QPA_PLATFORM", "xcb"); #endif -- 2.42.1