BDeskbar: Moved constants to shared header

* Instead of duplicating them in different files.
This commit is contained in:
Axel Dörfler 2018-11-03 17:50:37 +00:00
parent ed08b22dec
commit 5fd3bc6d2c
5 changed files with 52 additions and 46 deletions

View File

@ -0,0 +1,39 @@
/*
* Copyright 2001-2018 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Jérôme Duval
* Axel Dörfler
* Jeremy Rand, jrand@magma.ca
* John Scipione, jscipione@gmail.com
*/
#ifndef _DESKBAR_PRIVATE_H
#define _DESKBAR_PRIVATE_H
#ifndef kDeskbarSignature
# define kDeskbarSignature "application/x-vnd.Be-TSKB"
#endif
static const uint32 kMsgIsAlwaysOnTop = 'gtop';
static const uint32 kMsgAlwaysOnTop = 'stop';
static const uint32 kMsgIsAutoRaise = 'grse';
static const uint32 kMsgAutoRaise = 'srse';
static const uint32 kMsgIsAutoHide = 'ghid';
static const uint32 kMsgAutoHide = 'shid';
static const uint32 kMsgAddView = 'icon';
static const uint32 kMsgAddAddOn = 'adon';
static const uint32 kMsgHasItem = 'exst';
static const uint32 kMsgGetItemInfo = 'info';
static const uint32 kMsgCountItems = 'cwnt';
static const uint32 kMsgRemoveItem = 'remv';
static const uint32 kMsgLocation = 'gloc';
static const uint32 kMsgIsExpanded = 'gexp';
static const uint32 kMsgSetLocation = 'sloc';
static const uint32 kMsgExpand = 'sexp';
#endif /* _DESKBAR_PRIVATE_H */

View File

@ -54,7 +54,10 @@ All rights reserved.
#include <Messenger.h>
#include <Path.h>
#include <Roster.h>
#include <DeskbarPrivate.h>
#include <RosterPrivate.h>
#include "tracker_private.h"
#include "BarView.h"
#include "BarWindow.h"
@ -67,7 +70,6 @@ All rights reserved.
#include "Utilities.h"
#include "icons.h"
#include "tracker_private.h"
BLocker TBarApp::sSubscriberLock;

View File

@ -79,25 +79,6 @@ const uint32 kUpdatePreferences = 'Pref';
// realign replicants message constant
const uint32 kRealignReplicants = 'Algn';
// BDeskbar message constants
static const uint32 kMsgIsAlwaysOnTop = 'gtop';
static const uint32 kMsgAlwaysOnTop = 'stop';
static const uint32 kMsgIsAutoRaise = 'grse';
static const uint32 kMsgAutoRaise = 'srse';
static const uint32 kMsgIsAutoHide = 'ghid';
static const uint32 kMsgAutoHide = 'shid';
static const uint32 kMsgAddView = 'icon';
static const uint32 kMsgAddAddOn = 'adon';
static const uint32 kMsgHasItem = 'exst';
static const uint32 kMsgGetItemInfo = 'info';
static const uint32 kMsgCountItems = 'cwnt';
static const uint32 kMsgRemoveItem = 'remv';
static const uint32 kMsgLocation = 'gloc';
static const uint32 kMsgIsExpanded = 'gexp';
static const uint32 kMsgSetLocation = 'sloc';
static const uint32 kMsgExpand = 'sexp';
/* --------------------------------------------- */
class BBitmap;

View File

@ -52,6 +52,9 @@ All rights reserved.
#include <MessagePrivate.h>
#include <Screen.h>
#include <DeskbarPrivate.h>
#include <tracker_private.h>
#include "BarApp.h"
#include "BarMenuBar.h"
#include "BarView.h"
@ -60,7 +63,6 @@ All rights reserved.
#include "ExpandoMenuBar.h"
#include "StatusView.h"
#include "tracker_private.h"
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "MainWindow"

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2017 Haiku, Inc. All Rights Reserved.
* Copyright 2001-2018 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -11,6 +11,9 @@
#include <Deskbar.h>
#include <string.h>
#include <Messenger.h>
#include <Message.h>
#include <View.h>
@ -18,10 +21,10 @@
#include <InterfaceDefs.h>
#include <Node.h>
#include <string.h>
#include <DeskbarPrivate.h>
// ToDo: in case the BDeskbar methods are called from a Deskbar add-on,
// TODO: in case the BDeskbar methods are called from a Deskbar add-on,
// they will currently deadlock most of the time (only those that do
// not need a reply will work).
// That should be fixed in the Deskbar itself, even if the Be API found
@ -31,27 +34,6 @@
// should work with all versions of Tracker available for Haiku.
static const char* kDeskbarSignature = "application/x-vnd.Be-TSKB";
static const uint32 kMsgIsAlwaysOnTop = 'gtop';
static const uint32 kMsgAlwaysOnTop = 'stop';
static const uint32 kMsgIsAutoRaise = 'grse';
static const uint32 kMsgAutoRaise = 'srse';
static const uint32 kMsgIsAutoHide = 'ghid';
static const uint32 kMsgAutoHide = 'shid';
static const uint32 kMsgAddView = 'icon';
static const uint32 kMsgAddAddOn = 'adon';
static const uint32 kMsgHasItem = 'exst';
static const uint32 kMsgGetItemInfo = 'info';
static const uint32 kMsgCountItems = 'cwnt';
static const uint32 kMsgRemoveItem = 'remv';
static const uint32 kMsgLocation = 'gloc';
static const uint32 kMsgIsExpanded = 'gexp';
static const uint32 kMsgSetLocation = 'sloc';
static const uint32 kMsgExpand = 'sexp';
status_t
get_deskbar_frame(BRect* frame)
{
@ -328,7 +310,7 @@ BDeskbar::HasItem(const char* name) const
uint32
BDeskbar::CountItems() const
{
BMessage request(kMsgCountItems);
BMessage request(kMsgCountItems);
BMessage reply;
if (fMessenger->SendMessage(&request, &reply) == B_OK)