* Fixed artwork directory.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35462 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,12 +1,17 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
|
#include <Entry.h>
|
||||||
|
#include <FindDirectory.h>
|
||||||
|
#include <Path.h>
|
||||||
#include <Picture.h>
|
#include <Picture.h>
|
||||||
#include <Shape.h>
|
#include <Shape.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
|
|
||||||
#include "SVGViewView.h"
|
#include "SVGViewView.h"
|
||||||
|
|
||||||
|
|
||||||
class Svg2PictureWindow : public BWindow {
|
class Svg2PictureWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
Svg2PictureWindow(BRect frame, const char *filename)
|
Svg2PictureWindow(BRect frame, const char *filename)
|
||||||
@@ -17,6 +22,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class OriginalView : public BBox {
|
class OriginalView : public BBox {
|
||||||
public:
|
public:
|
||||||
OriginalView(BRect frame);
|
OriginalView(BRect frame);
|
||||||
@@ -137,6 +143,7 @@ PictureView::AllAttached()
|
|||||||
message2.PrintToStream();
|
message2.PrintToStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PictureView::Draw(BRect update)
|
PictureView::Draw(BRect update)
|
||||||
{
|
{
|
||||||
@@ -145,17 +152,17 @@ PictureView::Draw(BRect update)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// main
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
BApplication pictureApp("application/x-vnd.picture");
|
BApplication pictureApp("application/x-vnd.picture");
|
||||||
|
|
||||||
BWindow *pictureWindow = new BWindow(BRect(100, 100, 500, 400),
|
BWindow *pictureWindow = new BWindow(BRect(100, 100, 500, 400),
|
||||||
"BPicture test", B_TITLED_WINDOW,
|
"BPicture test", B_TITLED_WINDOW,
|
||||||
B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_QUIT_ON_WINDOW_CLOSE);
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_QUIT_ON_WINDOW_CLOSE);
|
||||||
|
|
||||||
BWindow *svgWindow = new Svg2PictureWindow(BRect(300, 300, 600, 600), "/boot/beos/etc/artwork/lion.svg");
|
|
||||||
|
|
||||||
|
|
||||||
BRect rect(pictureWindow->Bounds());
|
BRect rect(pictureWindow->Bounds());
|
||||||
rect.right -= (rect.Width() + 1) / 2;
|
rect.right -= (rect.Width() + 1) / 2;
|
||||||
@@ -166,12 +173,20 @@ main()
|
|||||||
|
|
||||||
pictureWindow->AddChild(testView);
|
pictureWindow->AddChild(testView);
|
||||||
pictureWindow->AddChild(pictureView);
|
pictureWindow->AddChild(pictureView);
|
||||||
|
|
||||||
pictureWindow->Show();
|
pictureWindow->Show();
|
||||||
|
|
||||||
|
BPath path;
|
||||||
|
if (find_directory(B_SYSTEM_DATA_DIRECTORY, &path) == B_OK) {
|
||||||
|
path.Append("artwork/lion.svg");
|
||||||
|
BEntry entry(path.Path());
|
||||||
|
if (entry.Exists()) {
|
||||||
|
BWindow *svgWindow = new Svg2PictureWindow(BRect(300, 300, 600, 600),
|
||||||
|
path.Path());
|
||||||
svgWindow->Show();
|
svgWindow->Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pictureApp.Run();
|
pictureApp.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user