ReactOS  0.4.12-dev-43-g63b00d8
tscroll.cpp File Reference
#include "precomp.h"
Include dependency graph for tscroll.cpp:

Go to the source code of this file.

Enumerations

enum  { HEX, DUMP, DUMPB, TEXTB }
 

Functions

int DummyStripBuffer (char *start, char *end, int width)
 
static BOOL WriteConsoleOutputCharAndAttribute (HANDLE hConsoleOutput, CHAR *lpWriteBuffer, WORD wAttrib, SHORT sX, SHORT sY)
 
static void hexify (int x, char *str, int len)
 
static int setmaxlines (int iDisplay, int iScrollSize, int strippedlines, int con_width)
 
static void setstatusline (char *szStatusLine, int len, int iDisplay)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HEX 
DUMP 
DUMPB 
TEXTB 

Definition at line 43 of file tscroll.cpp.

43  {
44  HEX,
45  DUMP,
46  DUMPB,
47  TEXTB,
48 };
Definition: tscroll.cpp:44
Definition: tscroll.cpp:45

Function Documentation

◆ DummyStripBuffer()

int DummyStripBuffer ( char start,
char end,
int  width 
)

Definition at line 50 of file tscroll.cpp.

Referenced by TScroller::TScroller().

50 {return 0;}

◆ hexify()

static void hexify ( int  x,
char str,
int  len 
)
static

Definition at line 130 of file tscroll.cpp.

Referenced by TScroller::ScrollBack().

130  {
131  for(int j = len - 1; j >= 0; j--) {
132  str[j] = x % 16;
133  if(str[j] > 9) str[j] += 'A' - 10;
134  else str[j] += '0';
135  x /= 16;
136  }
137 }
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
const WCHAR * str
GLenum GLsizei len
Definition: glext.h:6722
INT x
Definition: msvc.h:62

◆ setmaxlines()

static int setmaxlines ( int  iDisplay,
int  iScrollSize,
int  strippedlines,
int  con_width 
)
static

Definition at line 139 of file tscroll.cpp.

Referenced by TScroller::ScrollBack().

140  {
141  switch(iDisplay) {
142  case HEX: return(iScrollSize / 16); break;
143  case DUMP:
144  case DUMPB: return(iScrollSize / con_width); break;
145  case TEXTB: return(strippedlines); break;
146  }
147  return 0;
148 }
Definition: tscroll.cpp:44
Definition: tscroll.cpp:45

◆ setstatusline()

static void setstatusline ( char szStatusLine,
int  len,
int  iDisplay 
)
static

Definition at line 150 of file tscroll.cpp.

Referenced by TScroller::ScrollBack().

150  {
151  memset(szStatusLine, ' ', len);
152  memcpy(&szStatusLine[1], "Scrollback Mode", 15);
153  switch(iDisplay) {
154  case HEX: memcpy(&szStatusLine[len / 2 - 1], "HEX", 3); break;
155  case DUMP: memcpy(&szStatusLine[len / 2 - 2], "DUMP", 4); break;
156  case DUMPB: memcpy(&szStatusLine[len / 2 - 5], "BINARY DUMP", 11); break;
157  case TEXTB: memcpy(&szStatusLine[len / 2 - 2], "TEXT", 4); break;
158  }
159  memcpy(&szStatusLine[len - 6], "READY", 5);
160  szStatusLine[len] = 0;
161 }
Definition: tscroll.cpp:44
Definition: tscroll.cpp:45
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define memset(x, y, z)
Definition: compat.h:39

◆ WriteConsoleOutputCharAndAttribute()

static BOOL WriteConsoleOutputCharAndAttribute ( HANDLE  hConsoleOutput,
CHAR lpWriteBuffer,
WORD  wAttrib,
SHORT  sX,
SHORT  sY 
)
static

Definition at line 97 of file tscroll.cpp.

Referenced by TScroller::ScrollBack().

102  {
103  // we ought to allocate memory before writing to an address (PB 5/12/98)
104  DWORD cWritten;
105  const LPDWORD lpcWritten = &cWritten;
106 
107  DWORD cWriteCells = strlen(lpWriteBuffer);
108  COORD coordWrite = {sX,sY};
109  LPWORD lpwAttribute = new WORD[cWriteCells];
110  for (unsigned int i = 0; i < cWriteCells; i++)
111  lpwAttribute[i] = wAttrib;
113  hConsoleOutput, // handle of a console screen buffer
114  lpwAttribute, // address of buffer to write attributes from
115  cWriteCells, // number of character cells to write to
116  coordWrite, // coordinates of first cell to write to
117  lpcWritten // address of number of cells written to
118  );
120  hConsoleOutput, // handle of a console screen buffer
121  lpWriteBuffer, // address of buffer to write characters from
122  cWriteCells, // number of character cells to write to
123  coordWrite, // coordinates of first cell to write to
124  lpcWritten // address of number of cells written to
125  );
126  delete [] lpwAttribute;
127  return 1;
128 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLclampf GLint i
Definition: glfuncs.h:14
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: bl.h:1338
uint16_t * LPWORD
Definition: typedefs.h:54
uint32_t * LPDWORD
Definition: typedefs.h:57
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN CONST WORD *lpAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
Definition: readwrite.c:1655
#define WriteConsoleOutputCharacter
Definition: wincon.h:777