Add the add_on field in TermView::Archive(). This way instantiating a
replicant works (thank you Marc). Return errno instead of the return value of read() (thank you Jerome). Terminal now can be instantiated as a replicant, although input doesn't work :((. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21745 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
948b80756a
commit
2240e7df9b
@ -149,9 +149,8 @@ TermParse::PtyReader()
|
|||||||
uchar buf[READ_BUF_SIZE];
|
uchar buf[READ_BUF_SIZE];
|
||||||
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
|
int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fBufferPosition));
|
||||||
if (nread <= 0) {
|
if (nread <= 0) {
|
||||||
// TODO: errno ? (Jerome ?) :)
|
fView->NotifyQuit(errno);
|
||||||
fView->NotifyQuit(nread);
|
exit_thread(errno);
|
||||||
exit_thread(B_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy read string to PtyBuffer.
|
// Copy read string to PtyBuffer.
|
||||||
|
@ -206,7 +206,6 @@ TermView::TermView(BMessage *archive)
|
|||||||
fQuitting(false),
|
fQuitting(false),
|
||||||
fIMflag(false)
|
fIMflag(false)
|
||||||
{
|
{
|
||||||
printf("TermView(BMessage *)\n");
|
|
||||||
if (archive->FindInt32("encoding", (int32 *)&fEncoding) < B_OK)
|
if (archive->FindInt32("encoding", (int32 *)&fEncoding) < B_OK)
|
||||||
fEncoding = M_UTF8;
|
fEncoding = M_UTF8;
|
||||||
if (archive->FindInt32("columns", (int32 *)&fTermColumns) < B_OK)
|
if (archive->FindInt32("columns", (int32 *)&fTermColumns) < B_OK)
|
||||||
@ -215,7 +214,7 @@ TermView::TermView(BMessage *archive)
|
|||||||
fTermRows = 25;
|
fTermRows = 25;
|
||||||
|
|
||||||
// TODO: Retrieve command, colors, history size, etc. from archive
|
// TODO: Retrieve command, colors, history size, etc. from archive
|
||||||
printf("_InitObject() returned %s\n", strerror(_InitObject(NULL)));
|
_InitObject(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -266,11 +265,9 @@ TermView::~TermView()
|
|||||||
BArchivable *
|
BArchivable *
|
||||||
TermView::Instantiate(BMessage* data)
|
TermView::Instantiate(BMessage* data)
|
||||||
{
|
{
|
||||||
printf("TermView::Instantiate()\n");
|
|
||||||
if (validate_instantiation(data, "TermView"))
|
if (validate_instantiation(data, "TermView"))
|
||||||
return new (std::nothrow) TermView(data);
|
return new (std::nothrow) TermView(data);
|
||||||
|
|
||||||
printf("Returned NULL\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,15 +275,16 @@ TermView::Instantiate(BMessage* data)
|
|||||||
status_t
|
status_t
|
||||||
TermView::Archive(BMessage* data, bool deep) const
|
TermView::Archive(BMessage* data, bool deep) const
|
||||||
{
|
{
|
||||||
printf("TermView::Archive()\n");
|
|
||||||
status_t status = BView::Archive(data, deep);
|
status_t status = BView::Archive(data, deep);
|
||||||
|
if (status == B_OK)
|
||||||
|
status = data->AddString("add_on", TERM_SIGNATURE);
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = data->AddInt32("encoding", (int32)fEncoding);
|
status = data->AddInt32("encoding", (int32)fEncoding);
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = data->AddInt32("columns", (int32)fTermColumns);
|
status = data->AddInt32("columns", (int32)fTermColumns);
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = data->AddInt32("rows", (int32)fTermRows);
|
status = data->AddInt32("rows", (int32)fTermRows);
|
||||||
printf("Archive() returned %s\n", strerror(status));
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,51 +50,6 @@
|
|||||||
|
|
||||||
const static float kViewOffset = 3;
|
const static float kViewOffset = 3;
|
||||||
|
|
||||||
#if 0
|
|
||||||
TermWindow::TermWindow(BRect frame, const char* title, const char *command)
|
|
||||||
:
|
|
||||||
BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE|B_QUIT_ON_WINDOW_CLOSE),
|
|
||||||
fTabView(NULL),
|
|
||||||
fTermView(NULL),
|
|
||||||
fMenubar(NULL),
|
|
||||||
fFilemenu(NULL),
|
|
||||||
fEditmenu(NULL),
|
|
||||||
fEncodingmenu(NULL),
|
|
||||||
fHelpmenu(NULL),
|
|
||||||
fFontMenu(NULL),
|
|
||||||
fWindowSizeMenu(NULL),
|
|
||||||
fNewFontMenu(NULL),
|
|
||||||
fPrintSettings(NULL),
|
|
||||||
fPrefWindow(NULL),
|
|
||||||
fFindPanel(NULL),
|
|
||||||
fSavedFrame(0, 0, -1, -1),
|
|
||||||
fFindString(""),
|
|
||||||
fFindForwardMenuItem(NULL),
|
|
||||||
fFindBackwardMenuItem(NULL),
|
|
||||||
fFindSelection(false),
|
|
||||||
fForwardSearch(false),
|
|
||||||
fMatchCase(false),
|
|
||||||
fMatchWord(false)
|
|
||||||
{
|
|
||||||
|
|
||||||
fTabView = new SmartTabView(Bounds(), "Tab view");
|
|
||||||
AddChild(fTabView);
|
|
||||||
|
|
||||||
_NewTab(command);
|
|
||||||
_NewTab(NULL);
|
|
||||||
fTabView->Select(0);
|
|
||||||
/*
|
|
||||||
BView *view = new TermView(Bounds());
|
|
||||||
AddChild(view);
|
|
||||||
BRect _WritePTYdraggerFrame(0, 0, 16, 16);
|
|
||||||
draggerFrame.OffsetTo(Bounds().RightBottom() - BPoint(16, 16));
|
|
||||||
BDragger *dragger = new BDragger(draggerFrame, view, B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM, B_WILL_DRAW);
|
|
||||||
|
|
||||||
view->AddChild(dragger);*/
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
TermWindow::TermWindow(BRect frame, const char* title, const char *command)
|
TermWindow::TermWindow(BRect frame, const char* title, const char *command)
|
||||||
: BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE|B_QUIT_ON_WINDOW_CLOSE),
|
: BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE|B_QUIT_ON_WINDOW_CLOSE),
|
||||||
fTabView(NULL),
|
fTabView(NULL),
|
||||||
@ -120,6 +75,14 @@ TermWindow::TermWindow(BRect frame, const char* title, const char *command)
|
|||||||
fMatchWord(false)
|
fMatchWord(false)
|
||||||
{
|
{
|
||||||
_InitWindow(command);
|
_InitWindow(command);
|
||||||
|
/*BView *view = new TermView(Bounds());
|
||||||
|
|
||||||
|
AddChild(view);
|
||||||
|
BRect draggerFrame(0, 0, 16, 16);
|
||||||
|
draggerFrame.OffsetTo(Bounds().RightBottom() - BPoint(16, 16));
|
||||||
|
BDragger *dragger = new BDragger(draggerFrame, view, B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM, B_WILL_DRAW);
|
||||||
|
|
||||||
|
view->AddChild(dragger);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user