| 1 |
doda |
6806 |
/* |
| 2 |
|
|
* Copyright (C) 1994-1998 T. Teranishi |
| 3 |
nmaya |
9048 |
* (C) 2008- TeraTerm Project |
| 4 |
doda |
6806 |
* All rights reserved. |
| 5 |
|
|
* |
| 6 |
doda |
6841 |
* Redistribution and use in source and binary forms, with or without |
| 7 |
|
|
* modification, are permitted provided that the following conditions |
| 8 |
|
|
* are met: |
| 9 |
doda |
6806 |
* |
| 10 |
doda |
6841 |
* 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 |
doda |
6806 |
* |
| 18 |
doda |
6841 |
* 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 |
doda |
6806 |
*/ |
| 29 |
maya |
3227 |
|
| 30 |
|
|
/* TERATERM.EXE, VT terminal display routines */ |
| 31 |
zmatsuo |
8675 |
|
| 32 |
zmatsuo |
10256 |
#pragma once |
| 33 |
|
|
|
| 34 |
zmatsuo |
8675 |
#include "buffer.h" // for TCharAttr |
| 35 |
|
|
|
| 36 |
maya |
3227 |
#ifdef __cplusplus |
| 37 |
|
|
extern "C" { |
| 38 |
|
|
#endif |
| 39 |
|
|
|
| 40 |
zmatsuo |
10294 |
/* Constants */ |
| 41 |
|
|
/* for DispSetColor() / DispGetColor() */ |
| 42 |
|
|
// ANSIColor -- 0-255 |
| 43 |
|
|
#define CS_VT_NORMALFG 256 |
| 44 |
|
|
#define CS_VT_NORMALBG 257 |
| 45 |
|
|
#define CS_VT_BOLDFG 258 |
| 46 |
|
|
#define CS_VT_BOLDBG 259 |
| 47 |
|
|
#define CS_VT_BLINKFG 260 |
| 48 |
|
|
#define CS_VT_BLINKBG 261 |
| 49 |
|
|
#define CS_VT_REVERSEFG 262 |
| 50 |
|
|
#define CS_VT_REVERSEBG 263 |
| 51 |
|
|
#define CS_VT_URLFG 264 |
| 52 |
|
|
#define CS_VT_URLBG 265 |
| 53 |
|
|
#define CS_VT_UNDERFG 266 |
| 54 |
|
|
#define CS_VT_UNDERBG 267 |
| 55 |
|
|
#define CS_TEK_FG 268 |
| 56 |
|
|
#define CS_TEK_BG 269 |
| 57 |
|
|
#define CS_ANSICOLOR_ALL 270 |
| 58 |
|
|
#define CS_SP_ALL 271 |
| 59 |
|
|
#define CS_UNSPEC 0xffffffff |
| 60 |
zmatsuo |
10381 |
#define CS_ALL 0xfffffffe // DispResetColor() �������g�p |
| 61 |
zmatsuo |
10294 |
|
| 62 |
maya |
3227 |
/* prototypes */ |
| 63 |
yutakapon |
8106 |
void BGInitialize(BOOL initialize_once); |
| 64 |
zmatsuo |
10385 |
void BGLoadThemeFile(const TTTSet *pts); |
| 65 |
zmatsuo |
10134 |
void BGSetupPrimary(BOOL forceSetup); |
| 66 |
maya |
3227 |
|
| 67 |
|
|
void BGOnSettingChange(void); |
| 68 |
|
|
void BGOnEnterSizeMove(void); |
| 69 |
|
|
void BGOnExitSizeMove(void); |
| 70 |
|
|
|
| 71 |
zmatsuo |
9991 |
void InitDisp(void); |
| 72 |
|
|
void EndDisp(void); |
| 73 |
|
|
void DispReset(void); |
| 74 |
maya |
3227 |
void DispConvWinToScreen |
| 75 |
|
|
(int Xw, int Yw, int *Xs, int *Ys, PBOOL Right); |
| 76 |
|
|
void DispConvScreenToWin |
| 77 |
|
|
(int Xs, int Ys, int *Xw, int *Yw); |
| 78 |
zmatsuo |
9991 |
void ChangeFont(void); |
| 79 |
|
|
void ResetIME(void); |
| 80 |
|
|
void ChangeCaret(void); |
| 81 |
maya |
3227 |
void CaretKillFocus(BOOL show); |
| 82 |
doda |
3322 |
void UpdateCaretPosition(BOOL enforce); |
| 83 |
zmatsuo |
9991 |
void CaretOn(void); |
| 84 |
|
|
void CaretOff(void); |
| 85 |
|
|
void DispDestroyCaret(void); |
| 86 |
|
|
BOOL IsCaretOn(void); |
| 87 |
maya |
3227 |
void DispEnableCaret(BOOL On); |
| 88 |
zmatsuo |
9991 |
BOOL IsCaretEnabled(void); |
| 89 |
maya |
3227 |
void DispSetCaretWidth(BOOL DW); |
| 90 |
|
|
void DispChangeWinSize(int Nx, int Ny); |
| 91 |
|
|
void ResizeWindow(int x, int y, int w, int h, int cw, int ch); |
| 92 |
|
|
void PaintWindow(HDC PaintDC, RECT PaintRect, BOOL fBkGnd, |
| 93 |
|
|
int* Xs, int* Ys, int* Xe, int* Ye); |
| 94 |
zmatsuo |
9991 |
void DispEndPaint(void); |
| 95 |
|
|
void DispClearWin(void); |
| 96 |
|
|
void DispChangeBackground(void); |
| 97 |
|
|
void DispChangeWin(void); |
| 98 |
|
|
void DispInitDC(void); |
| 99 |
|
|
void DispReleaseDC(void); |
| 100 |
maya |
3227 |
void DispSetupDC(TCharAttr Attr, BOOL Reverse); |
| 101 |
zmatsuo |
10345 |
void DispStrA(const char *Buff, const char *WidthInfo, int Count, int Y, int* X); |
| 102 |
doda |
8445 |
void DispStrW(const wchar_t *StrW, const char *WidthInfo, int Count, int Y, int* X); |
| 103 |
zmatsuo |
10338 |
void DispEraseCurToEnd(int YEnd, const TCharAttr *attr); |
| 104 |
|
|
void DispEraseHomeToCur(int YHome, const TCharAttr *attr); |
| 105 |
|
|
void DispEraseCharsInLine(int XStart, int Count, const TCharAttr *attr); |
| 106 |
maya |
3227 |
BOOL DispDeleteLines(int Count, int YEnd); |
| 107 |
|
|
BOOL DispInsertLines(int Count, int YEnd); |
| 108 |
|
|
BOOL IsLineVisible(int* X, int* Y); |
| 109 |
zmatsuo |
9991 |
void AdjustScrollBar(void); |
| 110 |
maya |
3227 |
void DispScrollToCursor(int CurX, int CurY); |
| 111 |
|
|
void DispScrollNLines(int Top, int Bottom, int Direction); |
| 112 |
zmatsuo |
9991 |
void DispCountScroll(int n); |
| 113 |
|
|
void DispUpdateScroll(void); |
| 114 |
|
|
void DispScrollHomePos(void); |
| 115 |
maya |
3227 |
void DispAutoScroll(POINT p); |
| 116 |
|
|
void DispHScroll(int Func, int Pos); |
| 117 |
|
|
void DispVScroll(int Func, int Pos); |
| 118 |
zmatsuo |
10390 |
void DispSetupFontDlg(HWND hwndOwner); |
| 119 |
zmatsuo |
9991 |
void DispRestoreWinSize(void); |
| 120 |
|
|
void DispSetWinPos(void); |
| 121 |
maya |
3227 |
void DispSetActive(BOOL ActiveFlag); |
| 122 |
|
|
int TCharAttrCmp(TCharAttr a, TCharAttr b); |
| 123 |
doda |
4770 |
void DispSetColor(unsigned int num, COLORREF color); |
| 124 |
|
|
void DispResetColor(unsigned int num); |
| 125 |
|
|
COLORREF DispGetColor(unsigned int num); |
| 126 |
maya |
3227 |
void DispSetCurCharAttr(TCharAttr Attr); |
| 127 |
doda |
3297 |
void DispMoveWindow(int x, int y); |
| 128 |
doda |
3302 |
void DispShowWindow(int mode); |
| 129 |
doda |
3464 |
void DispResizeWin(int w, int h); |
| 130 |
zmatsuo |
9991 |
BOOL DispWindowIconified(void); |
| 131 |
doda |
7271 |
void DispGetWindowPos(int *x, int *y, BOOL client); |
| 132 |
doda |
7270 |
void DispGetWindowSize(int *width, int *height, BOOL client); |
| 133 |
doda |
7272 |
void DispGetRootWinSize(int *x, int *y, BOOL inPixels); |
| 134 |
doda |
5073 |
int DispFindClosestColor(int red, int green, int blue); |
| 135 |
zmatsuo |
10345 |
void DrawStrW(HDC DC, HDC BGDC, const wchar_t *StrW, const char *WidthInfo, int Count, int font_width, int font_height, |
| 136 |
|
|
int Y, int *X); |
| 137 |
|
|
void DrawStrA(HDC DC, HDC BGDC, const char *StrA, const char *WidthInfo, int Count, int font_width, int font_height, |
| 138 |
|
|
int Y, int *X); |
| 139 |
maya |
3227 |
|
| 140 |
|
|
extern int WinWidth, WinHeight; |
| 141 |
|
|
extern HFONT VTFont[AttrFontMask+1]; |
| 142 |
|
|
extern int FontHeight, FontWidth, ScreenWidth, ScreenHeight; |
| 143 |
|
|
extern BOOL AdjustSize, DontChangeSize; |
| 144 |
|
|
extern int CursorX, CursorY; |
| 145 |
|
|
extern int WinOrgX, WinOrgY, NewOrgX, NewOrgY; |
| 146 |
|
|
extern int NumOfLines, NumOfColumns; |
| 147 |
|
|
extern int PageStart, BuffEnd; |
| 148 |
|
|
extern TCharAttr DefCharAttr; |
| 149 |
|
|
|
| 150 |
zmatsuo |
7434 |
extern BOOL IMEstat; |
| 151 |
zmatsuo |
7534 |
extern BOOL IMECompositionState; |
| 152 |
zmatsuo |
7434 |
|
| 153 |
zmatsuo |
10303 |
// for DispHScroll(), DispVScroll() |
| 154 |
maya |
3227 |
#define SCROLL_BOTTOM 1 |
| 155 |
|
|
#define SCROLL_LINEDOWN 2 |
| 156 |
|
|
#define SCROLL_LINEUP 3 |
| 157 |
|
|
#define SCROLL_PAGEDOWN 4 |
| 158 |
|
|
#define SCROLL_PAGEUP 5 |
| 159 |
|
|
#define SCROLL_POS 6 |
| 160 |
|
|
#define SCROLL_TOP 7 |
| 161 |
|
|
|
| 162 |
zmatsuo |
10303 |
// for DispShowWindow() |
| 163 |
doda |
3309 |
#define WINDOW_MINIMIZE 1 |
| 164 |
|
|
#define WINDOW_MAXIMIZE 2 |
| 165 |
|
|
#define WINDOW_RESTORE 3 |
| 166 |
|
|
#define WINDOW_RAISE 4 |
| 167 |
|
|
#define WINDOW_LOWER 5 |
| 168 |
doda |
3310 |
#define WINDOW_REFRESH 6 |
| 169 |
doda |
7274 |
#define WINDOW_TOGGLE_MAXIMIZE 7 |
| 170 |
doda |
3309 |
|
| 171 |
maya |
3227 |
#ifdef __cplusplus |
| 172 |
|
|
} |
| 173 |
|
|
#endif |