xmlterm changes only, a=leaf (not part of the default build).

Implemented full screen operations in XMLTerm, although still buggy.
Commands like 'less', 'vi', and 'emacs -nw' now work in stand-alone xmlterm,
although scrolling is still messed up. Compiles with Feb21 tree.


git-svn-id: svn://10.0.0.236/trunk@61437 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
svn%xmlterm.org
2000-02-22 20:18:19 +00:00
parent 2ef6434ac5
commit abcb23fef9
27 changed files with 1045 additions and 163 deletions

View File

@@ -138,40 +138,44 @@ NS_IMETHODIMP mozXMLTermShell::GetCurrentEntryNumber(PRInt32 *aNumber)
}
NS_IMETHODIMP mozXMLTermShell::GetHistory(PRInt32 *aHistory)
/** Sets command history buffer count
* @param aHistory history buffer count
* @param aCookie document.cookie string for authentication
*/
NS_IMETHODIMP mozXMLTermShell::SetHistory(PRInt32 aHistory,
const PRUnichar* aCookie)
{
if (mXMLTerminal) {
return mXMLTerminal->GetHistory(aHistory);
} else {
return NS_ERROR_NOT_INITIALIZED;
}
}
nsresult result;
PRBool matchesCookie;
result = mXMLTerminal->MatchesCookie(aCookie, &matchesCookie);
if (NS_FAILED(result) || !matchesCookie)
return NS_ERROR_FAILURE;
NS_IMETHODIMP mozXMLTermShell::SetHistory(PRInt32 aHistory)
{
if (mXMLTerminal) {
return mXMLTerminal->SetHistory(aHistory);
} else {
return NS_ERROR_NOT_INITIALIZED;
}
}
NS_IMETHODIMP mozXMLTermShell::GetPrompt(PRUnichar **aPrompt)
/** Sets command prompt
* @param aPrompt command prompt string (HTML)
* @param aCookie document.cookie string for authentication
*/
NS_IMETHODIMP mozXMLTermShell::SetPrompt(const PRUnichar* aPrompt,
const PRUnichar* aCookie)
{
if (mXMLTerminal) {
return mXMLTerminal->GetPrompt(aPrompt);
} else {
return NS_ERROR_NOT_INITIALIZED;
}
}
nsresult result;
PRBool matchesCookie;
result = mXMLTerminal->MatchesCookie(aCookie, &matchesCookie);
if (NS_FAILED(result) || !matchesCookie)
return NS_ERROR_FAILURE;
NS_IMETHODIMP mozXMLTermShell::SetPrompt(const PRUnichar* aPrompt)
{
if (mXMLTerminal) {
return mXMLTerminal->SetPrompt(aPrompt);
} else {
return NS_ERROR_NOT_INITIALIZED;
}
@@ -228,6 +232,28 @@ mozXMLTermShell::Init(nsIDOMWindow* aContentWin,
}
/** Closes XMLterm, freeing resources
* @param aCookie document.cookie string for authentication
*/
NS_IMETHODIMP
mozXMLTermShell::Close(const PRUnichar* aCookie)
{
XMLT_LOG(mozXMLTermShell::Close,10,("\n"));
if (mInitialized && mXMLTerminal) {
nsresult result;
PRBool matchesCookie;
result = mXMLTerminal->MatchesCookie(aCookie, &matchesCookie);
if (NS_FAILED(result) || !matchesCookie)
return NS_ERROR_FAILURE;
Finalize();
}
return NS_OK;
}
// De-initialize XMLTermShell and free resources
NS_IMETHODIMP
mozXMLTermShell::Finalize(void)
@@ -259,18 +285,29 @@ NS_IMETHODIMP mozXMLTermShell::Poll(void)
}
/** Resizes XMLterm to match a resized window.
*/
NS_IMETHODIMP mozXMLTermShell::Resize(void)
{
if (!mXMLTerminal)
return NS_ERROR_NOT_INITIALIZED;
return mXMLTerminal->Resize();
}
// Send string to LineTerm as if the user had typed it
NS_IMETHODIMP mozXMLTermShell::SendText(const PRUnichar* buf,
const PRUnichar* cookie)
NS_IMETHODIMP mozXMLTermShell::SendText(const PRUnichar* aString,
const PRUnichar* aCookie)
{
if (!mXMLTerminal)
return NS_ERROR_FAILURE;
nsAutoString sendStr (buf);
nsAutoString sendStr (aString);
XMLT_LOG(mozXMLTermShell::SendText,10,("length=%d\n", sendStr.Length()));
return mXMLTerminal->SendText(sendStr, cookie);
return mXMLTerminal->SendText(sendStr, aCookie);
}