Compare commits

..

4 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
4d89b2903b Fix up 6c20e5db: let PARAGRAPH_GOTO use SCROLL_TOP again
As said, this was an experiment. It did not seem to stick.
2024-10-05 15:30:22 +02:00
Jean-Marc Lasgouttes
02beaa0a7b Remove configure test for std::call_once
It was not needed anymore since 193cda6e.
2024-10-05 15:18:19 +02:00
Jean-Marc Lasgouttes
09684899d6 Clean up after removal of strfwd.h
Remove autoconf tests for whether std::string uses COW, since this is
forbidden by C++11 standard.

Forbid the use of gcc 4.9 (which still uses COW).

Remove code in debug.h that added forward declarations for LLVM's
libc++, since we do not do forward declarations anymore.

Remove configure test for libc++.
2024-10-05 15:15:21 +02:00
Juergen Spitzmueller
1f7e8d3ffe Adhere to semantic background color with default branches
This fixes color mismatched when "use system colors" is checked

See https://marc.info/?l=lyx-users&m=172797086718347
2024-10-05 14:15:19 +02:00
6 changed files with 15 additions and 75 deletions

View File

@ -52,8 +52,9 @@ You will also probably need GNU m4 (perhaps installed as gm4).
Requirements Requirements
------------ ------------
First of all, you will need a C++11 standard conforming compiler, like g++ (at First of all, you will need a C++11 standard conforming compiler, like
least 5.0, to have proper std::regex & std::string) or clang++. g++ (at least 5.0, to have proper std::regex & std::string) or
clang++.
LyX makes great use of the C++ Standard Library. This means that gcc LyX makes great use of the C++ Standard Library. This means that gcc
users will have to install the relevant libstdc++ library to be able users will have to install the relevant libstdc++ library to be able

View File

