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 "TermConst.h"
|
||||||
#include "TermParse.h"
|
#include "TermParse.h"
|
||||||
#include "TermView.h"
|
#include "TerminalBuffer.h"
|
||||||
// TODO: Fix dependency!
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CEOF
|
#ifndef CEOF
|
||||||
#define CEOF ('D'&037)
|
#define CEOF ('D'&037)
|
||||||
@@ -227,17 +226,16 @@ Shell::FD() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: Fix this dependency!
|
|
||||||
void
|
void
|
||||||
Shell::ViewAttached(TermView *view)
|
Shell::AttachBuffer(TerminalBuffer *buffer)
|
||||||
{
|
{
|
||||||
if (fAttached)
|
if (fAttached)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
status_t status = fTermParse->StartThreads(view->TextBuffer());
|
status_t status = fTermParse->StartThreads(buffer);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
// TODO: What can we do here ?
|
// TODO: What can we do here ?
|
||||||
fprintf(stderr, "Shell:ViewAttached():"
|
fprintf(stderr, "Shell:AttachBuffer():"
|
||||||
" cannot start parser threads: %s",
|
" cannot start parser threads: %s",
|
||||||
strerror(status));
|
strerror(status));
|
||||||
}
|
}
|
||||||
@@ -245,7 +243,7 @@ Shell::ViewAttached(TermView *view)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Shell::ViewDetached()
|
Shell::DetachBuffer()
|
||||||
{
|
{
|
||||||
if (fAttached)
|
if (fAttached)
|
||||||
fTermParse->StopThreads();
|
fTermParse->StopThreads();
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
// TODO: Maybe merge TermParse and Shell classes ?
|
// TODO: Maybe merge TermParse and Shell classes ?
|
||||||
|
class TerminalBuffer;
|
||||||
class TermParse;
|
class TermParse;
|
||||||
class TermView;
|
|
||||||
|
|
||||||
class Shell {
|
class Shell {
|
||||||
public:
|
public:
|
||||||
@@ -40,8 +40,8 @@ public:
|
|||||||
int FD() const;
|
int FD() const;
|
||||||
pid_t ProcessID() const { return fProcessID; }
|
pid_t ProcessID() const { return fProcessID; }
|
||||||
|
|
||||||
virtual void ViewAttached(TermView *view);
|
virtual void AttachBuffer(TerminalBuffer *buffer);
|
||||||
virtual void ViewDetached();
|
virtual void DetachBuffer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fFd;
|
int fFd;
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ TermView::_AttachShell(Shell *shell)
|
|||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
fShell = shell;
|
fShell = shell;
|
||||||
fShell->ViewAttached(this);
|
fShell->AttachBuffer(TextBuffer());
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -729,7 +729,7 @@ TermView::_AttachShell(Shell *shell)
|
|||||||
void
|
void
|
||||||
TermView::_DetachShell()
|
TermView::_DetachShell()
|
||||||
{
|
{
|
||||||
fShell->ViewDetached();
|
fShell->DetachBuffer();
|
||||||
fShell = NULL;
|
fShell = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user