本文整理汇总了C++中UnRef函数的典型用法代码示例。如果您正苦于以下问题:C++ UnRef函数的具体用法?C++ UnRef怎么用?C++ UnRef使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UnRef函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnRef
bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
{
UnRef();
wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") )
wxCHECK_MSG( depth == -1 || depth == 1, FALSE, wxT("invalid bitmap depth") )
if (image.GetWidth() <= 0 || image.GetHeight() <= 0)
return false;
m_refData = new wxBitmapRefData();
if (depth == 1)
{
return CreateFromImageAsBitmap(image);
}
else
{
#ifdef __WXGTK20__
if (image.HasAlpha())
return CreateFromImageAsPixbuf(image);
#endif
return CreateFromImageAsPixmap(image);
}
}
示例2: UnRef
bool wxPalette::Create( int n,
const unsigned char* pRed,
const unsigned char* pGreen,
const unsigned char* pBlue )
{
PULONG pualTable;
UnRef();
m_refData = new wxPaletteRefData;
pualTable = new ULONG[n];
if (!pualTable)
return false;
for (int i = 0; i < n; i ++)
{
pualTable[i] = (PC_RESERVED * 16777216) + ((int)pRed[i] * 65536) + ((int)pGreen[i] * 256) + (int)pBlue[i];
}
M_PALETTEDATA->m_hPalette = (WXHPALETTE)::GpiCreatePalette( vHabmain
,LCOL_PURECOLOR
,LCOLF_CONSECRGB
,(LONG)n
,pualTable
);
delete [] pualTable;
return true;
} // end of wxPalette::Create
示例3: wxCHECK_MSG
bool wxPlotFunction::Create( const wxPlotFunction& curve )
{
wxCHECK_MSG(curve.Ok(), false, wxT("invalid plot function"));
UnRef();
Ref(curve);
return true;
}
示例4: UnRef
cLuaState::cRef::~cRef()
{
if (m_LuaState != nullptr)
{
UnRef();
}
}
示例5: WXUNUSED
bool wxAnimation::LoadFile(const wxString &name, wxAnimationType WXUNUSED(type))
{
UnRef();
m_pixbuf = gdk_pixbuf_animation_new_from_file(
wxConvFileName->cWX2MB(name), NULL);
return IsOk();
}
示例6: UnRef
bool wxBitmap::Create(int width, int height, int depth )
{
UnRef();
m_refData = new wxBitmapRefData(width, height, depth);
return true;
}
示例7: UnRef
bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
{
UnRef();
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL )
{
wxImage image;
if ( !image.LoadFile(name, type) || !image.IsOk() )
{
wxLogError(_("No bitmap handler for type %d defined."), type);
return false;
}
else
{
*this = wxBitmap(image);
return true;
}
}
m_refData = new wxBitmapRefData();
return handler->LoadFile(this, name, type, -1, -1);
}
示例8: UnRef
cLuaState::cRef::~cRef()
{
if (m_LuaState != NULL)
{
UnRef();
}
}
示例9: UnRef
void wxGenericPen::Create(const wxGenericColour &colour, int width, wxPenStyle style,
wxPenCap cap, wxPenJoin join )
{
UnRef();
m_refData = new wxGenericPenRefData(width, style, cap, join);
M_GPENDATA->m_colour = colour;
}
示例10: UnRef
void wxGenericPen::Create(const wxGenericColour &colour, int width, int style,
int cap, int join )
{
UnRef();
m_refData = new wxGenericPenRefData(width, style, cap, join);
M_GPENDATA->m_colour = colour;
}
示例11: UnRef
void wxAnimation::SetPixbuf(GdkPixbufAnimation* p)
{
UnRef();
m_pixbuf = p;
if (m_pixbuf)
g_object_ref(m_pixbuf);
}
示例12: wxCHECK_MSG
bool wxOptionValue::Create( const wxOptionValue &optValue )
{
wxCHECK_MSG( optValue.Ok(), false, wxT("Invalid wxOptionValue") );
UnRef();
Ref( optValue );
return Ok();
}
示例13: wxCHECK_MSG
bool wxSheetCellRenderer::Copy(const wxSheetCellRenderer& other)
{
wxCHECK_MSG(other.Ok(), false, wxT("wxSheetCellRenderer is not created"));
UnRef();
m_refData = ((wxSheetCellRendererRefData*)other.m_refData)->Clone();
return true;
}
示例14: UnRef
bool wxFontBase::SetFaceName(const wxString &facename)
{
if (!wxFontEnumerator::IsValidFacename(facename))
{
UnRef(); // make Ok() return false
return false;
}
return true;
}
示例15: UnRef
void wxColour::InitRGBA(unsigned char red, unsigned char green, unsigned char blue,
unsigned char alpha)
{
UnRef();
m_refData = new wxColourRefData(
(guint16(red) << SHIFT) + red,
(guint16(green) << SHIFT) + green,
(guint16(blue) << SHIFT) + blue,
alpha);
}