Tracker: style fixes to Utilities
This commit is contained in:
@@ -241,7 +241,6 @@ PeriodicUpdatePoses::DoPeriodicUpdate(bool forceRedraw)
|
||||
|
||||
PeriodicUpdatePoses gPeriodicUpdatePoses;
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
@@ -276,7 +275,7 @@ PoseInfo::PrintToStream()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - ExtendedPoseInfo
|
||||
|
||||
|
||||
size_t
|
||||
@@ -296,8 +295,7 @@ ExtendedPoseInfo::Size(int32 count)
|
||||
size_t
|
||||
ExtendedPoseInfo::SizeWithHeadroom() const
|
||||
{
|
||||
return sizeof(ExtendedPoseInfo) + (fNumFrames + 1)
|
||||
* sizeof(FrameLocation);
|
||||
return sizeof(ExtendedPoseInfo) + (fNumFrames + 1) * sizeof(FrameLocation);
|
||||
}
|
||||
|
||||
|
||||
@@ -394,7 +392,7 @@ ExtendedPoseInfo::PrintToStream()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - OffscreenBitmap
|
||||
|
||||
|
||||
OffscreenBitmap::OffscreenBitmap(BRect frame)
|
||||
@@ -475,7 +473,7 @@ OffscreenBitmap::View() const
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BPrivate functions
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
@@ -553,7 +551,7 @@ FadeRGBA32Vertical(uint32* bits, int32 width, int32 height, int32 from,
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - DraggableIcon
|
||||
|
||||
|
||||
DraggableIcon::DraggableIcon(BRect rect, const char* name,
|
||||
@@ -657,7 +655,7 @@ DraggableIcon::Draw(BRect)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - FlickerFreeStringView
|
||||
|
||||
|
||||
FlickerFreeStringView::FlickerFreeStringView(BRect bounds, const char* name,
|
||||
@@ -695,7 +693,7 @@ FlickerFreeStringView::Draw(BRect)
|
||||
|
||||
BView* offscreen = fBitmap->BeginUsing(bounds);
|
||||
|
||||
if (Parent()) {
|
||||
if (Parent() != NULL) {
|
||||
fViewColor = Parent()->ViewColor();
|
||||
fLowColor = Parent()->ViewColor();
|
||||
}
|
||||
@@ -714,7 +712,7 @@ FlickerFreeStringView::Draw(BRect)
|
||||
else
|
||||
offscreen->FillRect(bounds, B_SOLID_LOW);
|
||||
|
||||
if (Text()) {
|
||||
if (Text() != NULL) {
|
||||
BPoint loc;
|
||||
|
||||
font_height height;
|
||||
@@ -762,7 +760,7 @@ void
|
||||
FlickerFreeStringView::AttachedToWindow()
|
||||
{
|
||||
_inherited::AttachedToWindow();
|
||||
if (Parent()) {
|
||||
if (Parent() != NULL) {
|
||||
fViewColor = Parent()->ViewColor();
|
||||
fLowColor = Parent()->ViewColor();
|
||||
}
|
||||
@@ -793,7 +791,7 @@ FlickerFreeStringView::SetLowColor(rgb_color color)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - TitledSeparatorItem
|
||||
|
||||
|
||||
TitledSeparatorItem::TitledSeparatorItem(const char* label)
|
||||
@@ -925,7 +923,7 @@ TitledSeparatorItem::Draw()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - ShortcutFilter
|
||||
|
||||
|
||||
ShortcutFilter::ShortcutFilter(uint32 shortcutKey, uint32 shortcutModifier,
|
||||
@@ -970,12 +968,11 @@ ShortcutFilter::Filter(BMessage* message, BHandler**)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// #pragma mark - BPrivate functions
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
void
|
||||
EmbedUniqueVolumeInfo(BMessage* message, const BVolume* volume)
|
||||
{
|
||||
@@ -1522,6 +1519,9 @@ EachMenuItem(const BMenu* menu, bool recursive,
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - PositionPassingMenuItem
|
||||
|
||||
|
||||
PositionPassingMenuItem::PositionPassingMenuItem(const char* title,
|
||||
BMessage* message, char shortcut, uint32 modifiers)
|
||||
:
|
||||
@@ -1581,6 +1581,9 @@ PositionPassingMenuItem::Invoke(BMessage* message)
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - BPrivate functions
|
||||
|
||||
|
||||
bool
|
||||
BootedInSafeMode()
|
||||
{
|
||||
|
||||
@@ -94,11 +94,10 @@ extern bool gLocalizedNamePreferred;
|
||||
|
||||
// misc typedefs, constants and structs
|
||||
|
||||
class PeriodicUpdatePoses {
|
||||
// Periodically updated poses (ones with a volume space bar) register
|
||||
// themselfs in this global list. This way they can be iterated over instead
|
||||
// of sending around update messages.
|
||||
|
||||
class PeriodicUpdatePoses {
|
||||
public:
|
||||
PeriodicUpdatePoses();
|
||||
~PeriodicUpdatePoses();
|
||||
@@ -126,9 +125,9 @@ class PeriodicUpdatePoses {
|
||||
extern PeriodicUpdatePoses gPeriodicUpdatePoses;
|
||||
|
||||
|
||||
// PoseInfo is the structure that gets saved as attributes for every node on
|
||||
// disk, defining the node's position and visibility
|
||||
class PoseInfo {
|
||||
// PoseInfo is the structure that gets saved as attributes for every node
|
||||
// on disk, defining the node's position and visibility
|
||||
public:
|
||||
static void EndianSwap(void* castToThis);
|
||||
void PrintToStream();
|
||||
@@ -145,9 +144,9 @@ class PoseInfo {
|
||||
};
|
||||
|
||||
|
||||
class ExtendedPoseInfo {
|
||||
// extends PoseInfo adding workspace support; used for desktop
|
||||
// poses only
|
||||
class ExtendedPoseInfo {
|
||||
public:
|
||||
size_t Size() const;
|
||||
static size_t Size(int32);
|
||||
@@ -397,6 +396,7 @@ class ShortcutFilter : public BMessageFilter {
|
||||
BHandler* fTarget;
|
||||
};
|
||||
|
||||
|
||||
// iterates over all the refs in a message
|
||||
entry_ref* EachEntryRef(BMessage*, entry_ref* (*)(entry_ref*, void*),
|
||||
void* passThru = 0);
|
||||
@@ -447,6 +447,7 @@ bool operator!=(const rgb_color&, const rgb_color&);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
inline rgb_color
|
||||
Color(int32 r, int32 g, int32 b, int32 alpha = 255)
|
||||
{
|
||||
@@ -564,6 +565,7 @@ inline void PrintDirToStream(const BDirectory*, const char* = 0) {}
|
||||
#define WRITELOG(_ARGS_) \
|
||||
if (logFile == 0) \
|
||||
logFile = fopen("/var/log/tracker.log", "a+"); \
|
||||
\
|
||||
if (logFile != 0) { \
|
||||
thread_info info; \
|
||||
get_thread_info(find_thread(NULL), &info); \
|
||||
@@ -605,4 +607,5 @@ float ComputeTypeAheadScore(const char* text, const char* match,
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
|
||||
#endif // _UTILITIES_H
|
||||
|
||||
Reference in New Issue
Block a user