bonefish + zooey:
* Fixed a general problem with respect to overriding of the reserved virtual function slots: instead of statically invoking the method that corresponds to the reserved slot on the class that contains the slot, we now invoke the virtual Perform() method. Perform() then dispatches the method invocation to the "proper" class, i.e. the highest class in the hierarchy that actually implements the requested method. This fixes a crash in apps that use liblayout's MSlider class and should fix one or other spurious bug with old apps or libraries, too. * added new header folder 'binary_compatibility' that contains files that define the method codes and data structures required by Perform() * looked for and implemented all used reserved virtual slot functions to invoke Perform() where necessary or to pass on the method call statically (for slots that were already maintained by Be) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28124 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -18,11 +18,13 @@
|
||||
#include <Window.h>
|
||||
|
||||
#include <AppMisc.h>
|
||||
#include <binary_compatibility/Interface.h>
|
||||
#include <MenuPrivate.h>
|
||||
#include <TokenSpace.h>
|
||||
|
||||
#include "BMCPrivate.h"
|
||||
|
||||
|
||||
using BPrivate::gDefaultTokens;
|
||||
|
||||
|
||||
@@ -325,9 +327,58 @@ BMenuBar::AllDetached()
|
||||
|
||||
|
||||
status_t
|
||||
BMenuBar::Perform(perform_code d, void *arg)
|
||||
BMenuBar::Perform(perform_code code, void* _data)
|
||||
{
|
||||
return BMenu::Perform(d, arg);
|
||||
switch (code) {
|
||||
case PERFORM_CODE_MIN_SIZE:
|
||||
((perform_data_min_size*)_data)->return_value
|
||||
= BMenuBar::MinSize();
|
||||
return B_OK;
|
||||
case PERFORM_CODE_MAX_SIZE:
|
||||
((perform_data_max_size*)_data)->return_value
|
||||
= BMenuBar::MaxSize();
|
||||
return B_OK;
|
||||
case PERFORM_CODE_PREFERRED_SIZE:
|
||||
((perform_data_preferred_size*)_data)->return_value
|
||||
= BMenuBar::PreferredSize();
|
||||
return B_OK;
|
||||
case PERFORM_CODE_LAYOUT_ALIGNMENT:
|
||||
((perform_data_layout_alignment*)_data)->return_value
|
||||
= BMenuBar::LayoutAlignment();
|
||||
return B_OK;
|
||||
case PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH:
|
||||
((perform_data_has_height_for_width*)_data)->return_value
|
||||
= BMenuBar::HasHeightForWidth();
|
||||
return B_OK;
|
||||
case PERFORM_CODE_GET_HEIGHT_FOR_WIDTH:
|
||||
{
|
||||
perform_data_get_height_for_width* data
|
||||
= (perform_data_get_height_for_width*)_data;
|
||||
BMenuBar::GetHeightForWidth(data->width, &data->min, &data->max,
|
||||
&data->preferred);
|
||||
return B_OK;
|
||||
}
|
||||
case PERFORM_CODE_SET_LAYOUT:
|
||||
{
|
||||
perform_data_set_layout* data = (perform_data_set_layout*)_data;
|
||||
BMenuBar::SetLayout(data->layout);
|
||||
return B_OK;
|
||||
}
|
||||
case PERFORM_CODE_INVALIDATE_LAYOUT:
|
||||
{
|
||||
perform_data_invalidate_layout* data
|
||||
= (perform_data_invalidate_layout*)_data;
|
||||
BMenuBar::InvalidateLayout(data->descendants);
|
||||
return B_OK;
|
||||
}
|
||||
case PERFORM_CODE_DO_LAYOUT:
|
||||
{
|
||||
BMenuBar::DoLayout();
|
||||
return B_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return BMenu::Perform(code, _data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user