From 039f59262a5e56d1a577b183b3ad712c9f690f96 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Tue, 3 Mar 2015 16:00:16 -0500 Subject: [PATCH] Tracker, Deskbar, ShowImage: move public commands ... to tracker_private.h so they may be used by external apps such as Deskbar and ShowImage. Remove PublicCommands.h --- headers/private/tracker/tracker_private.h | 23 +++++++- src/apps/deskbar/BarApp.cpp | 6 +-- src/apps/deskbar/BarWindow.cpp | 3 +- src/apps/deskbar/DeskbarMenu.cpp | 2 +- src/apps/showimage/ImageFileNavigator.cpp | 7 --- src/kits/tracker/Commands.h | 8 +-- src/kits/tracker/PublicCommands.h | 64 ----------------------- 7 files changed, 32 insertions(+), 81 deletions(-) delete mode 100644 src/kits/tracker/PublicCommands.h diff --git a/headers/private/tracker/tracker_private.h b/headers/private/tracker/tracker_private.h index 9edcbbbea3..ec5500970b 100644 --- a/headers/private/tracker/tracker_private.h +++ b/headers/private/tracker/tracker_private.h @@ -48,6 +48,27 @@ _IMPEXP_TRACKER #endif void InitIconPreloader(); -} +// commands that may be issued to the tracker by other apps using messengers + +const uint32 kFindButton = 'Tfnd'; +const uint32 kSaveButton = 'Tsav'; +const uint32 kShowSplash = 'Spls'; + +const uint32 kStartWatchClipboardRefs = 'TCbw'; + // StartWatching() clipboard changes. Changes will be sent to given + // BMessenger "target" +const uint32 kStopWatchClipboardRefs = 'TCfw'; + // StopWatching() given BMessenger "target" +const uint32 kFSClipboardChanges = 'TCch'; + // Used by FSClipboard functions which change refs in clipboard and are + // used outside Tracker (like BFilePanel called in another app) + // Contains movemodes named as in FSClipboard operations and in Clipboard + // (look into FSClipboard files) + +const uint32 kMoveToTrash = 'Ttrs'; + // Used by ShowImage to delete images + +} // namespace BPrivate + #endif /* _TRACKER_PRIVATE_H */ diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp index f2a7fc8f52..e5dc306a86 100644 --- a/src/apps/deskbar/BarApp.cpp +++ b/src/apps/deskbar/BarApp.cpp @@ -56,19 +56,19 @@ All rights reserved. #include #include -#include "icons.h" -#include "tracker_private.h" #include "BarView.h" #include "BarWindow.h" #include "DeskbarUtils.h" #include "FSUtils.h" #include "PreferencesWindow.h" -#include "PublicCommands.h" #include "ResourceSet.h" #include "StatusView.h" #include "Switcher.h" #include "Utilities.h" +#include "icons.h" +#include "tracker_private.h" + BLocker TBarApp::sSubscriberLock; BList TBarApp::sBarTeamInfoList; diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp index f5af134180..0fd262eff0 100644 --- a/src/apps/deskbar/BarWindow.cpp +++ b/src/apps/deskbar/BarWindow.cpp @@ -56,10 +56,9 @@ All rights reserved. #include "BarView.h" #include "DeskbarUtils.h" #include "DeskbarMenu.h" -#include "PublicCommands.h" #include "StatusView.h" -#include "tracker_private.h" +#include "tracker_private.h" #undef B_TRANSLATION_CONTEXT #define B_TRANSLATION_CONTEXT "MainWindow" diff --git a/src/apps/deskbar/DeskbarMenu.cpp b/src/apps/deskbar/DeskbarMenu.cpp index 1185fcf088..c8587f1a8d 100644 --- a/src/apps/deskbar/DeskbarMenu.cpp +++ b/src/apps/deskbar/DeskbarMenu.cpp @@ -50,9 +50,9 @@ All rights reserved. #include "DeskbarUtils.h" #include "IconMenuItem.h" #include "MountMenu.h" -#include "PublicCommands.h" #include "RecentItems.h" #include "StatusView.h" + #include "tracker_private.h" #undef B_TRANSLATION_CONTEXT diff --git a/src/apps/showimage/ImageFileNavigator.cpp b/src/apps/showimage/ImageFileNavigator.cpp index bf32b106c2..b4eff7ec25 100644 --- a/src/apps/showimage/ImageFileNavigator.cpp +++ b/src/apps/showimage/ImageFileNavigator.cpp @@ -115,13 +115,6 @@ private: }; -// TODO: Remove this and use Tracker's Command.h once it is moved into the -// private headers! -namespace BPrivate { - const uint32 kMoveToTrash = 'Ttrs'; -} - - static bool entry_ref_is_file(const entry_ref& ref) { diff --git a/src/kits/tracker/Commands.h b/src/kits/tracker/Commands.h index 12efab0460..b9c15f7c27 100644 --- a/src/kits/tracker/Commands.h +++ b/src/kits/tracker/Commands.h @@ -35,16 +35,18 @@ All rights reserved. #define _COMMANDS_H -#include "PublicCommands.h" - #include +#include + +#include + // public commands moved here so they may be included by other apps + namespace BPrivate { // external app messages const uint32 kGetInfo = 'Tinf'; -const uint32 kMoveToTrash = 'Ttrs'; const uint32 kDelete = 'Tdel'; const uint32 kRestoreFromTrash = 'Tres'; const uint32 kIdentifyEntry = 'Tidt'; diff --git a/src/kits/tracker/PublicCommands.h b/src/kits/tracker/PublicCommands.h deleted file mode 100644 index 63cbd8a27c..0000000000 --- a/src/kits/tracker/PublicCommands.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -Open Tracker License - -Terms and Conditions - -Copyright (c) 1991-2000, Be Incorporated. All rights reserved. - -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 applies to all licensees -and 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 TITLE, MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -BE INCORPORATED 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. - -Except as contained in this notice, the name of Be Incorporated shall not be -used in advertising or otherwise to promote the sale, use or other dealings in -this Software without prior written authorization from Be Incorporated. - -Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks -of Be Incorporated in the United States and other countries. Other brand product -names are registered trademarks or trademarks of their respective holders. -All rights reserved. -*/ -#ifndef _PUBLIC_COMMANDS_H -#define _PUBLIC_COMMANDS_H - - -#include - - -// commands that may be issued to the tracker by other apps using messengers -namespace BPrivate { - -const uint32 kFindButton = 'Tfnd'; -const uint32 kSaveButton = 'Tsav'; -const uint32 kShowSplash = 'Spls'; - -const uint32 kStartWatchClipboardRefs = 'TCbw'; - // StartWatching() clipboard changes. Changes will be sent to given - // BMessenger "target" -const uint32 kStopWatchClipboardRefs = 'TCfw'; - // StopWatching() given BMessenger "target" -const uint32 kFSClipboardChanges = 'TCch'; - // Used by FSClipboard functions which change refs in clipboard and are - // used outside Tracker (like BFilePanel called in another app) - // Contains movemodes named as in FSClipboard operations and in Clipboard - // (look into FSClipboard files) - -} // namespace BPrivate - -using namespace BPrivate; - - -#endif // _PUBLIC_COMMANDS_H