* Replaced the nice ProcessController about window with a boring one that looks
like any other. * Added ProcessController to the image. * Have BeUnited made any changes to the sources besides putting "copyright beunited" everywhere? If so, we could just remove them to reduce the clutter. If anyone knows, please tell. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17595 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -33,7 +33,7 @@ BEOS_BIN = addattr alert arp basename beep cat catattr chgrp chmod chop chown cl
|
|||||||
zipnote zipsplit zmore znew
|
zipnote zipsplit zmore znew
|
||||||
;
|
;
|
||||||
|
|
||||||
BEOS_APPS = Terminal Expander People ShowImage Clock Pulse
|
BEOS_APPS = Terminal Expander People ShowImage Clock Pulse ProcessController
|
||||||
Playground SoundRecorder BitmapDrawing Magnify DiskProbe AboutHaiku
|
Playground SoundRecorder BitmapDrawing Magnify DiskProbe AboutHaiku
|
||||||
StyledEdit Installer Chart Workspaces $(X86_ONLY)Cortex $(X86_ONLY)CortexAddOnHost $(X86_ONLY)GLTeapot
|
StyledEdit Installer Chart Workspaces $(X86_ONLY)Cortex $(X86_ONLY)CortexAddOnHost $(X86_ONLY)GLTeapot
|
||||||
MediaPlayer
|
MediaPlayer
|
||||||
|
|||||||
@@ -1,121 +0,0 @@
|
|||||||
/*
|
|
||||||
AboutPC.cpp
|
|
||||||
|
|
||||||
ProcessController
|
|
||||||
© 2000, Georges-Edouard Berenger, All Rights Reserved.
|
|
||||||
Copyright (C) 2004 beunited.org
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with this library; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "PCWorld.h"
|
|
||||||
#include "AboutPC.h"
|
|
||||||
#include "WindowsTools.h"
|
|
||||||
#include <Button.h>
|
|
||||||
#include <Bitmap.h>
|
|
||||||
#include <Mime.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "URLView.h"
|
|
||||||
|
|
||||||
const char* kProgramName = "ProcessController 3.1.1";
|
|
||||||
const char* SendTexte = "Send your bug reports & comments to:";
|
|
||||||
|
|
||||||
const char* kAboutProgramName = "ProcessController";
|
|
||||||
const char* kAboutEmail = "[email protected]";
|
|
||||||
//const char* kAboutEmail = "[email protected]";
|
|
||||||
//const char* kAboutWeb = "http://home.foni.net/~berenger/";
|
|
||||||
//const char* kAboutWeb = "http://stv.steinberg.de/~georges/besoft/";
|
|
||||||
const char* kAboutWeb = "http://www.beunited.org/index.php?page=developer";
|
|
||||||
|
|
||||||
AboutPC::AboutPC(BRect r):BWindow(CenterRect(r, 530, 200), B_EMPTY_STRING,
|
|
||||||
B_MODAL_WINDOW, B_NOT_RESIZABLE+B_NOT_ZOOMABLE+B_NOT_MINIMIZABLE+B_NOT_CLOSABLE)
|
|
||||||
{
|
|
||||||
BRect rect;
|
|
||||||
AboutView *topview;
|
|
||||||
|
|
||||||
// View de fond
|
|
||||||
rect = Bounds();
|
|
||||||
AddChild(topview = new AboutView(rect));
|
|
||||||
BButton *ok;
|
|
||||||
topview->AddChild(ok = new BButton(BRect(rect.right-125, rect.bottom-40, rect.right-25, rect.bottom-16), NULL, "Thanks!", new BMessage(B_QUIT_REQUESTED), B_FOLLOW_LEFT));
|
|
||||||
ok->MakeDefault(true);
|
|
||||||
visible_window(this);
|
|
||||||
Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
#define kTop 163
|
|
||||||
#define kStep 12
|
|
||||||
#define kLeft 70
|
|
||||||
|
|
||||||
AboutView::AboutView(BRect frame)
|
|
||||||
: BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW)
|
|
||||||
{
|
|
||||||
fIcon = new BBitmap(BRect(0, 0, 31, 31), B_COLOR_8_BIT);
|
|
||||||
BMimeType(kSignature).GetIcon(fIcon, B_LARGE_ICON);
|
|
||||||
float middle = Frame ().Width () / 2;
|
|
||||||
BRect rect (middle, 112, 0, 0);
|
|
||||||
char subject[256];
|
|
||||||
sprintf (subject, "About %s (%s, %s)", kProgramName, __DATE__, __TIME__);
|
|
||||||
mailtoView* mailto = new mailtoView (rect, kAboutEmail, subject);
|
|
||||||
AddChild (mailto);
|
|
||||||
rect.Set (kLeft - 2, kTop + kStep + 2, kLeft - 2, 0);
|
|
||||||
URLView* urlview = new URLView (rect, kAboutWeb);
|
|
||||||
AddChild (urlview);
|
|
||||||
}
|
|
||||||
|
|
||||||
AboutView::~AboutView()
|
|
||||||
{
|
|
||||||
if (fIcon)
|
|
||||||
delete fIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AboutView::AttachedToWindow()
|
|
||||||
{
|
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
}
|
|
||||||
|
|
||||||
void AboutView::Draw(BRect /*updateRect*/)
|
|
||||||
{
|
|
||||||
static rgb_color panel_color = ui_color(B_PANEL_BACKGROUND_COLOR);
|
|
||||||
static rgb_color dark_panel_color = tint_color(panel_color, B_DARKEN_1_TINT);
|
|
||||||
BRect r = Bounds();
|
|
||||||
SetDrawingMode(B_OP_OVER);
|
|
||||||
DrawBitmap(fIcon, BPoint(20, 156));
|
|
||||||
SetDrawingMode(B_OP_COPY);
|
|
||||||
r.bottom = 80;
|
|
||||||
SetHighColor(dark_panel_color);
|
|
||||||
FillRect(r);
|
|
||||||
SetHighColor(kBordeaux);
|
|
||||||
SetLowColor(dark_panel_color);
|
|
||||||
if (fFont.SetFamilyAndFace ("Baskerville", B_BOLD_FACE | B_ITALIC_FACE) != B_OK)
|
|
||||||
fFont.SetFamilyAndFace ("Baskerville BT", B_BOLD_FACE | B_ITALIC_FACE);
|
|
||||||
fFont.SetSize(45);
|
|
||||||
SetFont(&fFont, B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE);
|
|
||||||
DrawString(kProgramName, BPoint((r.Width()-StringWidth(kProgramName))/2, 50));
|
|
||||||
fFont.SetFamilyAndFace ("Swis721 BT", B_REGULAR_FACE);
|
|
||||||
fFont.SetSize(10);
|
|
||||||
SetFont(&fFont, B_FONT_FAMILY_AND_STYLE | B_FONT_SIZE);
|
|
||||||
SetHighColor(kBlack);
|
|
||||||
SetLowColor(panel_color);
|
|
||||||
DrawString(SendTexte, BPoint((r.Width()-StringWidth(SendTexte))/2, 106));
|
|
||||||
MovePenTo(kLeft, kTop);
|
|
||||||
DrawString("Halifax, ");
|
|
||||||
DrawString(__DATE__);
|
|
||||||
DrawString(", ");
|
|
||||||
DrawString(__TIME__);
|
|
||||||
DrawString(".");
|
|
||||||
DrawString("© www.beuntied.org, 2004. Original by Georges-Edouard Berenger.", BPoint(kLeft, kTop + kStep));
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
AboutPC.h
|
|
||||||
|
|
||||||
ProcessController
|
|
||||||
© 2000, Georges-Edouard Berenger, All Rights Reserved.
|
|
||||||
Copyright (C) 2004 beunited.org
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
|
||||||
License along with this library; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ABOUT_PC_H_
|
|
||||||
#define _ABOUT_PC_H_
|
|
||||||
|
|
||||||
class BBitmap;
|
|
||||||
|
|
||||||
#include <Window.h>
|
|
||||||
#include <View.h>
|
|
||||||
#include <Font.h>
|
|
||||||
|
|
||||||
class AboutPC : public BWindow {
|
|
||||||
|
|
||||||
public:
|
|
||||||
AboutPC(BRect r);
|
|
||||||
};
|
|
||||||
|
|
||||||
class AboutView : public BView {
|
|
||||||
|
|
||||||
public:
|
|
||||||
AboutView(BRect frame);
|
|
||||||
~AboutView();
|
|
||||||
virtual void AttachedToWindow();
|
|
||||||
virtual void Draw(BRect updateRect);
|
|
||||||
|
|
||||||
private:
|
|
||||||
BFont fFont;
|
|
||||||
BBitmap *fIcon;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define CenterRect(r, W, H) BRect(r.left+(r.Width()-W)/2, r.top+(r.Height()-H)/3, r.right-(r.Width()-W)/2, r.bottom-2*(r.Height()-H)/3)
|
|
||||||
|
|
||||||
#endif // _ABOUT_PC_H_
|
|
||||||
@@ -3,7 +3,6 @@ SubDir HAIKU_TOP src apps processcontroller ;
|
|||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
Application ProcessController :
|
Application ProcessController :
|
||||||
AboutPC.cpp
|
|
||||||
AutoIcon.cpp
|
AutoIcon.cpp
|
||||||
IconMenuItem.cpp
|
IconMenuItem.cpp
|
||||||
KernelMemoryBarMenuItem.cpp
|
KernelMemoryBarMenuItem.cpp
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
PCView.cpp
|
PCView.cpp
|
||||||
|
|
||||||
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
|
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
|
||||||
Copyright (C) 2004 beunited.org
|
Copyright (C) 2004 beunited.org
|
||||||
|
Copyright (c) 2006 Haiku, Inc. All Rights Reserved.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
@@ -22,7 +23,6 @@
|
|||||||
#include "PCView.h"
|
#include "PCView.h"
|
||||||
#include "IconMenuItem.h"
|
#include "IconMenuItem.h"
|
||||||
#include "PCWorld.h"
|
#include "PCWorld.h"
|
||||||
#include "AboutPC.h"
|
|
||||||
#include "Preferences.h"
|
#include "Preferences.h"
|
||||||
#include "PCUtils.h"
|
#include "PCUtils.h"
|
||||||
#include "Colors.h"
|
#include "Colors.h"
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
|
#include <TextView.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -52,25 +53,25 @@ const char* kActiveColorPref = "deskbar_active_color";
|
|||||||
|
|
||||||
const char* kPuseSettings = "Pulse_settings";
|
const char* kPuseSettings = "Pulse_settings";
|
||||||
|
|
||||||
const rgb_color kKernelBlue = {20, 20, 231, 255};
|
const rgb_color kKernelBlue = {20, 20, 231, 255};
|
||||||
const rgb_color kIdleGreen = {110, 190,110, 255};
|
const rgb_color kIdleGreen = {110, 190,110, 255};
|
||||||
|
|
||||||
ProcessController* gPCView;
|
ProcessController* gPCView;
|
||||||
int32 gCPUcount;
|
int32 gCPUcount;
|
||||||
rgb_color gUserColor;
|
rgb_color gUserColor;
|
||||||
rgb_color gUserColorSelected;
|
rgb_color gUserColorSelected;
|
||||||
rgb_color gIdleColor;
|
rgb_color gIdleColor;
|
||||||
rgb_color gIdleColorSelected;
|
rgb_color gIdleColorSelected;
|
||||||
rgb_color gKernelColor;
|
rgb_color gKernelColor;
|
||||||
rgb_color gKernelColorSelected;
|
rgb_color gKernelColorSelected;
|
||||||
rgb_color gFrameColor;
|
rgb_color gFrameColor;
|
||||||
rgb_color gFrameColorSelected;
|
rgb_color gFrameColorSelected;
|
||||||
rgb_color gMenuBackColorSelected;
|
rgb_color gMenuBackColorSelected;
|
||||||
rgb_color gMenuBackColor;
|
rgb_color gMenuBackColor;
|
||||||
rgb_color gWhiteSelected;
|
rgb_color gWhiteSelected;
|
||||||
ThreadBarMenu* gCurrentThreadBarMenu;
|
ThreadBarMenu* gCurrentThreadBarMenu;
|
||||||
bool gInDeskbar = false;
|
bool gInDeskbar = false;
|
||||||
int32 gMimicPulse = 0;
|
int32 gMimicPulse = 0;
|
||||||
|
|
||||||
#define DEBUG_THREADS 1
|
#define DEBUG_THREADS 1
|
||||||
|
|
||||||
@@ -319,7 +320,7 @@ ProcessController::MessageReceived(BMessage *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case B_ABOUT_REQUESTED:
|
case B_ABOUT_REQUESTED:
|
||||||
new AboutPC(BScreen().Frame());
|
AboutRequested();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -328,6 +329,27 @@ ProcessController::MessageReceived(BMessage *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ProcessController::AboutRequested()
|
||||||
|
{
|
||||||
|
BAlert *alert = new BAlert("about", "ProcessController\n"
|
||||||
|
"\tCopyright 1997-2001,\n"
|
||||||
|
"\t\tGeorges-Edouard Berenger.\n\n"
|
||||||
|
"\tCopyright 2006, Haiku, Inc.\n\n", "Ok");
|
||||||
|
BTextView *view = alert->TextView();
|
||||||
|
BFont font;
|
||||||
|
|
||||||
|
view->SetStylable(true);
|
||||||
|
|
||||||
|
view->GetFont(&font);
|
||||||
|
font.SetSize(18);
|
||||||
|
font.SetFace(B_BOLD_FACE);
|
||||||
|
view->SetFontAndColor(0, 17, &font);
|
||||||
|
|
||||||
|
alert->Go();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessController::DefaultColors()
|
ProcessController::DefaultColors()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
PCView.h
|
PCView.h
|
||||||
|
|
||||||
ProcessController
|
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
|
||||||
© 2000, Georges-Edouard Berenger, All Rights Reserved.
|
|
||||||
Copyright (C) 2004 beunited.org
|
Copyright (C) 2004 beunited.org
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
@@ -19,45 +17,48 @@
|
|||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PCVIEW_H_
|
#ifndef _PCVIEW_H_
|
||||||
#define _PCVIEW_H_
|
#define _PCVIEW_H_
|
||||||
|
|
||||||
#include <View.h>
|
|
||||||
#include "AutoIcon.h"
|
#include "AutoIcon.h"
|
||||||
|
|
||||||
class BMessageRunner;
|
#include <View.h>
|
||||||
|
|
||||||
|
|
||||||
|
class BMessageRunner;
|
||||||
class ThreadBarMenu;
|
class ThreadBarMenu;
|
||||||
|
|
||||||
|
|
||||||
class _EXPORT ProcessController : public BView {
|
class _EXPORT ProcessController : public BView {
|
||||||
|
public:
|
||||||
|
ProcessController(BRect frame, bool temp = false);
|
||||||
|
ProcessController(BMessage *data);
|
||||||
|
ProcessController();
|
||||||
|
virtual ~ProcessController();
|
||||||
|
|
||||||
public:
|
virtual void MessageReceived(BMessage *message);
|
||||||
ProcessController(BRect frame, bool temp=false);
|
virtual void AttachedToWindow();
|
||||||
ProcessController(BMessage *data);
|
virtual void MouseDown(BPoint where);
|
||||||
ProcessController();
|
virtual void Draw(BRect updateRect);
|
||||||
virtual ~ProcessController();
|
void DoDraw (bool force);
|
||||||
virtual void MessageReceived(BMessage *message);
|
static ProcessController* Instantiate(BMessage* data);
|
||||||
virtual void AttachedToWindow();
|
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
||||||
virtual void MouseDown(BPoint where);
|
|
||||||
virtual void Draw(BRect updateRect);
|
|
||||||
void DoDraw (bool force);
|
|
||||||
static ProcessController *Instantiate(BMessage *data);
|
|
||||||
virtual status_t Archive(BMessage *data, bool deep = true) const;
|
|
||||||
|
|
||||||
void Update ();
|
void AboutRequested();
|
||||||
void DefaultColors ();
|
void Update();
|
||||||
|
void DefaultColors();
|
||||||
AutoIcon fProcessControllerIcon;
|
|
||||||
AutoIcon fProcessorIcon;
|
|
||||||
AutoIcon fTrackerIcon;
|
|
||||||
AutoIcon fDeskbarIcon;
|
|
||||||
AutoIcon fTerminalIcon;
|
|
||||||
|
|
||||||
private:
|
// TODO: move those into private, and have getter methods
|
||||||
void Init();
|
AutoIcon fProcessControllerIcon;
|
||||||
|
AutoIcon fProcessorIcon;
|
||||||
|
AutoIcon fTrackerIcon;
|
||||||
|
AutoIcon fDeskbarIcon;
|
||||||
|
AutoIcon fTerminalIcon;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Init();
|
||||||
|
|
||||||
bool fTemp;
|
bool fTemp;
|
||||||
float fMemoryUsage;
|
float fMemoryUsage;
|
||||||
@@ -66,7 +67,7 @@ private:
|
|||||||
double fCPUTimes[B_MAX_CPU_COUNT];
|
double fCPUTimes[B_MAX_CPU_COUNT];
|
||||||
bigtime_t fPrevActive[B_MAX_CPU_COUNT];
|
bigtime_t fPrevActive[B_MAX_CPU_COUNT];
|
||||||
bigtime_t fPrevTime;
|
bigtime_t fPrevTime;
|
||||||
BMessageRunner *fMessageRunner;
|
BMessageRunner* fMessageRunner;
|
||||||
rgb_color frame_color, active_color, idle_color, memory_color, swap_color;
|
rgb_color frame_color, active_color, idle_color, memory_color, swap_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user