• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Tera Termの色設定をセットで切り替えます。


Commit MetaInfo

Revisão2ee9ac8be4cbbadf36da69559816912964dc7f4b (tree)
Hora2022-04-17 23:36:55
AutorIWAMOTO Kouichi <sue@iwmt...>
CommiterIWAMOTO Kouichi

Mensagem de Log

Tera Term 5 のソースに対応した

Tera Term 5 のソースでビルドする場合は VS2019 を使う必要がある。

Mudança Sumário

Diff

--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@
44 *.suo
55 *.aps
66 *.vcproj.*.user
7-
7+*.vcxproj.user
--- a/TTXColorTheme.c
+++ b/TTXColorTheme.c
@@ -31,7 +31,16 @@
3131 #include <stdio.h>
3232 #include <string.h>
3333
34-#include "compat_w95.h"
34+#if TT_VERSION_MAJOR == 5
35+ #include "compat_win.h"
36+ #include "inifile_com.h"
37+ #pragma comment(lib, "common_static.lib")
38+ typedef const wchar_t *TTXIniFile;
39+#else
40+ #include "compat_w95.h"
41+ #define GetPrivateProfileStringAFileW GetPrivateProfileString
42+ typedef char *TTXIniFile;
43+#endif
3544
3645 #define ORDER 5900
3746 #define SECTION "Color Theme"
@@ -182,12 +191,12 @@ static void PASCAL TTXGetUIHooks(TTXUIHooks *hooks) {
182191 return;
183192 }
184193
185-void ReadANSIColorSetting(TAnsiColorSetting *color, int num, char *fn) {
194+void ReadANSIColorSetting(TAnsiColorSetting *color, int num, TTXIniFile fn) {
186195 char Key[32], Buff[512];
187196 int c, r, g, b;
188197
189198 _snprintf_s(Key, sizeof(Key), _TRUNCATE, "ANSIColor_%d", num + 1);
190- GetPrivateProfileString(SECTION, Key, "0", Buff, sizeof(Buff), fn);
199+ GetPrivateProfileStringAFileW(SECTION, Key, "0", Buff, sizeof(Buff), fn);
191200
192201 GetNthNum(Buff, 1, &c);
193202 color->change = c;
@@ -205,12 +214,12 @@ void ReadANSIColorSetting(TAnsiColorSetting *color, int num, char *fn) {
205214 return;
206215 }
207216
208-void ReadColorSetting(TColorSetting *color, char *ent, int num, char *fn) {
217+void ReadColorSetting(TColorSetting *color, char *ent, int num, TTXIniFile fn) {
209218 char Key[32], Buff[512];
210219 int c, r, g, b;
211220
212221 _snprintf_s(Key, sizeof(Key), _TRUNCATE, "%s_%d", ent, num + 1);
213- GetPrivateProfileString(SECTION, Key, "0", Buff, sizeof(Buff), fn);
222+ GetPrivateProfileStringAFileW(SECTION, Key, "0", Buff, sizeof(Buff), fn);
214223
215224 GetNthNum(Buff, 1, &c);
216225 color->change = c;
@@ -243,7 +252,7 @@ void GetDefaultColor(TColorSetting *tc, COLORREF *color, int field, PTTSet ts) {
243252 return;
244253 }
245254
246-static void PASCAL ColorThemeReadIniFile(PCHAR fn, PTTSet ts) {
255+static void PASCAL ColorThemeReadIniFile(TTXIniFile fn, PTTSet ts) {
247256 int i;
248257 char Key[20];
249258
@@ -263,7 +272,7 @@ static void PASCAL ColorThemeReadIniFile(PCHAR fn, PTTSet ts) {
263272
264273 for (i=0; i<MAX_MENU_ITEMS; i++) {
265274 _snprintf_s(Key, sizeof(Key), _TRUNCATE, "Theme_%d", i+1);
266- GetPrivateProfileString(SECTION, Key, "", pvar->ThemeList[i].name,
275+ GetPrivateProfileStringAFileW(SECTION, Key, "", pvar->ThemeList[i].name,
267276 sizeof(pvar->ThemeList[i].name), fn);
268277 if (pvar->ThemeList[i].name[0] == '\0')
269278 break;
@@ -425,7 +434,9 @@ BOOL WINAPI DllMain(HANDLE hInstance, ULONG ul_reason, LPVOID lpReserved)
425434 break;
426435 case DLL_PROCESS_ATTACH:
427436 /* do process initialization */
437+#if TT_VERSION_MAJOR != 5
428438 DoCover_IsDebuggerPresent();
439+#endif
429440 hInst = hInstance;
430441 pvar = &InstVar;
431442 break;
--- a/TTXColorTheme.vcproj
+++ b/TTXColorTheme.vcproj
@@ -62,6 +62,7 @@
6262 <Tool
6363 Name="VCLinkerTool"
6464 AdditionalDependencies="&quot;$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib&quot;"
65+ AdditionalLibraryDirectories="&quot;$(SolutionDir)..\teraterm\$(Configuration)&quot;"
6566 LinkIncremental="2"
6667 GenerateDebugInformation="true"
6768 SubSystem="2"
@@ -137,6 +138,7 @@
137138 <Tool
138139 Name="VCLinkerTool"
139140 AdditionalDependencies="&quot;$(SolutionDir)..\teraterm\$(ConfigurationName)\ttpcmn.lib&quot;"
141+ AdditionalLibraryDirectories="&quot;$(SolutionDir)..\teraterm\$(Configuration)&quot;"
140142 LinkIncremental="1"
141143 GenerateDebugInformation="true"
142144 SubSystem="2"
--- /dev/null
+++ b/TTXColorTheme.vcxproj
@@ -0,0 +1,104 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup Label="ProjectConfigurations">
4+ <ProjectConfiguration Include="Debug|Win32">
5+ <Configuration>Debug</Configuration>
6+ <Platform>Win32</Platform>
7+ </ProjectConfiguration>
8+ <ProjectConfiguration Include="Release|Win32">
9+ <Configuration>Release</Configuration>
10+ <Platform>Win32</Platform>
11+ </ProjectConfiguration>
12+ </ItemGroup>
13+ <PropertyGroup Label="Globals">
14+ <ProjectGuid>{35CA825D-EDF8-4E3B-B621-F576F10C72BE}</ProjectGuid>
15+ <RootNamespace>TTXColorTheme</RootNamespace>
16+ <Keyword>Win32Proj</Keyword>
17+ </PropertyGroup>
18+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
20+ <ConfigurationType>DynamicLibrary</ConfigurationType>
21+ <PlatformToolset>v142</PlatformToolset>
22+ <CharacterSet>NotSet</CharacterSet>
23+ <WholeProgramOptimization>true</WholeProgramOptimization>
24+ </PropertyGroup>
25+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
26+ <ConfigurationType>DynamicLibrary</ConfigurationType>
27+ <PlatformToolset>v142</PlatformToolset>
28+ <CharacterSet>NotSet</CharacterSet>
29+ </PropertyGroup>
30+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
31+ <ImportGroup Label="ExtensionSettings">
32+ </ImportGroup>
33+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
34+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
35+ </ImportGroup>
36+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
37+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
38+ </ImportGroup>
39+ <PropertyGroup Label="UserMacros" />
40+ <PropertyGroup>
41+ <_ProjectFileVersion>16.0.30804.86</_ProjectFileVersion>
42+ </PropertyGroup>
43+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
44+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
45+ <IntDir>$(Configuration)\</IntDir>
46+ <LinkIncremental>true</LinkIncremental>
47+ </PropertyGroup>
48+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
49+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
50+ <IntDir>$(Configuration)\</IntDir>
51+ <LinkIncremental>false</LinkIncremental>
52+ </PropertyGroup>
53+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
54+ <ClCompile>
55+ <Optimization>Disabled</Optimization>
56+ <AdditionalIncludeDirectories>$(SolutionDir)..\teraterm\common;$(SolutionDir)..\teraterm\teraterm;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
57+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
58+ <MinimalRebuild>true</MinimalRebuild>
59+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
60+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
61+ <PrecompiledHeader />
62+ <WarningLevel>Level3</WarningLevel>
63+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
64+ </ClCompile>
65+ <Link>
66+ <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
67+ <GenerateDebugInformation>true</GenerateDebugInformation>
68+ <SubSystem>Windows</SubSystem>
69+ <TargetMachine>MachineX86</TargetMachine>
70+ <AdditionalLibraryDirectories>$(SolutionDir)..\teraterm\$(Configuration)</AdditionalLibraryDirectories>
71+ </Link>
72+ </ItemDefinitionGroup>
73+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
74+ <ClCompile>
75+ <AdditionalIncludeDirectories>$(SolutionDir)..\teraterm\common;$(SolutionDir)..\teraterm\teraterm;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
76+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
77+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
78+ <PrecompiledHeader />
79+ <WarningLevel>Level3</WarningLevel>
80+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
81+ </ClCompile>
82+ <Link>
83+ <AdditionalDependencies>$(SolutionDir)..\teraterm\$(Configuration)\ttpcmn.lib;%(AdditionalDependencies)</AdditionalDependencies>
84+ <GenerateDebugInformation>true</GenerateDebugInformation>
85+ <SubSystem>Windows</SubSystem>
86+ <OptimizeReferences>true</OptimizeReferences>
87+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
88+ <TargetMachine>MachineX86</TargetMachine>
89+ <AdditionalLibraryDirectories>$(SolutionDir)..\teraterm\$(Configuration)</AdditionalLibraryDirectories>
90+ </Link>
91+ </ItemDefinitionGroup>
92+ <ItemGroup>
93+ <ClCompile Include="TTXColorTheme.c" />
94+ </ItemGroup>
95+ <ItemGroup>
96+ <None Include="LICENSE" />
97+ </ItemGroup>
98+ <ItemGroup>
99+ <Text Include="ReadMe.txt" />
100+ </ItemGroup>
101+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
102+ <ImportGroup Label="ExtensionTargets">
103+ </ImportGroup>
104+</Project>
\ No newline at end of file
--- /dev/null
+++ b/TTXColorTheme.vcxproj.filters
@@ -0,0 +1,27 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup>
4+ <Filter Include="Source Files">
5+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+ </Filter>
8+ <Filter Include="ReadMe">
9+ <UniqueIdentifier>{5a8b7529-cf5f-43a0-9613-39bc05580a57}</UniqueIdentifier>
10+ </Filter>
11+ </ItemGroup>
12+ <ItemGroup>
13+ <ClCompile Include="TTXColorTheme.c">
14+ <Filter>Source Files</Filter>
15+ </ClCompile>
16+ </ItemGroup>
17+ <ItemGroup>
18+ <None Include="LICENSE">
19+ <Filter>ReadMe</Filter>
20+ </None>
21+ </ItemGroup>
22+ <ItemGroup>
23+ <Text Include="ReadMe.txt">
24+ <Filter>ReadMe</Filter>
25+ </Text>
26+ </ItemGroup>
27+</Project>
\ No newline at end of file