foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Static Public Member Functions | Data Fields
t_font_description

#include <shared.h>

Public Types

enum  { m_facename_length = LF_FACESIZE*2, m_height_dpi = 480 }
 

Public Member Functions

HFONT SHARED_EXPORT create () const
 
void SHARED_EXPORT from_font (HFONT p_font)
 
template<typename t_stream , typename t_abort >
void from_stream (t_stream p_stream, t_abort &p_abort)
 
bool operator!= (const t_font_description &other) const
 
bool operator== (const t_font_description &other) const
 
bool SHARED_EXPORT popup_dialog (HWND p_parent)
 
template<typename t_stream , typename t_abort >
void to_stream (t_stream p_stream, t_abort &p_abort) const
 

Static Public Member Functions

static bool g_equals (const t_font_description &v1, const t_font_description &v2)
 
static t_font_description SHARED_EXPORT g_from_font (HFONT p_font)
 
static t_font_description SHARED_EXPORT g_from_logfont (LOGFONT const &lf)
 
static t_font_description SHARED_EXPORT g_from_system (int id=TMT_MENUFONT)
 

Data Fields

t_uint8 m_charset
 
char m_facename [m_facename_length]
 
t_uint32 m_height
 
t_uint8 m_italic
 
t_uint32 m_weight
 

Detailed Description

Definition at line 431 of file shared.h.

Member Enumeration Documentation

anonymous enum
Enumerator
m_facename_length 
m_height_dpi 

Definition at line 433 of file shared.h.

Member Function Documentation

HFONT SHARED_EXPORT t_font_description::create ( ) const
void SHARED_EXPORT t_font_description::from_font ( HFONT  p_font)
template<typename t_stream , typename t_abort >
void t_font_description::from_stream ( t_stream  p_stream,
t_abort &  p_abort 
)

Definition at line 471 of file shared.h.

471  {
472  p_stream->read_lendian_t(m_height,p_abort);
473  p_stream->read_lendian_t(m_weight,p_abort);
474  p_stream->read_lendian_t(m_italic,p_abort);
475  p_stream->read_lendian_t(m_charset,p_abort);
476  pfc::string8 temp;
477  p_stream->read_string(temp,p_abort);
478  strncpy_s(m_facename,temp,PFC_TABSIZE(m_facename));
479 }
char m_facename[m_facename_length]
Definition: shared.h:443
t_uint8 m_italic
Definition: shared.h:441
t_uint32 m_height
Definition: shared.h:439
t_uint8 m_charset
Definition: shared.h:442
t_uint32 m_weight
Definition: shared.h:440
static bool t_font_description::g_equals ( const t_font_description v1,
const t_font_description v2 
)
inlinestatic

Definition at line 448 of file shared.h.

448  {
449  return v1.m_height == v2.m_height && v1.m_weight == v2.m_weight && v1.m_italic == v2.m_italic && v1.m_charset == v2.m_charset && pfc::strcmp_ex(v1.m_facename, m_facename_length, v2.m_facename, m_facename_length) == 0;
450  }
char m_facename[m_facename_length]
Definition: shared.h:443
t_uint8 m_italic
Definition: shared.h:441
int strcmp_ex(const char *p1, t_size n1, const char *p2, t_size n2)
t_uint32 m_height
Definition: shared.h:439
t_uint8 m_charset
Definition: shared.h:442
t_uint32 m_weight
Definition: shared.h:440
static t_font_description SHARED_EXPORT t_font_description::g_from_font ( HFONT  p_font)
static
static t_font_description SHARED_EXPORT t_font_description::g_from_logfont ( LOGFONT const &  lf)
static
static t_font_description SHARED_EXPORT t_font_description::g_from_system ( int  id = TMT_MENUFONT)
static
bool t_font_description::operator!= ( const t_font_description other) const
inline

Definition at line 446 of file shared.h.

446 {return !g_equals(*this, other);}
static bool g_equals(const t_font_description &v1, const t_font_description &v2)
Definition: shared.h:448
bool t_font_description::operator== ( const t_font_description other) const
inline

Definition at line 445 of file shared.h.

445 {return g_equals(*this, other);}
static bool g_equals(const t_font_description &v1, const t_font_description &v2)
Definition: shared.h:448
bool SHARED_EXPORT t_font_description::popup_dialog ( HWND  p_parent)
template<typename t_stream , typename t_abort >
void t_font_description::to_stream ( t_stream  p_stream,
t_abort &  p_abort 
) const

Definition at line 463 of file shared.h.

463  {
464  p_stream->write_lendian_t(m_height,p_abort);
465  p_stream->write_lendian_t(m_weight,p_abort);
466  p_stream->write_lendian_t(m_italic,p_abort);
467  p_stream->write_lendian_t(m_charset,p_abort);
468  p_stream->write_string(m_facename,PFC_TABSIZE(m_facename),p_abort);
469 }
char m_facename[m_facename_length]
Definition: shared.h:443
t_uint8 m_italic
Definition: shared.h:441
t_uint32 m_height
Definition: shared.h:439
t_uint8 m_charset
Definition: shared.h:442
t_uint32 m_weight
Definition: shared.h:440

Field Documentation

t_uint8 t_font_description::m_charset

Definition at line 442 of file shared.h.

char t_font_description::m_facename[m_facename_length]

Definition at line 443 of file shared.h.

t_uint32 t_font_description::m_height

Definition at line 439 of file shared.h.

t_uint8 t_font_description::m_italic

Definition at line 441 of file shared.h.

t_uint32 t_font_description::m_weight

Definition at line 440 of file shared.h.


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