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
This commit is contained in:
Stefano Ceccherini 2005-02-23 11:23:41 +00:00
parent 94e3125a61
commit a84dde4cde
2 changed files with 24 additions and 19 deletions

View File

@ -31,20 +31,16 @@
#include <new> #include <new>
#include <stdlib.h> #include <stdlib.h>
#include <Application.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <InterfaceDefs.h>
#include <Locker.h> #include <Locker.h>
#include <OS.h>
#include <View.h> #include <View.h>
#include <Window.h>
// Includes to be able to talk to the app_server // Includes to be able to talk to the app_server
#include <Application.h>
#include <ServerProtocol.h> #include <ServerProtocol.h>
#include <AppServerLink.h> #include <AppServerLink.h>
enum {
NOT_IMPLEMENTED = B_ERROR
};
// TODO: system palette -- hard-coded for now, when the app server is ready // TODO: system palette -- hard-coded for now, when the app server is ready
// we should use system_colors() or BScreen::ColorMap(). // 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); | (needsContiguous ? B_BITMAP_IS_CONTIGUOUS : 0);
InitObject(bounds, colorSpace, flags, B_ANY_BYTES_PER_ROW, InitObject(bounds, colorSpace, flags, B_ANY_BYTES_PER_ROW,
B_MAIN_SCREEN_ID); B_MAIN_SCREEN_ID);
} }
// constructor // constructor
@ -969,7 +966,7 @@ BBitmap::IsValid() const
status_t status_t
BBitmap::LockBits(uint32 *state) BBitmap::LockBits(uint32 *state)
{ {
return NOT_IMPLEMENTED; return B_ERROR;
} }
// UnlockBits // UnlockBits
@ -2053,7 +2050,8 @@ BBitmap::ImportBits(const BBitmap *bitmap)
status_t status_t
BBitmap::GetOverlayRestrictions(overlay_restrictions *restrictions) const BBitmap::GetOverlayRestrictions(overlay_restrictions *restrictions) const
{ {
return NOT_IMPLEMENTED; // TODO: Implement
return B_ERROR;
} }
// AddChild // AddChild
@ -2067,6 +2065,8 @@ BBitmap::GetOverlayRestrictions(overlay_restrictions *restrictions) const
void void
BBitmap::AddChild(BView *view) BBitmap::AddChild(BView *view)
{ {
if (fWindow != NULL)
fWindow->AddChild(view);
} }
// RemoveChild // RemoveChild
@ -2076,7 +2076,7 @@ BBitmap::AddChild(BView *view)
bool bool
BBitmap::RemoveChild(BView *view) BBitmap::RemoveChild(BView *view)
{ {
return false; // not implemented return fWindow != NULL ? fWindow->RemoveChild(view) : false;
} }
// CountChildren // CountChildren
@ -2086,7 +2086,7 @@ BBitmap::RemoveChild(BView *view)
int32 int32
BBitmap::CountChildren() const BBitmap::CountChildren() const
{ {
return 0; // not implemented return fWindow != NULL ? fWindow->CountChildren() : 0;
} }
// ChildAt // ChildAt
@ -2098,7 +2098,7 @@ BBitmap::CountChildren() const
BView* BView*
BBitmap::ChildAt(int32 index) const BBitmap::ChildAt(int32 index) const
{ {
return NULL; // not implemented return fWindow != NULL ? fWindow->ChildAt(index) : NULL;
} }
// FindView // FindView
@ -2110,7 +2110,7 @@ BBitmap::ChildAt(int32 index) const
BView* BView*
BBitmap::FindView(const char *viewName) const BBitmap::FindView(const char *viewName) const
{ {
return NULL; // not implemented return fWindow != NULL ? fWindow->FindView(viewName) : NULL;
} }
// FindView // FindView
@ -2122,7 +2122,7 @@ BBitmap::FindView(const char *viewName) const
BView * BView *
BBitmap::FindView(BPoint point) const BBitmap::FindView(BPoint point) const
{ {
return NULL; // not implemented return fWindow != NULL ? fWindow->FindView(point) : NULL;
} }
// Lock // Lock
@ -2136,7 +2136,7 @@ BBitmap::FindView(BPoint point) const
bool bool
BBitmap::Lock() BBitmap::Lock()
{ {
return false; // not implemented return fWindow != NULL ? fWindow->Lock() : false;
} }
// Unlock // Unlock
@ -2147,6 +2147,8 @@ BBitmap::Lock()
void void
BBitmap::Unlock() BBitmap::Unlock()
{ {
if (fWindow != NULL)
fWindow->Unlock();
} }
// IsLocked // IsLocked
@ -2159,7 +2161,7 @@ BBitmap::Unlock()
bool bool
BBitmap::IsLocked() const BBitmap::IsLocked() const
{ {
return false; // not implemented return fWindow != NULL ? fWindow->IsLocked() : false;
} }
// Perform // Perform
@ -2168,7 +2170,7 @@ BBitmap::IsLocked() const
status_t status_t
BBitmap::Perform(perform_code d, void *arg) BBitmap::Perform(perform_code d, void *arg)
{ {
return NOT_IMPLEMENTED; return BArchivable::Perform(d, arg);
} }
// FBC // FBC

View File

@ -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 // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
@ -932,10 +932,13 @@ BHandler *BListView::ResolveSpecifier(BMessage *msg, int32 index,
return this; 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->AddString("suites", "suite/vnd.Be-list-view");
data->AddFlat("messages", &BPropertyInfo(prop_list)); data->AddFlat("messages", &propertyInfo);
return BView::GetSupportedSuites(data); return BView::GetSupportedSuites(data);
} }