Remove TermView dependency from Shell. It now depends on TerminalBuffer instead.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29273 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,9 +30,8 @@
|
||||
|
||||
#include "TermConst.h"
|
||||
#include "TermParse.h"
|
||||
#include "TermView.h"
|
||||
// TODO: Fix dependency!
|
||||
|
||||
#include "TerminalBuffer.h"
|
||||
|
||||
|
||||
#ifndef CEOF
|
||||
#define CEOF ('D'&037)
|
||||
@@ -227,17 +226,16 @@ Shell::FD() const
|
||||
}
|
||||
|
||||
|
||||
// TODO: Fix this dependency!
|
||||
void
|
||||
Shell::ViewAttached(TermView *view)
|
||||
Shell::AttachBuffer(TerminalBuffer *buffer)
|
||||
{
|
||||
if (fAttached)
|
||||
return;
|
||||
|
||||
status_t status = fTermParse->StartThreads(view->TextBuffer());
|
||||
status_t status = fTermParse->StartThreads(buffer);
|
||||
if (status < B_OK) {
|
||||
// TODO: What can we do here ?
|
||||
fprintf(stderr, "Shell:ViewAttached():"
|
||||
fprintf(stderr, "Shell:AttachBuffer():"
|
||||
" cannot start parser threads: %s",
|
||||
strerror(status));
|
||||
}
|
||||
@@ -245,7 +243,7 @@ Shell::ViewAttached(TermView *view)
|
||||
|
||||
|
||||
void
|
||||
Shell::ViewDetached()
|
||||
Shell::DetachBuffer()
|
||||
{
|
||||
if (fAttached)
|
||||
fTermParse->StopThreads();
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include <SupportDefs.h>
|
||||
|
||||
// TODO: Maybe merge TermParse and Shell classes ?
|
||||
class TerminalBuffer;
|
||||
class TermParse;
|
||||
class TermView;
|
||||
|
||||
class Shell {
|
||||
public:
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
int FD() const;
|
||||
pid_t ProcessID() const { return fProcessID; }
|
||||
|
||||
virtual void ViewAttached(TermView *view);
|
||||
virtual void ViewDetached();
|
||||
virtual void AttachBuffer(TerminalBuffer *buffer);
|
||||
virtual void DetachBuffer();
|
||||
|
||||
private:
|
||||
int fFd;
|
||||
|
||||
@@ -720,7 +720,7 @@ TermView::_AttachShell(Shell *shell)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
fShell = shell;
|
||||
fShell->ViewAttached(this);
|
||||
fShell->AttachBuffer(TextBuffer());
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
@@ -729,7 +729,7 @@ TermView::_AttachShell(Shell *shell)
|
||||
void
|
||||
TermView::_DetachShell()
|
||||
{
|
||||
fShell->ViewDetached();
|
||||
fShell->DetachBuffer();
|
||||
fShell = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user