[vlc-commits] [Git][videolan/vlc][master] 10 commits: skins2: x11: remove unused member

François Cartegnie (@fcartegnie) gitlab at videolan.org
Wed Apr 15 08:13:33 UTC 2026



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
2e0599fc by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: x11: remove unused member

In file included from ../../modules/gui/skins2/x11/x11_window.cpp:31:
../../modules/gui/skins2/x11/x11_window.hpp:95:16: warning: private field 'm_pParent' is not used [-Wunused-private-field]
    X11Window *m_pParent;
               ^

- - - - -
6904a5b5 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_checkbox: use override

- - - - -
ebf9f6d7 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_image: use override

- - - - -
d8ddd0b7 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_list: use override

- - - - -
1de5fd60 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_radialslider: use override

- - - - -
b0b68366 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_slider: use override

- - - - -
6bc5da96 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_tree: use override

- - - - -
5fe9d3e2 by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_generic: use override

- - - - -
0d7b41cf by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: using CtrlGeneric::OnUpdate to fix warnings

g++ complains with the following warning because CtrlGeneric derived 
classes are inheriting CtrlGeneric and then also Observer<T> classes.

    modules/gui/skins2/parser/../src/../controls/ctrl_generic.hpp:134:18: warning: ‘virtual void CtrlGeneric::onUpdate(Subject<VarBool>&, void*)’ was hidden [-Woverloaded-virtual=]
      134 |     virtual void onUpdate( Subject<VarBool> &rVariable , void* );
          |                  ^~~~~~~~

Both those classes are providing onUpdate() function but with different
parameters, and by C++ rules, CtrlGeneric::onUpdate() from CtrlGeneric
is then hidden by the Observer<T>::onUpdate() method.

- - - - -
5c3f79db by Alexandre Janniaux at 2026-04-15T09:17:34+02:00
skins2: ctrl_tree: switch to using T = ..;

- - - - -


11 changed files:

- modules/gui/skins2/controls/ctrl_button.hpp
- modules/gui/skins2/controls/ctrl_checkbox.hpp
- modules/gui/skins2/controls/ctrl_generic.hpp
- modules/gui/skins2/controls/ctrl_image.hpp
- modules/gui/skins2/controls/ctrl_list.hpp
- modules/gui/skins2/controls/ctrl_radialslider.hpp
- modules/gui/skins2/controls/ctrl_slider.hpp
- modules/gui/skins2/controls/ctrl_text.hpp
- modules/gui/skins2/controls/ctrl_tree.hpp
- modules/gui/skins2/x11/x11_window.cpp
- modules/gui/skins2/x11/x11_window.hpp


Changes:

=====================================
modules/gui/skins2/controls/ctrl_button.hpp
=====================================
@@ -64,6 +64,9 @@ public:
     /// Get the type of control (custom RTTI)
     virtual std::string getType() const { return "button"; }
 
+protected:
+    using CtrlGeneric::onUpdate;
+
 private:
     /// Finite state machine of the control
     FSM m_fsm;


=====================================
modules/gui/skins2/controls/ctrl_checkbox.hpp
=====================================
@@ -51,22 +51,25 @@ 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"; }
+
+protected:
+    using CtrlGeneric::onUpdate;
 
 private:
     /// Finite state machine of the control
@@ -105,10 +108,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 );


=====================================
modules/gui/skins2/controls/ctrl_generic.hpp
=====================================
@@ -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;


=====================================
modules/gui/skins2/controls/ctrl_image.hpp
=====================================
@@ -50,19 +50,22 @@ 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"; }
+
+protected:
+    using CtrlGeneric::onUpdate;
 
 private:
     /// Bitmap
@@ -82,7 +85,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;
 
 
 };


=====================================
modules/gui/skins2/controls/ctrl_list.hpp
=====================================
@@ -43,28 +43,31 @@ public:
               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"; }
+
+protected:
+    using CtrlGeneric::onUpdate;
 
 private:
     /// List associated to the control
@@ -90,13 +93,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();


=====================================
modules/gui/skins2/controls/ctrl_radialslider.hpp
=====================================
@@ -45,19 +45,22 @@ 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"; }
+
+protected:
+    using CtrlGeneric::onUpdate;
 
 private:
     /// Finite state machine of the control
@@ -83,7 +86,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


=====================================
modules/gui/skins2/controls/ctrl_slider.hpp
=====================================
@@ -50,35 +50,38 @@ 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"; }
+
+protected:
+    using CtrlGeneric::onUpdate;
 
 private:
     /// Finite state machine of the control
@@ -112,7 +115,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;
@@ -134,35 +137,38 @@ public:
                   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);
+
+protected:
+    using CtrlGeneric::onUpdate;
 
 private:
     /// Cursor of the slider
@@ -189,7 +195,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;


=====================================
modules/gui/skins2/controls/ctrl_text.hpp
=====================================
@@ -82,6 +82,9 @@ public:
     /// Get the type of control (custom RTTI)
     virtual std::string getType() const { return "text"; }
 
+protected:
+    using CtrlGeneric::onUpdate;
+
 private:
     /// Finite state machine of the control
     FSM m_fsm;


=====================================
modules/gui/skins2/controls/ctrl_tree.hpp
=====================================
@@ -36,7 +36,7 @@ class GenericBitmap;
 class CtrlTree: public CtrlGeneric, public Observer<VarTree, tree_update>
 {
 public:
-    typedef VarTree::IteratorVisible Iterator;
+    using Iterator = VarTree::IteratorVisible;
 
     CtrlTree( intf_thread_t *pIntf,
               VarTree &rTree,
@@ -53,34 +53,37 @@ 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
     /// \return true if it changed the position
     bool ensureVisible( const Iterator& it );
 
+protected:
+    using CtrlGeneric::onUpdate;
+
 private:
     /// Tree associated to the control
     VarTree &m_rTree;
@@ -125,11 +128,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();


=====================================
modules/gui/skins2/x11/x11_window.cpp
=====================================
@@ -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;


=====================================
modules/gui/skins2/x11/x11_window.hpp
=====================================
@@ -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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0355a3bd16e06641cfd6b689fa0c7a8ac96e3047...5c3f79db719a4303816f72dac3188d2a0cdd2307

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/0355a3bd16e06641cfd6b689fa0c7a8ac96e3047...5c3f79db719a4303816f72dac3188d2a0cdd2307
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list