Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/teraterm/teraterm/buffer.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9115 - (hide annotations) (download) (as text)
Mon Dec 28 14:29:48 2020 UTC (3 years, 3 months ago) by zmatsuo
File MIME type: text/x-chdr
File size: 6626 byte(s)
エスケープシーケンスからの印字を修正

- 内部は Unicode に対応した
- CP_ACP に変換して出力
1 doda 6806 /*
2     * Copyright (C) 1994-1998 T. Teranishi
3 nmaya 9048 * (C) 2005- 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, scroll buffer routines */
31    
32 zmatsuo 8675 #pragma once
33    
34 zmatsuo 9115 #include "teraprnfile.h"
35    
36 maya 3227 #ifdef __cplusplus
37     extern "C" {
38     #endif
39    
40 zmatsuo 8675 /* Character attribute bit masks */
41     #define AttrDefault 0x00
42     #define AttrDefaultFG 0x00
43     #define AttrDefaultBG 0x00
44     #define AttrBold 0x01
45     #define AttrUnder 0x02
46     #define AttrSpecial 0x04
47     #define AttrFontMask 0x07
48     #define AttrBlink 0x08
49     #define AttrReverse 0x10
50     #define AttrLineContinued 0x20 /* valid only at the beggining or end of a line */
51     /* begin - ishizaki */
52     #define AttrURL 0x40
53     /* end - ishizaki */
54     #define AttrKanji 0x80 // 1=�S�p(2cell)/0=���p(1cell)
55     #define AttrPadding 0x100 // 1=padding(2cell������1cell or �s��)
56    
57     /* Color attribute bit masks */
58     #define Attr2Fore 0x01
59     #define Attr2Back 0x02
60     #define AttrSgrMask (AttrBold | AttrUnder | AttrBlink | AttrReverse)
61     #define AttrColorMask (AttrBold | AttrBlink | AttrReverse)
62     #define Attr2ColorMask (Attr2Fore | Attr2Back)
63    
64     #define Attr2Protect 0x04
65    
66     typedef struct {
67     BYTE Attr;
68     BYTE Attr2;
69     #if 1 //UNICODE_INTERNAL_BUFF
70     WORD AttrEx; // �A�g���r���[�g���������e�X�g
71     #endif
72     BYTE Fore;
73     BYTE Back;
74     } TCharAttr;
75    
76     typedef TCharAttr *PCharAttr;
77    
78 zmatsuo 8748 void InitBuffer(BOOL use_unicode_api);
79 maya 3227 void LockBuffer();
80     void UnlockBuffer();
81     void FreeBuffer();
82     void BuffReset();
83     void BuffAllSelect();
84     void BuffScreenSelect();
85     void BuffCancelSelection();
86     void ChangeSelectRegion();
87     void BuffScroll(int Count, int Bottom);
88     void BuffInsertSpace(int Count);
89     void BuffEraseCurToEnd();
90     void BuffEraseHomeToCur();
91     void BuffInsertLines(int Count, int YEnd);
92     void BuffEraseCharsInLine(int XStart, int Count);
93     void BuffDeleteLines(int Count, int YEnd);
94     void BuffDeleteChars(int Count);
95     void BuffEraseChars(int Count);
96     void BuffFillWithE();
97     void BuffDrawLine(TCharAttr Attr, int Direction, int C);
98     void BuffEraseBox(int XStart, int YStart, int XEnd, int YEnd);
99 doda 5090 void BuffFillBox(char c, int XStart, int YStart, int XEnd, int YEnd);
100 doda 5089 void BuffCopyBox(int SrcXStart, int SrcYStart, int SrcXEnd, int SrcYEnd, int SrcPage, int DstX, int DstY, int DstPage);
101 doda 5095 void BuffChangeAttrBox(int XStart, int YStart, int XEnd, int YEnd, PCharAttr attr, PCharAttr mask);
102 doda 7086 void BuffChangeAttrStream(int XStart, int YStart, int XEnd, int YEnd, PCharAttr attr, PCharAttr mask);
103 zmatsuo 8676 wchar_t *BuffCBCopyUnicode(BOOL Table);
104 maya 3227 void BuffPrint(BOOL ScrollRegion);
105 zmatsuo 9115 void BuffDumpCurrentLine(PrintFile *handle, BYTE TERM);
106 maya 3227 void BuffPutChar(BYTE b, TCharAttr Attr, BOOL Insert);
107     void BuffPutKanji(WORD w, TCharAttr Attr, BOOL Insert);
108 doda 8445 int BuffPutUnicode(unsigned int uc, TCharAttr Attr, BOOL Insert);
109 maya 3227 void BuffUpdateRect(int XStart, int YStart, int XEnd, int YEnd);
110     void UpdateStr();
111     void UpdateStrUnicode(void);
112     void MoveCursor(int Xnew, int Ynew);
113     void MoveRight();
114     void BuffSetCaretWidth();
115     void BuffScrollNLines(int n);
116     void BuffClearScreen();
117     void BuffUpdateScroll();
118     void CursorUpWithScroll();
119     int BuffUrlDblClk(int Xw, int Yw);
120     void BuffDblClk(int Xw, int Yw);
121     void BuffTplClk(int Yw);
122     void BuffSeveralPagesSelect(int Xw, int Yw);
123     void BuffStartSelect(int Xw, int Yw, BOOL Box);
124     void BuffChangeSelect(int Xw, int Yw, int NClick);
125 zmatsuo 8676 wchar_t *BuffEndSelect();
126 maya 3227 void BuffChangeWinSize(int Nx, int Ny);
127     void BuffChangeTerminalSize(int Nx, int Ny);
128     void ChangeWin();
129     void ClearBuffer();
130     void SetTabStop();
131     void CursorForwardTab(int count, BOOL AutoWrapMode);
132     void CursorBackwardTab(int count);
133     void ClearTabStop(int Ps);
134     void ShowStatusLine(int Show);
135 doda 3312 void BuffLineContinued(BOOL mode);
136     #define SetLineContinued() BuffLineContinued(TRUE)
137     #define ClearLineContinued() BuffLineContinued(FALSE)
138 maya 3227 void BuffRegionScrollUpNLines(int n);
139     void BuffRegionScrollDownNLines(int n);
140     void BuffSetCurCharAttr(TCharAttr Attr);
141 doda 3743 void BuffSaveScreen();
142     void BuffRestoreScreen();
143 doda 3745 void BuffDiscardSavedScreen();
144 doda 4070 void BuffSelectedEraseCharsInLine(int XStart, int Count);
145     void BuffSelectedEraseCurToEnd();
146     void BuffSelectedEraseHomeToCur();
147     void BuffSelectedEraseScreen();
148 doda 5091 void BuffSelectiveEraseBox(int XStart, int YStart, int XEnd, int YEnd);
149 doda 4243 void BuffScrollLeft(int count);
150     void BuffScrollRight(int count);
151 yutakapon 4932 int BuffGetCurrentLineData(char *buf, int bufsize);
152 zmatsuo 8678 wchar_t *BuffGetLineStrW(int Sy, int *cx, size_t *length);
153 zmatsuo 8908 int BuffGetAnyLineData(int offset_y, char *buf, int bufsize);
154     int BuffGetAnyLineDataW(int offset_y, wchar_t *buf, size_t bufsize);
155 doda 5279 BOOL BuffCheckMouseOnURL(int Xw, int Yw);
156 doda 8445 wchar_t *BuffGetCharInfo(int Xw, int Yw);
157     void BuffSetCursorCharAttr(int x, int y, TCharAttr Attr);
158     TCharAttr BuffGetCursorCharAttr(int x, int y);
159 zmatsuo 8605 BOOL BuffIsCombiningCharacter(int x, int y, unsigned int u32);
160 zmatsuo 8750 void BuffSetDispAPI(BOOL unicode);
161 zmatsuo 8770 void BuffSetDispCodePage(int CodePage);
162     int BuffGetDispCodePage(void);
163 maya 3227
164     extern int StatusLine;
165 doda 5324 extern int CursorTop, CursorBottom, CursorLeftM, CursorRightM;
166 maya 3227 extern BOOL Selected;
167     extern BOOL Wrap;
168    
169 doda 6175 #define isCursorOnStatusLine (StatusLine && CursorY == NumOfLines-1)
170 doda 5324
171 maya 3227 #ifdef __cplusplus
172     }
173     #endif

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