Unbroke the classic R5 decorator and updated sources to match the sources for DefaultDecorator before applying changes for its looks
Sweet cracker sandwich! I actually figured out something for a Jamfile on my own -- it took a while to figure out how to link against the app_server. :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20213 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,77 +1,109 @@
|
|||||||
//------------------------------------------------------------------------------
|
/*
|
||||||
// Copyright (c) 2001-2002, OpenBeOS
|
* Copyright 2001-2006, Haiku.
|
||||||
//
|
* Distributed under the terms of the MIT License.
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
*
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
* Authors:
|
||||||
// to deal in the Software without restriction, including without limitation
|
* DarkWyrm <[email protected]>
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
* Stephan Aßmus <[email protected]>
|
||||||
// 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:
|
#ifndef DEFAULT_DECORATOR_H
|
||||||
//
|
#define DEFAULT_DECORATOR_H
|
||||||
// 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: BeDecorator.h
|
|
||||||
// Author: DarkWyrm <[email protected]>
|
|
||||||
// Description: Fallback decorator for the app_server
|
|
||||||
//
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
#ifndef _DEFAULT_DECORATOR_H_
|
|
||||||
#define _DEFAULT_DECORATOR_H_
|
|
||||||
|
|
||||||
#include "Decorator.h"
|
#include "Decorator.h"
|
||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
|
|
||||||
class BeDecorator: public Decorator
|
class Desktop;
|
||||||
{
|
|
||||||
public:
|
|
||||||
BeDecorator(BRect frame, int32 wlook, int32 wfeel, int32 wflags);
|
|
||||||
~BeDecorator(void);
|
|
||||||
|
|
||||||
void MoveBy(float x, float y);
|
|
||||||
void MoveBy(BPoint pt);
|
|
||||||
void Draw(BRect r);
|
|
||||||
void Draw(void);
|
|
||||||
void GetFootprint(BRegion *region);
|
|
||||||
click_type Clicked(BPoint pt, int32 buttons, int32 modifiers);
|
|
||||||
BRect SlideTab(float dx, float dy=0);
|
|
||||||
protected:
|
|
||||||
void _DrawClose(BRect r);
|
|
||||||
void _DrawFrame(BRect r);
|
|
||||||
void _DrawTab(BRect r);
|
|
||||||
void _DrawTitle(BRect r);
|
|
||||||
void _DrawZoom(BRect r);
|
|
||||||
void _DoLayout(void);
|
|
||||||
void _SetFocus(void);
|
|
||||||
void _SetColors(void);
|
|
||||||
void DrawBlendedRect(BRect r, bool down);
|
|
||||||
uint32 taboffset;
|
|
||||||
|
|
||||||
RGBColor tab_highcol, tab_lowcol;
|
class BeDecorator: public Decorator {
|
||||||
RGBColor button_highcol, button_lowcol;
|
public:
|
||||||
RGBColor frame_highcol, frame_midcol, frame_lowcol, frame_highercol,
|
BeDecorator(DesktopSettings& settings,
|
||||||
frame_lowercol;
|
BRect frame,
|
||||||
RGBColor textcol;
|
window_look look,
|
||||||
|
uint32 flags);
|
||||||
|
virtual ~BeDecorator();
|
||||||
|
|
||||||
RGBColor *framecolors;
|
virtual void SetTitle(const char* string,
|
||||||
|
BRegion* updateRegion = NULL);
|
||||||
|
virtual void SetLook(DesktopSettings& settings,
|
||||||
|
window_look look,
|
||||||
|
BRegion* updateRegion = NULL);
|
||||||
|
virtual void SetFlags(uint32 flags,
|
||||||
|
BRegion* updateRegion = NULL);
|
||||||
|
|
||||||
// Individual rects for handling window frame rendering the proper way
|
virtual void MoveBy(BPoint offset);
|
||||||
BRect rightborder,leftborder,topborder,bottomborder;
|
virtual void ResizeBy(BPoint offset, BRegion* dirty);
|
||||||
uint64 solidhigh, solidlow;
|
|
||||||
|
|
||||||
int32 borderwidth;
|
virtual bool SetTabLocation(float location,
|
||||||
|
BRegion* updateRegion = NULL);
|
||||||
|
virtual float TabLocation() const
|
||||||
|
{ return (float)fTabOffset; }
|
||||||
|
|
||||||
bool slidetab;
|
virtual bool SetSettings(const BMessage& settings,
|
||||||
int textoffset;
|
BRegion* updateRegion = NULL);
|
||||||
float titlepixelwidth;
|
virtual bool GetSettings(BMessage* settings) const;
|
||||||
|
|
||||||
|
virtual void Draw(BRect updateRect);
|
||||||
|
virtual void Draw();
|
||||||
|
|
||||||
|
virtual void GetSizeLimits(int32* minWidth,
|
||||||
|
int32* minHeight,
|
||||||
|
int32* maxWidth,
|
||||||
|
int32* maxHeight) const;
|
||||||
|
|
||||||
|
virtual void GetFootprint(BRegion* region);
|
||||||
|
|
||||||
|
virtual click_type Clicked(BPoint pt, int32 buttons,
|
||||||
|
int32 modifiers);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
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;
|
||||||
|
|
||||||
|
// Individual rects for handling window frame
|
||||||
|
// rendering the proper way
|
||||||
|
BRect fRightBorder;
|
||||||
|
BRect fLeftBorder;
|
||||||
|
BRect fTopBorder;
|
||||||
|
BRect fBottomBorder;
|
||||||
|
|
||||||
|
int32 fBorderWidth;
|
||||||
|
|
||||||
|
uint32 fTabOffset;
|
||||||
|
float fTabLocation;
|
||||||
|
float fTextOffset;
|
||||||
|
|
||||||
|
float fMinTabSize;
|
||||||
|
float fMaxTabSize;
|
||||||
|
BString fTruncatedTitle;
|
||||||
|
int32 fTruncatedTitleLength;
|
||||||
|
|
||||||
|
bigtime_t fLastClicked;
|
||||||
|
bool fWasDoubleClick;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // DEFAULT_DECORATOR_H
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
SubDir HAIKU_TOP src add-ons decorators BeDecorator ;
|
SubDir HAIKU_TOP src add-ons decorators BeDecorator ;
|
||||||
|
|
||||||
UseFreeTypeHeaders ;
|
UseFreeTypeHeaders ;
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src servers app server ] ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src servers app ] ;
|
||||||
UsePrivateHeaders [ FDirName servers app ] ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src servers app drawing ] ;
|
||||||
|
UsePrivateHeaders app shared interface graphics ;
|
||||||
|
|
||||||
Addon BeDecorator : decorators :
|
Addon ClassicBe : decorators :
|
||||||
BeDecorator.cpp
|
BeDecorator.cpp
|
||||||
: false
|
: false
|
||||||
: be libappserver.so
|
: be [ FDirName $(HAIKU_ARCH_OBJECT_DIR) release servers app app_server ]
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user