📄 pixmap.cpp
字号:
// Pixmap.cpp: implementation of the CPixmap class.
//
//////////////////////////////////////////////////////////////////////
#include "Pixmap.h"
static char * default_xpm[];
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPixmap::CPixmap(const gchar* filename)
{
m_pixmap = gdk_pixmap_colormap_create_from_xpm((GdkWindow*)NULL,
gdk_colormap_get_system (), &m_mask, (GdkColor*)NULL, filename);
if(!m_pixmap)
m_pixmap = gdk_pixmap_colormap_create_from_xpm_d((GdkWindow*)NULL,
gdk_colormap_get_system (), &m_mask, (GdkColor*)NULL, (gchar**) default_xpm);
}
CPixmap::CPixmap(const CPixmap& pix)
{
m_pixmap = pix.m_pixmap;
m_mask = pix.m_mask;
if(m_pixmap)
gdk_pixmap_ref(m_pixmap);
if(m_mask)
gdk_bitmap_ref(m_mask);
}
CPixmap& CPixmap::operator=(CPixmap& pix)
{
m_pixmap = pix.m_pixmap;
m_mask = pix.m_mask;
if(m_pixmap)
gdk_pixmap_ref(m_pixmap);
if(m_mask)
gdk_bitmap_ref(m_mask);
return *this;
}
CPixmap::~CPixmap()
{
if(m_pixmap)
gdk_pixmap_unref(m_pixmap);
if(m_mask)
gdk_bitmap_unref(m_mask);
}
/* XPM */
static char * default_xpm[] = {
"10 10 1 1",
". c #000000",
"..........",
"..........",
"..........",
"..........",
"..........",
"..........",
"..........",
"..........",
"..........",
"..........",
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -