Merge branch 'skins2-warnings/1' into 'master'

skins2: fix warnings on Clang 16.0.6

See merge request videolan/vlc!4881
This commit is contained in:
Alexandre Janniaux 2024-04-28 07:10:38 +00:00
commit da3c223463
12 changed files with 86 additions and 74 deletions

View File

@ -36,6 +36,8 @@ class CmdGeneric;
class CtrlButton: public CtrlGeneric, public Observer<AnimBitmap>
{
public:
using CtrlGeneric::onUpdate;
/// Create a button with 3 images
CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
const GenericBitmap &rBmpOver, const GenericBitmap &rBmpDown,

View File

@ -38,6 +38,8 @@ class CmdGeneric;
class CtrlCheckbox: public CtrlGeneric, public Observer<AnimBitmap>
{
public:
using CtrlGeneric::onUpdate;
/// Create a checkbox with 6 images
CtrlCheckbox( intf_thread_t *pIntf,
const GenericBitmap &rBmpUp1,
@ -51,22 +53,22 @@ public:
VarBool &rVariable, const UString &rHelp,
VarBool *pVisible);
virtual ~CtrlCheckbox();
~CtrlCheckbox() override;
/// Handle an event
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Get the text of the tooltip XXX
virtual UString getTooltipText() const { return *m_pTooltip; }
UString getTooltipText() const override { return *m_pTooltip; }
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "checkbox"; }
std::string getType() const override { return "checkbox"; }
private:
/// Finite state machine of the control
@ -105,10 +107,10 @@ private:
DEFINE_CALLBACK( CtrlCheckbox, HiddenUp )
/// Method called when the observed variable is modified
virtual void onVarBoolUpdate( VarBool &rVariable );
void onVarBoolUpdate(VarBool &rVariable) override;
/// Method called when an animated bitmap changes
virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
void onUpdate(Subject<AnimBitmap> &rBitmap, void*) override;
/// Change the current image
void setImage( AnimBitmap *pImg );

View File

@ -131,7 +131,7 @@ protected:
virtual void onVarBoolUpdate( VarBool &rVar ) { (void)rVar; }
/// Method called when an observed bool variable is changed
virtual void onUpdate( Subject<VarBool> &rVariable , void* );
void onUpdate(Subject<VarBool> &rVariable , void*) override;
/// Associated layout
GenericLayout *m_pLayout;

View File

@ -38,6 +38,8 @@ class VarString;
class CtrlImage: public CtrlFlat, public Observer<VarString>
{
public:
using CtrlGeneric::onUpdate;
/// Resize methods
enum resize_t
{
@ -50,19 +52,19 @@ public:
CtrlImage( intf_thread_t *pIntf, GenericBitmap &rBitmap,
CmdGeneric &rCommand, resize_t resizeMethod,
const UString &rHelp, VarBool *pVisible, bool art );
virtual ~CtrlImage();
~CtrlImage() override;
/// Handle an event on the control
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "image"; }
std::string getType() const override { return "image"; }
private:
/// Bitmap
@ -82,7 +84,7 @@ private:
int m_y;
/// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarString> &rVariable, void* );
void onUpdate(Subject<VarString> &rVariable, void*) override;
};

View File

@ -38,33 +38,35 @@ class CtrlList: public CtrlGeneric, public Observer<VarList>,
public Observer<VarPercent>
{
public:
using CtrlGeneric::onUpdate;
CtrlList( intf_thread_t *pIntf, VarList &rList,
const GenericFont &rFont, const GenericBitmap *pBitmap,
uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1,
uint32_t bgcolor2, uint32_t selColor,
const UString &rHelp, VarBool *pVisible );
virtual ~CtrlList();
~CtrlList() override;
/// Handle an event on the control.
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Check whether coordinates are inside the control.
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Called when the layout is resized
virtual void onResize();
void onResize() override;
/// Return true if the control can gain the focus
virtual bool isFocusable() const { return true; }
bool isFocusable() const override { return true; }
/// Return true if the control can be scrollable
virtual bool isScrollable() const { return true; }
bool isScrollable() const override { return true; }
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "list"; }
std::string getType() const override { return "list"; }
private:
/// List associated to the control
@ -90,13 +92,13 @@ private:
int m_lastPos;
/// Method called when the list variable is modified
virtual void onUpdate( Subject<VarList> &rList, void* );
void onUpdate(Subject<VarList> &rList, void*) override;
/// Method called when the position variable of the list is modified
virtual void onUpdate( Subject<VarPercent> &rPercent, void* );
void onUpdate(Subject<VarPercent> &rPercent, void*) override;
/// Called when the position is set
virtual void onPositionChange();
void onPositionChange() override;
/// Check if the list must be scrolled
void autoScroll();

View File

@ -38,6 +38,8 @@ class VarPercent;
class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
{
public:
using CtrlGeneric::onUpdate;
/// Create a radial slider with the given image, which must be
/// composed of numImg subimages of the same size
CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq,
@ -45,19 +47,19 @@ public:
float maxAngle, const UString &rHelp,
VarBool *pVisible );
virtual ~CtrlRadialSlider();
~CtrlRadialSlider() override;
/// Handle an event
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "radial_slider"; }
std::string getType() const override { return "radial_slider"; }
private:
/// Finite state machine of the control
@ -83,7 +85,7 @@ private:
DEFINE_CALLBACK( CtrlRadialSlider, Move )
/// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
void onUpdate(Subject<VarPercent> &rVariable, void*) override;
/// Change the position of the cursor, with the given position of
/// the mouse (relative to the layout). Is blocking is true, the

