Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/teraterm/teraterm/vtdisp.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10192 - (show annotations) (download) (as text)
Fri Aug 26 14:29:24 2022 UTC (19 months, 2 weeks ago) by zmatsuo
File MIME type: text/x-chdr
File size: 5735 byte(s)
文字色設定の整理

- 反転表示、常に標準の背景色を使う、8/16/256色表示 を整理
  - 反転表示 = 文字のBGとFGの色が入れ替わる処理
- vtdisp.c の DispSetupDC() のみで表示文字の色設定を行うようにした
- 従来、カラーテーブルの入れ替え、上書きなどを行っていた
  - BGExchangeColor() を削除
  - テーブルの入れ替えなどを行っている部分を削除
- 文字背景色が標準属性背景色で上書きしなくても表示できるようにした
  - ウィンドウの設定ダイアログの「常に標準の背景色を使う」のチェック
  - TERATERM.INI の [Tera Term] セクション UseNormalBGColor=on/off
  - 次の手順で上書きされる
    - 標準色を使うのチェックが外れている状態から
    - チェックを入れて
    - TERATERM.INIを保存すると、背景色が標準背景色となる
- 各種文字色設定をテストするテストを追加 color-sgr-decscnm.pl
  - いろいろなパターンの色設定を表示
  - 反転表示
  - マニュアルにスクリプトについて追記
1 /*
2 * Copyright (C) 1994-1998 T. Teranishi
3 * (C) 2008- 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 /* TERATERM.EXE, VT terminal display routines */
31
32 #include "buffer.h" // for TCharAttr
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /* prototypes */
39 void BGInitialize(BOOL initialize_once);
40 void BGLoadThemeFile(TTTSet *pts);
41 void BGSetupPrimary(BOOL forceSetup);
42 void BGWriteThemeFile(const wchar_t *theme_file);
43
44 void BGOnSettingChange(void);
45 void BGOnEnterSizeMove(void);
46 void BGOnExitSizeMove(void);
47
48 void InitDisp(void);
49 void EndDisp(void);
50 void DispReset(void);
51 void DispConvWinToScreen
52 (int Xw, int Yw, int *Xs, int *Ys, PBOOL Right);
53 void DispConvScreenToWin
54 (int Xs, int Ys, int *Xw, int *Yw);
55 //void SetLogFont(void);
56 void ChangeFont(void);
57 void ResetIME(void);
58 void ChangeCaret(void);
59 void CaretKillFocus(BOOL show);
60 void UpdateCaretPosition(BOOL enforce);
61 void CaretOn(void);
62 void CaretOff(void);
63 void DispDestroyCaret(void);
64 BOOL IsCaretOn(void);
65 void DispEnableCaret(BOOL On);
66 BOOL IsCaretEnabled(void);
67 void DispSetCaretWidth(BOOL DW);
68 void DispChangeWinSize(int Nx, int Ny);
69 void ResizeWindow(int x, int y, int w, int h, int cw, int ch);
70 void PaintWindow(HDC PaintDC, RECT PaintRect, BOOL fBkGnd,
71 int* Xs, int* Ys, int* Xe, int* Ye);
72 void DispEndPaint(void);
73 void DispClearWin(void);
74 void DispChangeBackground(void);
75 void DispChangeWin(void);
76 void DispInitDC(void);
77 void DispReleaseDC(void);
78 void DispSetupDC(TCharAttr Attr, BOOL Reverse);
79 void DispStr(const char *Buff, int Count, int Y, int* X);
80 void DispStrW(const wchar_t *StrW, const char *WidthInfo, int Count, int Y, int* X);
81 void DispEraseCurToEnd(int YEnd);
82 void DispEraseHomeToCur(int YHome);
83 void DispEraseCharsInLine(int XStart, int Count);
84 BOOL DispDeleteLines(int Count, int YEnd);
85 BOOL DispInsertLines(int Count, int YEnd);
86 BOOL IsLineVisible(int* X, int* Y);
87 void AdjustScrollBar(void);
88 void DispScrollToCursor(int CurX, int CurY);
89 void DispScrollNLines(int Top, int Bottom, int Direction);
90 void DispCountScroll(int n);
91 void DispUpdateScroll(void);
92 void DispScrollHomePos(void);
93 void DispAutoScroll(POINT p);
94 void DispHScroll(int Func, int Pos);
95 void DispVScroll(int Func, int Pos);
96 void DispSetupFontDlg(void);
97 void DispRestoreWinSize(void);
98 void DispSetWinPos(void);
99 void DispSetActive(BOOL ActiveFlag);
100 void InitColorTable(void);
101 void DispSetNearestColors(int start, int end, HDC DispCtx);
102 int TCharAttrCmp(TCharAttr a, TCharAttr b);
103 void DispSetColor(unsigned int num, COLORREF color);
104 void DispResetColor(unsigned int num);
105 COLORREF DispGetColor(unsigned int num);
106 void DispSetCurCharAttr(TCharAttr Attr);
107 void DispMoveWindow(int x, int y);
108 void DispShowWindow(int mode);
109 void DispResizeWin(int w, int h);
110 BOOL DispWindowIconified(void);
111 void DispGetWindowPos(int *x, int *y, BOOL client);
112 void DispGetWindowSize(int *width, int *height, BOOL client);
113 void DispGetRootWinSize(int *x, int *y, BOOL inPixels);
114 int DispFindClosestColor(int red, int green, int blue);
115 void UpdateBGBrush(void);
116 void DrawStrW(HDC DC, HDC BGDC, const wchar_t *StrW, const char *WidthInfo, int Count,
117 int font_width, int font_height, int Y, int* X);
118 void DrawStrA(HDC DC, HDC BGDC, const char *StrA, int Count,
119 int font_width, int font_height, int Y, int* X);
120
121 extern int WinWidth, WinHeight;
122 extern HFONT VTFont[AttrFontMask+1];
123 extern int FontHeight, FontWidth, ScreenWidth, ScreenHeight;
124 extern BOOL AdjustSize, DontChangeSize;
125 extern int CursorX, CursorY;
126 extern int WinOrgX, WinOrgY, NewOrgX, NewOrgY;
127 extern int NumOfLines, NumOfColumns;
128 extern int PageStart, BuffEnd;
129 extern TCharAttr DefCharAttr;
130
131 extern BOOL IMEstat;
132 extern BOOL IMECompositionState;
133
134 #define SCROLL_BOTTOM 1
135 #define SCROLL_LINEDOWN 2
136 #define SCROLL_LINEUP 3
137 #define SCROLL_PAGEDOWN 4
138 #define SCROLL_PAGEUP 5
139 #define SCROLL_POS 6
140 #define SCROLL_TOP 7
141
142 #define WINDOW_MINIMIZE 1
143 #define WINDOW_MAXIMIZE 2
144 #define WINDOW_RESTORE 3
145 #define WINDOW_RAISE 4
146 #define WINDOW_LOWER 5
147 #define WINDOW_REFRESH 6
148 #define WINDOW_TOGGLE_MAXIMIZE 7
149
150 #include "bg_theme.h"
151
152 typedef struct {
153 BG_PATTERN id;
154 const char *str;
155 } BG_PATTERN_ST;
156
157 const BG_PATTERN_ST *GetBGPatternList(int index);
158
159 #ifdef __cplusplus
160 }
161 #endif

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