From 6f850dfd449d3e2976aa5107d15c440dd807c087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 27 Mar 2006 06:48:24 +0000 Subject: [PATCH] Build fixes for the R5/Dano target, no longer relies on the COMPILE_FOR_R5 macro. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16887 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/AttributeEditors.cpp | 10 ++++++---- src/apps/diskprobe/AttributeWindow.cpp | 6 +++--- src/apps/diskprobe/DataEditor.h | 6 +++++- src/apps/diskprobe/DataView.cpp | 6 +++++- src/apps/diskprobe/FindWindow.h | 12 +++++++----- src/apps/diskprobe/Jamfile | 15 +++------------ src/apps/diskprobe/OpenWindow.h | 9 +++++---- src/apps/diskprobe/ProbeView.cpp | 15 +++++++++------ src/apps/diskprobe/ProbeView.h | 9 +++++---- src/apps/diskprobe/ProbeWindow.cpp | 9 +++++---- 10 files changed, 53 insertions(+), 44 deletions(-) diff --git a/src/apps/diskprobe/AttributeEditors.cpp b/src/apps/diskprobe/AttributeEditors.cpp index ccbbba22fa..988d51a9cd 100644 --- a/src/apps/diskprobe/AttributeEditors.cpp +++ b/src/apps/diskprobe/AttributeEditors.cpp @@ -1,7 +1,7 @@ -/* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ +/* + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #include "AttributeEditors.h" @@ -21,6 +21,8 @@ #include #include +#include + static const uint32 kMsgValueChanged = 'vlch'; static const uint32 kMimeTypeItem = 'miti'; diff --git a/src/apps/diskprobe/AttributeWindow.cpp b/src/apps/diskprobe/AttributeWindow.cpp index 6e661d0e33..e296f7279b 100644 --- a/src/apps/diskprobe/AttributeWindow.cpp +++ b/src/apps/diskprobe/AttributeWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -153,7 +153,7 @@ EditorTabView::SetTypeEditorTab(BView *view) FrameResized(0, 0); -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS if (Window() != NULL) { // With R5's BTabView, calling select without being // attached to a window crashes... @@ -176,7 +176,7 @@ AttributeWindow::AttributeWindow(BRect _rect, entry_ref *ref, const char *attrib // Set alternative window title for devices char name[B_FILE_NAME_LENGTH]; -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS strncpy(name, ref->name, sizeof(name)); name[sizeof(name) - 1] = '\0'; #else diff --git a/src/apps/diskprobe/DataEditor.h b/src/apps/diskprobe/DataEditor.h index cace088965..3f57010643 100644 --- a/src/apps/diskprobe/DataEditor.h +++ b/src/apps/diskprobe/DataEditor.h @@ -1,5 +1,5 @@ /* - * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef DATA_EDITOR_H @@ -11,10 +11,14 @@ #include #include +class BHandler; +class BLooper; +class BMessenger; class DataChange; class StateWatcher; + class DataEditor : public BLocker { public: DataEditor(); diff --git a/src/apps/diskprobe/DataView.cpp b/src/apps/diskprobe/DataView.cpp index 03399fa611..72450cf5c7 100644 --- a/src/apps/diskprobe/DataView.cpp +++ b/src/apps/diskprobe/DataView.cpp @@ -15,6 +15,10 @@ #include +#ifndef __HAIKU__ +typedef uint32 addr_t; +#endif + static const uint32 kBlockSize = 16; static const uint32 kHorizontalSpace = 8; static const uint32 kVerticalSpace = 4; @@ -1246,7 +1250,7 @@ DataView::KeyDown(const char *bytes, int32 numBytes) c += 'A' - 'a'; const char *hexNumbers = "0123456789abcdef"; addr_t number; - if (data == NULL || (number = (addr_t)strchr(hexNumbers, c)) == NULL) + if (data == NULL || (number = (addr_t)strchr(hexNumbers, c)) == 0) break; SetSelection(fStart, fStart); diff --git a/src/apps/diskprobe/FindWindow.h b/src/apps/diskprobe/FindWindow.h index f1df1f2e58..ce8e2b5718 100644 --- a/src/apps/diskprobe/FindWindow.h +++ b/src/apps/diskprobe/FindWindow.h @@ -1,7 +1,7 @@ -/* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the Haiku License. -*/ +/* + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef FIND_WINDOW_H #define FIND_WINDOW_H @@ -9,8 +9,10 @@ #include #include -class FindTextView; class BCheckBox; +class BMenu; + +class FindTextView; enum find_mode { diff --git a/src/apps/diskprobe/Jamfile b/src/apps/diskprobe/Jamfile index d3375e413b..488280aa98 100644 --- a/src/apps/diskprobe/Jamfile +++ b/src/apps/diskprobe/Jamfile @@ -1,13 +1,8 @@ SubDir HAIKU_TOP src apps diskprobe ; -UsePrivateHeaders shared ; +SetSubDirSupportedPlatformsBeOSCompatible ; -if ! $(DANO_COMPATIBLE) { - local defines = COMPILE_FOR_R5 ; - defines = [ FDefines $(defines) ] ; - SubDirCcFlags $(defines) ; - SubDirC++Flags $(defines) ; -} +UsePrivateHeaders shared ; Application DiskProbe : DiskProbe.cpp @@ -20,10 +15,6 @@ Application DiskProbe : ProbeView.cpp OpenWindow.cpp FindWindow.cpp - : libbe.so libtracker.so libtranslation.so + : be tracker translation : DiskProbe.rdef ; - -if $(HAIKU_COMPATIBLE) { - LinkAgainst DiskProbe : libroot.so ; -} diff --git a/src/apps/diskprobe/OpenWindow.h b/src/apps/diskprobe/OpenWindow.h index 0555790b8a..2e91251b68 100644 --- a/src/apps/diskprobe/OpenWindow.h +++ b/src/apps/diskprobe/OpenWindow.h @@ -1,13 +1,14 @@ -/* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ +/* + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef OPEN_WINDOW_H #define OPEN_WINDOW_H #include +class BEntry; class BMenu; diff --git a/src/apps/diskprobe/ProbeView.cpp b/src/apps/diskprobe/ProbeView.cpp index 4c274c4008..4b3ec312af 100644 --- a/src/apps/diskprobe/ProbeView.cpp +++ b/src/apps/diskprobe/ProbeView.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -36,6 +36,7 @@ #include #include +#include #include @@ -302,7 +303,7 @@ PositionSlider::DrawBar() frame.top++; frame.left++; frame.right = ThumbFrame().left + ThumbFrame().Width() / 2; -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS if (IsEnabled()) view->SetHighColor(102, 152, 203); else @@ -320,7 +321,7 @@ PositionSlider::DrawBar() rgb_color cornerColor = tint_color(ViewColor(), B_DARKEN_1_TINT); rgb_color darkColor = tint_color(ViewColor(), B_DARKEN_3_TINT); -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS rgb_color shineColor = {255, 255, 255}; rgb_color shadowColor = {0, 0, 0}; #else @@ -389,6 +390,7 @@ void PositionSlider::SetPosition(off_t position) { position /= fBlockSize; + printf("value: %ld\n", int32(1.0 * kMaxSliderLimit * position / ((fSize - 1) / fBlockSize) + 0.5)); SetValue(int32(1.0 * kMaxSliderLimit * position / ((fSize - 1) / fBlockSize) + 0.5)); } @@ -611,7 +613,7 @@ HeaderView::Draw(BRect updateRect) { BRect rect = Bounds(); -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS SetHighColor(255, 255, 255); #else SetHighColor(ui_color(B_SHINE_COLOR)); @@ -900,7 +902,7 @@ TypeMenuItem::DrawContent() point.x = Frame().right - 4 - Menu()->StringWidth(fType.String()); point.y += fontHeight.ascent; -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS Menu()->SetDrawingMode(B_OP_ALPHA); #endif @@ -1105,7 +1107,8 @@ ProbeView::UpdateSizeLimits() } else Window()->SetSizeLimits(250, 32768, 200, 32768); -#ifdef COMPILE_FOR_R5 +#ifdef HAIKU_TARGET_PLATFORM_BEOS + // In Haiku and Dano, the window is resized automatically BRect bounds = Window()->Bounds(); float minWidth, maxWidth, minHeight, maxHeight; Window()->GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); diff --git a/src/apps/diskprobe/ProbeView.h b/src/apps/diskprobe/ProbeView.h index 3760232f64..5ab05afa43 100644 --- a/src/apps/diskprobe/ProbeView.h +++ b/src/apps/diskprobe/ProbeView.h @@ -1,7 +1,7 @@ -/* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ +/* + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef PROBE_VIEW_H #define PROBE_VIEW_H @@ -15,6 +15,7 @@ class BScrollView; class BMenuItem; +class BMenu; class HeaderView; class DataView; diff --git a/src/apps/diskprobe/ProbeWindow.cpp b/src/apps/diskprobe/ProbeWindow.cpp index 0a29ede70f..c62dd27fe8 100644 --- a/src/apps/diskprobe/ProbeWindow.cpp +++ b/src/apps/diskprobe/ProbeWindow.cpp @@ -1,13 +1,14 @@ -/* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ +/* + * Copyright 2004-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #include "ProbeWindow.h" #include "DiskProbe.h" #include +#include ProbeWindow::ProbeWindow(BRect rect, entry_ref *ref)