The Haiku Logo is displayed on the Desktop. :-) Of course this will be removed as soon as Tracker runs. If you don't want it, you can disable it in RootLayer.h. Fixed a clipping bug with text rendering.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13057 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bdb153ee72
commit
9851ab5c1e
@ -93,7 +93,7 @@ class ServerBitmap {
|
||||
inline int32 Height() const
|
||||
{ return fHeight; }
|
||||
|
||||
inline bool InitCheck() const
|
||||
inline bool IsValid() const
|
||||
{ return fInitialized; }
|
||||
|
||||
//! Returns the identifier token for the bitmap
|
||||
|
@ -36,20 +36,27 @@
|
||||
#include <File.h>
|
||||
#include <PortLink.h>
|
||||
|
||||
#include "Globals.h"
|
||||
#include "RootLayer.h"
|
||||
#include "Layer.h"
|
||||
#include "Workspace.h"
|
||||
#include "ServerScreen.h"
|
||||
#include "WinBorder.h"
|
||||
#include "ServerWindow.h"
|
||||
#include "ServerApp.h"
|
||||
#include "Desktop.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "FMWList.h"
|
||||
#include "DisplayDriver.h"
|
||||
#include "ServerProtocol.h"
|
||||
#include "Decorator.h"
|
||||
#include "Desktop.h"
|
||||
#include "DisplayDriver.h"
|
||||
#include "FMWList.h"
|
||||
#include "Globals.h"
|
||||
#include "Layer.h"
|
||||
#include "ServerApp.h"
|
||||
#include "ServerConfig.h"
|
||||
#include "ServerProtocol.h"
|
||||
#include "ServerScreen.h"
|
||||
#include "ServerWindow.h"
|
||||
#include "WinBorder.h"
|
||||
#include "Workspace.h"
|
||||
|
||||
#include "RootLayer.h"
|
||||
|
||||
#if DISPLAY_HAIKU_LOGO
|
||||
#include "ServerBitmap.h"
|
||||
#include "HaikuLogo.h"
|
||||
static const float kGoldenProportion = (sqrtf(5.0) - 1.0) / 2.0;
|
||||
#endif
|
||||
|
||||
//#define DEBUG_ROOTLAYER
|
||||
#define APPSERVER_ROOTLAYER_SHOW_WORKSPACE_NUMBER
|
||||
@ -107,17 +114,30 @@ RootLayer::RootLayer(const char *name, int32 workspaceCount,
|
||||
fWinBorderIndex(0),
|
||||
|
||||
fScreenShotIndex(1),
|
||||
|
||||
#if ON_SCREEN_DEBUGGING_INFO
|
||||
fQuiting(false),
|
||||
fDebugInfo("")
|
||||
#else
|
||||
fQuiting(false)
|
||||
#endif
|
||||
{
|
||||
//NOTE: be careful about this one.
|
||||
fRootLayer = this;
|
||||
|
||||
// Some stuff that will go away in the future but fills some gaps right now
|
||||
#if ON_SCREEN_DEBUGGING_INFO
|
||||
fDebugInfo.SetTo("");
|
||||
#endif
|
||||
|
||||
#if DISPLAY_HAIKU_LOGO
|
||||
fLogoBitmap = new UtilityBitmap(BRect(0.0, 0.0, kLogoWidth - 1.0,
|
||||
kLogoHeight - 1.0),
|
||||
kLogoFormat, 0);
|
||||
if (fLogoBitmap->IsValid()) {
|
||||
int32 size = min_c(sizeof(kLogoBits), fLogoBitmap->BitsLength());
|
||||
memcpy(fLogoBitmap->Bits(), kLogoBits, size);
|
||||
} else {
|
||||
delete fLogoBitmap;
|
||||
fLogoBitmap = NULL;
|
||||
}
|
||||
#endif // DISPLAY_HAIKU_LOGO
|
||||
|
||||
|
||||
// easy way to identify this class.
|
||||
fClassID = AS_ROOTLAYER_CLASS;
|
||||
fHidden = false;
|
||||
@ -175,6 +195,10 @@ RootLayer::~RootLayer()
|
||||
free(fWinBorderList2);
|
||||
free(fWinBorderList);
|
||||
// RootLayer object just uses Screen objects, it is not allowed to delete them.
|
||||
|
||||
#if DISPLAY_HAIKU_LOGO
|
||||
delete fLogoBitmap;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -2103,6 +2127,18 @@ RootLayer::Draw(const BRect &r)
|
||||
}
|
||||
}
|
||||
#endif // ON_SCREEN_DEBUGGING_INFO
|
||||
|
||||
#if DISPLAY_HAIKU_LOGO
|
||||
if (fLogoBitmap) {
|
||||
BPoint logoPos;
|
||||
logoPos.x = floorf(min_c(fFrame.left + fFrame.Width() * kGoldenProportion,
|
||||
fFrame.right - (kLogoWidth + kLogoHeight / 2.0)));
|
||||
logoPos.y = floorf(fFrame.bottom - kLogoHeight * 1.5);
|
||||
BRect bitmapBounds = fLogoBitmap->Bounds();
|
||||
fDriver->DrawBitmap(fLogoBitmap, bitmapBounds,
|
||||
bitmapBounds.OffsetToCopy(logoPos), fLayerData);
|
||||
}
|
||||
#endif // DISPLAY_HAIKU_LOGO
|
||||
}
|
||||
|
||||
#if ON_SCREEN_DEBUGGING_INFO
|
||||
|
@ -45,6 +45,13 @@ class Desktop;
|
||||
class DisplayDriver;
|
||||
class BPortLink;
|
||||
|
||||
#ifndef DISPLAY_HAIKU_LOGO
|
||||
#define DISPLAY_HAIKU_LOGO 1
|
||||
#endif
|
||||
|
||||
#if DISPLAY_HAIKU_LOGO
|
||||
class UtilityBitmap;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\class RootLayer RootLayer.h
|
||||
@ -211,6 +218,9 @@ friend class Desktop;
|
||||
void AddDebugInfo(const char* string);
|
||||
BString fDebugInfo;
|
||||
#endif
|
||||
#if DISPLAY_HAIKU_LOGO
|
||||
UtilityBitmap* fLogoBitmap;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
5821
src/servers/app/drawing/HaikuLogo.h
Normal file
5821
src/servers/app/drawing/HaikuLogo.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -929,7 +929,7 @@ Painter::DrawBitmap(const ServerBitmap* bitmap,
|
||||
|
||||
BRect touched = _Clipped(viewRect);
|
||||
|
||||
if (bitmap && bitmap->InitCheck() && touched.IsValid()) {
|
||||
if (bitmap && bitmap->IsValid() && touched.IsValid()) {
|
||||
// the native bitmap coordinate system
|
||||
BRect actualBitmapRect(bitmap->Bounds());
|
||||
|
||||
|
@ -215,8 +215,9 @@ AGGTextRenderer::RenderString(const char* string,
|
||||
// by the x y location of the glyph along the base line,
|
||||
// it is therefor yet "untransformed".
|
||||
const agg::rect& r = glyph->bounds;
|
||||
BRect glyphBounds(r.x1 + x - 1, r.y1 + y - 1, r.x2 + x, r.y2 + y);
|
||||
// NOTE: "- 1" fixes some weird problem with the bounding box
|
||||
BRect glyphBounds(r.x1 + x, r.y1 + y - 1, r.x2 + x + 1, r.y2 + y);
|
||||
// NOTE: "- 1"/"+ 1" fixes some weird problem with the bounding box
|
||||
// might be a bug in AGG
|
||||
|
||||
// track bounding box
|
||||
if (glyphBounds.IsValid())
|
||||
|
Loading…
Reference in New Issue
Block a user