Propagate the encoding to TerminalBuffer. It doesn't really belong
there, but that's the easiest solution for the time being. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25887 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -356,6 +356,7 @@ TermView::_InitObject(int32 argc, const char **argv)
|
|||||||
status_t error = fTextBuffer->Init(fTermColumns, fTermRows, fScrBufSize);
|
status_t error = fTextBuffer->Init(fTermColumns, fTermRows, fScrBufSize);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
fTextBuffer->SetEncoding(fEncoding);
|
||||||
|
|
||||||
fShell = new (std::nothrow) Shell();
|
fShell = new (std::nothrow) Shell();
|
||||||
if (fShell == NULL)
|
if (fShell == NULL)
|
||||||
@@ -537,6 +538,9 @@ TermView::SetEncoding(int encoding)
|
|||||||
// the string value of encoding. But when this function is called and
|
// the string value of encoding. But when this function is called and
|
||||||
// the encoding changes, the new value is never passed to Shell.
|
// the encoding changes, the new value is never passed to Shell.
|
||||||
fEncoding = encoding;
|
fEncoding = encoding;
|
||||||
|
|
||||||
|
BAutolock _(fTextBuffer);
|
||||||
|
fTextBuffer->SetEncoding(fEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,8 @@ TerminalBuffer::_CursorChanged()
|
|||||||
TerminalBuffer::TerminalBuffer()
|
TerminalBuffer::TerminalBuffer()
|
||||||
:
|
:
|
||||||
BLocker("terminal buffer"),
|
BLocker("terminal buffer"),
|
||||||
fHistory(NULL)
|
fHistory(NULL),
|
||||||
|
fEncoding(M_UTF8)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,8 +146,14 @@ TerminalBuffer::SetListener(BMessenger listener)
|
|||||||
int
|
int
|
||||||
TerminalBuffer::Encoding() const
|
TerminalBuffer::Encoding() const
|
||||||
{
|
{
|
||||||
// TODO: Remove, if not needed!
|
return fEncoding;
|
||||||
return M_UTF8;
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
TerminalBuffer::SetEncoding(int encoding)
|
||||||
|
{
|
||||||
|
fEncoding = encoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
void SetListener(BMessenger listener);
|
void SetListener(BMessenger listener);
|
||||||
|
|
||||||
int Encoding() const;
|
int Encoding() const;
|
||||||
|
void SetEncoding(int encoding);
|
||||||
|
|
||||||
int32 Width() const { return fWidth; }
|
int32 Width() const { return fWidth; }
|
||||||
int32 Height() const { return fHeight; }
|
int32 Height() const { return fHeight; }
|
||||||
@@ -182,6 +183,8 @@ private:
|
|||||||
|
|
||||||
bool fOverwriteMode; // false for insert
|
bool fOverwriteMode; // false for insert
|
||||||
|
|
||||||
|
int fEncoding;
|
||||||
|
|
||||||
// listener/dirty region management
|
// listener/dirty region management
|
||||||
BMessenger fListener;
|
BMessenger fListener;
|
||||||
TerminalBufferDirtyInfo fDirtyInfo;
|
TerminalBufferDirtyInfo fDirtyInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user