From 4b5dfd789f1b4cdf00fac5192b510cdeb4a82480 Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Mon, 24 May 2010 06:48:13 +0000 Subject: [PATCH] * Removed obsolete picture test application. * Fixed build of print job utilities DumpPrintJob and ShowPrintJob. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36920 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/kits/interface/pictureprint/Jamfile | 19 +-- .../interface/pictureprint/PictureTestApp.cpp | 52 ------- .../interface/pictureprint/PictureTestApp.hpp | 51 ------- .../pictureprint/PictureTestView.cpp | 47 ------ .../pictureprint/PictureTestView.hpp | 47 ------ .../pictureprint/PictureTestWindow.cpp | 137 ------------------ .../pictureprint/PictureTestWindow.hpp | 58 -------- .../kits/interface/pictureprint/TestView.cpp | 81 ----------- .../kits/interface/pictureprint/TestView.hpp | 47 ------ 9 files changed, 4 insertions(+), 535 deletions(-) delete mode 100644 src/tests/kits/interface/pictureprint/PictureTestApp.cpp delete mode 100644 src/tests/kits/interface/pictureprint/PictureTestApp.hpp delete mode 100644 src/tests/kits/interface/pictureprint/PictureTestView.cpp delete mode 100644 src/tests/kits/interface/pictureprint/PictureTestView.hpp delete mode 100644 src/tests/kits/interface/pictureprint/PictureTestWindow.cpp delete mode 100644 src/tests/kits/interface/pictureprint/PictureTestWindow.hpp delete mode 100644 src/tests/kits/interface/pictureprint/TestView.cpp delete mode 100644 src/tests/kits/interface/pictureprint/TestView.hpp diff --git a/src/tests/kits/interface/pictureprint/Jamfile b/src/tests/kits/interface/pictureprint/Jamfile index b1235522f3..2976e17de1 100644 --- a/src/tests/kits/interface/pictureprint/Jamfile +++ b/src/tests/kits/interface/pictureprint/Jamfile @@ -1,21 +1,9 @@ SubDir HAIKU_TOP src tests kits interface pictureprint ; +SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ; + UsePrivateHeaders interface print ; -SimpleTest TestPictureApp : - PictureTestApp.cpp - PictureTestView.cpp - TestView.cpp - PictureTestWindow.cpp - ; - -LinkAgainst TestPictureApp : - be - root - libprintutils.a - $(TARGET_LIBSUPC++) - ; - SimpleTest DumpPrintJob : DumpPrintJob.cpp ; @@ -23,6 +11,7 @@ SimpleTest DumpPrintJob : LinkAgainst DumpPrintJob : be root + libprint.a libprintutils.a ; @@ -33,5 +22,5 @@ SimpleTest ShowPrintJob : LinkAgainst ShowPrintJob : be root - libprintutils.a + libprint.a ; diff --git a/src/tests/kits/interface/pictureprint/PictureTestApp.cpp b/src/tests/kits/interface/pictureprint/PictureTestApp.cpp deleted file mode 100644 index cb97508f52..0000000000 --- a/src/tests/kits/interface/pictureprint/PictureTestApp.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - -PictureTestApp - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#include "PictureTestApp.hpp" -#include "PictureTestWindow.hpp" -#include "PictureTestView.hpp" - -int main() -{ - new PictureTestApp; - be_app->Run(); - delete be_app; - - return 0; -} - -PictureTestApp::PictureTestApp() - : Inherited(PRINTTEST_SIGNATURE) -{ -} - -void PictureTestApp::ReadyToRun() -{ - (new PictureTestWindow)->Show(); -} - diff --git a/src/tests/kits/interface/pictureprint/PictureTestApp.hpp b/src/tests/kits/interface/pictureprint/PictureTestApp.hpp deleted file mode 100644 index fe37bd9271..0000000000 --- a/src/tests/kits/interface/pictureprint/PictureTestApp.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - -PictureTestApp - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#ifndef PICTURETESTAPP_HPP -#define PICTURETESTAPP_HPP - -class PictureTestApp; - -#include -#include - -#define PRINTTEST_SIGNATURE "application/x-vnd.OpenBeOS-picturetest" - -class PictureTestApp : public BApplication -{ - typedef BApplication Inherited; -public: - PictureTestApp(); - - void ReadyToRun(); -private: - void DoPictureTest(); -}; - -#endif diff --git a/src/tests/kits/interface/pictureprint/PictureTestView.cpp b/src/tests/kits/interface/pictureprint/PictureTestView.cpp deleted file mode 100644 index 8fe8e98a0e..0000000000 --- a/src/tests/kits/interface/pictureprint/PictureTestView.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - -PictureTestView - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#include "PictureTestView.hpp" - -PictureTestView::PictureTestView(BRect frame) - : Inherited(frame, "", B_FOLLOW_ALL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) -{ -} - -void PictureTestView::Draw(BRect updateRect) -{ - StrokeRoundRect(Bounds().InsetByCopy(20,20), 10, 10); - BFont font(be_bold_font); - font.SetSize(Bounds().Height()/10); - font.SetShear(Bounds().Height()/10); - font.SetRotation(Bounds().Width()/10); - SetFont(&font, B_FONT_ALL); - DrawString("OpenBeOS", 8, BPoint(Bounds().Width()/2,Bounds().Height()/2)); -} - diff --git a/src/tests/kits/interface/pictureprint/PictureTestView.hpp b/src/tests/kits/interface/pictureprint/PictureTestView.hpp deleted file mode 100644 index d962aa11f4..0000000000 --- a/src/tests/kits/interface/pictureprint/PictureTestView.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - -PictureTestView - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#ifndef PICTURETESTVIEW_HPP -#define PICTURETESTVIEW_HPP - -#include - -class PictureTestView; - -#include - -class PictureTestView : public BView -{ - typedef BView Inherited; -public: - PictureTestView(BRect frame); - void Draw(BRect updateRect); -}; - -#endif diff --git a/src/tests/kits/interface/pictureprint/PictureTestWindow.cpp b/src/tests/kits/interface/pictureprint/PictureTestWindow.cpp deleted file mode 100644 index 6767b115b8..0000000000 --- a/src/tests/kits/interface/pictureprint/PictureTestWindow.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - -PictureTestWindow - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#include "PictureTestWindow.hpp" - -#include "PictureTestView.hpp" -#include "TestView.hpp" -#include "PicturePrinter.h" - -#include - -#include -#include -#include -#include - -PictureTestWindow::PictureTestWindow() - : Inherited(BRect(100,100,500,300), "OpenBeOS Picture Test App", B_DOCUMENT_WINDOW, 0) -{ - BuildGUI(); -} - -bool PictureTestWindow::QuitRequested() -{ - bool isOk = Inherited::QuitRequested(); - if (isOk) { - be_app->PostMessage(B_QUIT_REQUESTED); - } - - return isOk; -} - - -void PictureTestWindow::BuildGUI() -{ - BView* backdrop = new BView(Bounds(), "backdrop", B_FOLLOW_ALL, B_WILL_DRAW); - backdrop->SetViewColor(::ui_color(B_PANEL_BACKGROUND_COLOR)); - AddChild(backdrop); - - BMenuBar* mb = new BMenuBar(Bounds(), "menubar"); - BMenu* m = new BMenu("File"); - m->AddItem(new BMenuItem("Picture"B_UTF8_ELLIPSIS, new BMessage('Pict'), 'P')); - m->AddSeparatorItem(); - m->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q')); - mb->AddItem(m); - - backdrop->AddChild(mb); - - BRect b = Bounds(); - b.top = mb->Bounds().bottom +1; - backdrop->AddChild(new PictureTestView(b)); -} - -void PictureTestWindow::MessageReceived(BMessage* msg) -{ - switch(msg->what) { - case 'Pict': - DoPictureTest(); - break; - } -} - -void PictureTestWindow::DoPictureTest() { - fView = new TestView(BRect(0, 0, 10000, 10000)); - AddChild(fView); - bool continue_test = true; - for (int i = 0; continue_test; i++) { - Begin(); - continue_test = fView->Test(i, fName); - End(continue_test); - } - RemoveChild(fView); - delete fView; -} - -void PictureTestWindow::Begin() { - fView->BeginPicture(new BPicture()); -} - -void PictureTestWindow::End(bool write) { - fView->Sync(); - if (!write) return; - BPicture* picture = fView->EndPicture(); - printf("\n%s\n", fName.String()); - if (picture) { - bool saved = false; - { - BFile file(fName.String(), B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE); - if (file.InitCheck() == B_OK) { - if (picture->Flatten(&file) != B_OK) - fprintf(stderr, "Error %s could not flatten BPicture\n", fName.String()); - else saved = true; - } else fprintf(stderr, "Error %s could not create file\n", fName.String()); - delete picture; - } - if (saved) { - BFile file(fName.String(), B_READ_ONLY); - if (file.InitCheck() == B_OK) { - BPicture p; - if (p.Unflatten(&file) == B_OK) { - PicturePrinter printer; - printer.Iterate(&p); - } else { - fprintf(stderr, "Error %s could not unflatten BPicture\n", fName.String()); - } - } else { - fprintf(stderr, "Error %s could not open file\n", fName.String()); - } - } - } -} diff --git a/src/tests/kits/interface/pictureprint/PictureTestWindow.hpp b/src/tests/kits/interface/pictureprint/PictureTestWindow.hpp deleted file mode 100644 index 34840bc9f8..0000000000 --- a/src/tests/kits/interface/pictureprint/PictureTestWindow.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - -PictureTestWindow - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#ifndef PICTURETESTWINDOW_HPP -#define PICTURETESTWINDOW_HPP - -class TestView; - -#include -#include -#include -#include - -class PictureTestWindow : public BWindow -{ - typedef BWindow Inherited; -public: - void MessageReceived(BMessage* m); - PictureTestWindow(); - bool QuitRequested(); -private: - void BuildGUI(); - void DoPictureTest(); - void Begin(); - void End(bool write); - - TestView* fView; - BString fName; - BPicture fPicture; -}; - -#endif diff --git a/src/tests/kits/interface/pictureprint/TestView.cpp b/src/tests/kits/interface/pictureprint/TestView.cpp deleted file mode 100644 index 6e89b13ec8..0000000000 --- a/src/tests/kits/interface/pictureprint/TestView.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - -TestView - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#include "TestView.hpp" - -static int NextNum() { - static int n = 0; - return n ++; -} - -static BPoint NextPoint() { - return BPoint(NextNum(), NextNum()); -} - -static BRect NextRect() { - return BRect(NextNum(), NextNum(), NextNum(), NextNum()); -} - -bool TestView::Test(int no, BString& name) { - switch (no) { - case 0: name = "MoveTo"; MoveTo(NextPoint()); break; - case 1: name = "StrokeLine"; StrokeLine(NextPoint(), NextPoint()); break; - case 2: name = "StrokeRect"; StrokeRect(NextRect()); break; - case 3: name = "FillRect"; FillRect(NextRect()); break; - case 4: name = "DrawChar"; MoveTo(NextPoint()); DrawChar('O'); DrawChar('B'); DrawChar('O'); DrawChar('S'); break; - case 5: name = "DrawString"; DrawString("OpenBeOS", NextPoint()); break; - case 6: name = "BlendingMode"; - SetBlendingMode(B_CONSTANT_ALPHA, B_ALPHA_OVERLAY); - StrokeRect(NextRect()); - break; -// case 7: name = ""; break; -/* - case 6: name = "StrokeEllipse"; break; - case 7: name = "FillEllipse"; break; - case 8: name = "StrokeBezier"; break; - case 9: name = "FillBezier"; break; - case 10: name = "StrokePolygone"; break; - case 11: name = "FillPolygone"; break; - case 12: name = "FillRegion"; break; - case 13: name = "StrokeTriangle"; break; - case 14: name = "FillTriangle"; break; - case 15: name = ""; break; - case 16: name = ""; break; - case 17: name = ""; break; - case 18: name = ""; break; - case 19: name = ""; break; - case 20: name = ""; break; - case 21: name = ""; break; - case 22: name = ""; break; -*/ - default: return false; - } - return true; -} - diff --git a/src/tests/kits/interface/pictureprint/TestView.hpp b/src/tests/kits/interface/pictureprint/TestView.hpp deleted file mode 100644 index 6ed878852b..0000000000 --- a/src/tests/kits/interface/pictureprint/TestView.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - -TestView - -Copyright (c) 2002 OpenBeOS. - -Author: - Michael Pfeiffer - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - - -#ifndef TESTVIEW_HPP -#define TESTVIEW_HPP - -#include - -#include - -class TestView : public BView -{ - typedef BView Inherited; -public: - TestView(BRect frame) : BView(frame, "", B_FOLLOW_NONE, 0) { } - void Draw(BRect updateRect) { }; - bool Test(int no, BString& name); -}; - -#endif /* TESTVIEW_HPP */