Start to permeate more ownership.
This commit is contained in:
@ -49,10 +49,8 @@ private:
|
|||||||
int isRoot() { return (root == NULL); }
|
int isRoot() { return (root == NULL); }
|
||||||
void detachScaledBuf (FltkImgbuf *scaledBuf);
|
void detachScaledBuf (FltkImgbuf *scaledBuf);
|
||||||
|
|
||||||
protected:
|
|
||||||
~FltkImgbuf ();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
~FltkImgbuf ();
|
||||||
FltkImgbuf (Type type, int width, int height, double gamma);
|
FltkImgbuf (Type type, int width, int height, double gamma);
|
||||||
|
|
||||||
static void freeall ();
|
static void freeall ();
|
||||||
|
@ -692,10 +692,11 @@ void FltkPlatform::copySelection(const char *text)
|
|||||||
Fl::copy(text, strlen(text), 0);
|
Fl::copy(text, strlen(text), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
core::Imgbuf *FltkPlatform::createImgbuf (core::Imgbuf::Type type,
|
std::unique_ptr< core::Imgbuf >
|
||||||
|
FltkPlatform::createImgbuf( core::Imgbuf::Type type,
|
||||||
int width, int height, double gamma)
|
int width, int height, double gamma)
|
||||||
{
|
{
|
||||||
return new FltkImgbuf (type, width, height, gamma);
|
return std::make_unique< FltkImgbuf >( type, width, height, gamma );
|
||||||
}
|
}
|
||||||
|
|
||||||
core::ui::ResourceFactory *FltkPlatform::getResourceFactory ()
|
core::ui::ResourceFactory *FltkPlatform::getResourceFactory ()
|
||||||
|
@ -171,8 +171,8 @@ public:
|
|||||||
core::style::Tooltip *createTooltip (const char *text);
|
core::style::Tooltip *createTooltip (const char *text);
|
||||||
void cancelTooltip();
|
void cancelTooltip();
|
||||||
|
|
||||||
core::Imgbuf *createImgbuf (core::Imgbuf::Type type, int width, int height,
|
std::unique_ptr< core::Imgbuf > createImgbuf( core::Imgbuf::Type type, int width, int height,
|
||||||
double gamma);
|
double gamma );
|
||||||
|
|
||||||
void copySelection(const char *text);
|
void copySelection(const char *text);
|
||||||
|
|
||||||
|
@ -414,8 +414,8 @@ public:
|
|||||||
return platform->cancelTooltip ();
|
return platform->cancelTooltip ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Imgbuf *createImgbuf (Imgbuf::Type type, int width, int height,
|
inline std::unique_ptr< Imgbuf >
|
||||||
double gamma)
|
createImgbuf( Imgbuf::Type type, int width, int height, double gamma )
|
||||||
{
|
{
|
||||||
return platform->createImgbuf (type, width, height, gamma);
|
return platform->createImgbuf (type, width, height, gamma);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef __DW_PLATFORM_HH__
|
#ifndef __DW_PLATFORM_HH__
|
||||||
#define __DW_PLATFORM_HH__
|
#define __DW_PLATFORM_HH__
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#ifndef __INCLUDED_FROM_DW_CORE_HH__
|
#ifndef __INCLUDED_FROM_DW_CORE_HH__
|
||||||
# error Do not include this file directly, use "core.hh" instead.
|
# error Do not include this file directly, use "core.hh" instead.
|
||||||
#endif
|
#endif
|
||||||
@ -152,8 +154,8 @@ public:
|
|||||||
*
|
*
|
||||||
* "gamma" is the value by which the image data is gamma-encoded.
|
* "gamma" is the value by which the image data is gamma-encoded.
|
||||||
*/
|
*/
|
||||||
virtual Imgbuf *createImgbuf (Imgbuf::Type type, int width, int height,
|
virtual std::unique_ptr< Imgbuf > createImgbuf( Imgbuf::Type type, int width, int height,
|
||||||
double gamma) = 0;
|
double gamma )= 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Copy selected text (0-terminated).
|
* \brief Copy selected text (0-terminated).
|
||||||
|
@ -104,7 +104,7 @@ void *a_Imgbuf_new(void *layout, int img_type, uint_t width, uint_t height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (void*)((Layout*)layout)->createImgbuf(Imgbuf::RGB, width, height,
|
return (void*)((Layout*)layout)->createImgbuf(Imgbuf::RGB, width, height,
|
||||||
gamma);
|
gamma).release();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user