From a84dde4cdea85f6601bf3f5548f29787d534df33 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 23 Feb 2005 11:23:41 +0000 Subject: [PATCH] Implemeted some methods for BBitmaps which accepts views, got rid of "NOT_IMPLEMENTED". Fixed a warning in ListView.cpp git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11461 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Bitmap.cpp | 34 +++++++++++++++++---------------- src/kits/interface/ListView.cpp | 9 ++++++--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/kits/interface/Bitmap.cpp b/src/kits/interface/Bitmap.cpp index b87c9631ac..6b86824c11 100644 --- a/src/kits/interface/Bitmap.cpp +++ b/src/kits/interface/Bitmap.cpp @@ -31,20 +31,16 @@ #include #include +#include #include -#include #include -#include #include +#include // Includes to be able to talk to the app_server -#include #include #include -enum { - NOT_IMPLEMENTED = B_ERROR -}; // TODO: system palette -- hard-coded for now, when the app server is ready // we should use system_colors() or BScreen::ColorMap(). @@ -787,6 +783,7 @@ BBitmap::BBitmap(BRect bounds, color_space colorSpace, bool acceptsViews, | (needsContiguous ? B_BITMAP_IS_CONTIGUOUS : 0); InitObject(bounds, colorSpace, flags, B_ANY_BYTES_PER_ROW, B_MAIN_SCREEN_ID); + } // constructor @@ -969,7 +966,7 @@ BBitmap::IsValid() const status_t BBitmap::LockBits(uint32 *state) { - return NOT_IMPLEMENTED; + return B_ERROR; } // UnlockBits @@ -2053,7 +2050,8 @@ BBitmap::ImportBits(const BBitmap *bitmap) status_t BBitmap::GetOverlayRestrictions(overlay_restrictions *restrictions) const { - return NOT_IMPLEMENTED; + // TODO: Implement + return B_ERROR; } // AddChild @@ -2067,6 +2065,8 @@ BBitmap::GetOverlayRestrictions(overlay_restrictions *restrictions) const void BBitmap::AddChild(BView *view) { + if (fWindow != NULL) + fWindow->AddChild(view); } // RemoveChild @@ -2076,7 +2076,7 @@ BBitmap::AddChild(BView *view) bool BBitmap::RemoveChild(BView *view) { - return false; // not implemented + return fWindow != NULL ? fWindow->RemoveChild(view) : false; } // CountChildren @@ -2086,7 +2086,7 @@ BBitmap::RemoveChild(BView *view) int32 BBitmap::CountChildren() const { - return 0; // not implemented + return fWindow != NULL ? fWindow->CountChildren() : 0; } // ChildAt @@ -2098,7 +2098,7 @@ BBitmap::CountChildren() const BView* BBitmap::ChildAt(int32 index) const { - return NULL; // not implemented + return fWindow != NULL ? fWindow->ChildAt(index) : NULL; } // FindView @@ -2110,7 +2110,7 @@ BBitmap::ChildAt(int32 index) const BView* BBitmap::FindView(const char *viewName) const { - return NULL; // not implemented + return fWindow != NULL ? fWindow->FindView(viewName) : NULL; } // FindView @@ -2122,7 +2122,7 @@ BBitmap::FindView(const char *viewName) const BView * BBitmap::FindView(BPoint point) const { - return NULL; // not implemented + return fWindow != NULL ? fWindow->FindView(point) : NULL; } // Lock @@ -2136,7 +2136,7 @@ BBitmap::FindView(BPoint point) const bool BBitmap::Lock() { - return false; // not implemented + return fWindow != NULL ? fWindow->Lock() : false; } // Unlock @@ -2147,6 +2147,8 @@ BBitmap::Lock() void BBitmap::Unlock() { + if (fWindow != NULL) + fWindow->Unlock(); } // IsLocked @@ -2159,7 +2161,7 @@ BBitmap::Unlock() bool BBitmap::IsLocked() const { - return false; // not implemented + return fWindow != NULL ? fWindow->IsLocked() : false; } // Perform @@ -2168,7 +2170,7 @@ BBitmap::IsLocked() const status_t BBitmap::Perform(perform_code d, void *arg) { - return NOT_IMPLEMENTED; + return BArchivable::Perform(d, arg); } // FBC diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index a8d8473231..00fded98cd 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -1,5 +1,5 @@ //------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS +// Copyright (c) 2001-2005, Haiku, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@ -932,10 +932,13 @@ BHandler *BListView::ResolveSpecifier(BMessage *msg, int32 index, return this; } //------------------------------------------------------------------------------ -status_t BListView::GetSupportedSuites( BMessage *data ) +status_t +BListView::GetSupportedSuites(BMessage *data ) { + BPropertyInfo propertyInfo(prop_list); + data->AddString("suites", "suite/vnd.Be-list-view"); - data->AddFlat("messages", &BPropertyInfo(prop_list)); + data->AddFlat("messages", &propertyInfo); return BView::GetSupportedSuites(data); }