2003-02-15 18:28:22 +03:00
|
|
|
//------------------------------------------------------------------------------
|
2004-09-21 02:50:02 +04:00
|
|
|
// Copyright (c) 2001-2002, Haiku, Inc.
|
2003-02-15 18:28:22 +03:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// File Name: DefaultDecorator.h
|
|
|
|
// Author: DarkWyrm <bpmagic@columbus.rr.com>
|
|
|
|
// Description: Fallback decorator for the app_server
|
|
|
|
//
|
|
|
|
//------------------------------------------------------------------------------
|
2003-02-13 05:13:55 +03:00
|
|
|
#ifndef _DEFAULT_DECORATOR_H_
|
|
|
|
#define _DEFAULT_DECORATOR_H_
|
|
|
|
|
|
|
|
#include "Decorator.h"
|
|
|
|
#include <Region.h>
|
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
class DefaultDecorator: public Decorator {
|
|
|
|
public:
|
|
|
|
DefaultDecorator(BRect frame,
|
|
|
|
int32 look,
|
|
|
|
int32 feel,
|
|
|
|
int32 flags);
|
|
|
|
virtual ~DefaultDecorator();
|
2003-02-13 05:13:55 +03:00
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
virtual void MoveBy(float x, float y);
|
|
|
|
virtual void MoveBy(BPoint pt);
|
|
|
|
virtual void ResizeBy(float x, float y);
|
|
|
|
virtual void ResizeBy(BPoint pt);
|
2004-05-16 23:17:34 +04:00
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
virtual void Draw(BRect r);
|
|
|
|
virtual void Draw();
|
|
|
|
|
|
|
|
virtual void GetSizeLimits(float* minWidth, float* minHeight,
|
|
|
|
float* maxWidth, float* maxHeight) const;
|
|
|
|
|
|
|
|
virtual void GetFootprint(BRegion *region);
|
|
|
|
|
|
|
|
virtual BRect SlideTab(float dx, float dy);
|
|
|
|
virtual click_type Clicked(BPoint pt, int32 buttons,
|
|
|
|
int32 modifiers);
|
2004-03-28 19:03:15 +04:00
|
|
|
|
2003-02-13 05:13:55 +03:00
|
|
|
protected:
|
2005-06-03 23:50:30 +04:00
|
|
|
virtual void _DoLayout();
|
|
|
|
|
|
|
|
virtual void _DrawFrame(BRect r);
|
|
|
|
virtual void _DrawTab(BRect r);
|
|
|
|
|
|
|
|
virtual void _DrawClose(BRect r);
|
|
|
|
virtual void _DrawTitle(BRect r);
|
|
|
|
virtual void _DrawZoom(BRect r);
|
|
|
|
|
|
|
|
virtual void _SetFocus();
|
|
|
|
virtual void _SetColors();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void _DrawBlendedRect(BRect r, bool down);
|
|
|
|
void _GetButtonSizeAndOffset(const BRect& tabRect,
|
|
|
|
float* offset, float*size) const;
|
|
|
|
void _LayoutTabItems(const BRect& tabRect);
|
|
|
|
|
|
|
|
RGBColor fButtonHighColor;
|
|
|
|
RGBColor fButtonLowColor;
|
|
|
|
RGBColor fTextColor;
|
|
|
|
RGBColor fTabColor;
|
|
|
|
|
|
|
|
RGBColor* fFrameColors;
|
2003-07-24 23:38:24 +04:00
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
// Individual rects for handling window frame
|
|
|
|
// rendering the proper way
|
|
|
|
BRect fRightBorder;
|
|
|
|
BRect fLeftBorder;
|
|
|
|
BRect fTopBorder;
|
|
|
|
BRect fBottomBorder;
|
|
|
|
|
|
|
|
int32 fBorderWidth;
|
|
|
|
|
|
|
|
// bool fSlidingTab;
|
|
|
|
// uint32 fTabOffset;
|
|
|
|
float fTextOffset;
|
2003-02-13 05:13:55 +03:00
|
|
|
|
2005-06-03 23:50:30 +04:00
|
|
|
float fMinTabWidth;
|
|
|
|
float fMaxTabWidth;
|
|
|
|
BString fTruncatedTitle;
|
|
|
|
int32 fTruncatedTitleLength;
|
2003-02-13 05:13:55 +03:00
|
|
|
};
|
|
|
|
|
2003-04-14 05:56:41 +04:00
|
|
|
#endif
|