📄 tbuffer.h
字号:
//---------------------------------------------------------
/*
File Name: TBuffer.h
Comments: This file contains the definition of the
text_buffer type.
*/
//---------------------------------------------------------
#ifndef TBUFFER_H
#define TBUFFER_H
//---------------------------------------------------------
// Include Files
#include "MiscType.h"
#include "TString.h"
// End Include Files
//---------------------------------------------------------
//---------------------------------------------------------
// Types
typedef struct
{
text_string *allRows;
int totalRows;
int topLine;
boolean isDirty;
} text_buffer;
typedef enum
{
TBE_NO_ERROR = 0,
TBE_CANT_ALLOCATE_BUFFER,
TBE_CANT_LOAD_FILE,
TBE_CANT_SAVE_FILE
} buffer_error;
// End Types
//---------------------------------------------------------
//---------------------------------------------------------
// Prototypes.
void TextBufferInitialize(text_buffer *tBuffer);
buffer_error TextBufferSetRow(
int rowNumber,
const text_string * const textString,
text_buffer *tBuffer);
buffer_error TextBufferGetRow(
int rowNumber,
text_string *textString,
const text_buffer * const tBuffer);
void TextBufferScrollUp(int linesToScroll,
text_buffer *tBuffer);
void TextBufferScrollDown(int linesToScroll,
int displayAreaHeight,
text_buffer *tBuffer);
int TextBufferGetTopLine(const text_buffer * const tBuffer);
int TextBufferGetBufferLength(
const text_buffer * const tBuffer);
void TextBufferFree(text_buffer *tBuffer);
buffer_error TextBufferLoadFile(text_buffer *tBuffer,
const text_string *fileName);
buffer_error TextBufferSaveFile(text_buffer *tBuffer,
const text_string *fileName);
// End Prototypes.
//---------------------------------------------------------
#endif
// End TBuffer.h
//---------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -