From 66133bb5d9edb26a18600b12199ab3b9f8104b10 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Mon, 20 Sep 2004 22:46:37 +0000 Subject: [PATCH] s/OpenBeOS/Haiku/ Style fixes for ServerBitmap and ServerCursor Assignment operator for GraphicsBuffer git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9018 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/servers/app/BitmapManager.h | 2 +- headers/private/servers/app/ColorSet.h | 2 +- headers/private/servers/app/Decorator.h | 2 +- headers/private/servers/app/DisplayDriver.h | 26 +++++--- headers/private/servers/app/DisplaySupport.h | 35 ++++++++-- headers/private/servers/app/FontFamily.h | 2 +- headers/private/servers/app/FontServer.h | 2 +- headers/private/servers/app/GraphicsBuffer.h | 6 +- headers/private/servers/app/IPoint.h | 9 ++- headers/private/servers/app/LayerData.h | 4 +- headers/private/servers/app/PatternHandler.h | 2 +- headers/private/servers/app/PixelRenderer.h | 2 +- headers/private/servers/app/RGBColor.h | 2 +- headers/private/servers/app/RectUtils.h | 2 +- headers/private/servers/app/ServerBitmap.h | 70 ++++++++++---------- headers/private/servers/app/ServerConfig.h | 2 +- headers/private/servers/app/ServerCursor.h | 13 ++-- headers/private/servers/app/ServerFont.h | 2 +- headers/private/servers/app/SharedObject.h | 2 +- headers/private/servers/app/SystemPalette.h | 2 +- headers/private/servers/app/TokenHandler.h | 2 +- 21 files changed, 115 insertions(+), 76 deletions(-) diff --git a/headers/private/servers/app/BitmapManager.h b/headers/private/servers/app/BitmapManager.h index df7ea24b15..d6ab320095 100644 --- a/headers/private/servers/app/BitmapManager.h +++ b/headers/private/servers/app/BitmapManager.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/ColorSet.h b/headers/private/servers/app/ColorSet.h index 0e6d6b1004..3191bac13d 100644 --- a/headers/private/servers/app/ColorSet.h +++ b/headers/private/servers/app/ColorSet.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/Decorator.h b/headers/private/servers/app/Decorator.h index ffe51f728c..86fd054285 100644 --- a/headers/private/servers/app/Decorator.h +++ b/headers/private/servers/app/Decorator.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/DisplayDriver.h b/headers/private/servers/app/DisplayDriver.h index 2c5472bec8..fe17f257b7 100644 --- a/headers/private/servers/app/DisplayDriver.h +++ b/headers/private/servers/app/DisplayDriver.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -41,6 +41,7 @@ #include "RGBColor.h" #include #include "PatternHandler.h" +#include "CursorHandler.h" #include "DisplaySupport.h" #include "LayerData.h" #include "ServerBitmap.h" @@ -216,6 +217,7 @@ public: protected: friend class Layer; friend class WinBorder; +friend CursorHandler; ServerCursor *_GetCursor(void); virtual void HLinePatternThick(int32 x1, int32 x2, int32 y); @@ -262,19 +264,21 @@ friend class WinBorder; int fLineThickness; BLocker *_locker; - bool _is_cursor_hidden; - bool _is_cursor_obscured; +// bool _is_cursor_hidden; +// bool _is_cursor_obscured; - ServerCursor *_cursor; - UtilityBitmap *_cursorsave; +// ServerCursor *_cursor; +// UtilityBitmap *_cursorsave; - uint32 _dpms_state; - uint32 _dpms_caps; - accelerant_device_info _acc_device_info; - display_mode _displaymode; + uint32 fDPMSState; + uint32 fDPMSCaps; + accelerant_device_info fAccDeviceInfo; + display_mode fDisplayMode; - BRect oldcursorframe, cursorframe, saveframe; - DrawData _drawdata; + CursorHandler *fCursorHandler; + +// BRect oldcursorframe, cursorframe, saveframe; + DrawData fDrawData; }; #endif diff --git a/headers/private/servers/app/DisplaySupport.h b/headers/private/servers/app/DisplaySupport.h index 5f36b9e309..267d22f094 100644 --- a/headers/private/servers/app/DisplaySupport.h +++ b/headers/private/servers/app/DisplaySupport.h @@ -1,3 +1,30 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2001-2002, Haiku, Inc. +// +// 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: DisplaySupport.h +// Author: DarkWyrm +// Gabe Yoder +// Description: Support classes for the DisplayDriver class +// +//------------------------------------------------------------------------------ #ifndef DDRIVER_SUPPORT_H_ #define DDRIVER_SUPPORT_H_ @@ -117,12 +144,12 @@ class FBBitmap : public ServerBitmap public: FBBitmap(void) : ServerBitmap(BRect(0,0,0,0),B_NO_COLOR_SPACE,0) { } ~FBBitmap(void) { } - void SetBytesPerRow(const int32 &bpr) { _bytesperrow=bpr; } - void SetSpace(const color_space &space) { _space=space; } + void SetBytesPerRow(const int32 &bpr) { fBytesPerRow=bpr; } + void SetSpace(const color_space &space) { fSpace=space; } // WARNING: - for some reason ServerBitmap adds 1 to the width and height. We do that also. - void SetSize(const int32 &w, const int32 &h) { _width=w+1; _height=h+1; } - void SetBuffer(void *ptr) { _buffer=(uint8*)ptr; } + void SetSize(const int32 &w, const int32 &h) { fWidth=w+1; fHeight=h+1; } + void SetBuffer(void *ptr) { fBuffer=(uint8*)ptr; } void SetBitsPerPixel(color_space space,int32 bytesperline) { _HandleSpace(space,bytesperline); } void ShallowCopy(const FBBitmap *from) { diff --git a/headers/private/servers/app/FontFamily.h b/headers/private/servers/app/FontFamily.h index 935c612962..81eb0cabe7 100644 --- a/headers/private/servers/app/FontFamily.h +++ b/headers/private/servers/app/FontFamily.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/FontServer.h b/headers/private/servers/app/FontServer.h index 29f0ec04d8..ca51f34d3b 100644 --- a/headers/private/servers/app/FontServer.h +++ b/headers/private/servers/app/FontServer.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/GraphicsBuffer.h b/headers/private/servers/app/GraphicsBuffer.h index 28890afd1c..8b5fc321c7 100644 --- a/headers/private/servers/app/GraphicsBuffer.h +++ b/headers/private/servers/app/GraphicsBuffer.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -34,6 +34,7 @@ class GraphicsBuffer { public: GraphicsBuffer(uint8 *buffer, uint32 width, uint32 height, uint32 rowbytes); + GraphicsBuffer(const GraphicsBuffer &buffer); ~GraphicsBuffer(); void SetTo(uint8 *buffer, uint32 width, uint32 height, uint32 rowbytes); @@ -46,7 +47,8 @@ public: uint32 Height(void) const { return fHeight; } uint32 BytesPerRow(void) const { return fBytesPerRow; } - + GraphicsBuffer &operator=(const GraphicsBuffer &buf); + private: uint32 fWidth; diff --git a/headers/private/servers/app/IPoint.h b/headers/private/servers/app/IPoint.h index b7cedbc90e..1c33f2dc94 100644 --- a/headers/private/servers/app/IPoint.h +++ b/headers/private/servers/app/IPoint.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -47,6 +47,9 @@ public: IPoint &operator=(const IPoint &p); IPoint &operator=(const BPoint &p); + + BPoint AsBPoint(void); + void Set(int32 X, int32 Y); void ConstrainTo(BRect r); @@ -112,5 +115,9 @@ inline void IPoint::Set(int32 X, int32 Y) y = Y; } //------------------------------------------------------------------------------ +inline BPoint IPoint::AsBPoint(void) +{ + return BPoint(x,y); +} #endif diff --git a/headers/private/servers/app/LayerData.h b/headers/private/servers/app/LayerData.h index 813c897944..b89465832c 100644 --- a/headers/private/servers/app/LayerData.h +++ b/headers/private/servers/app/LayerData.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -50,7 +50,7 @@ public: DrawData(const DrawData &data); virtual ~DrawData(void); DrawData& operator=(const DrawData &from); - // uncomment when needed. Also implement it! :-) + // TODO: uncomment and implement DrawData::PrintToStream when needed. // virtual void PrintToStream() const; BPoint penlocation; diff --git a/headers/private/servers/app/PatternHandler.h b/headers/private/servers/app/PatternHandler.h index 41cb6d31f0..989c6bb334 100644 --- a/headers/private/servers/app/PatternHandler.h +++ b/headers/private/servers/app/PatternHandler.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/PixelRenderer.h b/headers/private/servers/app/PixelRenderer.h index 5bf066bd51..91b3ce3146 100644 --- a/headers/private/servers/app/PixelRenderer.h +++ b/headers/private/servers/app/PixelRenderer.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/RGBColor.h b/headers/private/servers/app/RGBColor.h index 92bf7713d3..577bdba03d 100644 --- a/headers/private/servers/app/RGBColor.h +++ b/headers/private/servers/app/RGBColor.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/RectUtils.h b/headers/private/servers/app/RectUtils.h index 41626287ad..85c0caf717 100644 --- a/headers/private/servers/app/RectUtils.h +++ b/headers/private/servers/app/RectUtils.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/ServerBitmap.h b/headers/private/servers/app/ServerBitmap.h index f5f218fdf7..f89df8fc62 100644 --- a/headers/private/servers/app/ServerBitmap.h +++ b/headers/private/servers/app/ServerBitmap.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -55,38 +55,38 @@ public: - \c B_ERROR if the buffer is not allocated in an area - area_id for the buffer */ - area_id Area(void) const { return _area; } + area_id Area(void) const { return fArea; } // Returns the offset of the bitmap in its area - int32 AreaOffset(void) { return _offset; } + int32 AreaOffset(void) { return fOffset; } //! Returns the bitmap's buffer - uint8 *Bits(void) const { return _buffer; } + uint8 *Bits(void) const { return fBuffer; } uint32 BitsLength(void) const; //! Returns the size of the bitmap - BRect Bounds() const { return BRect(0,0,_width-1,_height-1); }; + BRect Bounds() const { return BRect(0,0,fWidth-1,fHeight-1); }; //! Returns the number of bytes in each row, including padding - int32 BytesPerRow(void) const { return _bytesperrow; }; + int32 BytesPerRow(void) const { return fBytesPerRow; }; //! Returns the pixel color depth - uint8 BitsPerPixel(void) const { return _bpp; } + uint8 BitsPerPixel(void) const { return fBitsPerPixel; } //! Returns the color space of the bitmap - color_space ColorSpace(void) const { return _space; } + color_space ColorSpace(void) const { return fSpace; } //! Returns the width of the bitmap - int32 Width(void) const { return _width; } + int32 Width(void) const { return fWidth; } //! Returns the height of the bitmap - int32 Height(void) const { return _height; } + int32 Height(void) const { return fHeight; } //! Returns whether the bitmap is valid - bool InitCheck(void) const { return _initialized; } + bool InitCheck(void) const { return fInitialized; } //! Returns the identifier token for the bitmap - int32 Token(void) const { return _token; } + int32 Token(void) const { return fToken; } //! Does a shallow copy of the bitmap passed to it void ShallowCopy(const ServerBitmap *from) @@ -94,17 +94,17 @@ public: if(!from) return; - _initialized=from->_initialized; - _area=from->_area; - _buffer=from->_buffer; - _width=from->_width; - _height=from->_height; - _bytesperrow=from->_bytesperrow; - _space=from->_space; - _flags=from->_flags; - _bpp=from->_bpp; - _token=from->_token; - _offset=from->_offset; + fInitialized=from->fInitialized; + fArea=from->fArea; + fBuffer=from->fBuffer; + fWidth=from->fWidth; + fHeight=from->fHeight; + fBytesPerRow=from->fBytesPerRow; + fSpace=from->fSpace; + fFlags=from->fFlags; + fBitsPerPixel=from->fBitsPerPixel; + fToken=from->fToken; + fOffset=from->fOffset; } protected: @@ -112,26 +112,26 @@ protected: friend class PicturePlayer; //! Internal function used by the BitmapManager. - void _SetArea(area_id ID) { _area=ID; } + void _SetArea(area_id ID) { fArea=ID; } //! Internal function used by the BitmapManager. - void _SetBuffer(void *ptr) { _buffer=(uint8*)ptr; } + void _SetBuffer(void *ptr) { fBuffer=(uint8*)ptr; } void _AllocateBuffer(void); void _FreeBuffer(void); void _HandleSpace(color_space space, int32 bytesperline=-1); - bool _initialized; - area_id _area; - uint8 *_buffer; + bool fInitialized; + area_id fArea; + uint8 *fBuffer; - int32 _width,_height; - int32 _bytesperrow; - color_space _space; - int32 _flags; - int _bpp; - int32 _token; - int32 _offset; + int32 fWidth,fHeight; + int32 fBytesPerRow; + color_space fSpace; + int32 fFlags; + int fBitsPerPixel; + int32 fToken; + int32 fOffset; }; class UtilityBitmap : public ServerBitmap diff --git a/headers/private/servers/app/ServerConfig.h b/headers/private/servers/app/ServerConfig.h index ecc70261a6..d591760058 100644 --- a/headers/private/servers/app/ServerConfig.h +++ b/headers/private/servers/app/ServerConfig.h @@ -44,7 +44,7 @@ // This is the application signature of our app_server when running as a // regular application. When running as the app_server, this is not used. -#define SERVER_SIGNATURE "application/x-vnd.OpenBeOS-app-server" +#define SERVER_SIGNATURE "application/x-vnd.haiku-app-server" // Directory for all app_server-related settings. Must include ending slash. #define SERVER_SETTINGS_DIR "/boot/home/config/settings/app_server/" diff --git a/headers/private/servers/app/ServerCursor.h b/headers/private/servers/app/ServerCursor.h index ccb3a5ed3e..e1ebd4e5b2 100644 --- a/headers/private/servers/app/ServerCursor.h +++ b/headers/private/servers/app/ServerCursor.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -52,19 +52,18 @@ public: ~ServerCursor(void); //! Returns the cursor's hot spot - BPoint GetHotSpot(void) { return _hotspot; } + BPoint GetHotSpot(void) { return fHotSpot; } void SetHotSpot(BPoint pt); - const char *GetAppSignature(void) { return _app_signature.String(); } + const char *GetAppSignature(void) { return fAppSignature.String(); } void SetAppSignature(const char *signature); //! Returns the cursor's ID - int32 ID(void) { return _token; } + int32 ID(void) { return fToken; } private: friend class CursorManager; - BPoint _hotspot; - BString _app_signature; - int32 _token; + BPoint fHotSpot; + BString fAppSignature; }; #endif diff --git a/headers/private/servers/app/ServerFont.h b/headers/private/servers/app/ServerFont.h index a3d804429f..1cc28e6523 100644 --- a/headers/private/servers/app/ServerFont.h +++ b/headers/private/servers/app/ServerFont.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/SharedObject.h b/headers/private/servers/app/SharedObject.h index 4057a609a4..fec4fcd391 100644 --- a/headers/private/servers/app/SharedObject.h +++ b/headers/private/servers/app/SharedObject.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/SystemPalette.h b/headers/private/servers/app/SystemPalette.h index e8a79da60f..25ee6c8354 100644 --- a/headers/private/servers/app/SystemPalette.h +++ b/headers/private/servers/app/SystemPalette.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), diff --git a/headers/private/servers/app/TokenHandler.h b/headers/private/servers/app/TokenHandler.h index e9cef77675..b984614a90 100644 --- a/headers/private/servers/app/TokenHandler.h +++ b/headers/private/servers/app/TokenHandler.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2002, Haiku // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"),