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 10256 - (hide annotations) (download) (as text)
Fri Sep 9 15:07:26 2022 UTC (19 months ago) by zmatsuo
File MIME type: text/x-chdr
File size: 3613 byte(s)
テーマファイルに関連する関数などを themefile.cpp へ移動

- bg_theme.h を theme.h へリネーム
- 関数名を Theme~ にリネームした
- BGテーマの設定を行っていると背景画像が表示されなくなる場合があったので修正
- 画像を設定していないのに背景画像チェックボックスのチェックが入ることがあった
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     char file[MAX_PATH];
56     } 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     typedef struct {
70     BOOL change;
71     BOOL enable;
72     COLORREF fg;
73     COLORREF bg;
74     } TColorSetting;
75    
76     typedef struct {
77     BOOL change;
78     BOOL enable;
79     COLORREF color[16];
80     } TAnsiColorSetting;
81    
82     typedef struct {
83     char name[50];
84     TColorSetting vt;
85 zmatsuo 10214 TColorSetting bold; // SGR 1
86     TColorSetting underline; // SGR 4
87     TColorSetting blink; // SGR 5
88     TColorSetting reverse; // SGR 7
89 zmatsuo 10134 TColorSetting url;
90     TAnsiColorSetting ansicolor;
91     } TColorTheme;
92    
93 zmatsuo 10256 typedef struct {
94     BG_PATTERN id;
95     const char *str;
96     } BG_PATTERN_ST;
97    
98     // setting / themefile.cpp
99     const BG_PATTERN_ST *ThemeBGPatternList(int index);
100    
101     // file / themefile.cpp
102     void ThemeLoadBG(const wchar_t *file, BGTheme *bg_theme);
103     void ThemeLoadColor(const wchar_t *fn, TColorTheme *color_theme);
104     void ThemeLoadColorOld(const wchar_t *file, TColorTheme *theme);
105     void ThemeLoad(const wchar_t *fname, BGTheme *bg_theme, TColorTheme *color_theme);
106     void ThemeSaveBG(const BGTheme *bg_theme, const wchar_t *fname);
107     void ThemeSaveColor(TColorTheme *color_theme, const wchar_t *fname);
108    
109     // setting / vtdisp.c
110     void ThemeGetBG(BGTheme *bg_theme);
111     void ThemeSetBG(const BGTheme *bg_theme);
112     void ThemeGetColor(TColorTheme *data);
113     void ThemeSetColor(const TColorTheme *data);
114     void ThemeGetColorDefault(TColorTheme *data);
115     void ThemeGetColorDefaultTS(const TTTSet *pts, TColorTheme *color_theme);
116     void ThemeGetBGDefault(BGTheme *bg_theme);
117    
118 zmatsuo 10134 #ifdef __cplusplus
119     }
120     #endif

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