diff --git a/build/jam/FileRules b/build/jam/FileRules index fceb452e39..c66230a231 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -249,3 +249,15 @@ actions CopySetHaikuRevision1 $(2[1]) --data $(2[3]) $(1) && $(2[2]) $(1) ${revision} } + +rule UseSharedSource +{ + UseSharedHeaders ; + + for file in $(1) { + local gristed_file = [ FGristFiles $(file) ] ; + SEARCH on $(gristed_file) = [ FDirName $(HAIKU_TOP) src shared ] ; + LOCATE on $(gristed_file) = [ FDirName $(HAIKU_TOP) src shared ] ; + SEARCH_SOURCE on $(gristed_file) = [ FDirName $(HAIKU_TOP) src shared ] ; + } +} diff --git a/build/jam/HeadersRules b/build/jam/HeadersRules index e7490235d6..652c73a2bd 100644 --- a/build/jam/HeadersRules +++ b/build/jam/HeadersRules @@ -338,6 +338,11 @@ rule UseLegacyObjectHeaders SourceSysHdrs $(1) : [ FDirName $(HAIKU_TOP) headers legacy ] : $(2) ; } +rule UseSharedHeaders +{ + UseHeaders [ FDirName $(HAIKU_TOP) headers shared ] ; +} + rule FStandardOSHeaders { local osIncludes = add-ons add-ons/file_system add-ons/graphics diff --git a/headers/private/interface/AboutWindow.h b/headers/shared/AboutWindow.h similarity index 86% rename from headers/private/interface/AboutWindow.h rename to headers/shared/AboutWindow.h index 7b731fcca8..57cf972db8 100644 --- a/headers/private/interface/AboutWindow.h +++ b/headers/shared/AboutWindow.h @@ -15,7 +15,7 @@ class BAboutWindow { public: BAboutWindow(char *appName, int32 firstCopyrightYear, - int32 numAuthors, const char **authors, char *extraInfo = NULL); + const char **authors, char *extraInfo = NULL); virtual ~BAboutWindow(); void Show(); diff --git a/src/apps/showimage/Jamfile b/src/apps/showimage/Jamfile index 87d24a0219..1684c91ea3 100644 --- a/src/apps/showimage/Jamfile +++ b/src/apps/showimage/Jamfile @@ -1,10 +1,13 @@ SubDir HAIKU_TOP src apps showimage ; -UsePrivateHeaders tracker interface ; +UsePrivateHeaders tracker ; SetSubDirSupportedPlatformsBeOSCompatible ; +UseSharedSource AboutWindow.cpp ; + Application ShowImage : + AboutWindow.cpp ShowImageApp.cpp ShowImageSettings.cpp ShowImageStatusView.cpp diff --git a/src/apps/showimage/ShowImageApp.cpp b/src/apps/showimage/ShowImageApp.cpp index f924541103..c5e2d139ae 100644 --- a/src/apps/showimage/ShowImageApp.cpp +++ b/src/apps/showimage/ShowImageApp.cpp @@ -10,13 +10,11 @@ */ +#include "AboutWindow.h" // Shared source #include "ShowImageApp.h" #include "ShowImageConstants.h" #include "ShowImageWindow.h" -#ifdef HAIKU_TARGET_PLATFORM_HAIKU -#include -#endif #include #include #include @@ -47,20 +45,15 @@ ShowImageApp::~ShowImageApp() void ShowImageApp::AboutRequested() { -#ifdef HAIKU_TARGET_PLATFORM_HAIKU const char *authors[] = { "Fernando F. Oliveira", "Michael Wilber", "Michael Pfeiffer", - "Ryan Leavengood" + "Ryan Leavengood", + NULL }; - BAboutWindow about("ShowImage", 2003, 4, authors); + BAboutWindow about("ShowImage", 2003, authors); about.Show(); -#else - BAlert* alert = new BAlert("About ShowImage", - "Haiku ShowImage\n\nby Fernando F. Oliveira, Michael Wilber, Michael Pfeiffer and Ryan Leavengood", "OK"); - alert->Go(); -#endif } diff --git a/src/kits/interface/Jamfile b/src/kits/interface/Jamfile index cfc948f434..abdfbd6c2f 100644 --- a/src/kits/interface/Jamfile +++ b/src/kits/interface/Jamfile @@ -37,7 +37,6 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) textview_support ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) layouter ] ; MergeObject interface_kit.o : - AboutWindow.cpp AbstractLayoutItem.cpp Alert.cpp Alignment.cpp diff --git a/src/kits/interface/AboutWindow.cpp b/src/shared/AboutWindow.cpp similarity index 87% rename from src/kits/interface/AboutWindow.cpp rename to src/shared/AboutWindow.cpp index 3a0ff59358..2b014f1a19 100644 --- a/src/kits/interface/AboutWindow.cpp +++ b/src/shared/AboutWindow.cpp @@ -6,17 +6,19 @@ * Ryan Leavengood, leavengood@gmail.com */ -#include +#include "AboutWindow.h" + #include #include #include #include +#include #include BAboutWindow::BAboutWindow(char *appName, int32 firstCopyrightYear, - int32 numAuthors, const char **authors, char *extraInfo) + const char **authors, char *extraInfo) { fAppName = new BString(appName); fText = new BString(); @@ -32,12 +34,15 @@ BAboutWindow::BAboutWindow(char *appName, int32 firstCopyrightYear, text << "\n\nCopyright " B_UTF8_COPYRIGHT " "; text << firstCopyrightYear << "-" << currentYear << " Haiku, Inc.\n\n"; text << "Written by:\n"; - for (int32 i = 0; i < numAuthors; i++) { + for (int32 i = 0; authors[i]; i++) { text << " " << authors[i] << "\n"; } + + // The extra information is optional if (extraInfo != NULL) { text << "\n" << extraInfo << "\n"; } + fText->Adopt(text); }