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:
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -20,7 +20,8 @@ public:
|
|||||||
ColorItem(const char* string, rgb_color color);
|
ColorItem(const char* string, rgb_color color);
|
||||||
|
|
||||||
virtual void DrawItem(BView* owner, BRect frame, bool complete);
|
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:
|
private:
|
||||||
rgb_color fColor;
|
rgb_color fColor;
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
SubDir HAIKU_TOP src add-ons screen_savers gravity ;
|
SubDir HAIKU_TOP src add-ons screen_savers gravity ;
|
||||||
UseBuildFeatureHeaders glu ;
|
UseBuildFeatureHeaders glu ;
|
||||||
UseBuildFeatureHeaders mesa ;
|
UseBuildFeatureHeaders mesa ;
|
||||||
|
UsePrivateHeaders shared ;
|
||||||
|
|
||||||
# For GCC2
|
# For GCC2
|
||||||
if $(TARGET_CC_IS_LEGACY_GCC_$(TARGET_PACKAGING_ARCH)) = 1 {
|
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 ;
|
AddResources Gravity : Gravity.rdef ;
|
||||||
|
|
||||||
local sources =
|
local sources =
|
||||||
ColorItem.cpp
|
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
Gravity.cpp
|
Gravity.cpp
|
||||||
GravitySource.cpp
|
GravitySource.cpp
|
||||||
@@ -30,7 +30,7 @@ Includes [ FGristFiles $(sources) ] :
|
|||||||
ScreenSaver Gravity :
|
ScreenSaver Gravity :
|
||||||
$(sources)
|
$(sources)
|
||||||
:
|
:
|
||||||
be screensaver localestub [ TargetLibstdc++ ]
|
be screensaver shared localestub [ TargetLibstdc++ ]
|
||||||
[ BuildFeatureAttribute glu : library ]
|
[ BuildFeatureAttribute glu : library ]
|
||||||
[ BuildFeatureAttribute mesa : library ]
|
[ BuildFeatureAttribute mesa : library ]
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -87,10 +87,3 @@ ColorItem::DrawItem(BView* owner, BRect frame, bool complete)
|
|||||||
owner->SetHighColor(highColor);
|
owner->SetHighColor(highColor);
|
||||||
owner->SetLowColor(lowColor);
|
owner->SetLowColor(lowColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
ColorItem::SetColor(rgb_color color)
|
|
||||||
{
|
|
||||||
fColor = color;
|
|
||||||
}
|
|
||||||
@@ -30,6 +30,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
|||||||
AttributeUtilities.cpp
|
AttributeUtilities.cpp
|
||||||
BitmapButton.cpp
|
BitmapButton.cpp
|
||||||
CalendarView.cpp
|
CalendarView.cpp
|
||||||
|
ColorItem.cpp
|
||||||
ColorQuantizer.cpp
|
ColorQuantizer.cpp
|
||||||
CommandPipe.cpp
|
CommandPipe.cpp
|
||||||
DateTimeEdit.cpp
|
DateTimeEdit.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user