View File

@ -52,7 +52,6 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rVariable( rVariable ), m_tooltip( rTooltip ),
m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ),
m_xPosition( 0 ), m_yPosition( 0 ),
m_cmdOverDown( this ), m_cmdDownOver( this ),
m_cmdOverUp( this ), m_cmdUpOver( this ),
m_cmdMove( this ), m_cmdScroll( this ),

View File

@ -41,6 +41,8 @@ class VarPercent;
class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
{
public:
using CtrlGeneric::onUpdate;
/// Create a cursor with 3 images (which are NOT copied, be careful)
/// If pVisible is NULL, the control is always visible
CtrlSliderCursor( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
@ -50,35 +52,35 @@ public:
VarBool *pVisible, const UString &rTooltip,
const UString &rHelp );
virtual ~CtrlSliderCursor();
~CtrlSliderCursor() override;
/// Handle an event
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Return true if the control can be scrollable
virtual bool isScrollable() const { return true; }
bool isScrollable() const override { return true; }
/// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Called when the position is set
virtual void onPositionChange();
void onPositionChange() override;
/// Method called when the control is resized
virtual void onResize();
void onResize() override;
/// Method called to notify are to be updated
virtual void notifyLayout( int width = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0 );
void notifyLayout(int width = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0) override;
/// Get the text of the tooltip
virtual UString getTooltipText() const { return m_tooltip; }
UString getTooltipText() const override { return m_tooltip; }
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "slider_cursor"; }
std::string getType() const override { return "slider_cursor"; }
private:
/// Finite state machine of the control
@ -89,8 +91,6 @@ private:
const UString m_tooltip;
/// Initial size of the control
int m_width, m_height;
/// Position of the cursor
int m_xPosition, m_yPosition;
/// Callback objects
DEFINE_CALLBACK( CtrlSliderCursor, OverDown )
DEFINE_CALLBACK( CtrlSliderCursor, DownOver )
@ -114,7 +114,7 @@ private:
const OSGraphics *m_pImg;
/// Method called when the position variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable, void * );
void onUpdate(Subject<VarPercent> &rVariable, void *) override;
/// Method to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const;
@ -131,40 +131,42 @@ private:
class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
{
public:
using CtrlGeneric::onUpdate;
CtrlSliderBg( intf_thread_t *pIntf,
const Bezier &rCurve, VarPercent &rVariable,
int thickness, GenericBitmap *pBackground, int nbHoriz,
int nbVert, int padHoriz, int padVert, VarBool *pVisible,
const UString &rHelp );
virtual ~CtrlSliderBg();
~CtrlSliderBg() override;
/// Return true if the control can be scrollable
virtual bool isScrollable() const { return true; }
bool isScrollable() const override { return true; }
/// Tell whether the mouse is over the control
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Handle an event
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Called when the position is set
virtual void onPositionChange();
void onPositionChange() override;
/// Method called when the control is resized
virtual void onResize();
void onResize() override;
/// Method called to notify are to be updated
virtual void notifyLayout( int width = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0 );
void notifyLayout(int width = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0) override;
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "slider_bg"; }
std::string getType() const override { return "slider_bg"; }
/// Associate a cursor to this background
void associateCursor( CtrlSliderCursor &rCursor );
void associateCursor(CtrlSliderCursor &rCursor);
private:
/// Cursor of the slider
@ -191,7 +193,7 @@ private:
int m_position;
/// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
void onUpdate(Subject<VarPercent> &rVariable, void*) override;
/// Method to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const;

