2 * Copyright (c) 2008 Stephan Aßmus <superstippi@gmx.de>.
3 * Copyright (c) 2009 Philippe Saint-Pierre, stpere@gmail.com
4 * All rights reserved. Distributed under the terms of the MIT license.
6 * Copyright (c) 1999 Mike Steed. You are free to use and distribute this software
7 * as long as it is accompanied by it's documentation and this copyright notice.
8 * The software comes with no warranty, etc.
35 class PieView
: public BView
{
37 PieView(BVolume
* volume
);
40 virtual void AttachedToWindow();
41 virtual void MessageReceived(BMessage
* message
);
42 virtual void MouseDown(BPoint where
);
43 virtual void MouseUp(BPoint where
);
44 virtual void MouseMoved(BPoint where
, uint32 transit
,
45 const BMessage
* dragMessage
);
46 virtual void Draw(BRect updateRect
);
47 void SetPath(BPath path
);
50 void _ShowVolume(BVolume
* volume
);
51 void _DrawProgressBar(BRect updateRect
);
52 void _DrawPieChart(BRect updateRect
);
53 float _DrawDirectory(BRect b
, FileInfo
* info
,
54 float parentSpan
, float beginAngle
,
55 int colorIdx
, int level
);
56 FileInfo
* _FileAt(const BPoint
& where
);
57 void _AddAppToList(vector
<AppMenuItem
*>& list
,
58 const char* appSignature
, int category
);
59 BMenu
* _BuildOpenWithMenu(FileInfo
* info
);
60 void _ShowContextMenu(FileInfo
* info
, BPoint where
);
61 void _Launch(FileInfo
* info
,
62 const entry_ref
* ref
= NULL
);
63 void _OpenInfo(FileInfo
* info
, BPoint p
);
68 : begin(0.0), end(0.0), info(NULL
) { }
69 Segment(float b
, float e
, FileInfo
* i
)
70 : begin(b
), end(e
), info(i
) { }
71 Segment(const Segment
&s
)
72 : begin(s
.begin
), end(s
.end
), info(s
.info
) { }
79 typedef vector
<Segment
> SegmentList
;
80 typedef map
<int, SegmentList
> MouseOverInfo
;
86 FileInfo
* fCurrentDir
;
87 MouseOverInfo fMouseOverInfo
;
88 BPopUpMenu
* fMouseOverMenu
;
89 BPopUpMenu
* fFileUnavailableMenu
;
94 FileInfo
* fClickedFile
;