|
|
|
@@ -51,39 +51,39 @@ static const uint32 kMsgUpdatePreviewPlacement = 'pvpl';
|
|
|
|
|
const uint8 kHandCursorData[68] = {
|
|
|
|
|
16, 1, 2, 2,
|
|
|
|
|
|
|
|
|
|
0,0, // 0000000000000000
|
|
|
|
|
7,128, // 0000011110000000
|
|
|
|
|
61,112, // 0011110101110000
|
|
|
|
|
37,40, // 0010010100101000
|
|
|
|
|
36,168, // 0010010010101000
|
|
|
|
|
18,148, // 0001001010010100
|
|
|
|
|
18,84, // 0001001001010100
|
|
|
|
|
9,42, // 0000100100101010
|
|
|
|
|
8,1, // 0000100000000001
|
|
|
|
|
60,1, // 0011110000000001
|
|
|
|
|
76,1, // 0100110000000001
|
|
|
|
|
66,1, // 0100001000000001
|
|
|
|
|
48,1, // 0011000000000001
|
|
|
|
|
12,1, // 0000110000000001
|
|
|
|
|
2,0, // 0000001000000000
|
|
|
|
|
1,0, // 0000000100000000
|
|
|
|
|
0, 0, // 0000000000000000
|
|
|
|
|
7, 128, // 0000011110000000
|
|
|
|
|
61, 112, // 0011110101110000
|
|
|
|
|
37, 40, // 0010010100101000
|
|
|
|
|
36, 168, // 0010010010101000
|
|
|
|
|
18, 148, // 0001001010010100
|
|
|
|
|
18, 84, // 0001001001010100
|
|
|
|
|
9, 42, // 0000100100101010
|
|
|
|
|
8, 1, // 0000100000000001
|
|
|
|
|
60, 1, // 0011110000000001
|
|
|
|
|
76, 1, // 0100110000000001
|
|
|
|
|
66, 1, // 0100001000000001
|
|
|
|
|
48, 1, // 0011000000000001
|
|
|
|
|
12, 1, // 0000110000000001
|
|
|
|
|
2, 0, // 0000001000000000
|
|
|
|
|
1, 0, // 0000000100000000
|
|
|
|
|
|
|
|
|
|
0,0, // 0000000000000000
|
|
|
|
|
7,128, // 0000011110000000
|
|
|
|
|
63,240, // 0011111111110000
|
|
|
|
|
63,248, // 0011111111111000
|
|
|
|
|
63,248, // 0011111111111000
|
|
|
|
|
31,252, // 0001111111111100
|
|
|
|
|
31,252, // 0001111111111100
|
|
|
|
|
15,254, // 0000111111111110
|
|
|
|
|
15,255, // 0000111111111111
|
|
|
|
|
63,255, // 0011111111111111
|
|
|
|
|
127,255, // 0111111111111111
|
|
|
|
|
127,255, // 0111111111111111
|
|
|
|
|
63,255, // 0011111111111111
|
|
|
|
|
15,255, // 0000111111111111
|
|
|
|
|
3,254, // 0000001111111110
|
|
|
|
|
1,248 // 0000000111111000
|
|
|
|
|
0, 0, // 0000000000000000
|
|
|
|
|
7, 128, // 0000011110000000
|
|
|
|
|
63, 240, // 0011111111110000
|
|
|
|
|
63, 248, // 0011111111111000
|
|
|
|
|
63, 248, // 0011111111111000
|
|
|
|
|
31, 252, // 0001111111111100
|
|
|
|
|
31, 252, // 0001111111111100
|
|
|
|
|
15, 254, // 0000111111111110
|
|
|
|
|
15, 255, // 0000111111111111
|
|
|
|
|
63, 255, // 0011111111111111
|
|
|
|
|
127, 255, // 0111111111111111
|
|
|
|
|
127, 255, // 0111111111111111
|
|
|
|
|
63, 255, // 0011111111111111
|
|
|
|
|
15, 255, // 0000111111111111
|
|
|
|
|
3, 254, // 0000001111111110
|
|
|
|
|
1, 248 // 0000000111111000
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -742,7 +742,7 @@ BackgroundsView::SaveSettings(void)
|
|
|
|
|
BFile file(path.Path(), B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
|
|
|
|
|
|
|
|
|
|
BPoint point = Window()->Frame().LeftTop();
|
|
|
|
|
if (fSettings.ReplacePoint("pos", point)!=B_OK)
|
|
|
|
|
if (fSettings.ReplacePoint("pos", point) != B_OK)
|
|
|
|
|
fSettings.AddPoint("pos", point);
|
|
|
|
|
|
|
|
|
|
entry_ref ref;
|
|
|
|
@@ -814,7 +814,7 @@ BackgroundsView::LoadSettings()
|
|
|
|
|
s << "Folder: " << path.Leaf();
|
|
|
|
|
BMenuItem *item = new BMenuItem(s.String(),
|
|
|
|
|
new BMessage(kMsgFolderSelected));
|
|
|
|
|
fWorkspaceMenu->AddItem(item, -i-1+6);
|
|
|
|
|
fWorkspaceMenu->AddItem(item, -i - 1 + 6);
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
fWorkspaceMenu->SetTargetForItems(this);
|
|
|
|
@@ -910,7 +910,7 @@ BackgroundsView::FindPlacementMode()
|
|
|
|
|
#ifndef __HAIKU__
|
|
|
|
|
inline bool operator!=(const rgb_color& x, const rgb_color& y)
|
|
|
|
|
{
|
|
|
|
|
return (x.red!=y.red || x.blue!=y.blue || x.green!=y.green);
|
|
|
|
|
return (x.red != y.red || x.blue != y.blue || x.green != y.green);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@@ -987,12 +987,12 @@ BackgroundsView::RefsReceived(BMessage *msg)
|
|
|
|
|
item = FindImageItem(index);
|
|
|
|
|
fLastImageIndex = index;
|
|
|
|
|
} else {
|
|
|
|
|
const char* name = GetImage(-index-1)->GetName();
|
|
|
|
|
item = new BGImageMenuItem(name, -index-1,
|
|
|
|
|
const char* name = GetImage(-index - 1)->GetName();
|
|
|
|
|
item = new BGImageMenuItem(name, -index - 1,
|
|
|
|
|
new BMessage(kMsgImageSelected));
|
|
|
|
|
AddItem(item);
|
|
|
|
|
item->SetTarget(this);
|
|
|
|
|
fLastImageIndex = -index-1;
|
|
|
|
|
fLastImageIndex = -index - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item->SetMarked(true);
|
|
|
|
@@ -1014,9 +1014,9 @@ BackgroundsView::RefsReceived(BMessage *msg)
|
|
|
|
|
BString s;
|
|
|
|
|
s << "Folder: " << path.Leaf();
|
|
|
|
|
item = new BMenuItem(s.String(), new BMessage(kMsgFolderSelected));
|
|
|
|
|
fWorkspaceMenu->AddItem(item, -index-1+6);
|
|
|
|
|
fWorkspaceMenu->AddItem(item, -index - 1 + 6);
|
|
|
|
|
item->SetTarget(this);
|
|
|
|
|
fLastWorkspaceIndex = -index-1 + 6;
|
|
|
|
|
fLastWorkspaceIndex = -index - 1 + 6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item->SetMarked(true);
|
|
|
|
@@ -1031,7 +1031,7 @@ BackgroundsView::AddPath(BPath path)
|
|
|
|
|
{
|
|
|
|
|
int32 count = fPathList.CountItems();
|
|
|
|
|
int32 index = 0;
|
|
|
|
|
for(; index < count; index++) {
|
|
|
|
|
for (; index < count; index++) {
|
|
|
|
|
BPath *p = fPathList.ItemAt(index);
|
|
|
|
|
int c = BString(p->Path()).ICompare(path.Path());
|
|
|
|
|
if (c == 0)
|
|
|
|
@@ -1041,7 +1041,7 @@ BackgroundsView::AddPath(BPath path)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
fPathList.AddItem(new BPath(path), index);
|
|
|
|
|
return -index-1;
|
|
|
|
|
return -index - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1050,14 +1050,14 @@ BackgroundsView::AddImage(BPath path)
|
|
|
|
|
{
|
|
|
|
|
int32 count = fImageList.CountItems();
|
|
|
|
|
int32 index = 0;
|
|
|
|
|
for(; index < count; index++) {
|
|
|
|
|
for (; index < count; index++) {
|
|
|
|
|
Image *image = fImageList.ItemAt(index);
|
|
|
|
|
if (image->GetPath() == path)
|
|
|
|
|
return index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fImageList.AddItem(new Image(path));
|
|
|
|
|
return -index-1;
|
|
|
|
|
return -index - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1147,7 +1147,7 @@ PreView::MouseDown(BPoint point)
|
|
|
|
|
if (IsEnabled() && Bounds().Contains(point)) {
|
|
|
|
|
uint32 buttons;
|
|
|
|
|
GetMouse(&point, &buttons);
|
|
|
|
|
if(buttons & B_PRIMARY_MOUSE_BUTTON) {
|
|
|
|
|
if (buttons & B_PRIMARY_MOUSE_BUTTON) {
|
|
|
|
|
fOldPoint = point;
|
|
|
|
|
SetTracking(true);
|
|
|
|
|
BScreen().GetMode(&mode);
|
|
|
|
@@ -1178,8 +1178,8 @@ PreView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
|
|
|
|
|
|
|
|
|
|
if (IsTracking()) {
|
|
|
|
|
float x, y;
|
|
|
|
|
x = fPoint.x + (point.x - fOldPoint.x)/ x_ratio;
|
|
|
|
|
y = fPoint.y + (point.y - fOldPoint.y)/ y_ratio;
|
|
|
|
|
x = fPoint.x + (point.x - fOldPoint.x) / x_ratio;
|
|
|
|
|
y = fPoint.y + (point.y - fOldPoint.y) / y_ratio;
|
|
|
|
|
bool min, max, mustSend = false;
|
|
|
|
|
min = (x > -fImageBounds.Width());
|
|
|
|
|
max = (x < mode.virtual_width);
|
|
|
|
@@ -1245,42 +1245,42 @@ PreviewBox::Draw(BRect rect)
|
|
|
|
|
rgb_color color = HighColor();
|
|
|
|
|
|
|
|
|
|
SetHighColor(LowColor());
|
|
|
|
|
FillRect(BRect(9,19,141,127));
|
|
|
|
|
FillRect(BRect(9, 19, 141, 127));
|
|
|
|
|
|
|
|
|
|
if (fIsDesktop) {
|
|
|
|
|
BPoint points[] = {
|
|
|
|
|
BPoint(11,19), BPoint(139,19), BPoint(141,21),
|
|
|
|
|
BPoint(141,119), BPoint(139,121), BPoint(118,121),
|
|
|
|
|
BPoint(118,126), BPoint(117,127), BPoint(33,127),
|
|
|
|
|
BPoint(32,126), BPoint(32,121),BPoint(11,121),
|
|
|
|
|
BPoint(9,119),BPoint(9,21),BPoint(11,19)
|
|
|
|
|
BPoint(11, 19), BPoint(139, 19), BPoint(141, 21),
|
|
|
|
|
BPoint(141, 119), BPoint(139, 121), BPoint(118, 121),
|
|
|
|
|
BPoint(118, 126), BPoint(117, 127), BPoint(33, 127),
|
|
|
|
|
BPoint(32, 126), BPoint(32, 121), BPoint(11, 121),
|
|
|
|
|
BPoint(9, 119), BPoint(9, 21), BPoint(11, 19)
|
|
|
|
|
};
|
|
|
|
|
SetHighColor(184,184,184);
|
|
|
|
|
SetHighColor(184, 184, 184);
|
|
|
|
|
FillPolygon(points, 15);
|
|
|
|
|
SetHighColor(96,96,96);
|
|
|
|
|
SetHighColor(96, 96, 96);
|
|
|
|
|
StrokePolygon(points, 15);
|
|
|
|
|
FillRect(BRect(107,121,111,123));
|
|
|
|
|
SetHighColor(0,0,0);
|
|
|
|
|
StrokeRect(BRect(14,24,136,116));
|
|
|
|
|
SetHighColor(0,255,0);
|
|
|
|
|
FillRect(BRect(101,122,103,123));
|
|
|
|
|
FillRect(BRect(107, 121, 111, 123));
|
|
|
|
|
SetHighColor(0, 0, 0);
|
|
|
|
|
StrokeRect(BRect(14, 24, 136, 116));
|
|
|
|
|
SetHighColor(0, 255, 0);
|
|
|
|
|
FillRect(BRect(101, 122, 103, 123));
|
|
|
|
|
} else {
|
|
|
|
|
SetHighColor(152,152,152);
|
|
|
|
|
StrokeLine(BPoint(11,13), BPoint(67,13));
|
|
|
|
|
StrokeLine(BPoint(67,21));
|
|
|
|
|
StrokeLine(BPoint(139,21));
|
|
|
|
|
StrokeLine(BPoint(139,119));
|
|
|
|
|
StrokeLine(BPoint(11,119));
|
|
|
|
|
StrokeLine(BPoint(11,13));
|
|
|
|
|
StrokeRect(BRect(14,24,136,116));
|
|
|
|
|
SetHighColor(255,203,0);
|
|
|
|
|
FillRect(BRect(12,14,66,21));
|
|
|
|
|
SetHighColor(240,240,240);
|
|
|
|
|
StrokeRect(BRect(12,22,137,117));
|
|
|
|
|
StrokeLine(BPoint(138,22), BPoint(138,22));
|
|
|
|
|
StrokeLine(BPoint(12,118), BPoint(12,118));
|
|
|
|
|
SetHighColor(200,200,200);
|
|
|
|
|
StrokeRect(BRect(13,23,138,118));
|
|
|
|
|
SetHighColor(152, 152, 152);
|
|
|
|
|
StrokeLine(BPoint(11, 13), BPoint(67, 13));
|
|
|
|
|
StrokeLine(BPoint(67, 21));
|
|
|
|
|
StrokeLine(BPoint(139, 21));
|
|
|
|
|
StrokeLine(BPoint(139, 119));
|
|
|
|
|
StrokeLine(BPoint(11, 119));
|
|
|
|
|
StrokeLine(BPoint(11, 13));
|
|
|
|
|
StrokeRect(BRect(14, 24, 136, 116));
|
|
|
|
|
SetHighColor(255, 203, 0);
|
|
|
|
|
FillRect(BRect(12, 14, 66, 21));
|
|
|
|
|
SetHighColor(240, 240, 240);
|
|
|
|
|
StrokeRect(BRect(12, 22, 137, 117));
|
|
|
|
|
StrokeLine(BPoint(138, 22), BPoint(138, 22));
|
|
|
|
|
StrokeLine(BPoint(12, 118), BPoint(12, 118));
|
|
|
|
|
SetHighColor(200, 200, 200);
|
|
|
|
|
StrokeRect(BRect(13, 23, 138, 118));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetHighColor(color);
|
|
|
|
|