Added missing team lead Michael Pfeiffer!

Added Michael Phipps to the list of contributors - at least he did
some coding some time ago ;-)) Anyone still not listed?
Applied the missing bits of our style guide (at least he tried :-)).
Removed the CPU detection code, as we have one at a central place
(headers/private/shared/cpu_type.h).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13254 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-06-24 01:48:44 +00:00
parent 2949ed1def
commit d830c752cc
2 changed files with 300 additions and 381 deletions
+292 -379
View File
@@ -1,9 +1,11 @@
/* /*
* Copyright (c) 2001-2005, Haiku, Inc. * Copyright (c) 2005, Haiku, Inc.
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
* *
* Author: DarkWyrm <[email protected]> * Author: DarkWyrm <[email protected]>
*/ */
#include <AppFileInfo.h> #include <AppFileInfo.h>
#include <Application.h> #include <Application.h>
#include <Bitmap.h> #include <Bitmap.h>
@@ -21,75 +23,76 @@
#include <View.h> #include <View.h>
#include <Window.h> #include <Window.h>
#include <cpu_type.h>
#include <stdio.h> #include <stdio.h>
#define MOVE_INFO_VIEW 'mviv' #define MOVE_INFO_VIEW 'mviv'
const char *CPUToString(cpu_type type);
const char *UptimeToString(void); const char *UptimeToString(void);
class AboutApp : public BApplication
{ class AboutApp : public BApplication {
public: public:
AboutApp(void); AboutApp(void);
}; };
class AboutWindow : public BWindow class AboutWindow : public BWindow {
{ public:
public: AboutWindow(void);
AboutWindow(void); bool QuitRequested(void);
bool QuitRequested(void);
}; };
class AboutView : public BView class AboutView : public BView {
{ public:
public: AboutView(const BRect &r);
AboutView(const BRect &r); ~AboutView(void);
~AboutView(void); void AttachedToWindow(void);
void AttachedToWindow(void); void Pulse(void);
void Pulse(void); void Draw(BRect update);
void Draw(BRect update); void MessageReceived(BMessage *msg);
void MessageReceived(BMessage *msg); void MouseDown(BPoint pt);
void MouseDown(BPoint pt);
private: private:
BStringView *fUptimeView; BStringView *fUptimeView;
BView *fInfoView; BView *fInfoView;
BTextView *fCreditsView; BTextView *fCreditsView;
BBitmap *fLogo; BBitmap *fLogo;
BPoint fDrawPoint; BPoint fDrawPoint;
}; };
int main(void)
{ // #pragma mark -
AboutApp app;
app.Run();
return 0;
}
AboutApp::AboutApp(void) AboutApp::AboutApp(void)
: BApplication("application/x-vnd.haiku-AboutHaiku") : BApplication("application/x-vnd.haiku-AboutHaiku")
{ {
AboutWindow *win = new AboutWindow(); AboutWindow *window = new AboutWindow();
win->Show(); window->Show();
} }
AboutWindow::AboutWindow(void) // #pragma mark -
: BWindow( BRect(0,0,500,300), "About Haiku", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
AboutWindow::AboutWindow()
: BWindow(BRect(0, 0, 500, 300), "About Haiku", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
{ {
AboutView *view = new AboutView(Bounds()); AddChild(new AboutView(Bounds()));
AddChild(view);
MoveTo((BScreen().Frame().Width() - Bounds().Width()) / 2,
MoveTo( (BScreen().Frame().Width() - Bounds().Width()) / 2, (BScreen().Frame().Height() - Bounds().Height()) / 2 );
(BScreen().Frame().Height() - Bounds().Height()) / 2 );
} }
bool bool
AboutWindow::QuitRequested(void) AboutWindow::QuitRequested()
{ {
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
return true; return true;
@@ -99,476 +102,386 @@ AboutWindow::QuitRequested(void)
AboutView::AboutView(const BRect &r) AboutView::AboutView(const BRect &r)
: BView(r, "aboutview", B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED) : BView(r, "aboutview", B_FOLLOW_ALL, B_WILL_DRAW | B_PULSE_NEEDED)
{ {
fLogo=BTranslationUtils::GetBitmap('PNG ',"haikulogo.png"); fLogo = BTranslationUtils::GetBitmap('PNG ',"haikulogo.png");
if (fLogo) {
if(fLogo) fDrawPoint.x = (225-fLogo->Bounds().Width()) / 2;
{ fDrawPoint.y = 0;
fDrawPoint.x=( 225-fLogo->Bounds().Width() )/2;
fDrawPoint.y=0;
} }
// Begin Construction of System Information controls // Begin Construction of System Information controls
font_height height; font_height height;
float labelsize, textsize; float labelHeight, textHeight;
char string[255]; char string[255];
system_info sysinfo;
system_info systemInfo;
get_system_info(&sysinfo); get_system_info(&systemInfo);
be_plain_font->GetHeight(&height); be_plain_font->GetHeight(&height);
textsize = height.ascent + height.descent + height.leading; textHeight = height.ascent + height.descent + height.leading;
be_bold_font->GetHeight(&height); be_bold_font->GetHeight(&height);
labelsize = height.ascent + height.descent + height.leading; labelHeight = height.ascent + height.descent + height.leading;
BRect r(0,0,225,Bounds().bottom); BRect r(0, 0, 225, Bounds().bottom);
if(fLogo) if (fLogo)
r.OffsetBy(0,fLogo->Bounds().Height()); r.OffsetBy(0,fLogo->Bounds().Height());
fInfoView = new BView(r, "infoview", B_FOLLOW_NONE, B_WILL_DRAW); fInfoView = new BView(r, "infoview", B_FOLLOW_NONE, B_WILL_DRAW);
fInfoView->SetViewColor(235,235,235); fInfoView->SetViewColor(235, 235, 235);
AddChild(fInfoView); AddChild(fInfoView);
// Add all the various labels for system infomation // Add all the various labels for system infomation
BStringView *strview; BStringView *stringView;
// OS Version // OS Version
r.Set(5,5,225,labelsize+5); r.Set(5, 5, 225, labelHeight + 5);
strview = new BStringView(r, "oslabel","Version:"); stringView = new BStringView(r, "oslabel", "Version:");
strview->SetFont(be_bold_font); stringView->SetFont(be_bold_font);
fInfoView->AddChild(strview); fInfoView->AddChild(stringView);
r.OffsetBy(0, labelHeight);
r.bottom = r.top + textHeight;
r.OffsetBy(0,labelsize);
r.bottom=r.top + textsize;
// the version is stored in the BEOS:APP_VERSION attribute of libbe.so // the version is stored in the BEOS:APP_VERSION attribute of libbe.so
BFile file("/boot/beos/system/lib/libbe.so",B_READ_ONLY); BFile file("/boot/beos/system/lib/libbe.so", B_READ_ONLY);
BAppFileInfo afInfo; if (file.InitCheck() == B_OK) {
version_info vInfo; BAppFileInfo appFileInfo;
version_info versionInfo;
if( file.InitCheck()==B_OK &&
afInfo.SetTo(&file)==B_OK && if (appFileInfo.SetTo(&file) == B_OK
afInfo.GetVersionInfo(&vInfo, B_APP_VERSION_KIND)==B_OK ) && appFileInfo.GetVersionInfo(&versionInfo, B_APP_VERSION_KIND) == B_OK)
{ strcpy(string, versionInfo.short_info);
strcpy(string,vInfo.short_info); else
strcpy(string, "Unknown");
} }
else
strcpy(string,"Unknown"); stringView = new BStringView(r, "ostext", string);
fInfoView->AddChild(stringView);
strview = new BStringView(r, "ostext",string);
fInfoView->AddChild(strview);
// CPU count, type and clock speed // CPU count, type and clock speed
r.OffsetBy(0,textsize*1.5); r.OffsetBy(0, textHeight * 1.5);
r.bottom=r.top + labelsize; r.bottom = r.top + labelHeight;
if(sysinfo.cpu_count > 1)
sprintf(string,"%ld Processors:",sysinfo.cpu_count);
else
strcpy(string,"Processor:");
strview = new BStringView(r, "cpulabel","Processor:");
strview->SetFont(be_bold_font);
fInfoView->AddChild(strview);
r.OffsetBy(0,labelsize);
r.bottom=r.top + textsize;
strview = new BStringView(r, "cputext",CPUToString(sysinfo.cpu_type));
fInfoView->AddChild(strview);
r.OffsetBy(0,labelsize); if (systemInfo.cpu_count > 1)
r.bottom=r.top + textsize; sprintf(string, "%ld Processors:", systemInfo.cpu_count);
if(sysinfo.cpu_clock_speed < 1000000000)
sprintf(string,"%.2f Mhz",sysinfo.cpu_clock_speed / 1000000.0f);
else else
sprintf(string,"%.2f Ghz",sysinfo.cpu_clock_speed / 1000000000.0f); strcpy(string, "Processor:");
strview = new BStringView(r, "mhztext",string); stringView = new BStringView(r, "cpulabel", "Processor:");
fInfoView->AddChild(strview); stringView->SetFont(be_bold_font);
fInfoView->AddChild(stringView);
BString cpuType;
cpuType << get_cpu_vendor_string(systemInfo.cpu_type)
<< " " << get_cpu_model_string(systemInfo.cpu_type);
r.OffsetBy(0, labelHeight);
r.bottom = r.top + textHeight;
stringView = new BStringView(r, "cputext", cpuType.String());
fInfoView->AddChild(stringView);
r.OffsetBy(0, labelHeight);
r.bottom = r.top + textHeight;
if (systemInfo.cpu_clock_speed < 1000000000)
sprintf(string,"%.2f Mhz", systemInfo.cpu_clock_speed / 1000000.0f);
else
sprintf(string,"%.2f Ghz", systemInfo.cpu_clock_speed / 1000000000.0f);
stringView = new BStringView(r, "mhztext", string);
fInfoView->AddChild(stringView);
// RAM // RAM
r.OffsetBy(0,textsize*1.5); r.OffsetBy(0, textHeight * 1.5);
r.bottom=r.top + labelsize; r.bottom = r.top + labelHeight;
strview = new BStringView(r, "ramlabel","Memory:"); stringView = new BStringView(r, "ramlabel", "Memory:");
strview->SetFont(be_bold_font); stringView->SetFont(be_bold_font);
fInfoView->AddChild(strview); fInfoView->AddChild(stringView);
r.OffsetBy(0, labelHeight);
r.bottom = r.top + textHeight;
sprintf(string, "%ld MB total", systemInfo.max_pages / 256);
stringView = new BStringView(r, "ramtext", string);
fInfoView->AddChild(stringView);
r.OffsetBy(0,labelsize);
r.bottom=r.top + textsize;
sprintf(string,"%ld MB total", sysinfo.max_pages / 256);
strview = new BStringView(r, "ramtext",string);
fInfoView->AddChild(strview);
// Kernel build time/date // Kernel build time/date
r.OffsetBy(0,textsize*1.5); r.OffsetBy(0, textHeight * 1.5);
r.bottom=r.top + labelsize; r.bottom = r.top + labelHeight;
strview = new BStringView(r, "kernellabel","Kernel:"); stringView = new BStringView(r, "kernellabel", "Kernel:");
strview->SetFont(be_bold_font); stringView->SetFont(be_bold_font);
fInfoView->AddChild(strview); fInfoView->AddChild(stringView);
r.OffsetBy(0, labelHeight);
r.bottom = r.top + textHeight;
sprintf(string, "%s %s", systemInfo.kernel_build_date, systemInfo.kernel_build_time);
stringView = new BStringView(r, "kerneltext", string);
fInfoView->AddChild(stringView);
r.OffsetBy(0,labelsize);
r.bottom=r.top + textsize;
sprintf(string,"%s %s",sysinfo.kernel_build_date, sysinfo.kernel_build_time);
strview = new BStringView(r, "kerneltext",string);
fInfoView->AddChild(strview);
// Uptime // Uptime
r.OffsetBy(0,textsize*1.5); r.OffsetBy(0, textHeight * 1.5);
r.bottom=r.top + labelsize; r.bottom = r.top + labelHeight;
strview = new BStringView(r, "uptimelabel","Time Running:"); stringView = new BStringView(r, "uptimelabel", "Time Running:");
strview->SetFont(be_bold_font); stringView->SetFont(be_bold_font);
fInfoView->AddChild(strview); fInfoView->AddChild(stringView);
r.OffsetBy(0,labelsize); r.OffsetBy(0, labelHeight);
r.bottom=r.top + textsize; r.bottom = r.top + textHeight;
fUptimeView = new BStringView(r, "uptimetext",""); fUptimeView = new BStringView(r, "uptimetext", "");
fInfoView->AddChild(fUptimeView); fInfoView->AddChild(fUptimeView);
fUptimeView->SetText(UptimeToString()); fUptimeView->SetText(UptimeToString());
// Begin construction of the credits view // Begin construction of the credits view
r=Bounds(); r = Bounds();
r.left += fInfoView->Bounds().right; r.left += fInfoView->Bounds().right;
r.right -= B_V_SCROLL_BAR_WIDTH; r.right -= B_V_SCROLL_BAR_WIDTH;
fCreditsView = new BTextView(r, "credits", r.OffsetToCopy(0,0).InsetByCopy(5,5),B_FOLLOW_NONE); fCreditsView = new BTextView(r, "credits",
BScrollView *creditsScroller = new BScrollView("creditsScroller",fCreditsView,0,0, r.OffsetToCopy(0, 0).InsetByCopy(5, 5), B_FOLLOW_NONE);
false,true, B_PLAIN_BORDER); BScrollView *creditsScroller = new BScrollView("creditsScroller",
fCreditsView, 0, 0, false, true, B_PLAIN_BORDER);
AddChild(creditsScroller); AddChild(creditsScroller);
fCreditsView->SetStylable(true); fCreditsView->SetStylable(true);
fCreditsView->MakeEditable(false); fCreditsView->MakeEditable(false);
BFont font(be_bold_font); BFont font(be_bold_font);
font.SetSize(be_bold_font->Size()+2); font.SetSize(font.Size() + 2);
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("Haiku\n"); fCreditsView->Insert("Haiku\n");
font.SetSize(be_bold_font->Size()+1); font.SetSize(be_bold_font->Size() + 1);
font.SetFace(B_BOLD_FACE | B_ITALIC_FACE); font.SetFace(B_BOLD_FACE | B_ITALIC_FACE);
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert("Copyright (C) 2001-2005 Haiku, Inc.\n\n"); fCreditsView->Insert("Copyright " B_UTF8_COPYRIGHT "2001-2005 Haiku, Inc.\n\n");
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("Team Leads:\n"); fCreditsView->Insert("Team Leads:\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert( fCreditsView->Insert(
"Bruno G. Albuquerque\n" "Bruno G. Albuquerque\n"
"DarkWyrm\n" "DarkWyrm\n"
"Axel Dörfler\n" "Axel Dörfler\n"
"Philippe Houdoin\n" "Phil Greenway\n"
"Kurtis Kopf\n" "Philippe Houdoin\n"
"Marcus Overhagen\n" "Kurtis Kopf\n"
"Sikosis\n" "Marcus Overhagen\n"
"Ingo Weinhold\n" "Michael Pfeiffer\n"
"Michael Wilber\n" "Ingo Weinhold\n"
"\n" "Michael Wilber\n"
); "\n");
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("Developers:\n"); fCreditsView->Insert("Developers:\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert( fCreditsView->Insert(
"Stephan Aßmus\n" "Stephan Aßmus\n"
"Andrew Bachmann\n" "Andrew Bachmann\n"
"Stefano Ceccherini\n" "Stefano Ceccherini\n"
"Rudolf Cornelissen\n" "Rudolf Cornelissen\n"
"Jérôme Duval\n" "Jérôme Duval\n"
"Matthijs Hollemans\n" "Matthijs Hollemans\n"
"Adi Oanca\n" "Adi Oanca\n"
"Niels Reedijk\n" "Niels Reedijk\n"
"\n"); "\n");
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("Contributors:\n"); fCreditsView->Insert("Contributors:\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert( fCreditsView->Insert(
"Bruce Cameron\n" "Bruce Cameron\n"
"Tyler Dauwalder\n" "Tyler Dauwalder\n"
"Oliver Ruiz Dorantes\n" "Oliver Ruiz Dorantes\n"
"Marc Flerackers\n" "Marc Flerackers\n"
"Erik Jaesler\n" "Erik Jaesler\n"
"Elad Lahav\n" "Elad Lahav\n"
"Santiago Lema\n" "Santiago Lema\n"
"Jerome Leveque\n" "Jerome Leveque\n"
"Michael Lotz\n" "Michael Lotz\n"
"Graham MacDonald\n" "Graham MacDonald\n"
"Brian Matzon\n" "Brian Matzon\n"
"Christopher ML Zumwalt May\n" "Christopher ML Zumwalt May\n"
"Andrew McCall\n" "Andrew McCall\n"
"David McPaul\n" "David McPaul\n"
"Misza\n" "Misza\n"
"MrSiggler\n" "MrSiggler\n"
"Alan Murta\n" "Alan Murta\n"
"Frans Van Nispen\n" "Frans Van Nispen\n"
"Pahtz\n" "Pahtz\n"
"Jeremy Rand\n" "Michael Phipps\n"
"David Reid" "Jeremy Rand\n"
"Daniel Reinhold\n" "David Reid"
"Thomas Roell\n" "Daniel Reinhold\n"
"François Revol\n" "Thomas Roell\n"
"Zousar Shaker\n" "François Revol\n"
"Daniel Switkin\n" "Zousar Shaker\n"
"Atsushi Takamatsu\n" "Daniel Switkin\n"
"Jason Vandermark\n" "Atsushi Takamatsu\n"
"Sandor Vroemisse\n" "Jason Vandermark\n"
"Nathan Whitehorn\n" "Sandor Vroemisse\n"
"Ulrich Wimboeck\n" "Nathan Whitehorn\n"
"Gabe Yoder\n" "Ulrich Wimboeck\n"
"\n"); "Gabe Yoder\n"
"\n");
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("Special Thanks To:\n"); fCreditsView->Insert("Special Thanks To:\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert("Michael Phipps\n\n"); fCreditsView->Insert("Michael Phipps (project founder)\n\n");
/* /*
// TODO: Add these (somehow) // TODO: Add these (somehow)
Brian Paul (Mesa) Brian Paul (Mesa)
Silicon Graphics Inc. (GLU) Silicon Graphics Inc. (GLU)
Mark Kilgard & Be Inc. & Jam Hamby (GLUT) Mark Kilgard & Be Inc. & Jam Hamby (GLUT)
*/ */
font.SetSize(be_bold_font->Size()+2); font.SetSize(be_bold_font->Size() + 2);
font.SetFace(B_BOLD_FACE); font.SetFace(B_BOLD_FACE);
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("\nCopyrights\n\n"); fCreditsView->Insert("\nCopyrights\n\n");
font.SetSize(be_bold_font->Size()+1); font.SetSize(be_bold_font->Size()+1);
font.SetFace(B_ITALIC_FACE); font.SetFace(B_ITALIC_FACE);
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("AntiGrain Geometry\n"); fCreditsView->Insert("AntiGrain Geometry\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert("Copyright (C) 2002-2005 Maxim Shemanarev (McSeem)\n\n"); fCreditsView->Insert("Copyright (C) 2002-2005 Maxim Shemanarev (McSeem)\n\n");
font.SetFace(B_ITALIC_FACE); font.SetFace(B_ITALIC_FACE);
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("PDFLib\n"); fCreditsView->Insert("PDFLib\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert("Copyright (c) 1997-2005 PDFlib GmbH and Thomas Merz. " fCreditsView->Insert(
"All rights reserved.\n" "Copyright (c) 1997-2005 PDFlib GmbH and Thomas Merz. "
"PDFlib and the PDFlib logo are registered trademarks of PDFlib GmbH.\n\n"); "All rights reserved.\n"
"PDFlib and the PDFlib logo are registered trademarks of PDFlib GmbH.\n\n");
font.SetFace(B_ITALIC_FACE); font.SetFace(B_ITALIC_FACE);
fCreditsView->SetFontAndColor(&font); fCreditsView->SetFontAndColor(&font);
fCreditsView->Insert("FreeType2\n"); fCreditsView->Insert("FreeType2\n");
fCreditsView->SetFontAndColor(be_plain_font); fCreditsView->SetFontAndColor(be_plain_font);
fCreditsView->Insert("Portions of this software are copyright (C) 1996-2002 The FreeType" fCreditsView->Insert("Portions of this software are copyright (C) 1996-2002 The FreeType"
" Project (www.freetype.org). All rights reserved.\n\n"); " Project (www.freetype.org). All rights reserved.\n\n");
} }
AboutView::~AboutView(void) AboutView::~AboutView(void)
{ {
} }
void void
AboutView::AttachedToWindow(void) AboutView::AttachedToWindow(void)
{ {
Window()->SetPulseRate(500000); Window()->SetPulseRate(500000);
} }
void void
AboutView::MouseDown(BPoint pt) AboutView::MouseDown(BPoint pt)
{ {
BRect r(92,26,105,31); BRect r(92, 26, 105, 31);
if(r.Contains(pt)) if (r.Contains(pt))
printf("Easter Egg\n"); printf("Easter Egg\n");
} }
void void
AboutView::Draw(BRect update) AboutView::Draw(BRect update)
{ {
if(fLogo) if (fLogo)
DrawBitmap(fLogo,fDrawPoint); DrawBitmap(fLogo, fDrawPoint);
} }
void void
AboutView::Pulse(void) AboutView::Pulse(void)
{ {
fUptimeView->SetText(UptimeToString()); fUptimeView->SetText(UptimeToString());
} }
void void
AboutView::MessageReceived(BMessage *msg) AboutView::MessageReceived(BMessage *msg)
{ {
switch(msg->what) switch (msg->what) {
{
case MOVE_INFO_VIEW: case MOVE_INFO_VIEW:
{ fInfoView->MoveBy(0, -5);
fInfoView->MoveBy(0,-5);
break; break;
}
default: default:
BView::MessageReceived(msg); BView::MessageReceived(msg);
} }
} }
const char *CPUToString(cpu_type type)
{
switch(type)
{
case B_CPU_PPC_601: return "PowerPC 601";
case B_CPU_PPC_603: return "PowerPC 603";
case B_CPU_PPC_603e: return "PowerPC 603e";
case B_CPU_PPC_604: return "PowerPC 604";
case B_CPU_PPC_604e: return "PowerPC 604e";
case B_CPU_PPC_750: return "PowerPC 750";
case B_CPU_PPC_686: return "PowerPC 686";
case B_CPU_AMD_29K: return "AMD 29000";
// case B_CPU_X86: return "Generic x86";
case B_CPU_MC6502: return "MC 6502";
case B_CPU_MIPS: return "MIPS";
case B_CPU_HPPA: return "HPPA";
case B_CPU_SH: return "SH";
case B_CPU_Z80: return "Z80";
case B_CPU_ALPHA: return "Alpha";
case B_CPU_M68K: return "Motorola 68000";
case B_CPU_ARM: return "ARM";
case B_CPU_SPARC: return "SPARC";
// case B_CPU_INTEL_X86: return "Generic Intel x86";
case B_CPU_INTEL_PENTIUM: return "Intel Pentium";
case B_CPU_INTEL_PENTIUM75: return "Intel Pentium";
case B_CPU_INTEL_PENTIUM_486_OVERDRIVE: return "Intel 486 Overdrive";
case B_CPU_INTEL_PENTIUM_MMX: return "Intel Pentium MMX";
case B_CPU_INTEL_PENTIUM_MMX_MODEL_8: return "Intel Pentium MMX, Model 8";
case B_CPU_INTEL_PENTIUM75_486_OVERDRIVE: return "Intel 486 Overdrive";
case B_CPU_INTEL_PENTIUM_PRO: return "Intel Pentium Pro";
case B_CPU_INTEL_PENTIUM_II: return "Intel Pentium II";
case B_CPU_INTEL_PENTIUM_II_MODEL_5: return "Intel Pentium II, Model 5";
case B_CPU_INTEL_CELERON: return "Intel Celeron";
case B_CPU_INTEL_PENTIUM_III: return "Intel Pentium III";
case B_CPU_INTEL_PENTIUM_III_MODEL_8: return "Intel Pentium III, Model 8";
case B_CPU_INTEL_PENTIUM_M: return "Intel Pentium M";
case B_CPU_INTEL_PENTIUM_III_XEON: return "Intel Pentium III Xeon";
case B_CPU_INTEL_PENTIUM_III_MODEL_11: return "Intel Pentium III, Model 11";
case B_CPU_INTEL_PENTIUM_M_MODEL_13: return "Intel Pentium M, Model 13";
case B_CPU_INTEL_PENTIUM_IV: return "Intel Pentium IV";
case B_CPU_INTEL_PENTIUM_IV_MODEL_1: return "Intel Pentium IV, Model 1";
case B_CPU_INTEL_PENTIUM_IV_MODEL_2: return "Intel Pentium IV, Model 2";
case B_CPU_INTEL_PENTIUM_IV_MODEL_3: return "Intel Pentium IV, Model 3";
case B_CPU_INTEL_PENTIUM_IV_MODEL_4: return "Intel Pentium IV, Model 4";
/* case B_CPU_AMD_X86: return "Generic AMD x86";
case B_CPU_AMD_K5_MODEL0: return "AMD K5, Model 0";
case B_CPU_AMD_K5_MODEL1: return "AMD K5, Model 1";
case B_CPU_AMD_K5_MODEL2: return "AMD K5, Model 2";
case B_CPU_AMD_K5_MODEL3: return "AMD K5, Model 3";
case B_CPU_AMD_K6_MODEL6: return "AMD K6, Model 6";
case B_CPU_AMD_K6_MODEL7: return "AMD K6, Model 7";
*/
case B_CPU_AMD_K6_2: return "AMD K6 2";
case B_CPU_AMD_K6_III: return "AMD K6 3";
case B_CPU_AMD_ATHLON_MODEL_1: return "AMD Athlon, Model 1";
case B_CPU_AMD_ATHLON_MODEL_2: return "AMD Athlon, Model 2";
case B_CPU_AMD_DURON: return "AMD Duron";
case B_CPU_AMD_ATHLON_THUNDERBIRD: return "AMD Athlon (Thunderbird)";
case B_CPU_AMD_ATHLON_XP: return "AMD Athlon XP";
case B_CPU_AMD_ATHLON_XP_MODEL_7: return "AMD Athlon XP, Model 7";
case B_CPU_AMD_ATHLON_XP_MODEL_8: return "AMD Athlon XP, Model 8";
case B_CPU_AMD_ATHLON_XP_MODEL_10: return "AMD Athlon XP, Model 10";
case B_CPU_AMD_ATHLON_64_MODEL_4: return "AMD Athlon64, Model 4";
case B_CPU_AMD_ATHLON_64_MODEL_5: return "AMD Athlon64, Model 5";
case B_CPU_AMD_ATHLON_64_MODEL_7: return "AMD Athlon64, Model 7";
case B_CPU_AMD_ATHLON_64_MODEL_8: return "AMD Athlon64, Model 8";
case B_CPU_AMD_ATHLON_64_MODEL_11: return "AMD Athlon64, Model 11";
case B_CPU_AMD_ATHLON_64_MODEL_12: return "AMD Athlon64, Model 12";
case B_CPU_AMD_ATHLON_64_MODEL_14: return "AMD Athlon64, Model 14";
case B_CPU_AMD_ATHLON_64_MODEL_15: return "AMD Athlon64, Model 15";
// case B_CPU_CYRIX_X86: return "Generic Cyrix x86";
case B_CPU_CYRIX_GXm: return "Cyrix GXm";
case B_CPU_CYRIX_6x86MX: return "Cyrix 6x86 MX";
// case B_CPU_IDT_X86: return "Generic IDT x86";
case B_CPU_IDT_WINCHIP_C6: return "IDT Winchip C6";
case B_CPU_IDT_WINCHIP_2: return "IDT Winchip 2";
case B_CPU_IDT_WINCHIP_3: return "IDT Winchip 3";
case B_CPU_VIA_EDEN: return "VIA Eden";
case B_CPU_VIA_EDEN_EZRA_T: return "Via Eden (Ezra)";
// case B_CPU_RISE_X86: return "Rise x86";
case B_CPU_RISE_mP6: return "Rise mP6";
case B_CPU_TRANSMETA_x86: return "Transmeta x86";
case B_CPU_TRANSMETA_CRUSOE: return "Transmeta Crusoe";
case B_CPU_NATIONAL_x86: return "National Semiconductor x86";
case B_CPU_NATIONAL_GEODE_GX1: return "National Semiconductor GX1";
case B_CPU_NATIONAL_GEODE_GX2: return "National Semiconductor GX2";
default:
break;
}
return "Unrecognized CPU";
}
const char *UptimeToString(void) // #pragma mark -
const char *
UptimeToString(void)
{ {
char string[255]; char string[255];
int64 days, hours, minutes, seconds, remainder; int64 days, hours, minutes, seconds, remainder;
int64 systime = system_time(); int64 systime = system_time();
if(systime > 86400000000LL) if (systime > 86400000000LL) {
{
days = systime / 86400000000LL; days = systime / 86400000000LL;
remainder = systime % 86400000000LL; remainder = systime % 86400000000LL;
hours = remainder / 3600000000LL; hours = remainder / 3600000000LL;
remainder = remainder % 3600000000LL; remainder = remainder % 3600000000LL;
minutes = remainder / 60000000; minutes = remainder / 60000000;
remainder = remainder % 60000000; remainder = remainder % 60000000;
seconds = remainder / 1000000; seconds = remainder / 1000000;
sprintf(string,"%lld days, %lld hours, %lld minutes, %lld seconds",days, sprintf(string, "%lld days, %lld hours, %lld minutes, %lld seconds",
hours, minutes, seconds); days, hours, minutes, seconds);
} } else if (systime > 3600000000LL) {
else
if(systime > 3600000000LL)
{
hours = systime / 3600000000LL; hours = systime / 3600000000LL;
remainder = systime % 3600000000LL; remainder = systime % 3600000000LL;
minutes = remainder / 60000000; minutes = remainder / 60000000;
remainder = remainder % 60000000; remainder = remainder % 60000000;
seconds = remainder / 1000000; seconds = remainder / 1000000;
sprintf(string,"%lld hours, %lld minutes, %lld seconds",hours, minutes, seconds); sprintf(string, "%lld hours, %lld minutes, %lld seconds",
} hours, minutes, seconds);
else } else if (systime > 60000000) {
if(systime > 60000000)
{
minutes = systime / 60000000; minutes = systime / 60000000;
remainder = systime % 60000000; remainder = systime % 60000000;
seconds = remainder / 1000000; seconds = remainder / 1000000;
sprintf(string,"%lld minutes, %lld seconds",minutes, seconds); sprintf(string, "%lld minutes, %lld seconds", minutes, seconds);
} } else {
else
{
seconds = systime / 1000000; seconds = systime / 1000000;
sprintf(string,"%lld seconds",seconds); sprintf(string, "%lld seconds", seconds);
} }
return string; return string;
} }
int
main()
{
AboutApp app;
app.Run();
return 0;
}
+8 -2
View File
@@ -1,7 +1,13 @@
SubDir OBOS_TOP src apps abouthaiku ; SubDir OBOS_TOP src apps abouthaiku ;
App AboutHaiku : AboutHaiku.cpp UsePrivateHeaders shared ;
if $(TARGET_PLATFORM) = r5 {
SubDirC++Flags -DR5_COMPATIBLE ;
}
App AboutHaiku :
AboutHaiku.cpp
: libbe.so libtranslation.so : libbe.so libtranslation.so
: AboutHaiku.rdef : AboutHaiku.rdef
; ;