mirror of
https://review.haiku-os.org/haiku
synced 2025-02-01 03:06:08 +01:00
Big refactoring. Got rid of some global variables by putting code in
global functions (at least for now), removed useless globals, restyled the code. Not yet done. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21557 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9047804645
commit
4ec75bbee6
@ -61,10 +61,6 @@ CodeConv::UTF8GetFontWidth(const char *string)
|
||||
int32
|
||||
CodeConv::ConvertFromInternal(const char *src, int32 srclen, char *dst, int coding)
|
||||
{
|
||||
int32 dstlen = 0;
|
||||
long state = 0;
|
||||
int theCoding;
|
||||
|
||||
if (srclen == -1)
|
||||
srclen = strlen(src);
|
||||
|
||||
@ -74,11 +70,10 @@ CodeConv::ConvertFromInternal(const char *src, int32 srclen, char *dst, int codi
|
||||
return srclen;
|
||||
}
|
||||
|
||||
theCoding = coding_translation_table[coding];
|
||||
|
||||
|
||||
dstlen = srclen * 256;
|
||||
int theCoding = coding_translation_table[coding];
|
||||
|
||||
int32 dstlen = srclen * 256;
|
||||
long state = 0;
|
||||
convert_from_utf8(theCoding, (char *)src, &srclen,
|
||||
(char *)dst, &dstlen, &state, '?');
|
||||
|
||||
@ -97,10 +92,6 @@ CodeConv::ConvertFromInternal(const char *src, int32 srclen, char *dst, int codi
|
||||
int32
|
||||
CodeConv::ConvertToInternal(const char *src, int32 srclen, char *dst, int coding)
|
||||
{
|
||||
int32 dstlen = 4;
|
||||
long state = 0;
|
||||
int theCoding;
|
||||
|
||||
if (srclen == -1)
|
||||
srclen = strlen(src);
|
||||
|
||||
@ -126,8 +117,9 @@ CodeConv::ConvertToInternal(const char *src, int32 srclen, char *dst, int coding
|
||||
#endif
|
||||
#endif
|
||||
|
||||
theCoding = coding_translation_table[coding];
|
||||
|
||||
int theCoding = coding_translation_table[coding];
|
||||
int32 dstlen = 4;
|
||||
long state = 0;
|
||||
convert_to_utf8(theCoding, (char *)src, &srclen,
|
||||
(char *)dst, &dstlen, &state, '?');
|
||||
|
||||
|
122
src/apps/terminal/Coding.cpp
Normal file
122
src/apps/terminal/Coding.cpp
Normal file
@ -0,0 +1,122 @@
|
||||
#include "Coding.h"
|
||||
|
||||
struct etable {
|
||||
const char *name; // long name for menu item.
|
||||
const char *shortname; // short name (use for command-line etc.)
|
||||
const char shortcut; // short cut key code
|
||||
const uint32 id; // encoding id
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* encoding_table ... use encoding menu, message, and preference keys.
|
||||
*/
|
||||
const static etable kEncodingTable[] =
|
||||
{
|
||||
{"UTF-8", "UTF8", 'U', M_UTF8},
|
||||
{"ISO-8859-1", "8859-1", '1', M_ISO_8859_1},
|
||||
{"ISO-8859-2", "8859-2", '2', M_ISO_8859_2},
|
||||
{"ISO-8859-3", "8859-3", '3', M_ISO_8859_3},
|
||||
{"ISO-8859-4", "8859-4", '4', M_ISO_8859_4},
|
||||
{"ISO-8859-5", "8859-5", '5', M_ISO_8859_5},
|
||||
{"ISO-8859-6", "8859-6", '6', M_ISO_8859_6},
|
||||
{"ISO-8859-7", "8859-7", '7', M_ISO_8859_7},
|
||||
{"ISO-8859-8", "8859-8", '8', M_ISO_8859_8},
|
||||
{"ISO-8859-9", "8859-9", '9', M_ISO_8859_9},
|
||||
{"ISO-8859-10", "8859-10", '0', M_ISO_8859_10},
|
||||
{"MacRoman", "MacRoman",'M', M_MAC_ROMAN},
|
||||
{"JIS", "JIS", 'J', M_ISO_2022_JP},
|
||||
{"Shift-JIS", "SJIS", 'S', M_SJIS},
|
||||
{"EUC-jp", "EUCJ", 'E', M_EUC_JP},
|
||||
{"EUC-kr", "EUCK", 'K', M_EUC_KR},
|
||||
|
||||
/* Not Implement.
|
||||
{"EUC-tw", "EUCT", "T", M_EUC_TW},
|
||||
{"Big5", "Big5", 'B', M_BIG5},
|
||||
{"ISO-2022-cn", "ISOC", 'C', M_ISO_2022_CN},
|
||||
{"ISO-2022-kr", "ISOK", 'R', M_ISO_2022_KR},
|
||||
*/
|
||||
|
||||
{NULL, NULL, 0, 0},
|
||||
};
|
||||
|
||||
|
||||
static int sCurrentEncoding = M_UTF8;
|
||||
|
||||
|
||||
status_t
|
||||
get_nth_encoding(int i, int *id)
|
||||
{
|
||||
if (id == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
if (i < 0 || i >= sizeof(kEncodingTable) / sizeof(etable))
|
||||
return B_BAD_INDEX;
|
||||
|
||||
*id = kEncodingTable[i].id;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
longname2id(const char *longname)
|
||||
{
|
||||
int id = M_UTF8;
|
||||
const etable *s = kEncodingTable;
|
||||
|
||||
for (int i = 0; s->name; s++, i++) {
|
||||
if (!strcmp(s->name, longname)) {
|
||||
id = s->id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
longname2shortname(const char *longname)
|
||||
{
|
||||
const char *shortName = NULL;
|
||||
|
||||
const etable *p = kEncodingTable;
|
||||
while (p->name) {
|
||||
if (!strcmp(p->name, longname)) {
|
||||
shortName = p->shortname;
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
|
||||
return shortName;
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
id2longname(int id)
|
||||
{
|
||||
return kEncodingTable[id].name;
|
||||
}
|
||||
|
||||
|
||||
const char
|
||||
id2shortcut(int id)
|
||||
{
|
||||
return kEncodingTable[id].shortcut;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SetEncoding(int encoding)
|
||||
{
|
||||
sCurrentEncoding = encoding;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
GetEncoding()
|
||||
{
|
||||
return sCurrentEncoding;
|
||||
}
|
||||
|
@ -82,45 +82,16 @@ const uint32 coding_translation_table[] = {
|
||||
B_EUC_KR_CONVERSION /* EUC Korean */
|
||||
};
|
||||
|
||||
struct etable
|
||||
{
|
||||
const char *name; // long name for menu item.
|
||||
const char *shortname; // short name (use for command-line etc.)
|
||||
const char shortcut; // short cut key code
|
||||
const uint32 op; // encodeing opcode
|
||||
};
|
||||
|
||||
/*
|
||||
* encoding_table ... use encoding menu, message, and preference keys.
|
||||
*/
|
||||
const etable encoding_table[]=
|
||||
{
|
||||
{"UTF-8", "UTF8", 'U', M_UTF8},
|
||||
{"ISO-8859-1", "8859-1", '1', M_ISO_8859_1},
|
||||
{"ISO-8859-2", "8859-2", '2', M_ISO_8859_2},
|
||||
{"ISO-8859-3", "8859-3", '3', M_ISO_8859_3},
|
||||
{"ISO-8859-4", "8859-4", '4', M_ISO_8859_4},
|
||||
{"ISO-8859-5", "8859-5", '5', M_ISO_8859_5},
|
||||
{"ISO-8859-6", "8859-6", '6', M_ISO_8859_6},
|
||||
{"ISO-8859-7", "8859-7", '7', M_ISO_8859_7},
|
||||
{"ISO-8859-8", "8859-8", '8', M_ISO_8859_8},
|
||||
{"ISO-8859-9", "8859-9", '9', M_ISO_8859_9},
|
||||
{"ISO-8859-10", "8859-10", '0', M_ISO_8859_10},
|
||||
{"MacRoman", "MacRoman",'M', M_MAC_ROMAN},
|
||||
{"JIS", "JIS", 'J', M_ISO_2022_JP},
|
||||
{"Shift-JIS", "SJIS", 'S', M_SJIS},
|
||||
{"EUC-jp", "EUCJ", 'E', M_EUC_JP},
|
||||
{"EUC-kr", "EUCK", 'K', M_EUC_KR},
|
||||
status_t get_nth_encoding(int i, int *op);
|
||||
|
||||
/* Not Implement.
|
||||
{"EUC-tw", "EUCT", "T", M_EUC_TW},
|
||||
{"Big5", "Big5", 'B', M_BIG5},
|
||||
{"ISO-2022-cn", "ISOC", 'C', M_ISO_2022_CN},
|
||||
{"ISO-2022-kr", "ISOK", 'R', M_ISO_2022_KR},
|
||||
*/
|
||||
int longname2id(const char *longname);
|
||||
const char * longname2shortname(const char *longname);
|
||||
const char * id2longname(int op);
|
||||
const char id2shortcut(int op);
|
||||
|
||||
{NULL, NULL, 0, 0},
|
||||
};
|
||||
void SetEncoding(int encoding);
|
||||
int GetEncoding();
|
||||
|
||||
|
||||
#endif /* _CODING_H_ */
|
||||
|
@ -7,6 +7,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) src kits tracker ] ;
|
||||
Application Terminal :
|
||||
AppearPrefView.cpp
|
||||
CodeConv.cpp
|
||||
Coding.cpp
|
||||
CurPos.cpp
|
||||
FindWindow.cpp
|
||||
MenuUtil.cpp
|
||||
|
@ -40,44 +40,24 @@ MakeMenu(ulong msg, const char **items, const char *defaultItemName)
|
||||
return menu;
|
||||
}
|
||||
|
||||
int
|
||||
longname2op(const char *longname)
|
||||
{
|
||||
int op = M_UTF8;
|
||||
const etable *s = encoding_table;
|
||||
|
||||
for (int i = 0; s->name; s++, i++) {
|
||||
if (!strcmp(s->name, longname)) {
|
||||
op = s->op;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
const char *
|
||||
op2longname(int op)
|
||||
{
|
||||
return encoding_table[op].name;
|
||||
}
|
||||
|
||||
void
|
||||
MakeEncodingMenu(BMenu *eMenu, int coding, bool flag)
|
||||
MakeEncodingMenu(BMenu *eMenu, int marked, bool flag)
|
||||
{
|
||||
const etable *e = encoding_table;
|
||||
int encoding;
|
||||
int i = 0;
|
||||
while (e->name) {
|
||||
while (get_nth_encoding(i, &encoding) == B_OK) {
|
||||
BMessage *msg = new BMessage(MENU_ENCODING);
|
||||
msg->AddInt32("op", (int32)e->op);
|
||||
msg->AddInt32("op", (int32)encoding);
|
||||
if (flag)
|
||||
eMenu->AddItem(new BMenuItem(e->name, msg, e->shortcut));
|
||||
eMenu->AddItem(new BMenuItem(id2longname(encoding), msg, id2shortcut(encoding)));
|
||||
else
|
||||
eMenu->AddItem(new BMenuItem(e->name, msg));
|
||||
eMenu->AddItem(new BMenuItem(id2longname(encoding), msg));
|
||||
|
||||
if (i == coding)
|
||||
if (i == marked)
|
||||
eMenu->ItemAt(i)->SetMarked(true);
|
||||
|
||||
e++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,6 @@
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
class BPopUpMenu;
|
||||
class BMenu;
|
||||
@ -22,13 +19,10 @@ class PrefHandler;
|
||||
|
||||
BPopUpMenu * MakeMenu(ulong msg, const char **items,
|
||||
const char *defaultItemName);
|
||||
int longname2op(const char *longname);
|
||||
const char * op2longname(int op);
|
||||
|
||||
void MakeEncodingMenu(BMenu *eMenu, int coding, bool flag);
|
||||
void LoadLocaleFile (PrefHandler *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -373,7 +373,7 @@ PrefHandler::_LoadFromFile(const char* path)
|
||||
setRGB(PREF_CURSOR_FORE_COLOR, prefs.curfg);
|
||||
setRGB(PREF_SELECT_BACK_COLOR, prefs.selbg);
|
||||
setRGB(PREF_SELECT_FORE_COLOR, prefs.selfg);
|
||||
setString(PREF_TEXT_ENCODING, encoding_table[prefs.encoding].name);
|
||||
setString(PREF_TEXT_ENCODING, id2longname(prefs.encoding));
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -58,23 +58,27 @@
|
||||
PrefView::PrefView (BRect frame, const char *name)
|
||||
:BView (frame, name, B_FOLLOW_ALL_SIDES, B_WILL_DRAW)
|
||||
{
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
fLabel.SetTo(name);
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
fLabel.SetTo(name);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ~PrefView ()
|
||||
// Destructor.
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
PrefView::~PrefView()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
PrefView::ViewLabel (void) const
|
||||
{
|
||||
return fLabel.String();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// CanApply()
|
||||
// Determines whether view can respont Apply command or not.
|
||||
@ -82,17 +86,17 @@ PrefView::ViewLabel (void) const
|
||||
bool
|
||||
PrefView::CanApply ()
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PrefView::MessageReceived(BMessage* msg)
|
||||
{
|
||||
BControl *control;
|
||||
|
||||
switch (msg->what) {
|
||||
switch (msg->what) {
|
||||
case MSG_TEXT_MODIFIED: {
|
||||
TTextControl* textControl;
|
||||
BControl *control;
|
||||
if (msg->FindPointer("source", (void**)&control) >= B_OK
|
||||
&& (textControl = dynamic_cast<TTextControl*>(control))) {
|
||||
textControl->ModifiedText(true);
|
||||
@ -106,8 +110,6 @@ PrefView::MessageReceived(BMessage* msg)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// SetupBColorControl
|
||||
// Make BColorControl.
|
||||
@ -115,10 +117,8 @@ PrefView::MessageReceived(BMessage* msg)
|
||||
BColorControl *
|
||||
PrefView::SetupBColorControl(BPoint p, color_control_layout layout, float cell_size, ulong msg)
|
||||
{
|
||||
BColorControl *col;
|
||||
|
||||
col = new BColorControl( p, layout, cell_size, "", new BMessage(msg));
|
||||
AddChild(col);
|
||||
return col;
|
||||
BColorControl *col = new BColorControl( p, layout, cell_size, "", new BMessage(msg));
|
||||
AddChild(col);
|
||||
return col;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
// Globals
|
||||
PrefHandler *gTermPref;
|
||||
extern char gWindowName[];
|
||||
|
||||
bool gUsageRequested = false;
|
||||
bool gGeometryRequested = false;
|
||||
@ -336,18 +335,6 @@ TermApp::RefsReceived(BMessage* message)
|
||||
status_t
|
||||
TermApp::_MakeTermWindow(BRect &frame)
|
||||
{
|
||||
const char *encoding = gTermPref->getString(PREF_TEXT_ENCODING);
|
||||
|
||||
// Get encoding name (setenv TTYPE in spawn_shell functions)
|
||||
const etable *p = encoding_table;
|
||||
while (p->name) {
|
||||
if (!strcmp(p->name, encoding)) {
|
||||
encoding = p->shortname;
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
|
||||
const char *command = NULL;
|
||||
if (CommandLine.Length() > 0)
|
||||
command = CommandLine.String();
|
||||
@ -362,6 +349,8 @@ TermApp::_MakeTermWindow(BRect &frame)
|
||||
if (cols < MIN_COLS)
|
||||
gTermPref->setInt32(PREF_COLS, cols = MIN_COLS);
|
||||
|
||||
// Get encoding name (setenv TTYPE in spawn_shell functions)
|
||||
const char *encoding = longname2shortname(gTermPref->getString(PREF_TEXT_ENCODING));
|
||||
int pfd = spawn_shell(rows, cols, command, encoding);
|
||||
if (pfd < 0)
|
||||
return pfd;
|
||||
|
@ -36,9 +36,6 @@
|
||||
#include <String.h>
|
||||
|
||||
|
||||
extern int gPfd;
|
||||
extern char *ptyname;
|
||||
|
||||
class TermWindow;
|
||||
class TermParse;
|
||||
class BRect;
|
||||
|
@ -42,8 +42,6 @@ extern int eigtable[]; /* ESC ignore table */
|
||||
extern int mbcstable[]; /* ESC $ */
|
||||
|
||||
|
||||
// MuTerminal coding system (global varriable)
|
||||
int gNowCoding = M_UTF8;
|
||||
|
||||
#define DEFAULT -1
|
||||
#define NPARAM 10 // Max parameters
|
||||
@ -271,11 +269,11 @@ TermParse::EscParse()
|
||||
if (GetReaderBuf(c) < B_OK)
|
||||
break;
|
||||
|
||||
if (now_coding != gNowCoding) {
|
||||
if (now_coding != GetEncoding()) {
|
||||
/*
|
||||
* Change coding, change parse table.
|
||||
*/
|
||||
switch (gNowCoding) {
|
||||
switch (GetEncoding()) {
|
||||
case M_UTF8:
|
||||
groundtable = utf8_groundtable;
|
||||
break;
|
||||
@ -301,7 +299,7 @@ TermParse::EscParse()
|
||||
break;
|
||||
}
|
||||
parsestate = groundtable;
|
||||
now_coding = gNowCoding;
|
||||
now_coding = GetEncoding();
|
||||
}
|
||||
|
||||
switch (parsestate[c]) {
|
||||
|
@ -49,7 +49,6 @@ using std::nothrow;
|
||||
extern int function_keycode_table[];
|
||||
extern char *function_key_char_table[];
|
||||
|
||||
extern int gNowCoding; // defined in TermParse.cpp
|
||||
extern PrefHandler *gTermPref; // Global Preference Handler
|
||||
|
||||
const static rgb_color kTermColorTable[16] = {
|
||||
@ -1339,9 +1338,9 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
||||
} else {
|
||||
// input multibyte character
|
||||
|
||||
if (gNowCoding != M_UTF8) {
|
||||
if (GetEncoding() != M_UTF8) {
|
||||
int cnum = fCodeConv->ConvertFromInternal(bytes, numBytes,
|
||||
(char *)dstbuf, gNowCoding);
|
||||
(char *)dstbuf, GetEncoding());
|
||||
write(fTerminalFd, dstbuf, cnum);
|
||||
return;
|
||||
}
|
||||
@ -1586,10 +1585,10 @@ TermView::DoClearAll(void)
|
||||
void
|
||||
TermView::WritePTY(const uchar *text, int numBytes)
|
||||
{
|
||||
if (gNowCoding != M_UTF8) {
|
||||
if (GetEncoding() != M_UTF8) {
|
||||
uchar *destBuffer = (uchar *)malloc(numBytes * 3);
|
||||
numBytes = fCodeConv->ConvertFromInternal((char*)text, numBytes,
|
||||
(char*)destBuffer, gNowCoding);
|
||||
(char*)destBuffer, GetEncoding());
|
||||
write(fTerminalFd, destBuffer, numBytes);
|
||||
free(destBuffer);
|
||||
} else {
|
||||
|
@ -53,10 +53,6 @@ extern PrefHandler *gTermPref;
|
||||
//#define GPL_FILE "/gpl.html"
|
||||
//#define CHLP_FILE "file:///boot/beos/documentation/Shell%20Tools/index.html"
|
||||
|
||||
extern int gNowCoding; /* defined TermParce.cpp */
|
||||
|
||||
void SetCoding(int);
|
||||
|
||||
|
||||
TermWindow::TermWindow(BRect frame, const char* title, int fd)
|
||||
: BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE|B_QUIT_ON_WINDOW_CLOSE),
|
||||
@ -180,7 +176,7 @@ TermWindow::InitWindow(void)
|
||||
fEditmenu->SetTargetForItems(fTermView);
|
||||
|
||||
// Initialize TermParse
|
||||
gNowCoding = longname2op(gTermPref->getString(PREF_TEXT_ENCODING));
|
||||
SetEncoding(longname2id(gTermPref->getString(PREF_TEXT_ENCODING)));
|
||||
fTermParse = new TermParse(fPfd, this, fTermView, fCodeConv);
|
||||
if (fTermParse->StartThreads() < B_OK)
|
||||
return;
|
||||
@ -203,7 +199,7 @@ void
|
||||
TermWindow::MenusBeginning(void)
|
||||
{
|
||||
// Syncronize Encode Menu Pop-up menu and Preference.
|
||||
(fEncodingmenu->FindItem(op2longname(gNowCoding)))->SetMarked(true);
|
||||
(fEncodingmenu->FindItem(id2longname(GetEncoding())))->SetMarked(true);
|
||||
BWindow::MenusBeginning();
|
||||
}
|
||||
|
||||
@ -277,7 +273,7 @@ TermWindow::SetupMenu(void)
|
||||
|
||||
fEncodingmenu = new BMenu("Font Encoding");
|
||||
fEncodingmenu->SetRadioMode(true);
|
||||
MakeEncodingMenu(fEncodingmenu, gNowCoding, true);
|
||||
MakeEncodingMenu(fEncodingmenu, GetEncoding(), true);
|
||||
fHelpmenu->AddItem(fWindowSizeMenu);
|
||||
fHelpmenu->AddItem(fEncodingmenu);
|
||||
// fHelpmenu->AddItem(fNewFontMenu);
|
||||
@ -398,8 +394,7 @@ TermWindow::MessageReceived(BMessage *message)
|
||||
|
||||
case MENU_ENCODING: {
|
||||
message->FindInt32 ("op", &coding_id);
|
||||
gNowCoding = coding_id;
|
||||
SetCoding(coding_id);
|
||||
SetEncoding(coding_id);
|
||||
break;
|
||||
}
|
||||
// Extended B_SET_PROPERTY. Dispatch this message,
|
||||
@ -410,8 +405,7 @@ TermWindow::MessageReceived(BMessage *message)
|
||||
message->GetCurrentSpecifier(&i, &spe);
|
||||
if (!strcmp("encode", spe.FindString("property", i))){
|
||||
message->FindInt32 ("data", &coding_id);
|
||||
gNowCoding = coding_id;
|
||||
SetCoding (coding_id);
|
||||
SetEncoding (coding_id);
|
||||
|
||||
message->SendReply(B_REPLY);
|
||||
} else {
|
||||
@ -427,7 +421,7 @@ TermWindow::MessageReceived(BMessage *message)
|
||||
message->GetCurrentSpecifier(&i, &spe);
|
||||
if (!strcmp("encode", spe.FindString("property", i))){
|
||||
BMessage reply(B_REPLY);
|
||||
reply.AddInt32("result", gNowCoding);
|
||||
reply.AddInt32("result", GetEncoding());
|
||||
message->SendReply(&reply);
|
||||
}
|
||||
else if (!strcmp("tty", spe.FindString("property", i))) {
|
||||
@ -664,20 +658,6 @@ TermWindow::ResolveSpecifier(BMessage *msg, int32 index,
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// SetCoding
|
||||
// Set coding utility functions.
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void
|
||||
SetCoding(int coding)
|
||||
{
|
||||
const etable *p = encoding_table;
|
||||
p += coding;
|
||||
|
||||
gNowCoding = coding;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
TermWindow::DoPageSetup()
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ class FindWindow;
|
||||
|
||||
class TermWindow : public BWindow {
|
||||
public:
|
||||
TermWindow(BRect frame, const char* title, int gPfd);
|
||||
TermWindow(BRect frame, const char* title, int fd);
|
||||
virtual ~TermWindow();
|
||||
|
||||
void TermWinActivate();
|
||||
|
@ -28,7 +28,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "TermApp.h"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user