View File

@ -40,6 +40,8 @@ class VarText;
class CtrlText: public CtrlGeneric, public Observer<VarText>
{
public:
using CtrlGeneric::onUpdate;
enum Align_t
{
kLeft,

View File

@ -36,7 +36,9 @@ class GenericBitmap;
class CtrlTree: public CtrlGeneric, public Observer<VarTree, tree_update>
{
public:
typedef VarTree::IteratorVisible Iterator;
using CtrlGeneric::onUpdate;
using Iterator = VarTree::IteratorVisible;
CtrlTree( intf_thread_t *pIntf,
VarTree &rTree,
@ -53,28 +55,28 @@ public:
const UString &rHelp,
VarBool *pVisible,
VarBool *pFlat );
virtual ~CtrlTree();
~CtrlTree() override;
/// Handle an event on the control
virtual void handleEvent( EvtGeneric &rEvent );
void handleEvent(EvtGeneric &rEvent) override;
/// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const;
bool mouseOver(int x, int y) const override;
/// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest, int w, int h );
void draw(OSGraphics &rImage, int xDest, int yDest, int w, int h) override;
/// Called when the layout is resized
virtual void onResize();
void onResize() override;
/// Return true if the control can gain the focus
virtual bool isFocusable() const { return true; }
bool isFocusable() const override { return true; }
/// Return true if the control can be scrollable
virtual bool isScrollable() const { return true; }
bool isScrollable() const override { return true; }
/// Get the type of control (custom RTTI)
virtual std::string getType() const { return "tree"; }
std::string getType() const override { return "tree"; }
/// Make sure an item is visible
/// \param item an iterator to a tree item
@ -125,11 +127,10 @@ private:
bool m_bRefreshOnDelete;
/// Method called when the tree variable is modified
virtual void onUpdate( Subject<VarTree, tree_update> &rTree,
tree_update *);
void onUpdate(Subject<VarTree, tree_update> &rTree, tree_update *) override;
/// Called when the position is set
virtual void onPositionChange();
void onPositionChange() override;
/// Compute the number of lines that can be displayed
float maxItems();

View File

@ -42,7 +42,7 @@
X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
X11Display &rDisplay, bool dragDrop, bool playOnDrop,
X11Window *pParentWindow, GenericWindow::WindowType_t type ):
OSWindow( pIntf ), m_rDisplay( rDisplay ), m_pParent( pParentWindow ),
OSWindow( pIntf ), m_rDisplay( rDisplay ),
m_dragDrop( dragDrop ), m_pDropTarget( NULL ), m_type ( type )
{
XSetWindowAttributes attr;

View File

@ -91,8 +91,6 @@ private:
Window m_wnd;
/// Window ID
Window m_wnd_parent;
/// Parent window
X11Window *m_pParent;
/// Indicates whether the window handles drag&drop events
bool m_dragDrop;
/// Drop target