Curses: implement the windowcolors option

Allow changing the curses windows foreground and background colors,
for example:

OPTIONS=windowcolor:menu #8000F0/20F080 message grey/blue
This commit is contained in:
Pasi Kallinen
2024-03-17 18:25:35 +02:00
parent 9dbab97a1e
commit 4030ef13a0
17 changed files with 214 additions and 32 deletions

View File

@@ -446,7 +446,7 @@ endif
#==========================================
#
ifeq "$(ADD_CURSES)" "Y"
CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" -DPDC_RGB
ifdef WANT_DOSVGA
CURSESDEF += -DCURSES_UNICODE -DPDC_WIDE
endif
@@ -538,13 +538,13 @@ $(OBJ)/%.o : $(WCURSES)/%.c
#==========================================
$(OBJ)/%.o : $(PDCURSES_TOP)/%.c
$(CC) $(cflags) -o$@ $<
$(CC) $(cflags) -o$@ $<
$(OBJ)/%.o : $(PDCSRC)/%.c
$(CC) $(cflags) -o$@ $<
$(CC) $(cflags) -o$@ $<
$(OBJ)/%.o : $(PDCDOS)/%.c
$(CC) $(cflags) -o$@ $<
$(CC) $(cflags) -o$@ $<
#==========================================
# Rules for LUA files

View File

@@ -50,7 +50,7 @@ ifdef WANT_DOSVGA
PDCPORT = $(PDCTOP)/dosvga
PDCURSESDEF= -I$(PDCTOP) -I$(PDCPORT) \
-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" \
-D"PDC_WIDE" -D"CURSES_UNICODE"
-D"PDC_WIDE" -D"PDC_RGB" -D"CURSES_UNICODE"
else
PDCPORT = $(PDCTOP)/dos
PDCURSESDEF= -I$(PDCTOP) -I$(PDCPORT) \

View File

@@ -118,7 +118,7 @@ GIT_AVAILABLE=Y
endif
PDCURSES=pdcursesmod
PDCURSESFLAGS = -DPDC_WIDE
PDCURSESFLAGS = -DPDC_WIDE -DPDC_RGB
#
#==============================================================================

View File

@@ -602,7 +602,7 @@ WINDHDR = $(MSWSYS)\win10.h $(MSWSYS)\winos.h $(MSWSYS)\win32api.h
#
!IF "$(ADD_CURSES)" == "Y"
PDCURSESFLAGS = -DPDC_WIDE
PDCURSESFLAGS = -DPDC_WIDE -DPDC_RGB
CURSESOBJ= $(OTTY)cursdial.o $(OTTY)cursinit.o $(OTTY)cursinvt.o \
$(OTTY)cursmain.o $(OTTY)cursmesg.o $(OTTY)cursmisc.o \
$(OTTY)cursstat.o $(OTTY)curswins.o

View File

@@ -90,14 +90,14 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_LIB;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -105,7 +105,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -117,7 +117,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_LIB;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

View File

@@ -84,14 +84,14 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;PDC_WIDE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;PDC_WIDE;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;PDC_WIDE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_LIB;PDC_WIDE;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -99,7 +99,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;PDC_WIDE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;PDC_WIDE;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -111,7 +111,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;PDC_WIDE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_LIB;PDC_WIDE;PDC_RGB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>