foobar2000 SDK  2015-08-03
Public Member Functions | Private Member Functions | Private Attributes
win32_font

#include <win32_misc.h>

Public Member Functions

 win32_font (HFONT p_initval)
 
 win32_font ()
 
 ~win32_font ()
 
void create (const t_font_description &p_desc)
 
HFONT detach ()
 
HFONT get () const
 
bool is_valid () const
 
void release ()
 
void set (HFONT p_font)
 

Private Member Functions

 win32_font (const win32_font &)
 
const win32_fontoperator= (const win32_font &)
 

Private Attributes

HFONT m_font
 

Detailed Description

Definition at line 9 of file win32_misc.h.

Constructor & Destructor Documentation

win32_font::win32_font ( HFONT  p_initval)
inline

Definition at line 11 of file win32_misc.h.

11 : m_font(p_initval) {}
HFONT m_font
Definition: win32_misc.h:37
win32_font::win32_font ( )
inline

Definition at line 12 of file win32_misc.h.

12 : m_font(NULL) {}
HFONT m_font
Definition: win32_misc.h:37
win32_font::~win32_font ( )
inline

Definition at line 13 of file win32_misc.h.

13 {release();}
void release()
Definition: win32_misc.h:15
win32_font::win32_font ( const win32_font )
private

Member Function Documentation

void win32_font::create ( const t_font_description p_desc)
inline

Definition at line 24 of file win32_misc.h.

24  {
25  SetLastError(NO_ERROR);
26  HFONT temp = p_desc.create();
27  if (temp == NULL) throw exception_win32(GetLastError());
28  set(temp);
29  }
HFONT SHARED_EXPORT create() const
HFONT win32_font::detach ( )
inline

Definition at line 22 of file win32_misc.h.

22 {return pfc::replace_t(m_font,(HFONT)NULL);}
t_type replace_t(t_type &p_var, const t_newval &p_newval)
Definition: primitives.h:682
HFONT m_font
Definition: win32_misc.h:37
HFONT win32_font::get ( ) const
inline

Definition at line 21 of file win32_misc.h.

21 {return m_font;}
HFONT m_font
Definition: win32_misc.h:37
bool win32_font::is_valid ( ) const
inline

Definition at line 31 of file win32_misc.h.

31 {return m_font != NULL;}
HFONT m_font
Definition: win32_misc.h:37
const win32_font& win32_font::operator= ( const win32_font )
private
void win32_font::release ( )
inline

Definition at line 15 of file win32_misc.h.

15  {
16  HFONT temp = detach();
17  if (temp != NULL) DeleteObject(temp);
18  }
HFONT detach()
Definition: win32_misc.h:22
void win32_font::set ( HFONT  p_font)
inline

Definition at line 20 of file win32_misc.h.

20 {release(); m_font = p_font;}
HFONT m_font
Definition: win32_misc.h:37
void release()
Definition: win32_misc.h:15

Field Documentation

HFONT win32_font::m_font
private

Definition at line 37 of file win32_misc.h.


The documentation for this class was generated from the following file: