29 #include "../idlib/precompiled.h"
39 static void FindMatches(
const char *
s ) {
52 for ( i = 0; s[
i]; i++ ) {
53 if ( tolower( globalAutoComplete.
currentMatch[i] ) != tolower( s[i] ) ) {
66 static void FindIndexMatch(
const char *s ) {
84 static void PrintMatches(
const char *s ) {
95 static void PrintCvarMatches(
const char *s ) {
198 idStr::Copynz( completionArgString, args.
Args(),
sizeof( completionArgString ) );
246 if ( strlen( completionArgString ) ) {
301 if ( ch ==
'v' -
'a' + 1 ) {
306 if ( ch ==
'c' -
'a' + 1 ) {
324 if ( ch ==
'a' -
'a' + 1 ) {
330 if ( ch ==
'e' -
'a' + 1 ) {
363 if (
cursor == len + 1 ) {
385 if ( key ==
K_DEL ) {
388 }
else if (
cursor < len ) {
471 if ( key ==
K_INS ) {
498 pasteLen = strlen( cbd );
499 for ( i = 0; i < pasteLen; i++ ) {
542 len = strlen(
buffer ) + 1;
545 if ( len <= drawLen ) {
548 if (
scroll + drawLen > len ) {
565 if ( prestep + drawLen > len ) {
566 drawLen = len - prestep;
574 memcpy( str,
buffer + prestep, drawLen );
596 for (
int i = 0; i<
cursor; i++ ) {
void Draw(int x, int y, int width, bool showCursor, const idMaterial *material)
virtual void CommandCompletion(void(*callback)(const char *s))=0
static int snPrintf(char *dest, int size, const char *fmt,...) id_attribute((format(printf
assert(prefInfo.fullscreenBtn)
char buffer[MAX_EDIT_LINE]
idCVarSystem * cvarSystem
int GetCursor(void) const
autoComplete_t autoComplete
idRenderSystem * renderSystem
const char * Args(int start=1, int end=-1, bool escapeArgs=false) const
void ClearAutoComplete(void)
volatile int com_ticNumber
virtual void DrawSmallChar(int x, int y, int ch, const idMaterial *material)=0
virtual void ArgCompletion(const char *cmdString, void(*callback)(const char *s))=0
virtual void ArgCompletion(const char *cmdString, void(*callback)(const char *s))=0
int Icmpn(const char *text, int n) const
const int SMALLCHAR_WIDTH
GLubyte GLubyte GLubyte GLubyte w
virtual void CommandCompletion(void(*callback)(const char *s))=0
virtual void DrawSmallStringExt(int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material)=0
virtual const char * GetCVarString(const char *name) const =0
void KeyDownEvent(int key)
int GetAutoCompleteLength(void) const
static void Copynz(char *dest, const char *src, int destsize)
char completionString[MAX_EDIT_LINE]
virtual void Printf(const char *fmt,...) id_attribute((format(printf
void TokenizeString(const char *text, bool keepAsStrings)
char currentMatch[MAX_EDIT_LINE]
void Append(const char a)
void SetBuffer(const char *buffer)
void SetWidthInChars(int w)
const char * Argv(int arg) const
virtual void Error(const char *fmt,...) id_attribute((format(printf
char * Sys_GetClipboardData(void)