Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/teraterm/teraterm/theme.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10332 - (hide annotations) (download) (as text)
Sun Oct 23 15:16:14 2022 UTC (17 months, 2 weeks ago) by zmatsuo
File MIME type: text/x-chdr
File size: 4014 byte(s)
テーマファイルの扱いをUnicode化

- UnicodeAPIを使用するよう修正
- 背景テーマのセクション名を "BG theme" へ変更
  - "BG" セクションも読み込める
- TODO
  - MAX_PATHが残っている
1 zmatsuo 10134 /*
2     * Copyright (C) 1994-1998 T. Teranishi
3     * (C) 2022- TeraTerm Project
4     * All rights reserved.
5     *
6     * Redistribution and use in source and binary forms, with or without
7     * modification, are permitted provided that the following conditions
8     * are met:
9     *
10     * 1. Redistributions of source code must retain the above copyright
11     * notice, this list of conditions and the following disclaimer.
12     * 2. Redistributions in binary form must reproduce the above copyright
13     * notice, this list of conditions and the following disclaimer in the
14     * documentation and/or other materials provided with the distribution.
15     * 3. The name of the author may not be used to endorse or promote products
16     * derived from this software without specific prior written permission.
17     *
18     * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
19     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21     * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23     * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28     */
29    
30     #pragma once
31    
32     #include <windows.h>
33    
34 zmatsuo 10256 #ifdef __cplusplus
35     extern "C" {
36     #endif
37    
38 zmatsuo 10134 typedef enum _BG_TYPE { BG_COLOR = 0, BG_PICTURE, BG_WALLPAPER, BG_NONE } BG_TYPE;
39     typedef enum _BG_PATTERN {
40     BG_STRETCH = 0,
41     BG_TILE,
42     BG_CENTER,
43     BG_FIT_WIDTH,
44     BG_FIT_HEIGHT,
45     BG_AUTOFIT,
46     BG_AUTOFILL
47     } BG_PATTERN;
48    
49     typedef struct {
50     BG_TYPE type;
51     BG_PATTERN pattern;
52     BOOL antiAlias;
53     COLORREF color;
54     int alpha;
55 zmatsuo 10332 wchar_t file[MAX_PATH];
56 zmatsuo 10134 } TBGSrc;
57    
58     typedef struct _BGTheme {
59     TBGSrc BGDest;
60     TBGSrc BGSrc1;
61     TBGSrc BGSrc2;
62     int BGReverseTextAlpha;
63     } BGTheme;
64    
65     ////////////////////
66     // color theme
67     ////////////////////
68    
69 zmatsuo 10303 // Character Attributes
70     // Normal(SGR 0), BOLD(SGR 1),...
71 zmatsuo 10134 typedef struct {
72 zmatsuo 10303 BOOL change; // TRUE/FALSE = default�F�������X����/���X������
73     BOOL enable; // TRUE/FALSE = ������������(Bold attribute��)�������F���L��/����������
74     COLORREF fg; // Fore color (���������������F���L��������)
75     COLORREF bg; // Back color (���������������F���L��������)
76 zmatsuo 10134 } TColorSetting;
77    
78 zmatsuo 10303 // ANSI Color
79 zmatsuo 10134 typedef struct {
80 zmatsuo 10303 BOOL change; // TRUE/FALSE = default�F�������X����/���X������
81     //BOOL enable; // �s�v��?
82     COLORREF color[16]; // ANSI color 256�F ��������16�F, (�O���������F,���������F���������F)
83 zmatsuo 10134 } TAnsiColorSetting;
84    
85 zmatsuo 10303 // color theme
86 zmatsuo 10134 typedef struct {
87 zmatsuo 10303 wchar_t name[50];
88     TColorSetting vt; // SGR 0
89 zmatsuo 10214 TColorSetting bold; // SGR 1
90     TColorSetting underline; // SGR 4
91     TColorSetting blink; // SGR 5
92     TColorSetting reverse; // SGR 7
93 zmatsuo 10134 TColorSetting url;
94     TAnsiColorSetting ansicolor;
95     } TColorTheme;
96    
97 zmatsuo 10256 typedef struct {
98     BG_PATTERN id;
99 zmatsuo 10332 const wchar_t *str;
100 zmatsuo 10256 } BG_PATTERN_ST;
101    
102     // setting / themefile.cpp
103     const BG_PATTERN_ST *ThemeBGPatternList(int index);
104    
105     // file / themefile.cpp
106     void ThemeLoadBG(const wchar_t *file, BGTheme *bg_theme);
107 zmatsuo 10303 void ThemeLoadColor(const wchar_t *fname, TColorTheme *color_theme);
108 zmatsuo 10256 void ThemeLoad(const wchar_t *fname, BGTheme *bg_theme, TColorTheme *color_theme);
109     void ThemeSaveBG(const BGTheme *bg_theme, const wchar_t *fname);
110     void ThemeSaveColor(TColorTheme *color_theme, const wchar_t *fname);
111    
112     // setting / vtdisp.c
113     void ThemeGetBG(BGTheme *bg_theme);
114     void ThemeSetBG(const BGTheme *bg_theme);
115     void ThemeGetColor(TColorTheme *data);
116     void ThemeSetColor(const TColorTheme *data);
117     void ThemeGetColorDefault(TColorTheme *data);
118     void ThemeGetColorDefaultTS(const TTTSet *pts, TColorTheme *color_theme);
119     void ThemeGetBGDefault(BGTheme *bg_theme);
120    
121 zmatsuo 10134 #ifdef __cplusplus
122     }
123     #endif

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26