gasDisplayLines = calloc( sizeof(char*), (Lines + ExtraScrollbackLines) );
gaiDisplayLineSizes = calloc( sizeof(int), (Lines + ExtraScrollbackLines) );
gabDisplayLinesDirty = calloc( sizeof(char), (Lines + ExtraScrollbackLines) );
+
+ AxWin3_RichText_SetLineCount(gMainWindow, Lines+ExtraScrollbackLines);
+ AxWin3_RichText_SetCursorType(gMainWindow, 1); // TODO: enum
}
void Display_int_PushString(int Length, const char *Text)
memcpy(gasDisplayLines[giCurrentLine]+giCurrentLinePos, Text, Length);
gabDisplayLinesDirty[giCurrentLine] = 1;
gasDisplayLines[giCurrentLine][giCurrentLinePos+Length] = 0;
+ giCurrentLinePos += Length;
}
{
uint32_t cp;
bytes += ReadUTF8(UTF8Text+bytes, &cp);
- if( Unicode_IsPrinting(cp) )
+ if( Unicode_IsPrinting(cp) ) {
space --;
+ giCurrentCol ++;
+ }
}
Display_int_PushString(bytes, UTF8Text);
UTF8Text += bytes;
- _SysDebug("Length(%i) -= bytes(%i)", Length, bytes);
Length -= bytes;
if( Length != 0 )
{
void Display_Newline(int bCarriageReturn)
{
- Display_Flush();
+// Display_Flush();
// Going down!
giCurrentLine ++;
void Display_MoveCursor(int RelRow, int RelCol)
{
- UNIMPLIMENTED();
+ if( RelRow < 0 )
+ {
+ for( ; RelRow < 0; RelRow ++ )
+ {
+ uint32_t cp;
+ int delta = ReadUTF8Rev(gasDisplayLines[giCurrentLine], giCurrentLinePos, &cp);
+ if( !Unicode_IsPrinting(cp) )
+ RelRow --;
+ else
+ giCurrentCol --;
+ giCurrentLinePos -= delta;
+ }
+ }
+ else
+ {
+ UNIMPLIMENTED();
+ }
}
void Display_ClearLine(int Dir) // 0: All, 1: Forward, -1: Reverse
void Display_SetForeground(uint32_t RGB)
{
- UNIMPLIMENTED();
+ char buf[7+1];
+ sprintf(buf, "\1%06x", RGB&0xFFFFFF);
+ Display_int_PushString(7, buf);
}
void Display_SetBackground(uint32_t RGB)
{
- UNIMPLIMENTED();
+ char buf[7+1];
+ sprintf(buf, "\2%06x", RGB&0xFFFFFF);
+ Display_int_PushString(7, buf);
}
void Display_Flush(void)
AxWin3_RichText_SendLine(gMainWindow, giFirstLine + i, gasDisplayLines[line] );
gabDisplayLinesDirty[line] = 0;
}
-
- // force redraw?
- AxWin3_FocusWindow(gMainWindow);
+ AxWin3_RichText_SetCursorPos(gMainWindow, giCurrentLine, giCurrentCol);
}
void Display_ShowAltBuffer(int AltBufEnabled)