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)
|
void FltkComplexButtonResource::attachView (FltkView *view)
|
||||||
|
|||||||
@ -275,7 +275,7 @@ protected:
|
|||||||
|
|
||||||
void sizeAllocate (core::Allocation *allocation);
|
void sizeAllocate (core::Allocation *allocation);
|
||||||
|
|
||||||
dw::core::Platform *createPlatform ();
|
std::unique_ptr< dw::core::Platform > createPlatform ();
|
||||||
void setLayout (dw::core::Layout *layout);
|
void setLayout (dw::core::Layout *layout);
|
||||||
|
|
||||||
int reliefXThickness ();
|
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();
|
childWidget = widget.get();
|
||||||
|
|
||||||
/* FIXME: Buttons should not need a full Layout */
|
/* FIXME: Buttons should not need a full Layout */
|
||||||
layout = new Layout (createPlatform (), false);
|
layout = new Layout (createPlatform ().release(), false);
|
||||||
setLayout (layout);
|
setLayout (layout);
|
||||||
DBG_OBJ_ASSOC_CHILD (layout);
|
DBG_OBJ_ASSOC_CHILD (layout);
|
||||||
layout->setWidget (std::move( widget ));
|
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.
|
# error Do not include this file directly, use "core.hh" instead.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace dw {
|
namespace dw {
|
||||||
namespace core {
|
namespace core {
|
||||||
|
|
||||||
@ -427,7 +429,7 @@ protected:
|
|||||||
|
|
||||||
void setEmbed (Embed *embed);
|
void setEmbed (Embed *embed);
|
||||||
|
|
||||||
virtual Platform *createPlatform () = 0;
|
virtual std::unique_ptr< Platform > createPlatform () = 0;
|
||||||
virtual void setLayout (Layout *layout) = 0;
|
virtual void setLayout (Layout *layout) = 0;
|
||||||
|
|
||||||
virtual int reliefXThickness () = 0;
|
virtual int reliefXThickness () = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user