From bd1ede2ae9c4e82a3b2859209edd2c951ec7bfd8 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Mon, 24 Jan 2005 17:34:47 +0000 Subject: [PATCH] Yes... I really don't remember why I haven't subclassed FMWList from BList... git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11007 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/FMWList.cpp | 66 ++++++++---------------------- src/servers/app/server/FMWList.h | 16 ++------ 2 files changed, 19 insertions(+), 63 deletions(-) diff --git a/src/servers/app/server/FMWList.cpp b/src/servers/app/server/FMWList.cpp index 780181b932..22d0883392 100644 --- a/src/servers/app/server/FMWList.cpp +++ b/src/servers/app/server/FMWList.cpp @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, Haiku, Inc. +// Copyright (c) 2001-2002, OpenBeOS // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -20,7 +20,7 @@ // DEALINGS IN THE SOFTWARE. // // File Name: FMWList.cpp -// Author: Adi Oanca +// Author: Adi Oanca // Description: List class for tracking floating and modal windows // //------------------------------------------------------------------------------ @@ -32,26 +32,27 @@ #include "ServerWindow.h" FMWList::FMWList(void) + : BList() { } FMWList::~FMWList(void) { -// printf("~FMWList()\n"); -// if (fList.CountItems() > 0) -// printf("SERVER: WARNING: FMWList NOT empty in destructor!\n"); } -void FMWList::AddItem(void *item) +void FMWList::AddWinBorder(void *item) { + if(HasItem(item)) + return; + int32 feelItem = ((WinBorder*)item)->Window()->Feel();; int32 feelTemp = 0; int32 location = 0; - for(int32 i=0; iWindow()->Feel(); + feelTemp = ((WinBorder*)ItemAt(i))->Window()->Feel(); // in short: if 'item' is a floating window if( (feelItem == B_FLOATING_SUBSET_WINDOW_FEEL || @@ -68,50 +69,15 @@ void FMWList::AddItem(void *item) break; } } - fList.AddItem(item, location); -} - -bool FMWList::HasItem(void *item) const -{ - return fList.HasItem(item); -} - -bool FMWList::RemoveItem(void *item) -{ - return fList.RemoveItem(item); -} - -void *FMWList::ItemAt(int32 i) const -{ - return fList.ItemAt(i); -} - -int32 FMWList::CountItems() const -{ - return fList.CountItems(); -} - -void *FMWList::LastItem() const -{ - return fList.LastItem(); -} - -void *FMWList::FirstItem() const -{ - return fList.FirstItem(); -} - -int32 FMWList::IndexOf(void *item) -{ - return fList.IndexOf(item); + AddItem(item, location); } void FMWList::AddFMWList(FMWList *list) { int32 i=0; - for(i=0; iWindow()->Feel(); + int32 feel = ((WinBorder*)ItemAt(i))->Window()->Feel(); if(feel == B_MODAL_SUBSET_WINDOW_FEEL || feel == B_MODAL_APP_WINDOW_FEEL || feel == B_MODAL_ALL_WINDOW_FEEL) @@ -129,11 +95,11 @@ void FMWList::AddFMWList(FMWList *list) feel == B_MODAL_APP_WINDOW_FEEL || feel == B_MODAL_ALL_WINDOW_FEEL) { - fList.AddItem(item, fList.CountItems()); + AddItem(item, CountItems()); } else { - fList.AddItem(item, i); + AddItem(item, i); i++; } } @@ -143,9 +109,9 @@ void FMWList::PrintToStream() const { printf("Floating and modal windows list:\n"); WinBorder *wb = NULL; - for (int32 i=0; iGetName()); diff --git a/src/servers/app/server/FMWList.h b/src/servers/app/server/FMWList.h index 67dc936038..3bc06d3608 100644 --- a/src/servers/app/server/FMWList.h +++ b/src/servers/app/server/FMWList.h @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, Haiku, Inc. +// Copyright (c) 2001-2002, OpenBeOS // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -30,28 +30,18 @@ #include #include -class FMWList +class FMWList : public BList { public: FMWList(void); virtual ~FMWList(void); - void AddItem(void *item); - bool HasItem(void *item) const; - bool RemoveItem(void* item); - void *ItemAt(int32 i) const; - int32 CountItems(void) const; - void *LastItem(void) const; - void *FirstItem(void) const; - int32 IndexOf(void *item); + void AddWinBorder(void *item); // special void AddFMWList(FMWList *list); // debugging methods void PrintToStream() const; - -private: - BList fList; }; #endif