}
-void CtrlButton::onUpdate( Subject<AnimBitmap, void*> &rBitmap, void *arg )
+void CtrlButton::onUpdate( Subject<AnimBitmap> &rBitmap, void *arg )
{
notifyLayout();
}
void setImage( AnimBitmap *pImg );
/// Method called when an animated bitmap changes
- virtual void onUpdate( Subject<AnimBitmap, void*> &rBitmap, void* );
+ virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
};
}
-void CtrlCheckbox::onUpdate( Subject<AnimBitmap, void*> &rBitmap, void *arg )
+void CtrlCheckbox::onUpdate( Subject<AnimBitmap> &rBitmap, void *arg )
{
notifyLayout();
}
virtual void onVarBoolUpdate( VarBool &rVariable );
/// Method called when an animated bitmap changes
- virtual void onUpdate( Subject<AnimBitmap, void*> &rBitmap, void* );
+ virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
/// Change the current image
void setImage( AnimBitmap *pImg );
}
-void CtrlGeneric::onUpdate( Subject<VarBool, void*> &rVariable, void *arg )
+void CtrlGeneric::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
// Is it the visibility variable ?
if( &rVariable == m_pVisible )
VarBool *m_pVisible;
/// Method called when an observed bool variable is changed
- virtual void onUpdate( Subject<VarBool, void*> &rVariable , void* );
+ virtual void onUpdate( Subject<VarBool> &rVariable , void* );
};
typedef CountedPtr<CtrlGeneric> CtrlGenericPtr;
}
-void CtrlList::onUpdate( Subject<VarList, void*> &rList, void *arg )
+void CtrlList::onUpdate( Subject<VarList> &rList, void *arg )
{
autoScroll();
m_pLastSelected = NULL;
}
-void CtrlList::onUpdate( Subject<VarPercent, void*> &rPercent, void *arg )
+void CtrlList::onUpdate( Subject<VarPercent> &rPercent, void *arg )
{
// Get the size of the control
const Position *pPos = getPosition();
int m_lastPos;
/// Method called when the list variable is modified
- virtual void onUpdate( Subject<VarList, void*> &rList, void* );
+ virtual void onUpdate( Subject<VarList> &rList, void* );
/// Method called when the position variable of the list is modified
- virtual void onUpdate( Subject<VarPercent, void*> &rPercent, void* );
+ virtual void onUpdate( Subject<VarPercent> &rPercent, void* );
/// Called when the position is set
virtual void onPositionChange();
}
-void CtrlRadialSlider::onUpdate( Subject<VarPercent,void*> &rVariable,
+void CtrlRadialSlider::onUpdate( Subject<VarPercent> &rVariable,
void *arg )
{
m_position = (int)( m_rVariable.get() * m_numImg );
DEFINE_CALLBACK( CtrlRadialSlider, Move )
/// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarPercent,void*> &rVariable, void* );
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
/// Change the position of the cursor, with the given position of
/// the mouse (relative to the layout). Is blocking is true, the
}
-void CtrlSliderCursor::onUpdate( Subject<VarPercent,void*> &rVariable,
+void CtrlSliderCursor::onUpdate( Subject<VarPercent> &rVariable,
void *arg )
{
// The position has changed
}
-void CtrlSliderBg::onUpdate( Subject<VarPercent, void*> &rVariable, void*arg )
+void CtrlSliderBg::onUpdate( Subject<VarPercent> &rVariable, void*arg )
{
m_position = (int)( m_rVariable.get() * (m_nbHoriz * m_nbVert - 1) );
notifyLayout( m_bgWidth, m_bgHeight );
const Bezier &m_rCurve;
/// Method called when the position variable is modified
- virtual void onUpdate( Subject<VarPercent,void*> &rVariable, void * );
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void * );
/// Method to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const;
int m_position;
/// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarPercent,void*> &rVariable, void* );
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
/// Method to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const;
}
-void CtrlText::onUpdate( Subject<VarText, void*> &rVariable, void* arg )
+void CtrlText::onUpdate( Subject<VarText> &rVariable, void* arg )
{
if( isVisible() )
{
DEFINE_CALLBACK( CtrlText, UpdateText );
/// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarText,void*> &rVariable, void* );
+ virtual void onUpdate( Subject<VarText> &rVariable, void* );
/// Display the text on the control
void displayText( const UString &rText );
notifyLayout();
}
-void CtrlTree::onUpdate( Subject<VarPercent, void*> &rPercent, void* arg)
+void CtrlTree::onUpdate( Subject<VarPercent> &rPercent, void* arg)
{
// Determine what is the first item to display
VarTree::Iterator it = m_flat ? m_rTree.firstLeaf() : m_rTree.begin();
tree_update *);
// Method called when the position variable of the tree is modified
- virtual void onUpdate( Subject<VarPercent, void *> &rPercent , void *);
+ virtual void onUpdate( Subject<VarPercent> &rPercent , void *);
/// Called when the position is set
virtual void onPositionChange();
}
-void CtrlVideo::onUpdate( Subject<VarBox, void *> &rVoutSize, void *arg )
+void CtrlVideo::onUpdate( Subject<VarBox> &rVoutSize, void *arg )
{
int newWidth = ((VarBox&)rVoutSize).getWidth() + m_xShift;
int newHeight = ((VarBox&)rVoutSize).getHeight() + m_yShift;
virtual string getType() const { return "video"; }
/// Method called when the vout size is updated
- virtual void onUpdate( Subject<VarBox,void*> &rVoutSize, void* );
+ virtual void onUpdate( Subject<VarBox> &rVoutSize, void* );
/// Called by the layout when the control is show/hidden
void setVisible( bool visible );
/// Animated bitmap
class AnimBitmap: public SkinObject, public Box,
- public Subject<AnimBitmap, void*>
+ public Subject<AnimBitmap>
{
public:
AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap );
}
-void GenericWindow::onUpdate( Subject<VarBool, void*> &rVariable, void*arg )
+void GenericWindow::onUpdate( Subject<VarBool> &rVariable, void*arg )
{
if( m_pVarVisible->get() )
{
mutable VarBoolImpl *m_pVarVisible;
/// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarBool, void*> &rVariable , void*);
+ virtual void onUpdate( Subject<VarBool> &rVariable , void*);
};
}
-void Tooltip::onUpdate( Subject<VarText, void*> &rVariable , void *arg)
+void Tooltip::onUpdate( Subject<VarText> &rVariable , void *arg)
{
// Redisplay the tooltip
displayText( ((VarText&)rVariable).get() );
int m_xPos, m_yPos;
/// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarText,void*> &rVariable, void * );
+ virtual void onUpdate( Subject<VarText> &rVariable, void * );
/// Display text of the tooltip
void displayText( const UString &rText );
/// Template for subjects in the Observer design pattern
-template <class S, class ARG> class Subject
+template <class S, class ARG = void*> class Subject
{
public:
virtual ~Subject() {}
/// Template for observers in the Observer design pattern
-template <class S, class ARG> class Observer
+template <class S, class ARG = void*> class Observer
{
public:
virtual ~Observer() {}
/// Variable implementing the Box interface
-class VarBox: public Variable, public Box, public Subject<VarBox, void*>
+class VarBox: public Variable, public Box, public Subject<VarBox>
{
public:
VarBox( intf_thread_t *pIntf, int width = 0, int height = 0 );
}
-void VarBoolAndBool::onUpdate( Subject<VarBool,void *> &rVariable, void *arg )
+void VarBoolAndBool::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
notify();
}
}
-void VarBoolOrBool::onUpdate( Subject<VarBool,void*> &rVariable , void*arg)
+void VarBoolOrBool::onUpdate( Subject<VarBool> &rVariable , void*arg)
{
notify();
}
}
-void VarNotBool::onUpdate( Subject<VarBool, void*> &rVariable, void*arg )
+void VarNotBool::onUpdate( Subject<VarBool> &rVariable, void*arg )
{
notify();
}
/// Interface for read-only boolean variable
-class VarBool: public Variable, public Subject<VarBool, void *>
+class VarBool: public Variable, public Subject<VarBool>
{
public:
/// Get the variable type
virtual bool get() const { return m_rVar1.get() && m_rVar2.get(); }
// Called when one of the observed variables is changed
- void onUpdate( Subject<VarBool, void*> &rVariable, void* );
+ void onUpdate( Subject<VarBool> &rVariable, void* );
private:
/// Boolean variables
virtual bool get() const { return m_rVar1.get() || m_rVar2.get(); }
// Called when one of the observed variables is changed
- void onUpdate( Subject<VarBool, void*> &rVariable, void* );
+ void onUpdate( Subject<VarBool> &rVariable, void* );
private:
/// Boolean variables
virtual bool get() const { return !m_rVar.get(); }
// Called when the observed variable is changed
- void onUpdate( Subject<VarBool, void*> &rVariable, void* );
+ void onUpdate( Subject<VarBool> &rVariable, void* );
private:
/// Boolean variable
/// List variable
-class VarList: public Variable, public Subject<VarList, void* >
+class VarList: public Variable, public Subject<VarList>
{
public:
VarList( intf_thread_t *pIntf );
/// Percentage variable
-class VarPercent: public Variable, public Subject<VarPercent, void*>
+class VarPercent: public Variable, public Subject<VarPercent>
{
public:
VarPercent( intf_thread_t *pIntf ): Variable( pIntf ), m_value( 0 ) {}
}
-void VarText::onUpdate( Subject<VarPercent, void*> &rVariable, void *arg )
+void VarText::onUpdate( Subject<VarPercent> &rVariable, void *arg )
{
UString newText = get();
// If the text has changed, notify the observers
}
-void VarText::onUpdate( Subject<VarText,void*> &rVariable, void *arg )
+void VarText::onUpdate( Subject<VarText> &rVariable, void *arg )
{
UString newText = get();
// If the text has changed, notify the observers
/// String variable
-class VarText: public Variable, public Subject<VarText, void*>,
+class VarText: public Variable, public Subject<VarText>,
public Observer<VarPercent, void*>,
public Observer< VarText,void*>
{
virtual const UString get() const;
/// Methods called when an observed variable is modified
- virtual void onUpdate( Subject<VarPercent, void*> &rVariable, void* );
- virtual void onUpdate( Subject<VarText, void*> &rVariable, void* );
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
+ virtual void onUpdate( Subject<VarText> &rVariable, void* );
private:
/// Stop observing other variables
}
-void EqualizerBands::onUpdate( Subject<VarPercent,void*> &rBand, void *arg )
+void EqualizerBands::onUpdate( Subject<VarPercent> &rBand, void *arg )
{
// Make sure we are not called from set()
if (!m_isUpdating)
bool m_isUpdating;
/// Callback for band updates
- virtual void onUpdate( Subject<VarPercent, void*> &rBand , void *);
+ virtual void onUpdate( Subject<VarPercent> &rBand , void *);
};