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:
@@ -48,7 +48,7 @@ aboutWindow::aboutWindow(const char *)
|
|||||||
Show();
|
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);
|
AddChild(text1);
|
||||||
|
|
||||||
text2 = new BStringView(BRect(15,30,390,50), "text", "Based on MuTerminal 2.3", B_FOLLOW_NONE, B_WILL_DRAW);
|
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);
|
text3 = new BStringView(BRect(15,50,390,70), "text", "By Kazuho Okui and Takashi Murai", B_FOLLOW_NONE, B_WILL_DRAW);
|
||||||
AddChild(text3);
|
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);
|
AddChild(text4);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
|
* 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.
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
|||||||
@@ -7,12 +7,10 @@ App Terminal2 : AboutWindow.cpp
|
|||||||
CodeConv.cpp
|
CodeConv.cpp
|
||||||
CurPos.cpp
|
CurPos.cpp
|
||||||
MenuUtil.cpp
|
MenuUtil.cpp
|
||||||
# MousePrefView.cpp
|
|
||||||
Terminal.cpp
|
Terminal.cpp
|
||||||
PrefDlg.cpp
|
PrefDlg.cpp
|
||||||
PrefHandler.cpp
|
PrefHandler.cpp
|
||||||
PrefView.cpp
|
PrefView.cpp
|
||||||
ShellPrefView.cpp
|
|
||||||
spawn.cpp
|
spawn.cpp
|
||||||
TermApp.cpp
|
TermApp.cpp
|
||||||
TermBaseView.cpp
|
TermBaseView.cpp
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
#include "MenuUtil.h"
|
#include "MenuUtil.h"
|
||||||
|
|
||||||
#include "AppearPrefView.h"
|
#include "AppearPrefView.h"
|
||||||
#include "ShellPrefView.h"
|
//#include "ShellPrefView.h"
|
||||||
#include "PrefView.h"
|
#include "PrefView.h"
|
||||||
#include "spawn.h"
|
#include "spawn.h"
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ PrefDlg::SetupContent()
|
|||||||
r.bottom -= fTabView->TabHeight();
|
r.bottom -= fTabView->TabHeight();
|
||||||
|
|
||||||
fTabView->AddTab(new AppearancePrefView (r, "Appearance", fTermWindow));
|
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.
|
// OK, Apply and Cancel button.
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
|
* 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.
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
|
* 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.
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
|||||||
@@ -1,20 +1,32 @@
|
|||||||
/* Hey Emacs, this file is -*- c++ -*-
|
/*
|
||||||
|
* Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
|
||||||
Multilingual Terminal Emulator "MuTerminal".
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
|
*
|
||||||
Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. ALL RIGHT RESERVED
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files or portions
|
||||||
This file is part of MuTerminal.
|
* thereof (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge,
|
||||||
MuTerminal is free software; you can redistribute it and/or modify
|
* publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
it under the terms of the GNU General Public License as published by
|
* and to permit persons to whom the Software is furnished to do so, subject
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
* to the following conditions:
|
||||||
any later version.
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright notice,
|
||||||
PrefView.h,v 2.8 1999/10/02 15:17:30 kaz Exp
|
* this list of conditions and the following disclaimer.
|
||||||
PrefView.h,v: Interface for Preference Tab Container View.
|
*
|
||||||
|
* * 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
|
#ifndef PREFVIEW_H_INCLUDED
|
||||||
#define PREFVIEW_H_INCLUDED
|
#define PREFVIEW_H_INCLUDED
|
||||||
|
|||||||
@@ -1,20 +1,32 @@
|
|||||||
/* Hey Emacs, this file is -*- c++ -*-
|
/*
|
||||||
|
* Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
|
||||||
Multilingual Terminal Emulator "MuTerminal".
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
|
*
|
||||||
Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. ALL RIGHT RESERVED
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files or portions
|
||||||
This file is part of MuTerminal.
|
* thereof (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge,
|
||||||
MuTerminal is free software; you can redistribute it and/or modify
|
* publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
it under the terms of the GNU General Public License as published by
|
* and to permit persons to whom the Software is furnished to do so, subject
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
* to the following conditions:
|
||||||
any later version.
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright notice,
|
||||||
TermBaseView.h,v 2.3 1999/10/13 15:00:59 kaz Exp
|
* this list of conditions and the following disclaimer.
|
||||||
TermBaseView.h,v: Interface for BView sub class.
|
*
|
||||||
|
* * 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
|
#ifndef TERMBASEVIEW_H_INCLUDED
|
||||||
#define TERMBASEVIEW_H_INCLUDED
|
#define TERMBASEVIEW_H_INCLUDED
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ const ulong PSET_FORE_COLOR = 'pfcl';
|
|||||||
const ulong PSET_BACK_COLOR = 'pbcl';
|
const ulong PSET_BACK_COLOR = 'pbcl';
|
||||||
const ulong PSET__CODING = 'pcod';
|
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
|
// Preference Read/Write Keys
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
|
* Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
|
||||||
|
* Copyright (c) 2004 Daniel Furrer <assimil8or@users.sourceforge.net>
|
||||||
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
@@ -67,10 +68,10 @@ extern PrefHandler *gTermPref;
|
|||||||
//
|
//
|
||||||
// help and GPL URL
|
// help and GPL URL
|
||||||
//
|
//
|
||||||
#define URL_PREFIX "file:///boot/home/config/settings/MuTerminal/help/"
|
//#define URL_PREFIX "file:///boot/home/config/settings/MuTerminal/help/"
|
||||||
#define INDEX_FILE "/index.html"
|
//#define INDEX_FILE "/index.html"
|
||||||
#define GPL_FILE "/gpl.html"
|
//#define GPL_FILE "/gpl.html"
|
||||||
#define CHLP_FILE "file:///boot/beos/documentation/Shell%20Tools/index.html"
|
//#define CHLP_FILE "file:///boot/beos/documentation/Shell%20Tools/index.html"
|
||||||
|
|
||||||
extern int gNowCoding; /* defined TermParce.cpp */
|
extern int gNowCoding; /* defined TermParce.cpp */
|
||||||
char gWindowName[256] = "Terminal";
|
char gWindowName[256] = "Terminal";
|
||||||
@@ -88,8 +89,7 @@ void SetCoding (int);
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
TermWindow::TermWindow( BRect frame)
|
TermWindow::TermWindow( BRect frame)
|
||||||
: BWindow (frame, NULL, B_DOCUMENT_WINDOW,
|
: BWindow (frame, NULL, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE)
|
||||||
B_NOT_ZOOMABLE, B_CURRENT_WORKSPACE)
|
|
||||||
{
|
{
|
||||||
InitWindow();
|
InitWindow();
|
||||||
SetWindowTitle();
|
SetWindowTitle();
|
||||||
@@ -285,10 +285,30 @@ TermWindow::SetupMenu(void)
|
|||||||
* Make Help Menu.
|
* Make Help Menu.
|
||||||
*/
|
*/
|
||||||
fHelpmenu = new BMenu("Settings");
|
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);
|
fEncodingmenu->SetRadioMode(true);
|
||||||
MakeEncodingMenu(fEncodingmenu, gNowCoding, 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)));
|
fHelpmenu->AddItem(new BMenuItem("About Terminal", new BMessage(MENU_SHOW_ABOUT)));
|
||||||
fMenubar->AddItem(fHelpmenu);
|
fMenubar->AddItem(fHelpmenu);
|
||||||
|
|
||||||
@@ -437,6 +457,47 @@ TermWindow::MessageReceived(BMessage *message)
|
|||||||
fTermView->Invalidate();
|
fTermView->Invalidate();
|
||||||
break;
|
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:
|
case MSG_COLOR_CHANGED:
|
||||||
fBaseView->SetViewColor (gTermPref->getRGB (PREF_TEXT_BACK_COLOR));
|
fBaseView->SetViewColor (gTermPref->getRGB (PREF_TEXT_BACK_COLOR));
|
||||||
fTermView->SetTermColor ();
|
fTermView->SetTermColor ();
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <MessageRunner.h>
|
#include <MessageRunner.h>
|
||||||
|
|
||||||
|
#include "PrefHandler.h"
|
||||||
|
|
||||||
class BFont;
|
class BFont;
|
||||||
class TermView;
|
class TermView;
|
||||||
class TermParse;
|
class TermParse;
|
||||||
@@ -77,17 +79,15 @@ private:
|
|||||||
*/
|
*/
|
||||||
TermParse *fTermParse;
|
TermParse *fTermParse;
|
||||||
BMenuBar *fMenubar;
|
BMenuBar *fMenubar;
|
||||||
BMenu *fFilemenu, *fEditmenu, *fEncodingmenu, *fHelpmenu, *fFontMenu;
|
BMenu *fFilemenu, *fEditmenu, *fEncodingmenu, *fHelpmenu, *fFontMenu, *fWindowSizeMenu, *fNewFontMenu;
|
||||||
TermView *fTermView;
|
TermView *fTermView;
|
||||||
BView *fBaseView;
|
BView *fBaseView;
|
||||||
CodeConv *fCodeConv;
|
CodeConv *fCodeConv;
|
||||||
BMessage *fPrintSettings;
|
BMessage *fPrintSettings;
|
||||||
PrefDlg *fPrefWindow;
|
PrefDlg *fPrefWindow;
|
||||||
PrefDlg2 *fPrefWindow2;
|
|
||||||
FindDlg *fFindPanel;
|
FindDlg *fFindPanel;
|
||||||
|
|
||||||
BMessageRunner *fWindowUpdate;
|
BMessageRunner *fWindowUpdate;
|
||||||
|
BMenuItem *item;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TERMWIN_H
|
#endif // TERMWIN_H
|
||||||
|
|||||||
Reference in New Issue
Block a user