MacDecorator:

- Style cleanup and sync with DefaultDecorator to some extent
- Don't draw a titlebar and border around menus
- Allow the client to draw something inside the window by returning the correct BRegion. (still not perfect, but it is useable, at least)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34756 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2009-12-23 15:18:40 +00:00
parent e71b48d3c1
commit 541987c85d
2 changed files with 625 additions and 601 deletions
File diff suppressed because it is too large Load Diff
@@ -1,63 +1,88 @@
/*
Copyright 2009, Haiku.
Distributed under the terms of the MIT License.
*/
#ifndef _MAC_DECORATOR_H_ #ifndef _MAC_DECORATOR_H_
#define _MAC_DECORATOR_H_ #define _MAC_DECORATOR_H_
#include "Decorator.h" #include "Decorator.h"
#include "RGBColor.h" #include "RGBColor.h"
class MacDecorator: public Decorator { class MacDecorator: public Decorator {
public: public:
MacDecorator(DesktopSettings& settings, MacDecorator(DesktopSettings& settings,
BRect frame, BRect frame, window_look look,
window_look look, uint32 flags);
uint32 flags); ~MacDecorator();
~MacDecorator(void);
// SetTitle // void SetTitle(const char* string,
// SetLook // BRegion* updateRegion = NULL);
// SetFlags // void FontsChanged(DesktopSettings& settings,
// BRegion* updateRegion);
// void SetLook(DesktopSettings& settings,
// BRegion* updateRegion = NULL);
// void SetFlags(uint32 flags,
// BRegion* updateRegion = NULL);
//void MoveBy(float x, float y); void MoveBy(BPoint offset);
void MoveBy(BPoint pt); void ResizeBy(BPoint offset, BRegion* dirty);
// void ResizeBy(float x, float y);
void ResizeBy(BPoint pt, BRegion* diirty);
// SetTabLocation // SetTabLocation
// TabLocation // TabLocation
//
// SetSettings // SetSettings
// GetSettings // GetSettings
void Draw(BRect r);
void Draw(void); void Draw(BRect updateRect);
void Draw();
//GetSizeLimits //GetSizeLimits
void GetFootprint(BRegion *region);
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); void GetFootprint(BRegion *region);
protected: click_type Clicked(BPoint pt, int32 buttons,
void _DoLayout(void); int32 modifiers);
void _DrawFrame(BRect r);
void _DrawTab(BRect r);
void _DrawClose(BRect r);
void _DrawTitle(BRect r);
void _DrawZoom(BRect r);
void _DrawMinimize(BRect r);
// SetFocus
// void _SetColors(void);
void DrawBlendedRect(BRect r, bool down);
uint32 taboffset;
private:
RGBColor tab_col;
RGBColor button_highcol,button_lowcol;
RGBColor frame_highcol, frame_midcol, frame_lowcol, frame_lowercol;
RGBColor textcol,inactive_textcol;
uint64 solidhigh, solidlow;
BString fTruncatedTitle; protected:
int32 fTruncatedTitleLength; void _DoLayout();
bool slidetab; void _DrawFrame(BRect r);
int textoffset; void _DrawTab(BRect r);
float titlepixelwidth;
void _DrawClose(BRect r);
void _DrawTitle(BRect r);
void _DrawZoom(BRect r);
void _DrawMinimize(BRect r);
// void _SetFocus();
// void _SetColors();
private:
void _DrawBlendedRect(DrawingEngine* engine,
BRect r, bool down);
rgb_color fButtonHighColor;
rgb_color fButtonLowColor;
rgb_color fTabColor;
rgb_color frame_highcol;
rgb_color frame_midcol;
rgb_color frame_lowcol;
rgb_color frame_lowercol;
rgb_color fFocusTextColor;
rgb_color fNonFocusTextColor;
uint64 solidhigh, solidlow;
BString fTruncatedTitle;
int32 fTruncatedTitleLength;
int32 fBorderWidth;
bool slidetab;
int textoffset;
float titlepixelwidth;
}; };
#endif #endif