foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions | Data Fields | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
ImplementBumpableElem< TClass >

#include <BumpableElem.h>

+ Inheritance diagram for ImplementBumpableElem< TClass >:

Public Member Functions

 ~ImplementBumpableElem () throw ()
 
 __super::notify (p_what, p_param1, p_param2, p_param2size)
 
 TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD_WITH_INITIALIZER (ImplementBumpableElem, TClass,{_init();}) BEGIN_MSG_MAP_EX(ImplementBumpableElem) MSG_WM_DESTROY(OnDestroy) CHAIN_MSG_MAP(__super) END_MSG_MAP_HOOK() void notify(const GUID &p_what
 

Static Public Member Functions

static bool Bump ()
 

Data Fields

t_size p_param1
 
t_size const void * p_param2
 
t_size const void t_size p_param2size
 

Private Types

typedef ImplementBumpableElem< TClass > TSelf
 

Private Member Functions

bool _bump ()
 
void _init ()
 
void OnDestroy () throw ()
 

Private Attributes

CFlashWindow m_flash
 
bool m_selfDestruct
 

Static Private Attributes

static pfc::avltree_t< TSelf * > instances
 

Detailed Description

template<typename TClass>
class ImplementBumpableElem< TClass >

Definition at line 2 of file BumpableElem.h.

Member Typedef Documentation

template<typename TClass >
typedef ImplementBumpableElem<TClass> ImplementBumpableElem< TClass >::TSelf
private

Definition at line 4 of file BumpableElem.h.

Constructor & Destructor Documentation

template<typename TClass >
ImplementBumpableElem< TClass >::~ImplementBumpableElem ( )
throw (
)
inline

Definition at line 24 of file BumpableElem.h.

24  {
25  PFC_ASSERT(core_api::is_main_thread());
26  instances -= this;
27  }
static pfc::avltree_t< TSelf * > instances
Definition: BumpableElem.h:47
bool is_main_thread()
Returns true if calling thread is main app thread, false otherwise.

Member Function Documentation

template<typename TClass >
ImplementBumpableElem< TClass >::__super::notify ( p_what  ,
p_param1  ,
p_param2  ,
p_param2size   
)
template<typename TClass >
bool ImplementBumpableElem< TClass >::_bump ( )
inlineprivate

Definition at line 34 of file BumpableElem.h.

34  {
35  if (m_selfDestruct || m_hWnd == NULL) return false;
36  //PROBLEM: This assumes we're implementing service_base methods at this point. Explodes if called during constructors/destructors.
37  if (!this->m_callback->request_activation(this)) return false;
38  m_flash.Activate(*this);
39  this->set_default_focus();
40  return true;
41  }
CFlashWindow m_flash
Definition: BumpableElem.h:49
void Activate(CWindow parent)
Definition: misc.h:209
template<typename TClass >
void ImplementBumpableElem< TClass >::_init ( )
inlineprivate

Definition at line 42 of file BumpableElem.h.

42  {
43  m_selfDestruct = false;
44  PFC_ASSERT(core_api::is_main_thread());
45  instances += this;
46  }
static pfc::avltree_t< TSelf * > instances
Definition: BumpableElem.h:47
bool is_main_thread()
Returns true if calling thread is main app thread, false otherwise.
template<typename TClass >
static bool ImplementBumpableElem< TClass >::Bump ( )
inlinestatic

Definition at line 18 of file BumpableElem.h.

18  {
19  for(pfc::const_iterator<TSelf*> walk = instances.first(); walk.is_valid(); ++walk) {
20  if ((*walk)->_bump()) return true;
21  }
22  return false;
23  }
static pfc::avltree_t< TSelf * > instances
Definition: BumpableElem.h:47
template<typename TClass >
void ImplementBumpableElem< TClass >::OnDestroy ( )
throw (
)
inlineprivate

Definition at line 29 of file BumpableElem.h.

29  {
30  m_selfDestruct = true;
31  m_flash.CleanUp();
32  SetMsgHandled(FALSE);
33  }
CFlashWindow m_flash
Definition: BumpableElem.h:49
void CleanUp()
Definition: misc.h:228
template<typename TClass >
ImplementBumpableElem< TClass >::TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD_WITH_INITIALIZER ( ImplementBumpableElem< TClass >  ,
TClass  ,
{_init();}   
) const

Field Documentation

template<typename TClass >
pfc::avltree_t< ImplementBumpableElem< TClass > * > ImplementBumpableElem< TClass >::instances
staticprivate

Definition at line 47 of file BumpableElem.h.

template<typename TClass >
CFlashWindow ImplementBumpableElem< TClass >::m_flash
private

Definition at line 49 of file BumpableElem.h.

template<typename TClass >
bool ImplementBumpableElem< TClass >::m_selfDestruct
private

Definition at line 48 of file BumpableElem.h.

template<typename TClass >
t_size ImplementBumpableElem< TClass >::p_param1

Definition at line 13 of file BumpableElem.h.

template<typename TClass >
t_size const void* ImplementBumpableElem< TClass >::p_param2

Definition at line 13 of file BumpableElem.h.

template<typename TClass >
t_size const void t_size ImplementBumpableElem< TClass >::p_param2size
Initial value:
{
if (p_what == ui_element_notify_visibility_changed && p_param2 == 0 && m_flash.m_hWnd != NULL) m_flash.Deactivate()

Definition at line 13 of file BumpableElem.h.


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