1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00
Files
weechat/src/core/CMakeLists.txt
T
Sébastien Helleu 460010cc13 core: register built-in "light" theme
Add a small core-theme-builtin.c module containing the core
contribution to the "light" theme: 33 overrides for
"weechat.bar.{status,title}.color_*" and "weechat.color.*" tuned for
light-background terminals.

theme_builtin_init() builds a hashtable from the static entry table and
calls theme_register("light", overrides), then frees the temporary
hashtable. It is called once from weechat_init right after theme_init.
Calling it twice is a no-op (the registry merges identical keys).

Default option values are NOT changed. Existing configs render exactly
as before; users opt in with "/theme apply light".

Add TEST(CoreTheme, BuiltinInit) covering:
  - the "light" theme is absent before theme_builtin_init();
  - it is present after, with >= 30 overrides;
  - three spot-checked values match the source table;
  - calling theme_builtin_init() a second time does not change the
    override count.

Plugins contribute their own "light" overrides via weechat_theme_register
in subsequent commits.
2026-07-05 08:44:01 +02:00

91 lines
3.1 KiB
CMake

#
# SPDX-FileCopyrightText: 2003-2026 Sébastien Helleu <flashcode@flashtux.org>
# SPDX-FileCopyrightText: 2008 Julien Louis <ptitlouis@sysif.net>
# SPDX-FileCopyrightText: 2009 Emmanuel Bouthenot <kolter@openics.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of WeeChat, the extensible chat client.
#
# WeeChat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# WeeChat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
#
set(LIB_CORE_SRC
weechat.c weechat.h
core-args.c core-args.h
core-arraylist.c core-arraylist.h
core-backtrace.c core-backtrace.h
core-calc.c core-calc.h
core-command.c core-command.h
core-completion.c core-completion.h
core-config.c core-config.h
core-config-file.c core-config-file.h
core-crypto.c core-crypto.h
core-debug.c core-debug.h
core-dir.c core-dir.h
core-doc.c core-doc.h
core-eval.c core-eval.h
core-hashtable.c core-hashtable.h
core-hdata.c core-hdata.h
core-hook.c core-hook.h
core-infolist.c core-infolist.h
core-input.c core-input.h
core-list.c core-list.h
core-log.c core-log.h
core-network.c core-network.h
core-proxy.c core-proxy.h
core-secure.c core-secure.h
core-secure-buffer.c core-secure-buffer.h
core-secure-config.c core-secure-config.h
core-signal.c core-signal.h
core-string.c core-string.h
core-sys.c core-sys.h
core-theme.c core-theme.h
core-theme-builtin.c
core-upgrade.c core-upgrade.h
core-upgrade-file.c core-upgrade-file.h
core-url.c core-url.h
core-utf8.c core-utf8.h
core-util.c core-util.h
core-version.c core-version.h
hook/hook-command-run.c hook/hook-command-run.h
hook/hook-command.c hook/hook-command.h
hook/hook-completion.c hook/hook-completion.h
hook/hook-config.c hook/hook-config.h
hook/hook-connect.c hook/hook-connect.h
hook/hook-fd.c hook/hook-fd.h
hook/hook-focus.c hook/hook-focus.h
hook/hook-hdata.c hook/hook-hdata.h
hook/hook-hsignal.c hook/hook-hsignal.h
hook/hook-info-hashtable.c hook/hook-info-hashtable.h
hook/hook-info.c hook/hook-info.h
hook/hook-infolist.c hook/hook-infolist.h
hook/hook-line.c hook/hook-line.h
hook/hook-modifier.c hook/hook-modifier.h
hook/hook-print.c hook/hook-print.h
hook/hook-process.c hook/hook-process.h
hook/hook-signal.c hook/hook-signal.h
hook/hook-timer.c hook/hook-timer.h
hook/hook-url.c hook/hook-url.h
)
# Check for flock support
include(CheckSymbolExists)
check_symbol_exists(flock "sys/file.h" HAVE_FLOCK)
include_directories("${CMAKE_BINARY_DIR}")
add_library(weechat_core OBJECT ${LIB_CORE_SRC})
target_link_libraries(weechat_core coverage_config)
add_dependencies(weechat_core version_git)