Terminal patch by Cian Duffy <myob87 AT gmail.com>: licence update, default window sizes.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9505 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2004-10-25 16:51:48 +00:00
parent ec3d3e05fe
commit b019492c62
11 changed files with 147 additions and 52 deletions
+2 -2
View File
@@ -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);
+1
View File
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 2004 Daniel Furrer <[email protected]>
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
*
* Permission is hereby granted, free of charge, to any person obtaining
-2
View File
@@ -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
+2 -2
View File
@@ -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.
+1
View File
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 2004 Daniel Furrer <[email protected]>
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
*
* Permission is hereby granted, free of charge, to any person obtaining
+1
View File
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 2004 Daniel Furrer <[email protected]>
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
*
* Permission is hereby granted, free of charge, to any person obtaining
+29 -17
View File
@@ -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 <[email protected]>
* 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
+29 -17
View File
@@ -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 <[email protected]>
* 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
+9
View File
@@ -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
////////////////////////////////////////////////////////////////////////////
+69 -8
View File
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 2004 Daniel Furrer <[email protected]>
* 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 ();
+4 -4
View File
@@ -34,6 +34,8 @@
#include <Window.h>
#include <MessageRunner.h>
#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