diff --git a/src/apps/terminal/MYOB/AboutWindow.cpp b/src/apps/terminal/MYOB/AboutWindow.cpp index ca91b55063..261276ae37 100644 --- a/src/apps/terminal/MYOB/AboutWindow.cpp +++ b/src/apps/terminal/MYOB/AboutWindow.cpp @@ -48,7 +48,7 @@ aboutWindow::aboutWindow(const char *) Show(); -text1 = new BStringView(BRect(15,10,390,30), "text", "OpenBeOS Terminal", B_FOLLOW_NONE, B_WILL_DRAW); +text1 = new BStringView(BRect(15,10,390,30), "text", "Haiku Terminal", B_FOLLOW_NONE, B_WILL_DRAW); AddChild(text1); text2 = new BStringView(BRect(15,30,390,50), "text", "Based on MuTerminal 2.3", B_FOLLOW_NONE, B_WILL_DRAW); @@ -57,7 +57,7 @@ AddChild(text2); text3 = new BStringView(BRect(15,50,390,70), "text", "By Kazuho Okui and Takashi Murai", B_FOLLOW_NONE, B_WILL_DRAW); AddChild(text3); -text4 = new BStringView(BRect(15,70,390,90), "text", "OpenBeOS Modifications by Cian Duffy", B_FOLLOW_NONE, B_WILL_DRAW); +text4 = new BStringView(BRect(15,70,390,90), "text", "Haiku Modifications by Kian Duffy, Daniel Furrer", B_FOLLOW_NONE, B_WILL_DRAW); AddChild(text4); diff --git a/src/apps/terminal/MYOB/Coding.h b/src/apps/terminal/MYOB/Coding.h index 1f3c9ec1c0..b03a7e1c93 100644 --- a/src/apps/terminal/MYOB/Coding.h +++ b/src/apps/terminal/MYOB/Coding.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2003-4 Kian Duffy + * Copyright (c) 2004 Daniel Furrer * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * * Permission is hereby granted, free of charge, to any person obtaining diff --git a/src/apps/terminal/MYOB/Jamfile b/src/apps/terminal/MYOB/Jamfile index 4a0d178621..8e44048a42 100644 --- a/src/apps/terminal/MYOB/Jamfile +++ b/src/apps/terminal/MYOB/Jamfile @@ -7,12 +7,10 @@ App Terminal2 : AboutWindow.cpp CodeConv.cpp CurPos.cpp MenuUtil.cpp -# MousePrefView.cpp Terminal.cpp PrefDlg.cpp PrefHandler.cpp PrefView.cpp - ShellPrefView.cpp spawn.cpp TermApp.cpp TermBaseView.cpp diff --git a/src/apps/terminal/MYOB/PrefDlg.cpp b/src/apps/terminal/MYOB/PrefDlg.cpp index c2266112b1..ba11cd275b 100644 --- a/src/apps/terminal/MYOB/PrefDlg.cpp +++ b/src/apps/terminal/MYOB/PrefDlg.cpp @@ -44,7 +44,7 @@ #include "MenuUtil.h" #include "AppearPrefView.h" -#include "ShellPrefView.h" +//#include "ShellPrefView.h" #include "PrefView.h" #include "spawn.h" @@ -112,7 +112,7 @@ PrefDlg::SetupContent() r.bottom -= fTabView->TabHeight(); fTabView->AddTab(new AppearancePrefView (r, "Appearance", fTermWindow)); - fTabView->AddTab(new ShellPrefView (r, "Shell", fTermWindow)); + // fTabView->AddTab(new ShellPrefView (r, "Shell", fTermWindow)); // // OK, Apply and Cancel button. diff --git a/src/apps/terminal/MYOB/PrefHandler.cpp b/src/apps/terminal/MYOB/PrefHandler.cpp index 6c4852f4c5..5367ebab9d 100644 --- a/src/apps/terminal/MYOB/PrefHandler.cpp +++ b/src/apps/terminal/MYOB/PrefHandler.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2003-4 Kian Duffy + * Copyright (c) 2004 Daniel Furrer * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * * Permission is hereby granted, free of charge, to any person obtaining diff --git a/src/apps/terminal/MYOB/PrefHandler.h b/src/apps/terminal/MYOB/PrefHandler.h index 89f69724d5..5261597aca 100644 --- a/src/apps/terminal/MYOB/PrefHandler.h +++ b/src/apps/terminal/MYOB/PrefHandler.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2003-4 Kian Duffy + * Copyright (c) 2004 Daniel Furrer * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * * Permission is hereby granted, free of charge, to any person obtaining diff --git a/src/apps/terminal/MYOB/PrefView.h b/src/apps/terminal/MYOB/PrefView.h index 64621d165b..82a4c7a705 100644 --- a/src/apps/terminal/MYOB/PrefView.h +++ b/src/apps/terminal/MYOB/PrefView.h @@ -1,20 +1,32 @@ -/* Hey Emacs, this file is -*- c++ -*- - - Multilingual Terminal Emulator "MuTerminal". - - Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. ALL RIGHT RESERVED - - This file is part of MuTerminal. - - MuTerminal is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - PrefView.h,v 2.8 1999/10/02 15:17:30 kaz Exp - PrefView.h,v: Interface for Preference Tab Container View. - -***************************************************************************/ +/* + * Copyright (c) 2003-4 Kian Duffy + * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files or portions + * thereof (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice + * in the binary, as well as this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with + * the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ #ifndef PREFVIEW_H_INCLUDED #define PREFVIEW_H_INCLUDED diff --git a/src/apps/terminal/MYOB/TermBaseView.h b/src/apps/terminal/MYOB/TermBaseView.h index 180d98c5aa..840991da46 100644 --- a/src/apps/terminal/MYOB/TermBaseView.h +++ b/src/apps/terminal/MYOB/TermBaseView.h @@ -1,20 +1,32 @@ -/* Hey Emacs, this file is -*- c++ -*- - - Multilingual Terminal Emulator "MuTerminal". - - Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. ALL RIGHT RESERVED - - This file is part of MuTerminal. - - MuTerminal is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - TermBaseView.h,v 2.3 1999/10/13 15:00:59 kaz Exp - TermBaseView.h,v: Interface for BView sub class. - -***************************************************************************/ +/* + * Copyright (c) 2003-4 Kian Duffy + * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files or portions + * thereof (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject + * to the following conditions: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice + * in the binary, as well as this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with + * the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ #ifndef TERMBASEVIEW_H_INCLUDED #define TERMBASEVIEW_H_INCLUDED diff --git a/src/apps/terminal/MYOB/TermConst.h b/src/apps/terminal/MYOB/TermConst.h index a749d4b116..4c2f73cbdc 100644 --- a/src/apps/terminal/MYOB/TermConst.h +++ b/src/apps/terminal/MYOB/TermConst.h @@ -80,6 +80,15 @@ const ulong PSET_FORE_COLOR = 'pfcl'; const ulong PSET_BACK_COLOR = 'pbcl'; const ulong PSET__CODING = 'pcod'; +// Terminal Size Messages +const uint32 EIGHTYTWENTYFOUR = 'etfo'; +const uint32 EIGHTYTWENTYFIVE = 'etfv'; +const uint32 EIGHTYFORTY = 'efor'; +const uint32 ONETHREETWOTWENTYFOUR = 'hunf'; +const uint32 ONETHREETWOTWENTYFIVE = 'hunv'; + +const uint32 MSG_FONT_CHANGED = 'fntc'; + //////////////////////////////////////////////////////////////////////////// // Preference Read/Write Keys //////////////////////////////////////////////////////////////////////////// diff --git a/src/apps/terminal/MYOB/TermWindow.cpp b/src/apps/terminal/MYOB/TermWindow.cpp index 2ade7b59a6..68142407f6 100644 --- a/src/apps/terminal/MYOB/TermWindow.cpp +++ b/src/apps/terminal/MYOB/TermWindow.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2003-4 Kian Duffy + * Copyright (c) 2004 Daniel Furrer * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * * Permission is hereby granted, free of charge, to any person obtaining @@ -67,10 +68,10 @@ extern PrefHandler *gTermPref; // // help and GPL URL // -#define URL_PREFIX "file:///boot/home/config/settings/MuTerminal/help/" -#define INDEX_FILE "/index.html" -#define GPL_FILE "/gpl.html" -#define CHLP_FILE "file:///boot/beos/documentation/Shell%20Tools/index.html" +//#define URL_PREFIX "file:///boot/home/config/settings/MuTerminal/help/" +//#define INDEX_FILE "/index.html" +//#define GPL_FILE "/gpl.html" +//#define CHLP_FILE "file:///boot/beos/documentation/Shell%20Tools/index.html" extern int gNowCoding; /* defined TermParce.cpp */ char gWindowName[256] = "Terminal"; @@ -88,8 +89,7 @@ void SetCoding (int); // //////////////////////////////////////////////////////////////////////////// TermWindow::TermWindow( BRect frame) - : BWindow (frame, NULL, B_DOCUMENT_WINDOW, - B_NOT_ZOOMABLE, B_CURRENT_WORKSPACE) + : BWindow (frame, NULL, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE) { InitWindow(); SetWindowTitle(); @@ -285,10 +285,30 @@ TermWindow::SetupMenu(void) * Make Help Menu. */ fHelpmenu = new BMenu("Settings"); - fEncodingmenu = new BMenu("Font Encoding"); + fWindowSizeMenu = new BMenu("Window Size"); + fWindowSizeMenu->AddItem(new BMenuItem("80x24", new BMessage(EIGHTYTWENTYFOUR))); + fWindowSizeMenu->AddItem(new BMenuItem("80x25", new BMessage(EIGHTYTWENTYFIVE))); + fWindowSizeMenu->AddItem(new BMenuItem("80x40", new BMessage(EIGHTYFORTY))); + fWindowSizeMenu->AddItem(new BMenuItem("132x24", new BMessage(ONETHREETWOTWENTYFOUR))); + fWindowSizeMenu->AddItem(new BMenuItem("132x25", new BMessage(ONETHREETWOTWENTYFIVE))); + fNewFontMenu = new BMenu("Font"); + fNewFontMenu->SetRadioMode(true); + int32 numFamilies1 = count_font_families(); + for ( int32 i = 0; i < numFamilies1; i++ ) { + font_family family; + uint32 flags; + if ( get_font_family(i, &family, &flags) == B_OK ) { + fNewFontMenu->AddItem(item = new BMenuItem(family, new BMessage(MSG_FONT_CHANGED))); + // if (0 ==i) item->SetMarked(true); + } + } + fNewFontMenu->FindItem (gTermPref->getString(PREF_HALF_FONT_FAMILY))->SetMarked(true); + fEncodingmenu = new BMenu("Font Encoding"); fEncodingmenu->SetRadioMode(true); MakeEncodingMenu(fEncodingmenu, gNowCoding, true); - fHelpmenu->AddItem(fEncodingmenu); + fHelpmenu->AddItem(fEncodingmenu); + fHelpmenu->AddItem(fWindowSizeMenu); + fHelpmenu->AddItem(fNewFontMenu); fHelpmenu->AddItem(new BMenuItem("About Terminal", new BMessage(MENU_SHOW_ABOUT))); fMenubar->AddItem(fHelpmenu); @@ -437,6 +457,47 @@ TermWindow::MessageReceived(BMessage *message) fTermView->Invalidate(); break; + case EIGHTYTWENTYFOUR: + gTermPref->setString(PREF_COLS, "80"); + gTermPref->setString(PREF_ROWS, "24"); + this->PostMessage (MSG_ROWS_CHANGED); + this->PostMessage (MSG_COLS_CHANGED); + break; + + case EIGHTYTWENTYFIVE: + gTermPref->setString(PREF_COLS, "80"); + gTermPref->setString(PREF_ROWS, "25"); + this->PostMessage (MSG_ROWS_CHANGED); + this->PostMessage (MSG_COLS_CHANGED); + break; + + case EIGHTYFORTY: + gTermPref->setString(PREF_COLS, "80"); + gTermPref->setString(PREF_ROWS, "40"); + this->PostMessage (MSG_ROWS_CHANGED); + this->PostMessage (MSG_COLS_CHANGED); + break; + + case ONETHREETWOTWENTYFOUR: + gTermPref->setString(PREF_COLS, "132"); + gTermPref->setString(PREF_ROWS, "24"); + this->PostMessage (MSG_ROWS_CHANGED); + this->PostMessage (MSG_COLS_CHANGED); + break; + + case ONETHREETWOTWENTYFIVE: + gTermPref->setString(PREF_COLS, "132"); + gTermPref->setString(PREF_ROWS, "25"); + this->PostMessage (MSG_ROWS_CHANGED); + this->PostMessage (MSG_COLS_CHANGED); + break; + + case MSG_FONT_CHANGED: + gTermPref->setString (PREF_HALF_FONT_FAMILY, fNewFontMenu->FindMarked()->Label()); + this->PostMessage (MSG_HALF_FONT_CHANGED); + break; + + case MSG_COLOR_CHANGED: fBaseView->SetViewColor (gTermPref->getRGB (PREF_TEXT_BACK_COLOR)); fTermView->SetTermColor (); diff --git a/src/apps/terminal/MYOB/TermWindow.h b/src/apps/terminal/MYOB/TermWindow.h index c6fee8563b..c1ed5791ee 100644 --- a/src/apps/terminal/MYOB/TermWindow.h +++ b/src/apps/terminal/MYOB/TermWindow.h @@ -34,6 +34,8 @@ #include #include +#include "PrefHandler.h" + class BFont; class TermView; class TermParse; @@ -77,17 +79,15 @@ private: */ TermParse *fTermParse; BMenuBar *fMenubar; - BMenu *fFilemenu, *fEditmenu, *fEncodingmenu, *fHelpmenu, *fFontMenu; + BMenu *fFilemenu, *fEditmenu, *fEncodingmenu, *fHelpmenu, *fFontMenu, *fWindowSizeMenu, *fNewFontMenu; TermView *fTermView; BView *fBaseView; CodeConv *fCodeConv; BMessage *fPrintSettings; PrefDlg *fPrefWindow; - PrefDlg2 *fPrefWindow2; FindDlg *fFindPanel; - BMessageRunner *fWindowUpdate; - + BMenuItem *item; }; #endif // TERMWIN_H