DiskProbe: Clean up old compiler pragmas for BeOS and Dano.

Change-Id: I0c8a4ce6c8d1c8994e2f89a4d35db3ac0ae03117
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4714
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Mikael Konradsson
2022-06-28 16:48:33 +00:00
committed by waddlesplash
parent 63816858af
commit c5702ad4e8
2 changed files with 3 additions and 111 deletions
-96
View File
@@ -50,13 +50,6 @@
#include "TypeEditors.h"
#ifndef __HAIKU__
# define DRAW_SLIDER_BAR
// if this is defined, the standard slider bar is replaced with
// one that looks exactly like the one in the original DiskProbe
// (even in Dano/Zeta)
#endif
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "ProbeView"
@@ -97,10 +90,6 @@ public:
uint32 blockSize);
virtual ~PositionSlider();
#ifdef DRAW_SLIDER_BAR
virtual void DrawBar();
#endif
off_t Position() const;
off_t Size() const { return fSize; }
uint32 BlockSize() const { return fBlockSize; }
@@ -282,22 +271,14 @@ void
IconView::UpdateIcon()
{
if (fBitmap == NULL)
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
fBitmap = new BBitmap(BRect(0, 0, 31, 31), B_RGBA32);
#else
fBitmap = new BBitmap(BRect(0, 0, 31, 31), B_CMAP8);
#endif
if (fBitmap != NULL) {
status_t status = B_ERROR;
if (fIsDevice) {
BPath path(&fRef);
#ifdef __HAIKU__
status = get_device_icon(path.Path(), fBitmap, B_LARGE_ICON);
#else
status = get_device_icon(path.Path(), fBitmap->Bits(), B_LARGE_ICON);
#endif
} else
status = BNodeInfo::GetTrackerIcon(&fRef, fBitmap);
@@ -330,10 +311,8 @@ PositionSlider::PositionSlider(const char* name, BMessage* message,
{
Reset();
#ifndef DRAW_SLIDER_BAR
rgb_color color = ui_color(B_CONTROL_HIGHLIGHT_COLOR);
UseFillColor(true, &color);
#endif
}
@@ -342,77 +321,6 @@ PositionSlider::~PositionSlider()
}
#ifdef DRAW_SLIDER_BAR
void
PositionSlider::DrawBar()
{
BView* view = OffscreenView();
BRect barFrame = BarFrame();
BRect frame = barFrame.InsetByCopy(1, 1);
frame.top++;
frame.left++;
frame.right = ThumbFrame().left + ThumbFrame().Width() / 2;
#ifdef HAIKU_TARGET_PLATFORM_BEOS
if (IsEnabled())
view->SetHighColor(102, 152, 203);
else
view->SetHighColor(92, 102, 160);
#else
view->SetHighColor(IsEnabled() ? ui_color(B_CONTROL_HIGHLIGHT_COLOR)
: tint_color(ui_color(B_CONTROL_HIGHLIGHT_COLOR), B_DARKEN_1_TINT));
#endif
view->FillRect(frame);
frame.left = frame.right + 1;
frame.right = barFrame.right - 1;
view->SetHighColor(tint_color(ViewColor(), IsEnabled() ? B_DARKEN_1_TINT : B_LIGHTEN_1_TINT));
view->FillRect(frame);
rgb_color cornerColor = tint_color(ViewColor(), B_DARKEN_1_TINT);
rgb_color darkColor = tint_color(ViewColor(), B_DARKEN_3_TINT);
#ifdef HAIKU_TARGET_PLATFORM_BEOS
rgb_color shineColor = {255, 255, 255};
rgb_color shadowColor = {0, 0, 0};
#else
rgb_color shineColor = ui_color(B_SHINE_COLOR);
rgb_color shadowColor = ui_color(B_SHADOW_COLOR);
#endif
if (!IsEnabled()) {
darkColor = tint_color(ViewColor(), B_DARKEN_1_TINT);
shineColor = tint_color(shineColor, B_DARKEN_2_TINT);
shadowColor = tint_color(shadowColor, B_LIGHTEN_2_TINT);
}
view->BeginLineArray(9);
// the corners
view->AddLine(barFrame.LeftTop(), barFrame.LeftTop(), cornerColor);
view->AddLine(barFrame.LeftBottom(), barFrame.LeftBottom(), cornerColor);
view->AddLine(barFrame.RightTop(), barFrame.RightTop(), cornerColor);
// the edges
view->AddLine(BPoint(barFrame.left, barFrame.top + 1),
BPoint(barFrame.left, barFrame.bottom - 1), darkColor);
view->AddLine(BPoint(barFrame.right, barFrame.top + 1),
BPoint(barFrame.right, barFrame.bottom), shineColor);
barFrame.left++;
barFrame.right--;
view->AddLine(barFrame.LeftTop(), barFrame.RightTop(), darkColor);
view->AddLine(barFrame.LeftBottom(), barFrame.RightBottom(), shineColor);
// the inner edges
barFrame.top++;
view->AddLine(barFrame.LeftTop(), barFrame.RightTop(), shadowColor);
view->AddLine(BPoint(barFrame.left, barFrame.top + 1),
BPoint(barFrame.left, barFrame.bottom - 1), shadowColor);
view->EndLineArray();
}
#endif // DRAW_SLIDER_BAR
void
PositionSlider::Reset()
{
@@ -955,10 +863,6 @@ TypeMenuItem::DrawContent()
point.x = Frame().right - 4 - Menu()->StringWidth(fType.String());
point.y += fontHeight.ascent;
#ifdef HAIKU_TARGET_PLATFORM_BEOS
Menu()->SetDrawingMode(B_OP_ALPHA);
#endif
Menu()->DrawString(fType.String(), point);
}
+3 -15
View File
@@ -853,11 +853,10 @@ ImageView::ImageView(DataEditor &editor)
{
if (editor.Type() == B_MINI_ICON_TYPE
|| editor.Type() == B_LARGE_ICON_TYPE
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|| editor.Type() == B_VECTOR_ICON_TYPE
#endif
)
|| editor.Type() == B_VECTOR_ICON_TYPE) {
SetName(B_TRANSLATE("Icon view"));
}
fDescriptionView = new BStringView("",
B_TRANSLATE_COMMENT("Could not read image", "Image means "
@@ -979,7 +978,6 @@ ImageView::_UpdateImage()
fEditor.SetViewSize(viewSize);
return;
}
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
if (fBitmap != NULL && fEditor.Type() == B_VECTOR_ICON_TYPE
&& fScaleSlider->Value() * 8 - 1 == fBitmap->Bounds().Width()) {
if (BIconUtils::GetVectorIcon((const uint8 *)data,
@@ -988,7 +986,6 @@ ImageView::_UpdateImage()
return;
}
}
#endif
delete fBitmap;
fBitmap = NULL;
@@ -1004,7 +1001,6 @@ ImageView::_UpdateImage()
if (fBitmap->InitCheck() == B_OK)
fBitmap->SetBits(data, fEditor.FileSize(), 0, B_CMAP8);
break;
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
case B_VECTOR_ICON_TYPE:
fBitmap = new BBitmap(BRect(0, 0, fScaleSlider->Value() * 8 - 1,
fScaleSlider->Value() * 8 - 1), B_RGB32);
@@ -1015,7 +1011,6 @@ ImageView::_UpdateImage()
fBitmap = NULL;
}
break;
#endif
case B_PNG_FORMAT:
{
BMemoryIO stream(data, fEditor.FileSize());
@@ -1047,9 +1042,7 @@ ImageView::_UpdateImage()
switch (fEditor.Type()) {
case B_MINI_ICON_TYPE:
case B_LARGE_ICON_TYPE:
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
case B_VECTOR_ICON_TYPE:
#endif
type = B_TRANSLATE("Icon");
break;
case B_PNG_FORMAT:
@@ -1177,9 +1170,6 @@ MessageView::SetTo(BMessage& message)
type_code type;
int32 count;
#ifdef HAIKU_TARGET_PLATFORM_DANO
const
#endif
char* name;
for (int32 i = 0; message.GetInfo(B_ANY_TYPE, i, &name, &type, &count)
== B_OK; i++) {
@@ -1327,9 +1317,7 @@ GetTypeEditorFor(BRect rect, DataEditor& editor)
case B_MINI_ICON_TYPE:
case B_LARGE_ICON_TYPE:
case B_PNG_FORMAT:
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
case B_VECTOR_ICON_TYPE:
#endif
return new ImageView(editor);
}