Expand a bit of ownership...
This commit is contained in:
@ -777,9 +777,9 @@ void FltkComplexButtonResource::widgetCallback (Fl_Widget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
dw::core::Platform *FltkComplexButtonResource::createPlatform ()
|
||||
std::unique_ptr< dw::core::Platform > FltkComplexButtonResource::createPlatform ()
|
||||
{
|
||||
return new FltkPlatform ();
|
||||
return std::make_unique< FltkPlatform >();
|
||||
}
|
||||
|
||||
void FltkComplexButtonResource::attachView (FltkView *view)
|
||||
|
||||
@ -275,7 +275,7 @@ protected:
|
||||
|
||||
void sizeAllocate (core::Allocation *allocation);
|
||||
|
||||
dw::core::Platform *createPlatform ();
|
||||
std::unique_ptr< dw::core::Platform > createPlatform ();
|
||||
void setLayout (dw::core::Layout *layout);
|
||||
|
||||
int reliefXThickness ();
|
||||
|
||||
2
dw/ui.cc
2
dw/ui.cc
@ -345,7 +345,7 @@ void ComplexButtonResource::init (std::unique_ptr< Widget > widget)
|
||||
childWidget = widget.get();
|
||||
|
||||
/* FIXME: Buttons should not need a full Layout */
|
||||
layout = new Layout (createPlatform (), false);
|
||||
layout = new Layout (createPlatform ().release(), false);
|
||||
setLayout (layout);
|
||||
DBG_OBJ_ASSOC_CHILD (layout);
|
||||
layout->setWidget (std::move( widget ));
|
||||
|
||||
4
dw/ui.hh
4
dw/ui.hh
@ -5,6 +5,8 @@
|
||||
# error Do not include this file directly, use "core.hh" instead.
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace dw {
|
||||
namespace core {
|
||||
|
||||
@ -427,7 +429,7 @@ protected:
|
||||
|
||||
void setEmbed (Embed *embed);
|
||||
|
||||
virtual Platform *createPlatform () = 0;
|
||||
virtual std::unique_ptr< Platform > createPlatform () = 0;
|
||||
virtual void setLayout (Layout *layout) = 0;
|
||||
|
||||
virtual int reliefXThickness () = 0;
|
||||
|
||||
Reference in New Issue
Block a user