@ -210,32 +210,6 @@ AC_DEFUN([LYX_CXX_CXX11_FLAGS],
]) ])
dnl Usage: LYX_CXX_USE_CALL_ONCE
dnl check whether we can use std::call_once and set the
dnl LYX_USE_STD_CALL_ONCE macro and conditional accordingly.
AC_DEFUN([LYX_CXX_USE_CALL_ONCE],
[AC_MSG_CHECKING([for std::call_once availability])
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <mutex>
static std::once_flag flag;
]], [[
std::call_once(flag, [](){ return; });
]])],[lyx_std_call_once=yes],[lyx_std_call_once=no])
CXXFLAGS=$save_CXXFLAGS
CPPFLAGS=$save_CPPFLAGS
AC_MSG_RESULT([$lyx_std_call_once])
if test $lyx_std_call_once = yes ; then
AC_DEFINE([LYX_USE_STD_CALL_ONCE], 1, [define to 1 if std::call_once is supported by the compiler])
fi
AM_CONDITIONAL([LYX_USE_STD_CALL_ONCE], test $lyx_std_call_once = yes)
])
dnl Usage: LYX_LIB_STDCXX: set lyx_cv_lib_stdcxx to yes if the STL library is libstdc++. dnl Usage: LYX_LIB_STDCXX: set lyx_cv_lib_stdcxx to yes if the STL library is libstdc++.
AC_DEFUN([LYX_LIB_STDCXX], AC_DEFUN([LYX_LIB_STDCXX],
[AC_CACHE_CHECK([whether STL is libstdc++], [AC_CACHE_CHECK([whether STL is libstdc++],
@ -248,19 +222,6 @@ AC_DEFUN([LYX_LIB_STDCXX],
]) ])
dnl Usage: LYX_LIB_STDCXX_CXX11_ABI: set lyx_cv_lib_stdcxx_cxx11_abi to yes
dnl if the STL library is GNU libstdc++ and the C++11 ABI is used.
AC_DEFUN([LYX_LIB_STDCXX_CXX11_ABI],
[AC_CACHE_CHECK([whether STL is libstdc++ using the C++11 ABI],
[lyx_cv_lib_stdcxx_cxx11_abi],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include<vector>]], [[
#if ! defined(_GLIBCXX_USE_CXX11_ABI) || ! _GLIBCXX_USE_CXX11_ABI
this is not libstdc++ using the C++11 ABI
#endif
]])],[lyx_cv_lib_stdcxx_cxx11_abi=yes],[lyx_cv_lib_stdcxx_cxx11_abi=no])])
])
AC_DEFUN([LYX_PROG_CXX], AC_DEFUN([LYX_PROG_CXX],
[AC_REQUIRE([AC_PROG_CXX]) [AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_CXXCPP]) AC_REQUIRE([AC_PROG_CXXCPP])
@ -275,22 +236,8 @@ AC_LANG_PUSH(C++)
LYX_PROG_CLANG LYX_PROG_CLANG
LYX_CXX_CXX11_FLAGS($enable_cxx_mode) LYX_CXX_CXX11_FLAGS($enable_cxx_mode)
LYX_LIB_STDCXX LYX_LIB_STDCXX
LYX_LIB_STDCXX_CXX11_ABI
LYX_CXX_USE_CALL_ONCE
AC_LANG_POP(C++) AC_LANG_POP(C++)
if test $lyx_cv_lib_stdcxx = "yes" ; then
if test $lyx_cv_lib_stdcxx_cxx11_abi = "yes" ; then
AC_DEFINE(USE_GLIBCXX_CXX11_ABI, 1, [use GNU libstdc++ with C++11 ABI])
else
AC_DEFINE(STD_STRING_USES_COW, 1, [std::string uses copy-on-write])
fi
else
if test $lyx_cv_prog_clang = "yes" ; then
AC_DEFINE(USE_LLVM_LIBCPP, 1, [use libc++ provided by llvm instead of GNU libstdc++])
fi
fi
### We might want to get or shut warnings. ### We might want to get or shut warnings.
AC_ARG_ENABLE(warnings, AC_ARG_ENABLE(warnings,
AS_HELP_STRING([--enable-warnings],[tell the compiler to display more warnings]),, AS_HELP_STRING([--enable-warnings],[tell the compiler to display more warnings]),,
@ -363,7 +310,7 @@ if test x$GXX = xyes; then
fi fi
case $gxx_version in case $gxx_version in
2.*|3.*|4.@<:@0-8@:>@*) AC_MSG_ERROR([gcc >= 4.9 is required]);; 2.*|3.*|4.*) AC_MSG_ERROR([gcc >= 5 is required]);;
esac esac
AM_CXXFLAGS="$lyx_optim $AM_CXXFLAGS" AM_CXXFLAGS="$lyx_optim $AM_CXXFLAGS"

View File

@ -114,12 +114,14 @@ void Branch::setColors(string const & lmcol, string const & dmcol)
string lmcolor = lmcolor_; string lmcolor = lmcolor_;
string dmcolor = dmcolor_; string dmcolor = dmcolor_;
if (lmcolor == "none") if (lmcolor == "none")
lmcolor = lcolor.getX11HexName(Color_background); lmcolor = "background";
else if (lmcolor.size() != 7 || lmcolor[0] != '#') // if we have background color, keep semantic value, as system colors might vary
else if (lmcolor != "background" && (lmcolor.size() != 7 || lmcolor[0] != '#'))
lmcolor = lcolor.getX11HexName(lcolor.getFromLyXName(lmcolor)); lmcolor = lcolor.getX11HexName(lcolor.getFromLyXName(lmcolor));
if (dmcolor == "none") if (dmcolor == "none")
dmcolor = lcolor.getX11HexName(Color_background, true); dmcolor = "background";
else if (dmcolor.size() != 7 || dmcolor[0] != '#') // if we have background color, keep semantic value, as system colors might vary
else if (dmcolor != "background" && (dmcolor.size() != 7 || dmcolor[0] != '#'))
dmcolor = lcolor.getX11HexName(lcolor.getFromLyXName(dmcolor), true); dmcolor = lcolor.getX11HexName(lcolor.getFromLyXName(dmcolor), true);
// FIXME UNICODE // FIXME UNICODE

View File

@ -1676,7 +1676,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
success = setCursorFromEntries({id, pos}, success = setCursorFromEntries({id, pos},
{id_end, pos_end}); {id_end, pos_end});
} }
if (success && scrollToCursor(d->cursor_, SCROLL_TOGGLE)) if (success && scrollToCursor(d->cursor_, SCROLL_TOP))
dr.screenUpdate(Update::Force); dr.screenUpdate(Update::Force);
} else { } else {
// Switch to other buffer view and resend cmd // Switch to other buffer view and resend cmd

View File

@ -154,6 +154,10 @@ ColorCode InsetBranch::backgroundColor(PainterInfo const & pi) const
// FIXME UNICODE // FIXME UNICODE
string const branchcol = "branch" + branch_id + to_utf8(params_.branch); string const branchcol = "branch" + branch_id + to_utf8(params_.branch);
ColorCode c = lcolor.getFromLyXName(branchcol); ColorCode c = lcolor.getFromLyXName(branchcol);
// if we have background color, set to semantic value, as system colors
// might vary
if (lcolor.getX11HexName(c, (theApp() && theApp()->isInDarkMode())) == "background")
c = Color_background;
if (c == Color_none) if (c == Color_none)
c = Color_error; c = Color_error;
return c; return c;

View File

@ -17,20 +17,6 @@
#include "support/docstring.h" #include "support/docstring.h"
// Forward definitions do not work with libc++
// but ios_base has already been defined in strfwd
// if compiling with it
#ifndef USE_LLVM_LIBCPP
namespace std {
class ios_base;
template<typename CharT, typename Traits> class basic_streambuf;
typedef basic_streambuf<char, char_traits<char> > streambuf;
} // namespace std
#endif
// Make sure at compile time that sizeof(unsigned long long) >= 8 // Make sure at compile time that sizeof(unsigned long long) >= 8
typedef char p__LINE__[ (sizeof(unsigned long long) > 7) ? 1 : -1]; typedef char p__LINE__[ (sizeof(unsigned long long) > 7) ? 1 : -1];