shared: add ColorItem from Gravity screensaver.

* A useful utility class that will also be used by Terminal later

Change-Id: I23020a401fbab7d4116df31f965ae61ecaf2a6cd
This commit is contained in:
Jessica Hamilton 2022-12-22 09:47:08 +13:00
parent 9f9688d841
commit a764093ca8
4 changed files with 7 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Copyright 2016-2022 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -20,7 +20,8 @@ public:
ColorItem(const char* string, rgb_color color);
virtual void DrawItem(BView* owner, BRect frame, bool complete);
virtual void SetColor(rgb_color color);
void SetColor(rgb_color color) { fColor = color; }
rgb_color Color() const { return fColor; }
private:
rgb_color fColor;

View File

@ -1,6 +1,7 @@
SubDir HAIKU_TOP src add-ons screen_savers gravity ;
UseBuildFeatureHeaders glu ;
UseBuildFeatureHeaders mesa ;
UsePrivateHeaders shared ;
# For GCC2
if $(TARGET_CC_IS_LEGACY_GCC_$(TARGET_PACKAGING_ARCH)) = 1 {
@ -10,7 +11,6 @@ if $(TARGET_CC_IS_LEGACY_GCC_$(TARGET_PACKAGING_ARCH)) = 1 {
AddResources Gravity : Gravity.rdef ;
local sources =
ColorItem.cpp
ConfigView.cpp
Gravity.cpp
GravitySource.cpp
@ -30,7 +30,7 @@ Includes [ FGristFiles $(sources) ] :
ScreenSaver Gravity :
$(sources)
:
be screensaver localestub [ TargetLibstdc++ ]
be screensaver shared localestub [ TargetLibstdc++ ]
[ BuildFeatureAttribute glu : library ]
[ BuildFeatureAttribute mesa : library ]
;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Copyright 2016-2022 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -87,10 +87,3 @@ ColorItem::DrawItem(BView* owner, BRect frame, bool complete)
owner->SetHighColor(highColor);
owner->SetLowColor(lowColor);
}
void
ColorItem::SetColor(rgb_color color)
{
fColor = color;
}

View File

@ -30,6 +30,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
AttributeUtilities.cpp
BitmapButton.cpp
CalendarView.cpp
ColorItem.cpp
ColorQuantizer.cpp
CommandPipe.cpp
DateTimeEdit.cpp