Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
0b62586c
Commit
0b62586c
authored
Dec 03, 2005
by
zorglub
Browse files
Support for passing an argument from subject to observer
parent
4eed3209
Changes
34
Hide whitespace changes
Inline
Side-by-side
modules/gui/skins2/controls/ctrl_button.cpp
View file @
0b62586c
...
...
@@ -131,7 +131,7 @@ void CtrlButton::setImage( AnimBitmap *pImg )
}
void
CtrlButton
::
onUpdate
(
Subject
<
AnimBitmap
>
&
rBitmap
)
void
CtrlButton
::
onUpdate
(
Subject
<
AnimBitmap
,
void
*
>
&
rBitmap
,
void
*
arg
)
{
notifyLayout
();
}
...
...
modules/gui/skins2/controls/ctrl_button.hpp
View file @
0b62586c
...
...
@@ -34,7 +34,7 @@ class CmdGeneric;
/// Base class for button controls
class
CtrlButton
:
public
CtrlGeneric
,
public
Observer
<
AnimBitmap
>
class
CtrlButton
:
public
CtrlGeneric
,
public
Observer
<
AnimBitmap
,
void
*
>
{
public:
/// Create a button with 3 images
...
...
@@ -88,7 +88,7 @@ class CtrlButton: public CtrlGeneric, public Observer<AnimBitmap>
void
setImage
(
AnimBitmap
*
pImg
);
/// Method called when an animated bitmap changes
virtual
void
onUpdate
(
Subject
<
AnimBitmap
>
&
rBitmap
);
virtual
void
onUpdate
(
Subject
<
AnimBitmap
,
void
*
>
&
rBitmap
,
void
*
);
};
...
...
modules/gui/skins2/controls/ctrl_generic.cpp
View file @
0b62586c
...
...
@@ -155,7 +155,7 @@ bool CtrlGeneric::isVisible() const
}
void
CtrlGeneric
::
onUpdate
(
Subject
<
VarBool
>
&
rVariable
)
void
CtrlGeneric
::
onUpdate
(
Subject
<
VarBool
,
void
*
>
&
rVariable
,
void
*
arg
)
{
// Is it the visibility variable ?
if
(
&
rVariable
==
m_pVisible
)
...
...
modules/gui/skins2/controls/ctrl_generic.hpp
View file @
0b62586c
...
...
@@ -41,7 +41,7 @@ class VarBool;
/// Base class for controls
class
CtrlGeneric
:
public
SkinObject
,
public
Observer
<
VarBool
>
class
CtrlGeneric
:
public
SkinObject
,
public
Observer
<
VarBool
,
void
*
>
{
public:
virtual
~
CtrlGeneric
();
...
...
@@ -128,7 +128,7 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
VarBool
*
m_pVisible
;
/// Method called when an observed bool variable is changed
virtual
void
onUpdate
(
Subject
<
VarBool
>
&
rVariable
);
virtual
void
onUpdate
(
Subject
<
VarBool
,
void
*
>
&
rVariable
,
void
*
);
};
typedef
CountedPtr
<
CtrlGeneric
>
CtrlGenericPtr
;
...
...
modules/gui/skins2/controls/ctrl_list.cpp
View file @
0b62586c
...
...
@@ -72,14 +72,14 @@ CtrlList::~CtrlList()
}
void
CtrlList
::
onUpdate
(
Subject
<
VarList
>
&
rList
)
void
CtrlList
::
onUpdate
(
Subject
<
VarList
,
void
*
>
&
rList
,
void
*
arg
)
{
autoScroll
();
m_pLastSelected
=
NULL
;
}
void
CtrlList
::
onUpdate
(
Subject
<
VarPercent
>
&
rPercent
)
void
CtrlList
::
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rPercent
,
void
*
arg
)
{
// Get the size of the control
const
Position
*
pPos
=
getPosition
();
...
...
modules/gui/skins2/controls/ctrl_list.hpp
View file @
0b62586c
...
...
@@ -35,8 +35,8 @@ class GenericBitmap;
/// Class for control list
class
CtrlList
:
public
CtrlGeneric
,
public
Observer
<
VarList
>
,
public
Observer
<
VarPercent
>
class
CtrlList
:
public
CtrlGeneric
,
public
Observer
<
VarList
,
void
*
>
,
public
Observer
<
VarPercent
,
void
*
>
{
public:
CtrlList
(
intf_thread_t
*
pIntf
,
VarList
&
rList
,
...
...
@@ -88,10 +88,10 @@ class CtrlList: public CtrlGeneric, public Observer<VarList>,
int
m_lastPos
;
/// Method called when the list variable is modified
virtual
void
onUpdate
(
Subject
<
VarList
>
&
rList
);
virtual
void
onUpdate
(
Subject
<
VarList
,
void
*
>
&
rList
,
void
*
);
/// Method called when the position variable of the list is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rPercent
);
virtual
void
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rPercent
,
void
*
);
/// Called when the position is set
virtual
void
onPositionChange
();
...
...
modules/gui/skins2/controls/ctrl_radialslider.cpp
View file @
0b62586c
...
...
@@ -98,7 +98,8 @@ void CtrlRadialSlider::draw( OSGraphics &rImage, int xDest, int yDest )
}
void
CtrlRadialSlider
::
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
)
void
CtrlRadialSlider
::
onUpdate
(
Subject
<
VarPercent
,
void
*>
&
rVariable
,
void
*
arg
)
{
m_position
=
(
int
)(
m_rVariable
.
get
()
*
m_numImg
);
notifyLayout
(
m_width
,
m_height
);
...
...
modules/gui/skins2/controls/ctrl_radialslider.hpp
View file @
0b62586c
...
...
@@ -36,7 +36,7 @@ class VarPercent;
/// Radial slider
class
CtrlRadialSlider
:
public
CtrlGeneric
,
public
Observer
<
VarPercent
>
class
CtrlRadialSlider
:
public
CtrlGeneric
,
public
Observer
<
VarPercent
,
void
*
>
{
public:
/// Create a radial slider with the given image, which must be
...
...
@@ -86,7 +86,7 @@ class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
DEFINE_CALLBACK
(
CtrlRadialSlider
,
Move
)
/// Method called when the observed variable is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
);
virtual
void
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rVariable
,
void
*
);
/// Change the position of the cursor, with the given position of
/// the mouse (relative to the layout). Is blocking is true, the
...
...
modules/gui/skins2/controls/ctrl_slider.cpp
View file @
0b62586c
...
...
@@ -159,7 +159,8 @@ void CtrlSliderCursor::draw( OSGraphics &rImage, int xDest, int yDest )
}
void
CtrlSliderCursor
::
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
)
void
CtrlSliderCursor
::
onUpdate
(
Subject
<
VarPercent
,
void
*>
&
rVariable
,
void
*
arg
)
{
// The position has changed
refreshLayout
();
...
...
@@ -425,7 +426,7 @@ void CtrlSliderBg::associateCursor( CtrlSliderCursor &rCursor )
}
void
CtrlSliderBg
::
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
)
void
CtrlSliderBg
::
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rVariable
,
void
*
arg
)
{
m_position
=
(
int
)(
m_rVariable
.
get
()
*
(
m_nbHoriz
*
m_nbVert
-
1
)
);
notifyLayout
(
m_bgWidth
,
m_bgHeight
);
...
...
modules/gui/skins2/controls/ctrl_slider.hpp
View file @
0b62586c
...
...
@@ -37,7 +37,7 @@ class VarPercent;
/// Cursor of a slider
class
CtrlSliderCursor
:
public
CtrlGeneric
,
public
Observer
<
VarPercent
>
class
CtrlSliderCursor
:
public
CtrlGeneric
,
public
Observer
<
VarPercent
,
void
*
>
{
public:
/// Create a cursor with 3 images (which are NOT copied, be careful)
...
...
@@ -98,7 +98,7 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
const
Bezier
&
m_rCurve
;
/// Method called when the position variable is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
);
virtual
void
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rVariable
,
void
*
);
/// Method to compute the resize factors
void
getResizeFactors
(
float
&
rFactorX
,
float
&
rFactorY
)
const
;
...
...
@@ -109,7 +109,7 @@ class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
/// Slider background
class
CtrlSliderBg
:
public
CtrlGeneric
,
public
Observer
<
VarPercent
>
class
CtrlSliderBg
:
public
CtrlGeneric
,
public
Observer
<
VarPercent
,
void
*
>
{
public:
CtrlSliderBg
(
intf_thread_t
*
pIntf
,
...
...
@@ -157,7 +157,7 @@ class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
int
m_position
;
/// Method called when the observed variable is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rVariable
);
virtual
void
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rVariable
,
void
*
);
/// Method to compute the resize factors
void
getResizeFactors
(
float
&
rFactorX
,
float
&
rFactorY
)
const
;
...
...
modules/gui/skins2/controls/ctrl_text.cpp
View file @
0b62586c
...
...
@@ -214,7 +214,7 @@ void CtrlText::setText( const UString &rText, uint32_t color )
}
void
CtrlText
::
onUpdate
(
Subject
<
VarText
>
&
rVariable
)
void
CtrlText
::
onUpdate
(
Subject
<
VarText
,
void
*
>
&
rVariable
,
void
*
arg
)
{
displayText
(
m_rVariable
.
get
()
);
}
...
...
modules/gui/skins2/controls/ctrl_text.hpp
View file @
0b62586c
...
...
@@ -38,7 +38,7 @@ class VarText;
/// Class for control text
class
CtrlText
:
public
CtrlGeneric
,
public
Observer
<
VarText
>
class
CtrlText
:
public
CtrlGeneric
,
public
Observer
<
VarText
,
void
*
>
{
public:
enum
Align_t
...
...
@@ -122,7 +122,7 @@ class CtrlText: public CtrlGeneric, public Observer<VarText>
DEFINE_CALLBACK
(
CtrlText
,
UpdateText
);
/// Method called when the observed variable is modified
virtual
void
onUpdate
(
Subject
<
VarText
>
&
rVariable
);
virtual
void
onUpdate
(
Subject
<
VarText
,
void
*
>
&
rVariable
,
void
*
);
/// Display the text on the control
void
displayText
(
const
UString
&
rText
);
...
...
modules/gui/skins2/controls/ctrl_tree.cpp
View file @
0b62586c
...
...
@@ -130,13 +130,14 @@ int CtrlTree::maxItems()
}
void
CtrlTree
::
onUpdate
(
Subject
<
VarTree
>
&
rTree
)
void
CtrlTree
::
onUpdate
(
Subject
<
VarTree
,
int
>
&
rTree
,
int
arg
)
{
fprintf
(
stderr
,
"Doing update type %i
\n
"
,
arg
);
autoScroll
();
m_pLastSelected
=
NULL
;
}
void
CtrlTree
::
onUpdate
(
Subject
<
VarPercent
>
&
rPercent
)
void
CtrlTree
::
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rPercent
,
void
*
arg
)
{
// Determine what is the first item to display
VarTree
::
Iterator
it
=
m_rTree
.
begin
();
...
...
modules/gui/skins2/controls/ctrl_tree.hpp
View file @
0b62586c
...
...
@@ -33,8 +33,8 @@ class GenericFont;
class
GenericBitmap
;
/// Class for control tree
class
CtrlTree
:
public
CtrlGeneric
,
public
Observer
<
VarTree
>
,
public
Observer
<
VarPercent
>
class
CtrlTree
:
public
CtrlGeneric
,
public
Observer
<
VarTree
,
int
>
,
public
Observer
<
VarPercent
,
void
*
>
{
public:
CtrlTree
(
intf_thread_t
*
pIntf
,
...
...
@@ -102,10 +102,10 @@ class CtrlTree: public CtrlGeneric, public Observer<VarTree>,
VarTree
::
Iterator
m_lastPos
;
/// Method called when the tree variable is modified
virtual
void
onUpdate
(
Subject
<
VarTree
>
&
rTree
);
virtual
void
onUpdate
(
Subject
<
VarTree
,
int
>
&
rTree
,
int
);
// Method called when the position variable of the tree is modified
virtual
void
onUpdate
(
Subject
<
VarPercent
>
&
rPercent
);
virtual
void
onUpdate
(
Subject
<
VarPercent
,
void
*
>
&
rPercent
,
void
*
);
/// Called when the position is set
virtual
void
onPositionChange
();
...
...
modules/gui/skins2/controls/ctrl_video.cpp
View file @
0b62586c
...
...
@@ -109,7 +109,7 @@ void CtrlVideo::draw( OSGraphics &rImage, int xDest, int yDest )
}
void
CtrlVideo
::
onUpdate
(
Subject
<
VarBox
>
&
rVoutSize
)
void
CtrlVideo
::
onUpdate
(
Subject
<
VarBox
,
void
*
>
&
rVoutSize
,
void
*
arg
)
{
int
newWidth
=
((
VarBox
&
)
rVoutSize
).
getWidth
()
+
m_xShift
;
int
newHeight
=
((
VarBox
&
)
rVoutSize
).
getHeight
()
+
m_yShift
;
...
...
modules/gui/skins2/controls/ctrl_video.hpp
View file @
0b62586c
...
...
@@ -30,7 +30,7 @@
class
VoutWindow
;
/// Control video
class
CtrlVideo
:
public
CtrlGeneric
,
public
Observer
<
VarBox
>
class
CtrlVideo
:
public
CtrlGeneric
,
public
Observer
<
VarBox
,
void
*
>
{
public:
CtrlVideo
(
intf_thread_t
*
pIntf
,
GenericLayout
&
rLayout
,
...
...
@@ -56,7 +56,7 @@ class CtrlVideo: public CtrlGeneric, public Observer<VarBox>
virtual
string
getType
()
const
{
return
"video"
;
}
/// Method called when the vout size is updated
virtual
void
onUpdate
(
Subject
<
VarBox
>
&
rVoutSize
);
virtual
void
onUpdate
(
Subject
<
VarBox
,
void
*
>
&
rVoutSize
,
void
*
);
private:
/// Vout window
...
...
modules/gui/skins2/src/anim_bitmap.hpp
View file @
0b62586c
...
...
@@ -34,7 +34,8 @@ class OSTimer;
/// Animated bitmap
class
AnimBitmap
:
public
SkinObject
,
public
Box
,
public
Subject
<
AnimBitmap
>
class
AnimBitmap
:
public
SkinObject
,
public
Box
,
public
Subject
<
AnimBitmap
,
void
*>
{
public:
AnimBitmap
(
intf_thread_t
*
pIntf
,
const
GenericBitmap
&
rBitmap
);
...
...
modules/gui/skins2/src/generic_window.cpp
View file @
0b62586c
...
...
@@ -122,7 +122,7 @@ void GenericWindow::toggleOnTop( bool onTop ) const
}
void
GenericWindow
::
onUpdate
(
Subject
<
VarBool
>
&
rVariable
)
void
GenericWindow
::
onUpdate
(
Subject
<
VarBool
,
void
*
>
&
rVariable
,
void
*
arg
)
{
if
(
m_varVisible
.
get
()
)
{
...
...
modules/gui/skins2/src/generic_window.hpp
View file @
0b62586c
...
...
@@ -41,7 +41,7 @@ class WindowManager;
/// Generic window class
class
GenericWindow
:
public
SkinObject
,
public
Observer
<
VarBool
>
class
GenericWindow
:
public
SkinObject
,
public
Observer
<
VarBool
,
void
*
>
{
private:
friend
class
WindowManager
;
...
...
@@ -120,7 +120,7 @@ class GenericWindow: public SkinObject, public Observer<VarBool>
mutable
VarBoolImpl
m_varVisible
;
/// Method called when the observed variable is modified
virtual
void
onUpdate
(
Subject
<
VarBool
>
&
rVariable
);
virtual
void
onUpdate
(
Subject
<
VarBool
,
void
*
>
&
rVariable
,
void
*
);
};
...
...
modules/gui/skins2/src/tooltip.cpp
View file @
0b62586c
...
...
@@ -74,7 +74,7 @@ void Tooltip::hide()
}
void
Tooltip
::
onUpdate
(
Subject
<
VarText
>
&
rVariable
)
void
Tooltip
::
onUpdate
(
Subject
<
VarText
,
void
*
>
&
rVariable
,
void
*
arg
)
{
// Redisplay the tooltip
displayText
(
((
VarText
&
)
rVariable
).
get
()
);
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment