誤ってコミットしてしまったためリバート
@@ -1,185 +0,0 @@ | ||
1 | -/* Tera Term 高速化テスト */ | |
2 | - | |
3 | -#include <windows.h> | |
4 | -#include <time.h> | |
5 | -#include <stdio.h> | |
6 | - | |
7 | -#include "tttypes.h" | |
8 | -#include "ttwinman.h" | |
9 | -#include "ttlib.h" | |
10 | -#include "vtdisp.h" | |
11 | -#include "vtdisp_delay.h" | |
12 | - | |
13 | -// buffer.c | |
14 | -extern int StrChangeStart, StrChangeCount; | |
15 | -extern int dScroll; | |
16 | - | |
17 | -#define DISPLAY_INTERVAL (1000 / 30) // (ms) | |
18 | -//#define DISPLAY_INTERVAL (1000) // (ms) | |
19 | - | |
20 | -#define OutputDebugPrintf(...) | |
21 | - | |
22 | -void BuffUpdateRect2(int XStart, int YStart, int XEnd, int YEnd); | |
23 | - | |
24 | -//////////////////////////////////////// | |
25 | - | |
26 | -typedef struct { | |
27 | - enum { | |
28 | - NONE, // 描画なし | |
29 | - ONE_LINE, // 1行描画 | |
30 | - WHOLE_TERM, // 全画面描画 | |
31 | - } Type; | |
32 | - | |
33 | - // ONE_LINE時のデータ | |
34 | - int StrChangeStart; // cursorのX | |
35 | - int CursorY; // cursorのY | |
36 | - int StrChangeCount; // 文字数 | |
37 | - | |
38 | - // 表示開始位置 | |
39 | - int NewOrgX; | |
40 | - int NewOrgY; | |
41 | - | |
42 | - DWORD UpdateTick; | |
43 | - | |
44 | - // scroll bar情報 | |
45 | - int ScrollBarVPos; | |
46 | -} UpdateInfo_t; | |
47 | - | |
48 | -static UpdateInfo_t UpdateInfo; | |
49 | - | |
50 | -void UpdateStr() | |
51 | -{ | |
52 | - if (UpdateInfo.Type == NONE) { | |
53 | - if (StrChangeCount != 0) { | |
54 | - UpdateInfo.Type = ONE_LINE; | |
55 | - UpdateInfo.CursorY = CursorY; | |
56 | - UpdateInfo.StrChangeStart = StrChangeStart; | |
57 | - UpdateInfo.StrChangeCount = StrChangeCount; | |
58 | - } | |
59 | - } else if (UpdateInfo.Type == ONE_LINE) { | |
60 | - if (StrChangeCount == 0) { | |
61 | - ; | |
62 | - } else if (UpdateInfo.CursorY != CursorY) { | |
63 | - UpdateInfo.Type = WHOLE_TERM; | |
64 | - } else if (UpdateInfo.StrChangeStart + UpdateInfo.StrChangeCount == StrChangeStart ) { | |
65 | - UpdateInfo.StrChangeCount += StrChangeCount; | |
66 | - } else { | |
67 | - UpdateInfo.StrChangeStart = 0; | |
68 | - UpdateInfo.StrChangeCount = NumOfColumns; | |
69 | - } | |
70 | - } | |
71 | - | |
72 | - OutputDebugPrintf("%d (%d,%d)%d , (%d,%d)%d\n", | |
73 | - UpdateInfo.Type, | |
74 | - StrChangeStart, CursorY, StrChangeCount, | |
75 | - UpdateInfo.StrChangeStart, UpdateInfo.CursorY, UpdateInfo.StrChangeCount); | |
76 | - | |
77 | - StrChangeCount = 0; | |
78 | -} | |
79 | - | |
80 | -void BuffUpdateRect(int XStart, int YStart, int XEnd, int YEnd) | |
81 | -{ | |
82 | - OutputDebugPrintf("BuffUpdateRect(%d,%d,%d,%d)\n", | |
83 | - XStart, YStart, XEnd, YEnd); | |
84 | - UpdateInfo.Type = WHOLE_TERM; | |
85 | -} | |
86 | - | |
87 | -void DispUpdateScroll() | |
88 | -{ | |
89 | - OutputDebugPrintf("DispUpdateScroll\n"); | |
90 | - UpdateInfo.Type = WHOLE_TERM; | |
91 | - UpdateInfo.NewOrgX = NewOrgX; | |
92 | - UpdateInfo.NewOrgY = NewOrgY; | |
93 | - dScroll = 0; | |
94 | -} | |
95 | - | |
96 | -void UpdateTerm() | |
97 | -{ | |
98 | - DWORD now = timeGetTime(); | |
99 | - int NewOrgX; | |
100 | - int NewOrgY; | |
101 | - int ScrollBarUpdated = 0; | |
102 | - OutputDebugPrintf("UpdateTerm %d\n", UpdateInfo.Type); | |
103 | - | |
104 | - if (UpdateInfo.Type == NONE) { | |
105 | - return; | |
106 | - } | |
107 | - | |
108 | - NewOrgX = UpdateInfo.NewOrgX; | |
109 | - NewOrgY = UpdateInfo.NewOrgY; | |
110 | - | |
111 | - /* Update normal scroll */ | |
112 | - if (NewOrgX < 0) NewOrgX = 0; | |
113 | - if (NewOrgX > NumOfColumns - WinWidth) | |
114 | - NewOrgX = NumOfColumns - WinWidth; | |
115 | - if (NewOrgY < -PageStart) | |
116 | - NewOrgY = -PageStart; | |
117 | - if (NewOrgY > BuffEnd - WinHeight - PageStart) | |
118 | - NewOrgY = BuffEnd - WinHeight - PageStart; | |
119 | - | |
120 | - if (NewOrgX != WinOrgX) { | |
121 | - SetScrollPos(HVTWin, SB_HORZ, NewOrgX, TRUE); | |
122 | - ScrollBarUpdated = 1; | |
123 | - } | |
124 | - | |
125 | - if (((ts.AutoScrollOnlyInBottomLine != 0 || NewOrgY!=WinOrgY)) && | |
126 | - (UpdateInfo.ScrollBarVPos != NewOrgY + PageStart)) | |
127 | - { | |
128 | - SCROLLINFO scroll_info; | |
129 | - scroll_info.cbSize = sizeof(scroll_info); | |
130 | - scroll_info.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; | |
131 | - scroll_info.nPage = WinHeight; | |
132 | - scroll_info.nMin = 0; | |
133 | - scroll_info.nMax = BuffEnd-WinHeight; | |
134 | - | |
135 | - if ((BuffEnd==WinHeight) && (ts.EnableScrollBuff>0)) { | |
136 | - scroll_info.nMax = BuffEnd; | |
137 | - scroll_info.nPos = 0; | |
138 | - } else { | |
139 | - int max = BuffEnd - WinHeight; | |
140 | - scroll_info.nMax = BuffEnd; | |
141 | - scroll_info.nPos = NewOrgY+PageStart; | |
142 | - } | |
143 | - | |
144 | - SetScrollInfo(HVTWin, SB_VERT, &scroll_info, TRUE); | |
145 | - UpdateInfo.ScrollBarVPos = scroll_info.nPos; | |
146 | - ScrollBarUpdated = 1; | |
147 | - OutputDebugPrintf("sb_vert %d-%d-%d,%d\n", | |
148 | - scroll_info.nMin, | |
149 | - scroll_info.nPos, | |
150 | - scroll_info.nMax, | |
151 | - scroll_info.nPage); | |
152 | - } | |
153 | - | |
154 | -#if 0 | |
155 | - if (ScrollBarUpdated) { | |
156 | - // スクロールバーが更新された場合はすぐに描画する | |
157 | - InvalidateRect(HVTWin, NULL, FALSE); | |
158 | - } else | |
159 | -#endif | |
160 | - if (UpdateInfo.Type == WHOLE_TERM || NewOrgY != WinOrgY) { | |
161 | - if ((now - UpdateInfo.UpdateTick) < DISPLAY_INTERVAL) { | |
162 | - return; | |
163 | - } | |
164 | - InvalidateRect(HVTWin, NULL, FALSE); | |
165 | - } else if (UpdateInfo.Type == ONE_LINE) { | |
166 | - BuffUpdateRect2(UpdateInfo.StrChangeStart, UpdateInfo.CursorY, | |
167 | - UpdateInfo.StrChangeStart + UpdateInfo.StrChangeCount, UpdateInfo.CursorY); | |
168 | - } | |
169 | - | |
170 | - WinOrgX = NewOrgX; | |
171 | - WinOrgY = NewOrgY; | |
172 | - UpdateInfo.NewOrgX = 0; | |
173 | - UpdateInfo.NewOrgY = 0; | |
174 | - UpdateInfo.UpdateTick = now; | |
175 | - UpdateInfo.Type = NONE; | |
176 | - | |
177 | -} | |
178 | - | |
179 | -int IsUpdateTerm() | |
180 | -{ | |
181 | - if (UpdateInfo.Type == NONE) { | |
182 | - return 0; | |
183 | - } | |
184 | - return 1; | |
185 | -} |
@@ -1,10 +0,0 @@ | ||
1 | -#ifdef __cplusplus | |
2 | -extern "C" { | |
3 | -#endif | |
4 | - | |
5 | -int IsUpdateTerm(); | |
6 | -void UpdateTerm(); | |
7 | - | |
8 | -#ifdef __cplusplus | |
9 | -} | |
10 | -#endif |
@@ -98,8 +98,6 @@ | ||
98 | 98 | ttwsk.h |
99 | 99 | vtdisp.c |
100 | 100 | vtdisp.h |
101 | - vtdisp_delay.c | |
102 | - vtdisp_delay.h | |
103 | 101 | vtterm.c |
104 | 102 | vtterm.h |
105 | 103 | vtwin.cpp |
@@ -88,7 +88,7 @@ | ||
88 | 88 | static BOOL BoxSelect; |
89 | 89 | static POINT DblClkStart, DblClkEnd; |
90 | 90 | |
91 | -int StrChangeStart, StrChangeCount; | |
91 | +static int StrChangeStart, StrChangeCount; | |
92 | 92 | |
93 | 93 | static BOOL SeveralPageSelect; // add (2005.5.15 yutaka) |
94 | 94 |
@@ -1900,7 +1900,6 @@ | ||
1900 | 1900 | StrChangeStart = CursorX; |
1901 | 1901 | } |
1902 | 1902 | StrChangeCount++; |
1903 | - UpdateStr(); | |
1904 | 1903 | } |
1905 | 1904 | } |
1906 | 1905 |
@@ -2025,7 +2024,7 @@ | ||
2025 | 2024 | } |
2026 | 2025 | } |
2027 | 2026 | |
2028 | -void BuffUpdateRect2 | |
2027 | +void BuffUpdateRect | |
2029 | 2028 | (int XStart, int YStart, int XEnd, int YEnd) |
2030 | 2029 | // Display text in a rectangular region in the screen |
2031 | 2030 | // XStart: x position of the upper-left corner (screen cordinate) |
@@ -2122,7 +2121,6 @@ | ||
2122 | 2121 | } |
2123 | 2122 | } |
2124 | 2123 | |
2125 | -#if 0 | |
2126 | 2124 | void UpdateStr() |
2127 | 2125 | // Display not-yet-displayed string |
2128 | 2126 | { |
@@ -2177,7 +2175,6 @@ | ||
2177 | 2175 | |
2178 | 2176 | StrChangeCount = 0; |
2179 | 2177 | } |
2180 | -#endif | |
2181 | 2178 | |
2182 | 2179 | #if 0 |
2183 | 2180 | void UpdateStrUnicode(void) |
@@ -47,7 +47,6 @@ | ||
47 | 47 | #include "keyboard.h" |
48 | 48 | #include "dllutil.h" |
49 | 49 | #include "compat_win.h" |
50 | -#include "vtdisp_delay.h" | |
51 | 50 | |
52 | 51 | #include "teraapp.h" |
53 | 52 |
@@ -303,13 +302,6 @@ | ||
303 | 302 | Busy--; |
304 | 303 | } |
305 | 304 | |
306 | - if (Busy == 0) { | |
307 | - if (IsUpdateTerm()) { | |
308 | - UpdateTerm(); | |
309 | - Busy++; | |
310 | - } | |
311 | - } | |
312 | - | |
313 | 305 | return (Busy>0); |
314 | 306 | } |
315 | 307 |
@@ -80,7 +80,7 @@ | ||
80 | 80 | {168,168,168}, {178,178,178}, {188,188,188}, {198,198,198}, {208,208,208}, {218,218,218}, {228,228,228}, {238,238,238} // 248 - 255 |
81 | 81 | }; |
82 | 82 | |
83 | -int WinWidth, WinHeight; // 画面に表示されている文字数 | |
83 | +int WinWidth, WinHeight; | |
84 | 84 | static BOOL Active = FALSE; |
85 | 85 | static BOOL CompletelyVisible; |
86 | 86 | HFONT VTFont[AttrFontMask+1]; |
@@ -95,12 +95,10 @@ | ||
95 | 95 | RECT VirtualScreen; |
96 | 96 | |
97 | 97 | // --- scrolling status flags |
98 | -int WinOrgX, WinOrgY; // 現在の表示位置 | |
99 | -int NewOrgX, NewOrgY; // 更新後の表示位置 | |
100 | -int ScrollBarVPos; // スクロールバーの位置 | |
98 | +int WinOrgX, WinOrgY, NewOrgX, NewOrgY; | |
101 | 99 | |
102 | -int NumOfLines, NumOfColumns; // バッファリングしている文字数 | |
103 | -int PageStart, BuffEnd; // 表示しているバッファ内の位置 | |
100 | +int NumOfLines, NumOfColumns; | |
101 | +int PageStart, BuffEnd; | |
104 | 102 | |
105 | 103 | static BOOL CursorOnDBCS = FALSE; |
106 | 104 | static LOGFONT VTlf; |
@@ -132,7 +130,7 @@ | ||
132 | 130 | |
133 | 131 | // scrolling |
134 | 132 | static int ScrollCount = 0; |
135 | -int dScroll = 0; | |
133 | +static int dScroll = 0; | |
136 | 134 | static int SRegionTop; |
137 | 135 | static int SRegionBottom; |
138 | 136 |
@@ -3181,7 +3179,6 @@ | ||
3181 | 3179 | if (ScrollCount>=ts.ScrollThreshold) DispUpdateScroll(); |
3182 | 3180 | } |
3183 | 3181 | |
3184 | -#if 0 | |
3185 | 3182 | void DispUpdateScroll() |
3186 | 3183 | { |
3187 | 3184 | int d; |
@@ -3287,7 +3284,6 @@ | ||
3287 | 3284 | |
3288 | 3285 | if (IsCaretOn()) CaretOn(); |
3289 | 3286 | } |
3290 | -#endif | |
3291 | 3287 | |
3292 | 3288 | void DispScrollHomePos() |
3293 | 3289 | { |
@@ -54,8 +54,6 @@ | ||
54 | 54 | #include "clipboar.h" |
55 | 55 | #include "codeconv.h" |
56 | 56 | |
57 | -#include "vtdisp_delay.h" | |
58 | - | |
59 | 57 | #include "vtterm.h" |
60 | 58 | |
61 | 59 | #ifdef _DEBUG |
@@ -5750,12 +5748,7 @@ | ||
5750 | 5748 | |
5751 | 5749 | c = CommRead1Byte(&cv,&b); |
5752 | 5750 | |
5753 | - if (c==0) { | |
5754 | - if (IsUpdateTerm()) { | |
5755 | - UpdateTerm(); | |
5756 | - } | |
5757 | - return 0; | |
5758 | - } | |
5751 | + if (c==0) return 0; | |
5759 | 5752 | |
5760 | 5753 | CaretOff(); |
5761 | 5754 | UpdateCaretPosition(FALSE); // 非アクティブの場合のみ再描画する |
@@ -5814,9 +5807,7 @@ | ||
5814 | 5807 | c = CommRead1Byte(&cv,&b); |
5815 | 5808 | } |
5816 | 5809 | |
5817 | - if (IsUpdateTerm()) { | |
5818 | - UpdateTerm(); | |
5819 | - } | |
5810 | + BuffUpdateScroll(); | |
5820 | 5811 | |
5821 | 5812 | BuffSetCaretWidth(); |
5822 | 5813 | UnlockBuffer(); |
@@ -94,8 +94,6 @@ | ||
94 | 94 | static char THIS_FILE[] = __FILE__; |
95 | 95 | #endif |
96 | 96 | |
97 | -extern "C" void BuffUpdateRect2(int XStart, int YStart, int XEnd, int YEnd); | |
98 | - | |
99 | 97 | // ウィンドウ最大化ボタンを有効にする (2005.1.15 yutaka) |
100 | 98 | #define WINDOW_MAXMIMUM_ENABLED 1 |
101 | 99 |
@@ -2657,7 +2655,7 @@ | ||
2657 | 2655 | |
2658 | 2656 | PaintWindow(PaintDC,ps.rcPaint,ps.fErase, &Xs,&Ys,&Xe,&Ye); |
2659 | 2657 | LockBuffer(); |
2660 | - BuffUpdateRect2(Xs,Ys,Xe,Ye); | |
2658 | + BuffUpdateRect(Xs,Ys,Xe,Ye); | |
2661 | 2659 | UnlockBuffer(); |
2662 | 2660 | DispEndPaint(); |
2663 | 2661 |