From fd99e7194c3df67ce323a179237add69611ea0bd Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 23 Dec 2004 14:03:28 +0000 Subject: [PATCH] Made the (private) 'JAHA' message a constant, and moved it to ViewAux.h. Maybe it doesn't fit much in there, but I didn't want to create a new header just for it. Feel free to move it to a better place. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10521 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/interface/ViewAux.h | 16 ++++++++-------- src/kits/interface/Dragger.cpp | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/headers/private/interface/ViewAux.h b/headers/private/interface/ViewAux.h index b44fa01fb7..957ac6fbb3 100644 --- a/headers/private/interface/ViewAux.h +++ b/headers/private/interface/ViewAux.h @@ -2,15 +2,14 @@ #define _VIEWAUX_H_ #include -#include -#include -#include -#include #include -/* - URGENT: Move this structure in a private header. - This one is copied from Shape.cpp. -*/ +#include +#include +#include +#include + +const static uint32 kDeleteDragger = 'JAHA'; + struct shape_data { uint32 *opList; int32 opCount; @@ -43,6 +42,7 @@ enum { }; +// JB: Is there any reason why this can't be a struct ? //struct _view_attr_{ class ViewAttr { diff --git a/src/kits/interface/Dragger.cpp b/src/kits/interface/Dragger.cpp index 0af85c36aa..a6bea7fbff 100644 --- a/src/kits/interface/Dragger.cpp +++ b/src/kits/interface/Dragger.cpp @@ -36,6 +36,7 @@ #include #include +#include bool BDragger::sVisible; bool BDragger::sInited; @@ -277,7 +278,7 @@ BDragger::MessageReceived(BMessage *msg) { if (msg->what == B_TRASH_TARGET) { if (fShelf) - Window()->PostMessage('JAHA', fTarget, NULL); // TODO: 'JAHA' ? What's that ? + Window()->PostMessage(kDeleteDragger, fTarget, NULL); else (new BAlert("??", "Can't delete this replicant from its original application. Life goes on.", @@ -555,14 +556,14 @@ BDragger::BuildDefaultPopUp() char about[B_OS_NAME_LENGTH]; snprintf(about, B_OS_NAME_LENGTH, "About %s", name); - + fPopUp->AddItem(new BMenuItem(about, msg)); // Separator fPopUp->AddItem(new BSeparatorItem()); // Delete - fPopUp->AddItem(new BMenuItem("Delete", new BMessage('JAHA'))); + fPopUp->AddItem(new BMenuItem("Delete", new BMessage(kDeleteDragger))); }