* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef ASYNC_QUEUE_HPP
/// Asynchronous queue for commands
class AsyncQueue: public SkinObject
{
- public:
- /// Get the instance of AsyncQueue
- /// Returns NULL if initialization failed.
- static AsyncQueue *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of AsyncQueue
+ /// Returns NULL if initialization failed.
+ static AsyncQueue *instance( intf_thread_t *pIntf );
- /// Destroy the instance of AsyncQueue
- static void destroy( intf_thread_t *pIntf );
+ /// Destroy the instance of AsyncQueue
+ static void destroy( intf_thread_t *pIntf );
- /// Add a command in the queue, after having removed the commands
- /// of the same type already in the queue if needed
- void push( const CmdGenericPtr &rcCommand, bool removePrev = true );
+ /// Add a command in the queue, after having removed the commands
+ /// of the same type already in the queue if needed
+ void push( const CmdGenericPtr &rcCommand, bool removePrev = true );
- /// Remove the commands of the given type
- void remove( const string &rType , const CmdGenericPtr &rcCommand );
+ /// Remove the commands of the given type
+ void remove( const string &rType , const CmdGenericPtr &rcCommand );
- /// Flush the queue and execute the commands
- void flush();
+ /// Flush the queue and execute the commands
+ void flush();
- private:
- /// Command queue
- list<CmdGenericPtr> m_cmdList;
- /// Timer
- OSTimer *m_pTimer;
- /// Mutex
- vlc_mutex_t m_lock;
+private:
+ /// Command queue
+ list<CmdGenericPtr> m_cmdList;
+ /// Timer
+ OSTimer *m_pTimer;
+ /// Mutex
+ vlc_mutex_t m_lock;
- // Private because it is a singleton
- AsyncQueue( intf_thread_t *pIntf );
- virtual ~AsyncQueue();
+ // Private because it is a singleton
+ AsyncQueue( intf_thread_t *pIntf );
+ virtual ~AsyncQueue();
- // Callback to flush the queue
- DEFINE_CALLBACK( AsyncQueue, Flush );
+ // Callback to flush the queue
+ DEFINE_CALLBACK( AsyncQueue, Flush );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_ADD_ITEM_HPP
/// "Add item" command
class CmdAddItem: public CmdGeneric
{
- public:
- CmdAddItem( intf_thread_t *pIntf, const string &rName, bool playNow ):
- CmdGeneric( pIntf ), m_name( rName ), m_playNow( playNow ) {}
- virtual ~CmdAddItem() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "add item"; }
-
- private:
- /// Name of the item to enqueue
- string m_name;
- /// Should we play the item immediately?
- bool m_playNow;
+public:
+ CmdAddItem( intf_thread_t *pIntf, const string &rName, bool playNow )
+ : CmdGeneric( pIntf ), m_name( rName ), m_playNow( playNow ) { }
+ virtual ~CmdAddItem() { }
+ virtual void execute();
+ virtual string getType() const { return "add item"; }
+
+private:
+ /// Name of the item to enqueue
+ string m_name;
+ /// Should we play the item immediately?
+ bool m_playNow;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_AUDIO_HPP
/// Command to enable/disable the equalizer
class CmdSetEqualizer: public CmdGeneric
{
- public:
- CmdSetEqualizer( intf_thread_t *pIntf, bool iEnable ):
- CmdGeneric( pIntf ), m_enable( iEnable ) {}
- virtual ~CmdSetEqualizer() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "set equalizer"; }
-
- private:
- /// Enable or disable the equalizer
- bool m_enable;
+public:
+ CmdSetEqualizer( intf_thread_t *pIntf, bool iEnable )
+ : CmdGeneric( pIntf ), m_enable( iEnable ) { }
+ virtual ~CmdSetEqualizer() { }
+ virtual void execute();
+ virtual string getType() const { return "set equalizer"; }
+
+private:
+ /// Enable or disable the equalizer
+ bool m_enable;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_CHANGE_SKIN_HPP
/// "Change Skin" command
class CmdChangeSkin: public CmdGeneric
{
- public:
- CmdChangeSkin( intf_thread_t *pIntf, const string &rFile ):
- CmdGeneric( pIntf ), m_file( rFile ) {}
- virtual ~CmdChangeSkin() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "change skin"; }
-
- private:
- /// Skin file to load
- string m_file;
+public:
+ CmdChangeSkin( intf_thread_t *pIntf, const string &rFile ):
+ CmdGeneric( pIntf ), m_file( rFile ) { }
+ virtual ~CmdChangeSkin() { }
+ virtual void execute();
+ virtual string getType() const { return "change skin"; }
+
+private:
+ /// Skin file to load
+ string m_file;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_GENERIC_HPP
#define CMD_GENERIC_HPP
+#include <string>
+
#include "../src/skin_common.hpp"
#include "../utils/pointer.hpp"
-#include <string>
-
/// Macro to define the prototype of simple commands
-#define DEFINE_COMMAND( name, type ) \
-class Cmd##name: public CmdGeneric \
-{ \
- public: \
- Cmd##name( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {} \
- virtual ~Cmd##name() {} \
- virtual void execute(); \
- virtual string getType() const { return type; } \
-\
+#define DEFINE_COMMAND( name, type ) \
+class Cmd##name: public CmdGeneric \
+{ public: \
+ Cmd##name( intf_thread_t *pIntf ): CmdGeneric( pIntf ) { } \
+ virtual ~Cmd##name() { } \
+ virtual void execute(); \
+ virtual string getType() const { return type; } \
};
/// Macro to define a "callback" command inside a class
-#define DEFINE_CALLBACK( parent, action ) \
-class Cmd##action: public CmdGeneric \
-{ \
- public: \
- Cmd##action( parent *pParent ): \
- CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) {} \
- virtual ~Cmd##action() {} \
- virtual void execute(); \
- virtual string getType() const { return "Cmd" #parent #action; } \
- private: \
- parent *m_pParent; \
-\
-} m_cmd##action; \
+#define DEFINE_CALLBACK( parent, action ) \
+class Cmd##action: public CmdGeneric \
+{ \
+public: \
+ Cmd##action( parent *pParent ): \
+ CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) { } \
+ virtual ~Cmd##action() { } \
+ virtual void execute(); \
+ virtual string getType() const { return "Cmd" #parent #action; } \
+private: \
+ parent *m_pParent; \
+} m_cmd##action; \
friend class Cmd##action;
/// Base class for skins commands
class CmdGeneric: public SkinObject
{
- public:
- virtual ~CmdGeneric() {}
+public:
+ virtual ~CmdGeneric() { }
- /// This method does the real job of the command
- virtual void execute() = 0;
+ /// This method does the real job of the command
+ virtual void execute() = 0;
- /// Return the type of the command
- virtual string getType() const { return ""; }
+ /// Return the type of the command
+ virtual string getType() const { return ""; }
- /// During queue reductions, check if we really want to remove
- /// this command.
- virtual bool checkRemove( CmdGeneric * ) const { return true; }
+ /// During queue reductions, check if we really want to remove
+ /// this command.
+ virtual bool checkRemove( CmdGeneric * ) const { return true; }
- protected:
- CmdGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ CmdGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_LAYOUT_HPP
/// "Change layout" command
class CmdLayout: public CmdGeneric
{
- public:
- CmdLayout( intf_thread_t *pIntf, TopWindow &rWindow,
- GenericLayout &rLayout );
- virtual ~CmdLayout() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "change layout"; }
-
- private:
- TopWindow &m_rWindow;
- GenericLayout &m_rLayout;
+public:
+ CmdLayout( intf_thread_t *pIntf, TopWindow &rWindow,
+ GenericLayout &rLayout );
+ virtual ~CmdLayout() { }
+ virtual void execute();
+ virtual string getType() const { return "change layout"; }
+
+private:
+ TopWindow &m_rWindow;
+ GenericLayout &m_rLayout;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_MINIMIZE_HPP
/// Command to maximize a window
class CmdMaximize: public CmdGeneric
{
- public:
- /// Maximize the given layout
- CmdMaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
- TopWindow &rWindow );
- virtual ~CmdMaximize() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "maximize"; }
-
- private:
- WindowManager &m_rWindowManager;
- TopWindow &m_rWindow;
+public:
+ /// Maximize the given layout
+ CmdMaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
+ TopWindow &rWindow );
+ virtual ~CmdMaximize() { }
+ virtual void execute();
+ virtual string getType() const { return "maximize"; }
+
+private:
+ WindowManager &m_rWindowManager;
+ TopWindow &m_rWindow;
};
/// Command to unmaximize a window
class CmdUnmaximize: public CmdGeneric
{
- public:
- /// Unmaximize the given layout
- CmdUnmaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
- TopWindow &rWindow );
- virtual ~CmdUnmaximize() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "unmaximize"; }
-
- private:
- WindowManager &m_rWindowManager;
- TopWindow &m_rWindow;
+public:
+ /// Unmaximize the given layout
+ CmdUnmaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
+ TopWindow &rWindow );
+ virtual ~CmdUnmaximize() { }
+ virtual void execute();
+ virtual string getType() const { return "unmaximize"; }
+
+private:
+ WindowManager &m_rWindowManager;
+ TopWindow &m_rWindow;
};
-DEFINE_COMMAND(AddInTray, "add in tray" )
-DEFINE_COMMAND(RemoveFromTray, "remove from tray" )
-DEFINE_COMMAND(AddInTaskBar, "add in taskbar" )
-DEFINE_COMMAND(RemoveFromTaskBar, "remove from taskbar" )
+DEFINE_COMMAND( AddInTray, "add in tray" )
+DEFINE_COMMAND( RemoveFromTray, "remove from tray" )
+DEFINE_COMMAND( AddInTaskBar, "add in taskbar" )
+DEFINE_COMMAND( RemoveFromTaskBar, "remove from taskbar" )
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_MUXER_HPP
/// This command only contains other commands (composite pattern)
class CmdMuxer: public CmdGeneric
{
- public:
- CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList ):
- CmdGeneric( pIntf ), m_list( rList ) {}
- virtual ~CmdMuxer() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "muxer"; }
-
- private:
- /// List of commands we will execute sequentially
- list<CmdGeneric*> m_list;
+public:
+ CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList ):
+ CmdGeneric( pIntf ), m_list( rList ) { }
+ virtual ~CmdMuxer() { }
+ virtual void execute();
+ virtual string getType() const { return "muxer"; }
+
+private:
+ /// List of commands we will execute sequentially
+ list<CmdGeneric*> m_list;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_PLAYLIST_HPP
/// Command to delete the selected items from a list
class CmdPlaylistDel: public CmdGeneric
{
- public:
- CmdPlaylistDel( intf_thread_t *pIntf, VarList &rList ):
- CmdGeneric( pIntf ), m_rList( rList ) {}
- virtual ~CmdPlaylistDel() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playlist del"; }
-
- private:
- /// List
- VarList &m_rList;
+public:
+ CmdPlaylistDel( intf_thread_t *pIntf, VarList &rList )
+ : CmdGeneric( pIntf ), m_rList( rList ) { }
+ virtual ~CmdPlaylistDel() { }
+ virtual void execute();
+ virtual string getType() const { return "playlist del"; }
+
+private:
+ /// List
+ VarList &m_rList;
};
/// Command to set the random state
class CmdPlaylistRandom: public CmdGeneric
{
- public:
- CmdPlaylistRandom( intf_thread_t *pIntf, bool value ):
- CmdGeneric( pIntf ), m_value( value ) {}
- virtual ~CmdPlaylistRandom() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playlist random"; }
-
- private:
- /// Random state
- bool m_value;
+public:
+ CmdPlaylistRandom( intf_thread_t *pIntf, bool value )
+ : CmdGeneric( pIntf ), m_value( value ) { }
+ virtual ~CmdPlaylistRandom() { }
+ virtual void execute();
+ virtual string getType() const { return "playlist random"; }
+
+private:
+ /// Random state
+ bool m_value;
};
/// Command to set the loop state
class CmdPlaylistLoop: public CmdGeneric
{
- public:
- CmdPlaylistLoop( intf_thread_t *pIntf, bool value ):
- CmdGeneric( pIntf ), m_value( value ) {}
- virtual ~CmdPlaylistLoop() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playlist loop"; }
-
- private:
- /// Loop state
- bool m_value;
+public:
+ CmdPlaylistLoop( intf_thread_t *pIntf, bool value )
+ : CmdGeneric( pIntf ), m_value( value ) { }
+ virtual ~CmdPlaylistLoop() { }
+ virtual void execute();
+ virtual string getType() const { return "playlist loop"; }
+
+private:
+ /// Loop state
+ bool m_value;
};
/// Command to set the repeat state
class CmdPlaylistRepeat: public CmdGeneric
{
- public:
- CmdPlaylistRepeat( intf_thread_t *pIntf, bool value ):
- CmdGeneric( pIntf ), m_value( value ) {}
- virtual ~CmdPlaylistRepeat() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playlist repeat"; }
-
- private:
- /// Repeat state
- bool m_value;
+public:
+ CmdPlaylistRepeat( intf_thread_t *pIntf, bool value )
+ : CmdGeneric( pIntf ), m_value( value ) { }
+ virtual ~CmdPlaylistRepeat() { }
+ virtual void execute();
+ virtual string getType() const { return "playlist repeat"; }
+
+private:
+ /// Repeat state
+ bool m_value;
};
/// Command to load a playlist
class CmdPlaylistLoad: public CmdGeneric
{
- public:
- CmdPlaylistLoad( intf_thread_t *pIntf, const string& rFile ):
- CmdGeneric( pIntf ), m_file( rFile ) {}
- virtual ~CmdPlaylistLoad() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playlist load"; }
-
- private:
- /// Playlist file to load
- string m_file;
+public:
+ CmdPlaylistLoad( intf_thread_t *pIntf, const string& rFile )
+ : CmdGeneric( pIntf ), m_file( rFile ) { }
+ virtual ~CmdPlaylistLoad() { }
+ virtual void execute();
+ virtual string getType() const { return "playlist load"; }
+
+private:
+ /// Playlist file to load
+ string m_file;
};
/// Command to save a playlist
class CmdPlaylistSave: public CmdGeneric
{
- public:
- CmdPlaylistSave( intf_thread_t *pIntf, const string& rFile ):
- CmdGeneric( pIntf ), m_file( rFile ) {}
- virtual ~CmdPlaylistSave() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playlist save"; }
-
- private:
- /// Playlist file to save
- string m_file;
+public:
+ CmdPlaylistSave( intf_thread_t *pIntf, const string& rFile )
+ : CmdGeneric( pIntf ), m_file( rFile ) { }
+ virtual ~CmdPlaylistSave() { }
+ virtual void execute();
+ virtual string getType() const { return "playlist save"; }
+
+private:
+ /// Playlist file to save
+ string m_file;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_PLAYTREE_HPP
/// Command to delete the selected items from a tree
class CmdPlaytreeDel: public CmdGeneric
{
- public:
- CmdPlaytreeDel( intf_thread_t *pIntf, VarTree &rTree ):
- CmdGeneric( pIntf ), m_rTree( rTree ) {}
- virtual ~CmdPlaytreeDel() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playtree del"; }
-
- private:
- /// Tree
- VarTree &m_rTree;
+public:
+ CmdPlaytreeDel( intf_thread_t *pIntf, VarTree &rTree )
+ : CmdGeneric( pIntf ), m_rTree( rTree ) { }
+ virtual ~CmdPlaytreeDel() { }
+ virtual void execute();
+ virtual string getType() const { return "playtree del"; }
+
+private:
+ /// Tree
+ VarTree &m_rTree;
};
/// Command to sort the playtree
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_RESIZE_HPP
/// Command to resize a layout
class CmdResize: public CmdGeneric
{
- public:
- /// Resize the given layout
- CmdResize( intf_thread_t *pIntf, const WindowManager &rWindowManager,
- GenericLayout &rLayout, int width, int height );
- virtual ~CmdResize() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "resize"; }
-
- private:
- const WindowManager &m_rWindowManager;
- GenericLayout &m_rLayout;
- int m_width, m_height;
+public:
+ /// Resize the given layout
+ CmdResize( intf_thread_t *pIntf, const WindowManager &rWindowManager,
+ GenericLayout &rLayout, int width, int height );
+ virtual ~CmdResize() { }
+ virtual void execute();
+ virtual string getType() const { return "resize"; }
+
+private:
+ const WindowManager &m_rWindowManager;
+ GenericLayout &m_rLayout;
+ int m_width, m_height;
};
/// Command to resize the inner vout window
class CmdResizeInnerVout: public CmdGeneric
{
- public:
- /// Resize the given layout
- CmdResizeInnerVout( intf_thread_t *pIntf, CtrlVideo* pCtrlVideo );
- virtual ~CmdResizeInnerVout() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "resize inner vout"; }
-
- private:
- CtrlVideo* m_pCtrlVideo;
+public:
+ /// Resize the given layout
+ CmdResizeInnerVout( intf_thread_t *pIntf, CtrlVideo* pCtrlVideo );
+ virtual ~CmdResizeInnerVout() { }
+ virtual void execute();
+ virtual string getType() const { return "resize inner vout"; }
+
+private:
+ CtrlVideo* m_pCtrlVideo;
};
/// Command to resize the vout window
class CmdResizeVout: public CmdGeneric
{
- public:
- /// Resize the given layout
- CmdResizeVout( intf_thread_t *pIntf, vout_window_t* pWnd,
- int width, int height );
- virtual ~CmdResizeVout() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "resize vout"; }
-
- private:
- vout_window_t* m_pWnd;
- int m_width, m_height;
+public:
+ /// Resize the given layout
+ CmdResizeVout( intf_thread_t *pIntf, vout_window_t* pWnd,
+ int width, int height );
+ virtual ~CmdResizeVout() { }
+ virtual void execute();
+ virtual string getType() const { return "resize vout"; }
+
+private:
+ vout_window_t* m_pWnd;
+ int m_width, m_height;
};
/// Command to toggle Fullscreen
class CmdSetFullscreen: public CmdGeneric
{
- public:
- /// Resize the given layout
- CmdSetFullscreen( intf_thread_t *pIntf, vout_window_t* pWnd,
- bool fullscreen );
- virtual ~CmdSetFullscreen() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "toogle fullscreen"; }
-
- private:
- vout_window_t* m_pWnd;
- bool m_bFullscreen;
+public:
+ /// Resize the given layout
+ CmdSetFullscreen( intf_thread_t *pIntf, vout_window_t* pWnd,
+ bool fullscreen );
+ virtual ~CmdSetFullscreen() { }
+ virtual void execute();
+ virtual string getType() const { return "toogle fullscreen"; }
+
+private:
+ vout_window_t* m_pWnd;
+ bool m_bFullscreen;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_SHOW_WINDOW_HPP
/// Command to show a window
class CmdShowWindow: public CmdGeneric
{
- public:
- CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
- TopWindow &rWin ):
- CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {}
- virtual ~CmdShowWindow() {}
-
- /// This method does the real job of the command
- virtual void execute() { m_rWinManager.show( m_rWin ); }
-
- /// Return the type of the command
- virtual string getType() const { return "show window"; }
-
- private:
- /// Reference to the window manager
- WindowManager &m_rWinManager;
- /// Reference to the window
- TopWindow &m_rWin;
+public:
+ CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
+ TopWindow &rWin ):
+ CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { }
+ virtual ~CmdShowWindow() { }
+ virtual void execute() { m_rWinManager.show( m_rWin ); }
+ virtual string getType() const { return "show window"; }
+
+private:
+ /// Reference to the window manager
+ WindowManager &m_rWinManager;
+ /// Reference to the window
+ TopWindow &m_rWin;
};
/// Command to hide a window
class CmdHideWindow: public CmdGeneric
{
- public:
- CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
- TopWindow &rWin ):
- CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {}
- virtual ~CmdHideWindow() {}
-
- /// This method does the real job of the command
- virtual void execute() { m_rWinManager.hide( m_rWin ); }
-
- /// Return the type of the command
- virtual string getType() const { return "hide window"; }
-
- private:
- /// Reference to the window manager
- WindowManager &m_rWinManager;
- /// Reference to the window
- TopWindow &m_rWin;
+public:
+ CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
+ TopWindow &rWin ):
+ CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { }
+ virtual ~CmdHideWindow() { }
+ virtual void execute() { m_rWinManager.hide( m_rWin ); }
+ virtual string getType() const { return "hide window"; }
+
+private:
+ /// Reference to the window manager
+ WindowManager &m_rWinManager;
+ /// Reference to the window
+ TopWindow &m_rWin;
};
/// Command to raise all windows
class CmdRaiseAll: public CmdGeneric
{
- public:
- CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ):
- CmdGeneric( pIntf ), m_rWinManager( rWinManager ) {}
- virtual ~CmdRaiseAll() {}
-
- /// This method does the real job of the command
- virtual void execute() { m_rWinManager.raiseAll(); }
-
- /// Return the type of the command
- virtual string getType() const { return "raise all windows"; }
-
- private:
- /// Reference to the window manager
- WindowManager &m_rWinManager;
+public:
+ CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ):
+ CmdGeneric( pIntf ), m_rWinManager( rWinManager ) { }
+ virtual ~CmdRaiseAll() { }
+ virtual void execute() { m_rWinManager.raiseAll(); }
+ virtual string getType() const { return "raise all windows"; }
+
+private:
+ /// Reference to the window manager
+ WindowManager &m_rWinManager;
};
/// Command to show a popup menu
class CmdShowPopup: public CmdGeneric
{
- public:
- CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ):
- CmdGeneric( pIntf ), m_rPopup( rPopup ) {}
- virtual ~CmdShowPopup() {}
-
- /// This method does the real job of the command
- virtual void execute()
- {
- int x, y;
- OSFactory::instance( getIntf() )->getMousePos( x, y );
- m_rPopup.show( x, y );
- }
-
- /// Return the type of the command
- virtual string getType() const { return "show popup"; }
-
- private:
- /// Reference to the popup
- Popup &m_rPopup;
+public:
+ CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ):
+ CmdGeneric( pIntf ), m_rPopup( rPopup ) { }
+ virtual ~CmdShowPopup() { }
+
+ virtual void execute()
+ {
+ int x, y;
+ OSFactory::instance( getIntf() )->getMousePos( x, y );
+ m_rPopup.show( x, y );
+ }
+
+ virtual string getType() const { return "show popup"; }
+
+private:
+ /// Reference to the popup
+ Popup &m_rPopup;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_UPDATE_ITEM_HPP
/// Udate item command
class CmdUpdateItem: public CmdGeneric
{
- public:
- CmdUpdateItem( intf_thread_t *pIntf, VarText &rStreamName, VarText &rStreamURI ) :
- CmdGeneric( pIntf ), m_rStreamName(rStreamName), m_rStreamURI(rStreamURI) {}
- virtual ~CmdUpdateItem() {}
+public:
+ CmdUpdateItem( intf_thread_t *I,VarText &N,VarText &U )
+ : CmdGeneric(I), m_rStreamName(N), m_rStreamURI(U) { }
+ virtual ~CmdUpdateItem() { }
+ virtual void execute();
+ virtual string getType() const { return "update item"; }
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "update item"; }
-
- private:
- VarText &m_rStreamName;
- VarText &m_rStreamURI;
+private:
+ VarText &m_rStreamName;
+ VarText &m_rStreamURI;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_VARS_HPP
/// Command to notify the playtree of an item update
class CmdPlaytreeUpdate: public CmdGeneric
{
- public:
- CmdPlaytreeUpdate( intf_thread_t *pIntf, int id ):
- CmdGeneric( pIntf ), m_id( id ) {}
- virtual ~CmdPlaytreeUpdate() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playtree update"; }
-
- /// Only accept removal of command if they concern the same item
- virtual bool checkRemove( CmdGeneric * ) const;
-
- private:
- /// Playlist item ID
- int m_id;
+public:
+ CmdPlaytreeUpdate( intf_thread_t *pIntf, int id ):
+ CmdGeneric( pIntf ), m_id( id ) { }
+ virtual ~CmdPlaytreeUpdate() { }
+ virtual void execute();
+ virtual string getType() const { return "playtree update"; }
+
+ /// Only accept removal of command if they concern the same item
+ virtual bool checkRemove( CmdGeneric * ) const;
+
+private:
+ /// Playlist item ID
+ int m_id;
};
/// Command to notify the playtree of an item append
class CmdPlaytreeAppend: public CmdGeneric
{
- public:
- CmdPlaytreeAppend( intf_thread_t *pIntf, playlist_add_t *p_add ) :
- CmdGeneric( pIntf ), m_pAdd( p_add ) {}
- virtual ~CmdPlaytreeAppend() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playtree append"; }
-
- private:
- playlist_add_t * m_pAdd;
+public:
+ CmdPlaytreeAppend( intf_thread_t *pIntf, playlist_add_t *p_add ):
+ CmdGeneric( pIntf ), m_pAdd( p_add ) { }
+ virtual ~CmdPlaytreeAppend() { }
+ virtual void execute();
+ virtual string getType() const { return "playtree append"; }
+
+private:
+ playlist_add_t * m_pAdd;
};
/// Command to notify the playtree of an item deletion
class CmdPlaytreeDelete: public CmdGeneric
{
- public:
- CmdPlaytreeDelete( intf_thread_t *pIntf, int i_id ) :
- CmdGeneric( pIntf ), m_id( i_id ) {}
- virtual ~CmdPlaytreeDelete() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "playtree append"; }
-
- private:
- int m_id;
+public:
+ CmdPlaytreeDelete( intf_thread_t *pIntf, int i_id ):
+ CmdGeneric( pIntf ), m_id( i_id ) { }
+ virtual ~CmdPlaytreeDelete() { }
+ virtual void execute();
+ virtual string getType() const { return "playtree append"; }
+
+private:
+ int m_id;
};
-
-
/// Command to set a text variable
class CmdSetText: public CmdGeneric
{
- public:
- CmdSetText( intf_thread_t *pIntf, VarText &rText,
- const UString &rValue ):
- CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) {}
- virtual ~CmdSetText() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "set text"; }
-
- private:
- /// Text variable to set
- VarText &m_rText;
- /// Value to set
- const UString m_value;
+public:
+ CmdSetText( intf_thread_t *pIntf, VarText &rText, const UString &rValue ):
+ CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) { }
+ virtual ~CmdSetText() { }
+ virtual void execute();
+ virtual string getType() const { return "set text"; }
+
+private:
+ /// Text variable to set
+ VarText &m_rText;
+ /// Value to set
+ const UString m_value;
};
/// Command to set the equalizer preamp
class CmdSetEqPreamp: public CmdGeneric
{
- public:
- CmdSetEqPreamp( intf_thread_t *pIntf, EqualizerPreamp &rPreamp,
- float value ):
- CmdGeneric( pIntf ), m_rPreamp( rPreamp ), m_value( value ) {}
- virtual ~CmdSetEqPreamp() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "set equalizer preamp"; }
-
- private:
- /// Preamp variable to set
- EqualizerPreamp &m_rPreamp;
- /// Value to set
- float m_value;
+public:
+ CmdSetEqPreamp( intf_thread_t *I, EqualizerPreamp &P, float v )
+ : CmdGeneric( I ), m_rPreamp( P ), m_value( v ) { }
+ virtual ~CmdSetEqPreamp() { }
+ virtual void execute();
+ virtual string getType() const { return "set equalizer preamp"; }
+
+private:
+ /// Preamp variable to set
+ EqualizerPreamp &m_rPreamp;
+ /// Value to set
+ float m_value;
};
/// Command to set the equalizerbands
class CmdSetEqBands: public CmdGeneric
{
- public:
- CmdSetEqBands( intf_thread_t *pIntf, EqualizerBands &rEqBands,
- const string &rValue ):
- CmdGeneric( pIntf ), m_rEqBands( rEqBands ), m_value( rValue ) {}
- virtual ~CmdSetEqBands() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "set equalizer bands"; }
-
- private:
- /// Equalizer variable to set
- EqualizerBands &m_rEqBands;
- /// Value to set
- const string m_value;
+public:
+ CmdSetEqBands( intf_thread_t *I, EqualizerBands &B, const string &V )
+ : CmdGeneric( I ), m_rEqBands( B ), m_value( V ) { }
+ virtual ~CmdSetEqBands() { }
+ virtual void execute();
+ virtual string getType() const { return "set equalizer bands"; }
+
+private:
+ /// Equalizer variable to set
+ EqualizerBands &m_rEqBands;
+ /// Value to set
+ const string m_value;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CMD_VOUTWINDOW_HPP
/// Command to create a vout window
class CmdNewVoutWindow: public CmdGeneric
{
- public:
- /// Create a vout window
- CmdNewVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
- virtual ~CmdNewVoutWindow() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "new vout window"; }
-
- private:
- vout_window_t* m_pWnd;
+public:
+ /// Create a vout window
+ CmdNewVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
+ virtual ~CmdNewVoutWindow() { }
+ virtual void execute();
+ virtual string getType() const { return "new vout window"; }
+
+private:
+ vout_window_t* m_pWnd;
};
/// Command to release a vout window
class CmdReleaseVoutWindow: public CmdGeneric
{
- public:
- /// Release a vout window
- CmdReleaseVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
- virtual ~CmdReleaseVoutWindow() {}
-
- /// This method does the real job of the command
- virtual void execute();
-
- /// Return the type of the command
- virtual string getType() const { return "new vout window"; }
-
- private:
- vout_window_t* m_pWnd;
+public:
+ /// Release a vout window
+ CmdReleaseVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
+ virtual ~CmdReleaseVoutWindow() { }
+ virtual void execute();
+ virtual string getType() const { return "new vout window"; }
+
+private:
+ vout_window_t* m_pWnd;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_BUTTON_HPP
/// Base class for button controls
class CtrlButton: public CtrlGeneric, public Observer<AnimBitmap>
{
- public:
- /// Create a button with 3 images
- CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
- const GenericBitmap &rBmpOver,
- const GenericBitmap &rBmpDown,
- CmdGeneric &rCommand, const UString &rTooltip,
- const UString &rHelp, VarBool *pVisible );
-
- virtual ~CtrlButton();
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Get the text of the tooltip
- virtual UString getTooltipText() const { return m_tooltip; }
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "button"; }
-
- private:
- /// Finite state machine of the control
- FSM m_fsm;
- /// Command triggered by the button
- CmdGeneric &m_rCommand;
- /// Tooltip text
- const UString m_tooltip;
- /// Images of the button in the different states
- AnimBitmap m_imgUp, m_imgOver, m_imgDown;
- /// Current image
- AnimBitmap *m_pImg;
-
- /// Callback objects
- DEFINE_CALLBACK( CtrlButton, UpOverDownOver )
- DEFINE_CALLBACK( CtrlButton, DownOverUpOver )
- DEFINE_CALLBACK( CtrlButton, DownOverDown )
- DEFINE_CALLBACK( CtrlButton, DownDownOver )
- DEFINE_CALLBACK( CtrlButton, UpOverUp )
- DEFINE_CALLBACK( CtrlButton, UpUpOver )
- DEFINE_CALLBACK( CtrlButton, DownUp )
- DEFINE_CALLBACK( CtrlButton, UpHidden )
- DEFINE_CALLBACK( CtrlButton, HiddenUp )
-
- /// Change the current image
- void setImage( AnimBitmap *pImg );
-
- /// Method called when an animated bitmap changes
- virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
+public:
+ /// Create a button with 3 images
+ CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
+ const GenericBitmap &rBmpOver, const GenericBitmap &rBmpDown,
+ CmdGeneric &rCommand, const UString &rTooltip,
+ const UString &rHelp, VarBool *pVisible );
+
+ virtual ~CtrlButton();
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Get the text of the tooltip
+ virtual UString getTooltipText() const { return m_tooltip; }
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "button"; }
+
+private:
+ /// Finite state machine of the control
+ FSM m_fsm;
+ /// Command triggered by the button
+ CmdGeneric &m_rCommand;
+ /// Tooltip text
+ const UString m_tooltip;
+ /// Images of the button in the different states
+ AnimBitmap m_imgUp, m_imgOver, m_imgDown;
+ /// Current image
+ AnimBitmap *m_pImg;
+
+ /// Callback objects
+ DEFINE_CALLBACK( CtrlButton, UpOverDownOver )
+ DEFINE_CALLBACK( CtrlButton, DownOverUpOver )
+ DEFINE_CALLBACK( CtrlButton, DownOverDown )
+ DEFINE_CALLBACK( CtrlButton, DownDownOver )
+ DEFINE_CALLBACK( CtrlButton, UpOverUp )
+ DEFINE_CALLBACK( CtrlButton, UpUpOver )
+ DEFINE_CALLBACK( CtrlButton, DownUp )
+ DEFINE_CALLBACK( CtrlButton, UpHidden )
+ DEFINE_CALLBACK( CtrlButton, HiddenUp )
+
+ /// Change the current image
+ void setImage( AnimBitmap *pImg );
+
+ /// Method called when an animated bitmap changes
+ virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_CHECKBOX_HPP
/// Base class for checkbox controls
class CtrlCheckbox: public CtrlGeneric, public Observer<AnimBitmap>
{
- public:
- /// Create a checkbox with 6 images
- CtrlCheckbox( intf_thread_t *pIntf,
- const GenericBitmap &rBmpUp1,
- const GenericBitmap &rBmpOver1,
- const GenericBitmap &rBmpDown1,
- const GenericBitmap &rBmpUp2,
- const GenericBitmap &rBmpOver2,
- const GenericBitmap &rBmpDown2,
- CmdGeneric &rCommand1, CmdGeneric &rCommand2,
- const UString &rTooltip1, const UString &rTooltip2,
- VarBool &rVariable, const UString &rHelp,
- VarBool *pVisible);
-
- virtual ~CtrlCheckbox();
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Get the text of the tooltip XXX
- virtual UString getTooltipText() const { return *m_pTooltip; }
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "checkbox"; }
-
- private:
- /// Finite state machine of the control
- FSM m_fsm;
- /// Observed variable
- VarBool &m_rVariable;
- /// Commands for the 2 states
- CmdGeneric &m_rCommand1, &m_rCommand2;
- /// Current command
- CmdGeneric *m_pCommand;
- /// Tooltip texts for the 2 states
- const UString m_tooltip1, m_tooltip2;
- /// Current tooltip
- const UString *m_pTooltip;
- /// Images of the checkbox in the different states
- AnimBitmap m_imgUp1, m_imgOver1, m_imgDown1;
- AnimBitmap m_imgUp2, m_imgOver2, m_imgDown2;
- /// Current set of images (pointing to 1 or 2)
- /// In fact, we consider here that a checkbox acts like 2 buttons, in a
- /// symetric way; this is a small trick to avoid multiplicating the
- /// callbacks (and it could be extended easily to support 3 buttons or
- /// more...)
- AnimBitmap *m_pImgUp, *m_pImgOver, *m_pImgDown;
- /// Current image
- AnimBitmap *m_pImgCurrent;
-
- /// Callback objects
- DEFINE_CALLBACK( CtrlCheckbox, UpOverDownOver )
- DEFINE_CALLBACK( CtrlCheckbox, DownOverUpOver )
- DEFINE_CALLBACK( CtrlCheckbox, DownOverDown )
- DEFINE_CALLBACK( CtrlCheckbox, DownDownOver )
- DEFINE_CALLBACK( CtrlCheckbox, UpOverUp )
- DEFINE_CALLBACK( CtrlCheckbox, UpUpOver )
- DEFINE_CALLBACK( CtrlCheckbox, DownUp )
- DEFINE_CALLBACK( CtrlCheckbox, UpHidden )
- DEFINE_CALLBACK( CtrlCheckbox, HiddenUp )
-
- /// Method called when the observed variable is modified
- virtual void onVarBoolUpdate( VarBool &rVariable );
-
- /// Method called when an animated bitmap changes
- virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
-
- /// Change the current image
- void setImage( AnimBitmap *pImg );
-
- /// Helper function to update the current state of images
- void changeButton();
+public:
+ /// Create a checkbox with 6 images
+ CtrlCheckbox( intf_thread_t *pIntf,
+ const GenericBitmap &rBmpUp1,
+ const GenericBitmap &rBmpOver1,
+ const GenericBitmap &rBmpDown1,
+ const GenericBitmap &rBmpUp2,
+ const GenericBitmap &rBmpOver2,
+ const GenericBitmap &rBmpDown2,
+ CmdGeneric &rCommand1, CmdGeneric &rCommand2,
+ const UString &rTooltip1, const UString &rTooltip2,
+ VarBool &rVariable, const UString &rHelp,
+ VarBool *pVisible);
+
+ virtual ~CtrlCheckbox();
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Get the text of the tooltip XXX
+ virtual UString getTooltipText() const { return *m_pTooltip; }
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "checkbox"; }
+
+private:
+ /// Finite state machine of the control
+ FSM m_fsm;
+ /// Observed variable
+ VarBool &m_rVariable;
+ /// Commands for the 2 states
+ CmdGeneric &m_rCommand1, &m_rCommand2;
+ /// Current command
+ CmdGeneric *m_pCommand;
+ /// Tooltip texts for the 2 states
+ const UString m_tooltip1, m_tooltip2;
+ /// Current tooltip
+ const UString *m_pTooltip;
+ /// Images of the checkbox in the different states
+ AnimBitmap m_imgUp1, m_imgOver1, m_imgDown1;
+ AnimBitmap m_imgUp2, m_imgOver2, m_imgDown2;
+ /// Current set of images (pointing to 1 or 2)
+ /// In fact, we consider here that a checkbox acts like 2 buttons, in a
+ /// symetric way; this is a small trick to avoid multiplicating the
+ /// callbacks (and it could be extended easily to support 3 buttons or
+ /// more...)
+ AnimBitmap *m_pImgUp, *m_pImgOver, *m_pImgDown;
+ /// Current image
+ AnimBitmap *m_pImgCurrent;
+
+ /// Callback objects
+ DEFINE_CALLBACK( CtrlCheckbox, UpOverDownOver )
+ DEFINE_CALLBACK( CtrlCheckbox, DownOverUpOver )
+ DEFINE_CALLBACK( CtrlCheckbox, DownOverDown )
+ DEFINE_CALLBACK( CtrlCheckbox, DownDownOver )
+ DEFINE_CALLBACK( CtrlCheckbox, UpOverUp )
+ DEFINE_CALLBACK( CtrlCheckbox, UpUpOver )
+ DEFINE_CALLBACK( CtrlCheckbox, DownUp )
+ DEFINE_CALLBACK( CtrlCheckbox, UpHidden )
+ DEFINE_CALLBACK( CtrlCheckbox, HiddenUp )
+
+ /// Method called when the observed variable is modified
+ virtual void onVarBoolUpdate( VarBool &rVariable );
+
+ /// Method called when an animated bitmap changes
+ virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
+
+ /// Change the current image
+ void setImage( AnimBitmap *pImg );
+
+ /// Helper function to update the current state of images
+ void changeButton();
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_FLAT_HPP
/// Base class for "mover controls" and images
class CtrlFlat: public CtrlGeneric
{
- protected:
- CtrlFlat( intf_thread_t *pIntf, const UString &rHelp,
- VarBool *pVisible ):
- CtrlGeneric( pIntf, rHelp, pVisible ) {}
+protected:
+ CtrlFlat( intf_thread_t *pIntf, const UString &rHelp, VarBool *pVisible )
+ : CtrlGeneric( pIntf, rHelp, pVisible ) { }
- virtual ~CtrlFlat() {}
+ virtual ~CtrlFlat() { }
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_GENERIC_HPP
/// Base class for controls
class CtrlGeneric: public SkinObject, public Observer<VarBool>
{
- public:
- virtual ~CtrlGeneric();
+public:
+ virtual ~CtrlGeneric();
- /// Handle an event on the control
- virtual void handleEvent( EvtGeneric &rEvent ) {}
+ /// Handle an event on the control
+ virtual void handleEvent( EvtGeneric &rEvent ) { }
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const { return false; }
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const { return false; }
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest ) {}
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest ) { }
- /// Set the position and the associated layout of the control
- virtual void setLayout( GenericLayout *pLayout,
- const Position &rPosition );
+ /// Set the position and the associated layout of the control
+ virtual void setLayout( GenericLayout *pLayout,
+ const Position &rPosition );
- /// Get the position of the control in the layout, if any
- virtual const Position *getPosition() const { return m_pPosition; }
+ /// Get the position of the control in the layout, if any
+ virtual const Position *getPosition() const { return m_pPosition; }
- /// Get the text of the tooltip
- virtual UString getTooltipText() const
- { return UString( getIntf(), "" ); }
+ /// Get the text of the tooltip
+ virtual UString getTooltipText() const
+ { return UString( getIntf(), "" ); }
- /**
- * Overload this method if you want to do something special when
- * the layout is resized
- */
- virtual void onResize() {}
+ /**
+ * Overload this method if you want to do something special when
+ * the layout is resized
+ */
+ virtual void onResize() { }
- /// Get the help text
- virtual const UString &getHelpText() const { return m_help; }
+ /// Get the help text
+ virtual const UString &getHelpText() const { return m_help; }
- /// Return true if the control can gain the focus
- virtual bool isFocusable() const { return false; }
+ /// Return true if the control can gain the focus
+ virtual bool isFocusable() const { return false; }
- /// Return true if the control is visible
- virtual bool isVisible() const;
+ /// Return true if the control is visible
+ virtual bool isVisible() const;
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return ""; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return ""; }
- protected:
- // If pVisible is NULL, the control is always visible
- CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
- VarBool *pVisible = NULL );
+protected:
+ // If pVisible is NULL, the control is always visible
+ CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
+ VarBool *pVisible = NULL );
- /**
- * Tell the layout when the image has changed, with the size of the
- * rectangle to repaint and its offset.
- * Use the default values to repaint the whole window
- */
- virtual void notifyLayout( int witdh = -1, int height = -1,
- int xOffSet = 0, int yOffSet = 0 ) const;
+ /**
+ * Tell the layout when the image has changed, with the size of the
+ * rectangle to repaint and its offset.
+ * Use the default values to repaint the whole window
+ */
+ virtual void notifyLayout( int witdh = -1, int height = -1,
+ int xOffSet = 0, int yOffSet = 0 ) const;
- /**
- * Same as notifyLayout(), but takes optional images as parameters.
- * The maximum size(s) of the images will be used for repainting.
- */
- void notifyLayoutMaxSize( const Box *pImg1 = NULL,
- const Box *pImg2 = NULL );
+ /**
+ * Same as notifyLayout(), but takes optional images as parameters.
+ * The maximum size(s) of the images will be used for repainting.
+ */
+ void notifyLayoutMaxSize( const Box *pImg1 = NULL,
+ const Box *pImg2 = NULL );
- /// Ask the layout to capture the mouse
- virtual void captureMouse() const;
+ /// Ask the layout to capture the mouse
+ virtual void captureMouse() const;
- /// Ask the layout to release the mouse
- virtual void releaseMouse() const;
+ /// Ask the layout to release the mouse
+ virtual void releaseMouse() const;
- /// Notify the window the tooltip has changed
- virtual void notifyTooltipChange() const;
+ /// Notify the window the tooltip has changed
+ virtual void notifyTooltipChange() const;
- /// Get the associated window, if any
- virtual TopWindow *getWindow() const;
+ /// Get the associated window, if any
+ virtual TopWindow *getWindow() const;
- /**
- * Overload this method if you want to do something special when
- * the Position object is set
- */
- virtual void onPositionChange() {}
+ /**
+ * Overload this method if you want to do something special when
+ * the Position object is set
+ */
+ virtual void onPositionChange() { }
- /// Overload this method to get notified of bool variable changes
- virtual void onVarBoolUpdate( VarBool &rVar ) {}
+ /// Overload this method to get notified of bool variable changes
+ virtual void onVarBoolUpdate( VarBool &rVar ) { }
- /// Method called when an observed bool variable is changed
- virtual void onUpdate( Subject<VarBool> &rVariable , void* );
+ /// Method called when an observed bool variable is changed
+ virtual void onUpdate( Subject<VarBool> &rVariable , void* );
- /// Associated layout
- GenericLayout *m_pLayout;
+ /// Associated layout
+ GenericLayout *m_pLayout;
- /// Visibility variable
- VarBool *m_pVisible;
+ /// Visibility variable
+ VarBool *m_pVisible;
- private:
- /// Position in the layout
- Position *m_pPosition;
- /// Help text
- UString m_help;
+private:
+ /// Position in the layout
+ Position *m_pPosition;
+ /// Help text
+ UString m_help;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_IMAGE_HPP
/// Control image
class CtrlImage: public CtrlFlat
{
- public:
- /// Resize methods
- enum resize_t
- {
- kMosaic, // Repeat the base image in a mosaic
- kScale // Scale the base image
- };
+public:
+ /// Resize methods
+ enum resize_t
+ {
+ kMosaic, // Repeat the base image in a mosaic
+ kScale // Scale the base image
+ };
- // Create an image with the given bitmap (which is NOT copied)
- CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
- CmdGeneric &rCommand, resize_t resizeMethod,
- const UString &rHelp, VarBool *pVisible );
- virtual ~CtrlImage();
+ // Create an image with the given bitmap (which is NOT copied)
+ CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
+ CmdGeneric &rCommand, resize_t resizeMethod,
+ const UString &rHelp, VarBool *pVisible );
+ virtual ~CtrlImage();
- /// Handle an event on the control
- virtual void handleEvent( EvtGeneric &rEvent );
+ /// Handle an event on the control
+ virtual void handleEvent( EvtGeneric &rEvent );
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "image"; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "image"; }
- private:
- /// Bitmap
- const GenericBitmap &m_rBitmap;
- /// Buffer to stored the rendered bitmap
- OSGraphics *m_pImage;
- /// Command triggered by a double-click on the image
- CmdGeneric &m_rCommand;
- /// Resize method
- resize_t m_resizeMethod;
+private:
+ /// Bitmap
+ const GenericBitmap &m_rBitmap;
+ /// Buffer to stored the rendered bitmap
+ OSGraphics *m_pImage;
+ /// Command triggered by a double-click on the image
+ CmdGeneric &m_rCommand;
+ /// Resize method
+ resize_t m_resizeMethod;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_LIST_HPP
class CtrlList: public CtrlGeneric, public Observer<VarList>,
public Observer<VarPercent>
{
- public:
- 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();
-
- /// Handle an event on the control.
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control.
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Called when the layout is resized
- virtual void onResize();
-
- /// Return true if the control can gain the focus
- virtual bool isFocusable() const { return true; }
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "list"; }
-
- private:
- /// List associated to the control
- VarList &m_rList;
- /// Font
- const GenericFont &m_rFont;
- /// Background bitmap
- /** If NULL, the 2 background colors defined below will be used */
- const GenericBitmap *m_pBitmap;
- /// Color of normal text
- uint32_t m_fgColor;
- /// Color of the playing item
- uint32_t m_playColor;
- /// Background colors, used when no background bitmap is given
- uint32_t m_bgColor1, m_bgColor2;
- /// Background of selected items
- uint32_t m_selColor;
- /// Pointer on the last selected item in the list
- VarList::Elem_t *m_pLastSelected;
- /// Image of the control
- OSGraphics *m_pImage;
- /// Last position
- int m_lastPos;
-
- /// Method called when the list variable is modified
- virtual void onUpdate( Subject<VarList> &rList, void* );
-
- /// Method called when the position variable of the list is modified
- virtual void onUpdate( Subject<VarPercent> &rPercent, void* );
-
- /// Called when the position is set
- virtual void onPositionChange();
-
- /// Check if the list must be scrolled
- void autoScroll();
-
- /// Draw the image of the control
- void makeImage();
+public:
+ 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();
+
+ /// Handle an event on the control.
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control.
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Called when the layout is resized
+ virtual void onResize();
+
+ /// Return true if the control can gain the focus
+ virtual bool isFocusable() const { return true; }
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "list"; }
+
+private:
+ /// List associated to the control
+ VarList &m_rList;
+ /// Font
+ const GenericFont &m_rFont;
+ /// Background bitmap
+ /** If NULL, the 2 background colors defined below will be used */
+ const GenericBitmap *m_pBitmap;
+ /// Color of normal text
+ uint32_t m_fgColor;
+ /// Color of the playing item
+ uint32_t m_playColor;
+ /// Background colors, used when no background bitmap is given
+ uint32_t m_bgColor1, m_bgColor2;
+ /// Background of selected items
+ uint32_t m_selColor;
+ /// Pointer on the last selected item in the list
+ VarList::Elem_t *m_pLastSelected;
+ /// Image of the control
+ OSGraphics *m_pImage;
+ /// Last position
+ int m_lastPos;
+
+ /// Method called when the list variable is modified
+ virtual void onUpdate( Subject<VarList> &rList, void* );
+
+ /// Method called when the position variable of the list is modified
+ virtual void onUpdate( Subject<VarPercent> &rPercent, void* );
+
+ /// Called when the position is set
+ virtual void onPositionChange();
+
+ /// Check if the list must be scrolled
+ void autoScroll();
+
+ /// Draw the image of the control
+ void makeImage();
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_MOVE_HPP
/// Control for moving windows
class CtrlMove: public CtrlFlat
{
- public:
- CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
- CtrlFlat &rCtrl, TopWindow &rWindow,
- const UString &rHelp, VarBool *pVisible );
- virtual ~CtrlMove() {}
+public:
+ CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
+ CtrlFlat &rCtrl, TopWindow &rWindow,
+ const UString &rHelp, VarBool *pVisible );
+ virtual ~CtrlMove() { }
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
- /// Check whether coordinates are inside the decorated control
- virtual bool mouseOver( int x, int y ) const;
+ /// Check whether coordinates are inside the decorated control
+ virtual bool mouseOver( int x, int y ) const;
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
- /// Set the position and the associated layout of the decorated control
- virtual void setLayout( GenericLayout *pLayout,
- const Position &rPosition );
+ /// Set the position and the associated layout of the decorated control
+ virtual void setLayout( GenericLayout *pLayout,
+ const Position &rPosition );
- /// Get the position of the decorated control in the layout, if any
- virtual const Position *getPosition() const;
+ /// Get the position of the decorated control in the layout, if any
+ virtual const Position *getPosition() const;
- /// Method called when the control is resized
- virtual void onResize();
+ /// Method called when the control is resized
+ virtual void onResize();
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return m_rCtrl.getType(); }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return m_rCtrl.getType(); }
- private:
- FSM m_fsm;
- /// Window manager
- WindowManager &m_rWindowManager;
- /// Decorated CtrlFlat
- CtrlFlat &m_rCtrl;
- /// The window moved by this control
- TopWindow &m_rWindow;
- /// The last received event
- EvtGeneric *m_pEvt;
- /// Position of the click that started the move
- int m_xPos, m_yPos;
+private:
+ FSM m_fsm;
+ /// Window manager
+ WindowManager &m_rWindowManager;
+ /// Decorated CtrlFlat
+ CtrlFlat &m_rCtrl;
+ /// The window moved by this control
+ TopWindow &m_rWindow;
+ /// The last received event
+ EvtGeneric *m_pEvt;
+ /// Position of the click that started the move
+ int m_xPos, m_yPos;
- /// Callback objects
- DEFINE_CALLBACK( CtrlMove, MovingMoving )
- DEFINE_CALLBACK( CtrlMove, StillMoving )
- DEFINE_CALLBACK( CtrlMove, MovingStill )
- };
+ /// Callback objects
+ DEFINE_CALLBACK( CtrlMove, MovingMoving )
+ DEFINE_CALLBACK( CtrlMove, StillMoving )
+ DEFINE_CALLBACK( CtrlMove, MovingStill )
+};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_RADIALSLIDER_HPP
/// Radial slider
class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
{
- public:
- /// 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,
- int numImg, VarPercent &rVariable, float minAngle,
- float maxAngle, const UString &rHelp,
- VarBool *pVisible );
-
- virtual ~CtrlRadialSlider();
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "radial_slider"; }
-
- private:
- /// Finite state machine of the control
- FSM m_fsm;
- /// Number of sub-images in the slider image
- int m_numImg;
- /// Variable associated to the slider
- VarPercent &m_rVariable;
- /// Min and max angles of the button
- float m_minAngle, m_maxAngle;
- /// Position of the cursor
- int m_position;
- /// Size of an image
- int m_width, m_height;
- /// The last received event
- EvtGeneric *m_pEvt;
- /// Sequence of images
- OSGraphics *m_pImgSeq;
- /// Last saved position
- int m_lastPos;
-
- /// Callback objects
- DEFINE_CALLBACK( CtrlRadialSlider, UpDown )
- DEFINE_CALLBACK( CtrlRadialSlider, DownUp )
- DEFINE_CALLBACK( CtrlRadialSlider, Move )
-
- /// Method called when the observed variable is modified
- 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
- /// the cursor cannot do more than a half turn
- void setCursor( int posX, int posY, bool blocking );
+public:
+ /// 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,
+ int numImg, VarPercent &rVariable, float minAngle,
+ float maxAngle, const UString &rHelp,
+ VarBool *pVisible );
+
+ virtual ~CtrlRadialSlider();
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "radial_slider"; }
+
+private:
+ /// Finite state machine of the control
+ FSM m_fsm;
+ /// Number of sub-images in the slider image
+ int m_numImg;
+ /// Variable associated to the slider
+ VarPercent &m_rVariable;
+ /// Min and max angles of the button
+ float m_minAngle, m_maxAngle;
+ /// Position of the cursor
+ int m_position;
+ /// Size of an image
+ int m_width, m_height;
+ /// The last received event
+ EvtGeneric *m_pEvt;
+ /// Sequence of images
+ OSGraphics *m_pImgSeq;
+ /// Last saved position
+ int m_lastPos;
+
+ /// Callback objects
+ DEFINE_CALLBACK( CtrlRadialSlider, UpDown )
+ DEFINE_CALLBACK( CtrlRadialSlider, DownUp )
+ DEFINE_CALLBACK( CtrlRadialSlider, Move )
+
+ /// Method called when the observed variable is modified
+ 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
+ /// the cursor cannot do more than a half turn
+ void setCursor( int posX, int posY, bool blocking );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_RESIZE_HPP
/// Control decorator for resizing windows
class CtrlResize: public CtrlFlat
{
- public:
- CtrlResize( intf_thread_t *pIntf, WindowManager &rWindowManager,
- CtrlFlat &rCtrl, GenericLayout &rLayout,
- const UString &rHelp, VarBool *pVisible,
- WindowManager::Direction_t direction );
- virtual ~CtrlResize() {}
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the decorated control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Set the position and the associated layout of the decorated control
- virtual void setLayout( GenericLayout *pLayout,
- const Position &rPosition );
-
- /// Get the position of the decorated control in the layout, if any
- virtual const Position *getPosition() const;
-
- /// Method called when the control is resized
- virtual void onResize();
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return m_rCtrl.getType(); }
-
- private:
- FSM m_fsm;
- /// Window manager
- WindowManager &m_rWindowManager;
- /// Decorated CtrlFlat
- CtrlFlat &m_rCtrl;
- /// The layout resized by this control
- GenericLayout &m_rLayout;
- /// The last received event
- EvtGeneric *m_pEvt;
- /// Position of the click that started the resizing
- int m_xPos, m_yPos;
- /// Direction of the resizing
- WindowManager::Direction_t m_direction;
-
- /// Change the cursor, based on the given direction
- void changeCursor( WindowManager::Direction_t direction ) const;
-
- /// Callback objects
- DEFINE_CALLBACK( CtrlResize, OutStill )
- DEFINE_CALLBACK( CtrlResize, StillOut )
- DEFINE_CALLBACK( CtrlResize, StillStill )
- DEFINE_CALLBACK( CtrlResize, StillResize )
- DEFINE_CALLBACK( CtrlResize, ResizeStill )
- DEFINE_CALLBACK( CtrlResize, ResizeResize )
-
- // Size of the layout, before resizing
- int m_width, m_height;
+public:
+ CtrlResize( intf_thread_t *pIntf, WindowManager &rWindowManager,
+ CtrlFlat &rCtrl, GenericLayout &rLayout,
+ const UString &rHelp, VarBool *pVisible,
+ WindowManager::Direction_t direction );
+ virtual ~CtrlResize() { }
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the decorated control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Set the position and the associated layout of the decorated control
+ virtual void setLayout( GenericLayout *pLayout,
+ const Position &rPosition );
+
+ /// Get the position of the decorated control in the layout, if any
+ virtual const Position *getPosition() const;
+
+ /// Method called when the control is resized
+ virtual void onResize();
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return m_rCtrl.getType(); }
+
+private:
+ FSM m_fsm;
+ /// Window manager
+ WindowManager &m_rWindowManager;
+ /// Decorated CtrlFlat
+ CtrlFlat &m_rCtrl;
+ /// The layout resized by this control
+ GenericLayout &m_rLayout;
+ /// The last received event
+ EvtGeneric *m_pEvt;
+ /// Position of the click that started the resizing
+ int m_xPos, m_yPos;
+ /// Direction of the resizing
+ WindowManager::Direction_t m_direction;
+
+ /// Change the cursor, based on the given direction
+ void changeCursor( WindowManager::Direction_t direction ) const;
+
+ /// Callback objects
+ DEFINE_CALLBACK( CtrlResize, OutStill )
+ DEFINE_CALLBACK( CtrlResize, StillOut )
+ DEFINE_CALLBACK( CtrlResize, StillStill )
+ DEFINE_CALLBACK( CtrlResize, StillResize )
+ DEFINE_CALLBACK( CtrlResize, ResizeStill )
+ DEFINE_CALLBACK( CtrlResize, ResizeResize )
+
+ // Size of the layout, before resizing
+ int m_width, m_height;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_SLIDER_HPP
/// Cursor of a slider
class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
{
- public:
- /// 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,
- const GenericBitmap &rBmpOver,
- const GenericBitmap &rBmpDown,
- const Bezier &rCurve, VarPercent &rVariable,
- VarBool *pVisible, const UString &rTooltip,
- const UString &rHelp );
-
- virtual ~CtrlSliderCursor();
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Get the text of the tooltip
- virtual UString getTooltipText() const { return m_tooltip; }
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "slider_cursor"; }
-
- private:
- /// Finite state machine of the control
- FSM m_fsm;
- /// Variable associated to the cursor
- VarPercent &m_rVariable;
- /// Tooltip text
- 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 )
- DEFINE_CALLBACK( CtrlSliderCursor, OverUp )
- DEFINE_CALLBACK( CtrlSliderCursor, UpOver )
- DEFINE_CALLBACK( CtrlSliderCursor, Move )
- DEFINE_CALLBACK( CtrlSliderCursor, Scroll )
- /// Last saved position of the cursor (stored as a percentage)
- float m_lastPercentage;
- /// Offset between the mouse pointer and the center of the cursor
- int m_xOffset, m_yOffset;
- /// The last received event
- EvtGeneric *m_pEvt;
- /// Images of the cursor in the differents states
- OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown;
- /// Current image
- OSGraphics *m_pImg;
- /// Bezier curve of the slider
- const Bezier &m_rCurve;
-
- /// Method called when the position variable is modified
- virtual void onUpdate( Subject<VarPercent> &rVariable, void * );
-
- /// Method to compute the resize factors
- void getResizeFactors( float &rFactorX, float &rFactorY ) const;
-
- /// Call notifyLayout
- void refreshLayout();
+public:
+ /// 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,
+ const GenericBitmap &rBmpOver,
+ const GenericBitmap &rBmpDown,
+ const Bezier &rCurve, VarPercent &rVariable,
+ VarBool *pVisible, const UString &rTooltip,
+ const UString &rHelp );
+
+ virtual ~CtrlSliderCursor();
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Get the text of the tooltip
+ virtual UString getTooltipText() const { return m_tooltip; }
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "slider_cursor"; }
+
+private:
+ /// Finite state machine of the control
+ FSM m_fsm;
+ /// Variable associated to the cursor
+ VarPercent &m_rVariable;
+ /// Tooltip text
+ 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 )
+ DEFINE_CALLBACK( CtrlSliderCursor, OverUp )
+ DEFINE_CALLBACK( CtrlSliderCursor, UpOver )
+ DEFINE_CALLBACK( CtrlSliderCursor, Move )
+ DEFINE_CALLBACK( CtrlSliderCursor, Scroll )
+ /// Last saved position of the cursor (stored as a percentage)
+ float m_lastPercentage;
+ /// Offset between the mouse pointer and the center of the cursor
+ int m_xOffset, m_yOffset;
+ /// The last received event
+ EvtGeneric *m_pEvt;
+ /// Images of the cursor in the differents states
+ OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown;
+ /// Current image
+ OSGraphics *m_pImg;
+ /// Bezier curve of the slider
+ const Bezier &m_rCurve;
+
+ /// Method called when the position variable is modified
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void * );
+
+ /// Method to compute the resize factors
+ void getResizeFactors( float &rFactorX, float &rFactorY ) const;
+
+ /// Call notifyLayout
+ void refreshLayout();
};
/// Slider background
class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
{
- public:
- 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();
-
- /// Tell whether the mouse is over the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Method called when the control is resized
- virtual void onResize();
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "slider_bg"; }
-
- /// Associate a cursor to this background
- void associateCursor( CtrlSliderCursor &rCursor );
-
- private:
- /// Cursor of the slider
- CtrlSliderCursor *m_pCursor;
- /// Variable associated to the slider
- VarPercent &m_rVariable;
- /// Thickness of the curve
- int m_thickness;
- /// Bezier curve of the slider
- const Bezier &m_rCurve;
- /// Initial size of the control
- int m_width, m_height;
- /// Background image sequence (optional)
- GenericBitmap *m_pImgSeq;
- /// Number of images in the background bitmap
- int m_nbHoriz, m_nbVert;
- /// Number of pixels between two images
- int m_padHoriz, m_padVert;
- /// Size of a background image
- int m_bgWidth, m_bgHeight;
- /// Index of the current background image
- int m_position;
-
- /// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
-
- /// Method to compute the resize factors
- void getResizeFactors( float &rFactorX, float &rFactorY ) const;
+public:
+ 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();
+
+ /// Tell whether the mouse is over the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Method called when the control is resized
+ virtual void onResize();
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "slider_bg"; }
+
+ /// Associate a cursor to this background
+ void associateCursor( CtrlSliderCursor &rCursor );
+
+private:
+ /// Cursor of the slider
+ CtrlSliderCursor *m_pCursor;
+ /// Variable associated to the slider
+ VarPercent &m_rVariable;
+ /// Thickness of the curve
+ int m_thickness;
+ /// Bezier curve of the slider
+ const Bezier &m_rCurve;
+ /// Initial size of the control
+ int m_width, m_height;
+ /// Background image sequence (optional)
+ GenericBitmap *m_pImgSeq;
+ /// Number of images in the background bitmap
+ int m_nbHoriz, m_nbVert;
+ /// Number of pixels between two images
+ int m_padHoriz, m_padVert;
+ /// Size of a background image
+ int m_bgWidth, m_bgHeight;
+ /// Index of the current background image
+ int m_position;
+
+ /// Method called when the observed variable is modified
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
+
+ /// Method to compute the resize factors
+ void getResizeFactors( float &rFactorX, float &rFactorY ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_TEXT_HPP
/// Class for control text
class CtrlText: public CtrlGeneric, public Observer<VarText>
{
- public:
- enum Align_t
- {
- kLeft,
- kCenter,
- kRight
- };
-
- enum Scrolling_t
- {
- // The text starts scrolling automatically if it is larger than the
- // width of the control. The user can still stop it or make it
- // scroll manually with the mouse.
- kAutomatic,
- // Only manual scrolling is allowed (with the mouse)
- kManual,
- // No scrolling of the text is allowed
- kNone
- };
-
- /// Create a text control with the optional given color
- CtrlText( intf_thread_t *pIntf, VarText &rVariable,
- const GenericFont &rFont, const UString &rHelp,
- uint32_t color, VarBool *pVisible, Scrolling_t scrollMode,
- Align_t alignment);
- virtual ~CtrlText();
-
- /// Handle an event
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Set the text of the control, with an optional color
- /// This takes effect immediatly
- void setText( const UString &rText, uint32_t color = 0xFFFFFFFF );
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "text"; }
-
- private:
- /// Finite state machine of the control
- FSM m_fsm;
- /// Variable associated to the control
- VarText &m_rVariable;
- /// Callback objects
- DEFINE_CALLBACK( CtrlText, ToManual )
- DEFINE_CALLBACK( CtrlText, ManualMoving )
- DEFINE_CALLBACK( CtrlText, ManualStill )
- DEFINE_CALLBACK( CtrlText, Move )
- /// The last received event
- EvtGeneric *m_pEvt;
- /// Font used to render the text
- const GenericFont &m_rFont;
- /// Color of the text
- uint32_t m_color;
- /// Scrolling mode
- Scrolling_t m_scrollMode;
- /// Type of alignment
- Align_t m_alignment;
- /// Image of the text
- GenericBitmap *m_pImg;
- /// Image of the text, repeated twice and with some blank between;
- /// useful to display a 'circular' moving text...
- GenericBitmap *m_pImgDouble;
- /// Current image (should always be equal to m_pImg or m_pImgDouble)
- GenericBitmap *m_pCurrImg;
- /// Position of the left side of the moving text (always <= 0)
- int m_xPos;
- /// Offset between the mouse pointer and the left side of the
- /// moving text
- int m_xOffset;
- /// Timer to move the text
- OSTimer *m_pTimer;
-
- /// Callback for the timer
- DEFINE_CALLBACK( CtrlText, UpdateText );
-
- /// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarText> &rVariable, void* );
-
- /// Display the text on the control
- void displayText( const UString &rText );
-
- /// Helper function to set the position in the correct interval
- void adjust( int &position );
-
- /// Update the behaviour of the text whenever the control size changes
- virtual void onPositionChange();
- /// Update the behaviour of the text whenever the control size changes
- virtual void onResize();
+public:
+ enum Align_t
+ {
+ kLeft,
+ kCenter,
+ kRight
+ };
+
+ enum Scrolling_t
+ {
+ // The text starts scrolling automatically if it is larger than the
+ // width of the control. The user can still stop it or make it
+ // scroll manually with the mouse.
+ kAutomatic,
+ // Only manual scrolling is allowed (with the mouse)
+ kManual,
+ // No scrolling of the text is allowed
+ kNone
+ };
+
+ /// Create a text control with the optional given color
+ CtrlText( intf_thread_t *pIntf, VarText &rVariable,
+ const GenericFont &rFont, const UString &rHelp,
+ uint32_t color, VarBool *pVisible, Scrolling_t scrollMode,
+ Align_t alignment);
+ virtual ~CtrlText();
+
+ /// Handle an event
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Set the text of the control, with an optional color
+ /// This takes effect immediatly
+ void setText( const UString &rText, uint32_t color = 0xFFFFFFFF );
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "text"; }
+
+private:
+ /// Finite state machine of the control
+ FSM m_fsm;
+ /// Variable associated to the control
+ VarText &m_rVariable;
+ /// Callback objects
+ DEFINE_CALLBACK( CtrlText, ToManual )
+ DEFINE_CALLBACK( CtrlText, ManualMoving )
+ DEFINE_CALLBACK( CtrlText, ManualStill )
+ DEFINE_CALLBACK( CtrlText, Move )
+ /// The last received event
+ EvtGeneric *m_pEvt;
+ /// Font used to render the text
+ const GenericFont &m_rFont;
+ /// Color of the text
+ uint32_t m_color;
+ /// Scrolling mode
+ Scrolling_t m_scrollMode;
+ /// Type of alignment
+ Align_t m_alignment;
+ /// Image of the text
+ GenericBitmap *m_pImg;
+ /// Image of the text, repeated twice and with some blank between;
+ /// useful to display a 'circular' moving text...
+ GenericBitmap *m_pImgDouble;
+ /// Current image (should always be equal to m_pImg or m_pImgDouble)
+ GenericBitmap *m_pCurrImg;
+ /// Position of the left side of the moving text (always <= 0)
+ int m_xPos;
+ /// Offset between the mouse pointer and the left side of the
+ /// moving text
+ int m_xOffset;
+ /// Timer to move the text
+ OSTimer *m_pTimer;
+
+ /// Callback for the timer
+ DEFINE_CALLBACK( CtrlText, UpdateText );
+
+ /// Method called when the observed variable is modified
+ virtual void onUpdate( Subject<VarText> &rVariable, void* );
+
+ /// Display the text on the control
+ void displayText( const UString &rText );
+
+ /// Helper function to set the position in the correct interval
+ void adjust( int &position );
+
+ /// Update the behaviour of the text whenever the control size changes
+ virtual void onPositionChange();
+ /// Update the behaviour of the text whenever the control size changes
+ virtual void onResize();
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_TREE_HPP
class CtrlTree: public CtrlGeneric, public Observer<VarTree, tree_update>,
public Observer<VarPercent>
{
- public:
- CtrlTree( intf_thread_t *pIntf,
- VarTree &rTree,
- const GenericFont &rFont,
- const GenericBitmap *pBgBitmap,
- const GenericBitmap *pItemBitmap,
- const GenericBitmap *pOpenBitmap,
- const GenericBitmap *pClosedBitmap,
- uint32_t fgColor,
- uint32_t playColor,
- uint32_t bgColor1,
- uint32_t bgColor2,
- uint32_t selColor,
- const UString &rHelp,
- VarBool *pVisible,
- VarBool *pFlat );
- virtual ~CtrlTree();
-
- /// Handle an event on the control
- virtual void handleEvent( EvtGeneric &rEvent );
-
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
-
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Called when the layout is resized
- virtual void onResize();
-
- /// Return true if the control can gain the focus
- virtual bool isFocusable() const { return true; }
-
- /// Get the type of control (custom RTTI)
- virtual string getType() const { 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( VarTree::Iterator item );
-
- /// Make sure an item is visible
- /// \param itemIndex the absolute index in the tree
- /// \return true if it changed the position
- bool ensureVisible( int itemIndex );
-
- private:
- /// Tree associated to the control
- VarTree &m_rTree;
- /// Font
- const GenericFont &m_rFont;
- /// Background bitmap
- const GenericBitmap *m_pBgBitmap;
- /// Item (leaf) bitmap
- // (TODO : add different bitmaps for different item types
- // like in the wx playlist)
- const GenericBitmap *m_pItemBitmap;
- /// Open (expanded) node bitmap
- const GenericBitmap *m_pOpenBitmap;
- /// Closed node bitmap
- const GenericBitmap *m_pClosedBitmap;
- /// Color of normal test
- uint32_t m_fgColor;
- /// Color of the playing item
- uint32_t m_playColor;
- /// Background colors, used when no background bitmap is given
- uint32_t m_bgColor1, m_bgColor2;
- /// Background of selected items
- uint32_t m_selColor;
- /// Pointer on the last selected item in the tree
- VarTree *m_pLastSelected;
- /// Image of the control
- OSGraphics *m_pImage;
- /// First item in the visible area
- VarTree::Iterator m_firstPos;
-
- /// Don't move if the position variable is updated
- bool m_dontMove;
-
- /// Do we want to "flaten" the tree ?
- bool m_flat;
-
- /// Method called when the tree variable is modified
- virtual void onUpdate( Subject<VarTree, tree_update> &rTree ,
- tree_update *);
-
- // Method called when the position variable of the tree is modified
- virtual void onUpdate( Subject<VarPercent> &rPercent , void *);
-
- /// Called when the position is set
- virtual void onPositionChange();
-
- /// Compute the number of lines that can be displayed
- int maxItems();
-
- /// Compute the item's height (depends on fonts and images used)
- int itemHeight();
-
- /// Compute the width of an item's bitmap
- int itemImageWidth();
-
- /// Check if the tree must be scrolled
- void autoScroll();
-
- /// Draw the image of the control
- void makeImage();
-
- /// Return the n'th displayed item (starting at position 0)
- /**
- * Return m_rTree.end() if such an item cannot be found (n < 0, or
- * n too big)
- */
- VarTree::Iterator findItemAtPos( int n );
+public:
+ CtrlTree( intf_thread_t *pIntf,
+ VarTree &rTree,
+ const GenericFont &rFont,
+ const GenericBitmap *pBgBitmap,
+ const GenericBitmap *pItemBitmap,
+ const GenericBitmap *pOpenBitmap,
+ const GenericBitmap *pClosedBitmap,
+ uint32_t fgColor,
+ uint32_t playColor,
+ uint32_t bgColor1,
+ uint32_t bgColor2,
+ uint32_t selColor,
+ const UString &rHelp,
+ VarBool *pVisible,
+ VarBool *pFlat );
+ virtual ~CtrlTree();
+
+ /// Handle an event on the control
+ virtual void handleEvent( EvtGeneric &rEvent );
+
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
+
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Called when the layout is resized
+ virtual void onResize();
+
+ /// Return true if the control can gain the focus
+ virtual bool isFocusable() const { return true; }
+
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { 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( VarTree::Iterator item );
+
+ /// Make sure an item is visible
+ /// \param itemIndex the absolute index in the tree
+ /// \return true if it changed the position
+ bool ensureVisible( int itemIndex );
+
+private:
+ /// Tree associated to the control
+ VarTree &m_rTree;
+ /// Font
+ const GenericFont &m_rFont;
+ /// Background bitmap
+ const GenericBitmap *m_pBgBitmap;
+ /// Item (leaf) bitmap
+ // (TODO : add different bitmaps for different item types
+ // like in the wx playlist)
+ const GenericBitmap *m_pItemBitmap;
+ /// Open (expanded) node bitmap
+ const GenericBitmap *m_pOpenBitmap;
+ /// Closed node bitmap
+ const GenericBitmap *m_pClosedBitmap;
+ /// Color of normal test
+ uint32_t m_fgColor;
+ /// Color of the playing item
+ uint32_t m_playColor;
+ /// Background colors, used when no background bitmap is given
+ uint32_t m_bgColor1, m_bgColor2;
+ /// Background of selected items
+ uint32_t m_selColor;
+ /// Pointer on the last selected item in the tree
+ VarTree *m_pLastSelected;
+ /// Image of the control
+ OSGraphics *m_pImage;
+ /// First item in the visible area
+ VarTree::Iterator m_firstPos;
+
+ /// Don't move if the position variable is updated
+ bool m_dontMove;
+
+ /// Do we want to "flaten" the tree ?
+ bool m_flat;
+
+ /// Method called when the tree variable is modified
+ virtual void onUpdate( Subject<VarTree, tree_update> &rTree ,
+ tree_update *);
+
+ // Method called when the position variable of the tree is modified
+ virtual void onUpdate( Subject<VarPercent> &rPercent , void *);
+
+ /// Called when the position is set
+ virtual void onPositionChange();
+
+ /// Compute the number of lines that can be displayed
+ int maxItems();
+
+ /// Compute the item's height (depends on fonts and images used)
+ int itemHeight();
+
+ /// Compute the width of an item's bitmap
+ int itemImageWidth();
+
+ /// Check if the tree must be scrolled
+ void autoScroll();
+
+ /// Draw the image of the control
+ void makeImage();
+
+ /// Return the n'th displayed item (starting at position 0)
+ /**
+ * Return m_rTree.end() if such an item cannot be found (n < 0, or
+ * n too big)
+ */
+ VarTree::Iterator findItemAtPos( int n );
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CTRL_VIDEO_HPP
/// Control video
class CtrlVideo: public CtrlGeneric, public Observer<VarBox>
{
- public:
- CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
- bool autoResize, const UString &rHelp, VarBool *pVisible );
- virtual ~CtrlVideo();
+public:
+ CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
+ bool autoResize, const UString &rHelp, VarBool *pVisible );
+ virtual ~CtrlVideo();
- /// Handle an event on the control
- virtual void handleEvent( EvtGeneric &rEvent );
+ /// Handle an event on the control
+ virtual void handleEvent( EvtGeneric &rEvent );
- /// Check whether coordinates are inside the control
- virtual bool mouseOver( int x, int y ) const;
+ /// Check whether coordinates are inside the control
+ virtual bool mouseOver( int x, int y ) const;
- /// Callback for layout resize
- virtual void onResize();
+ /// Callback for layout resize
+ virtual void onResize();
- /// Called when the Position is set
- virtual void onPositionChange();
+ /// Called when the Position is set
+ virtual void onPositionChange();
- /// Draw the control on the given graphics
- virtual void draw( OSGraphics &rImage, int xDest, int yDest );
+ /// Draw the control on the given graphics
+ virtual void draw( OSGraphics &rImage, int xDest, int yDest );
- /// Get the type of control (custom RTTI)
- virtual string getType() const { return "video"; }
+ /// Get the type of control (custom RTTI)
+ virtual string getType() const { return "video"; }
- /// Method called when the vout size is updated
- virtual void onUpdate( Subject<VarBox> &rVoutSize, void* );
+ /// Method called when the vout size is updated
+ virtual void onUpdate( Subject<VarBox> &rVoutSize, void* );
- /// Method called when visibility or ActiveLayout is updated
- virtual void onUpdate( Subject<VarBool> &rVariable , void* );
+ /// Method called when visibility or ActiveLayout is updated
+ virtual void onUpdate( Subject<VarBool> &rVariable , void* );
- // Attach a voutWindow to a Video Control
- void attachVoutWindow( VoutWindow* pVoutWindow,
- int width = -1, int height = -1 );
+ // Attach a voutWindow to a Video Control
+ void attachVoutWindow( VoutWindow* pVoutWindow,
+ int width = -1, int height = -1 );
- // Detach a voutWindow from a Video Control
- void detachVoutWindow( );
+ // Detach a voutWindow from a Video Control
+ void detachVoutWindow( );
- // Update the inner part of the Video Control
- void resizeInnerVout( );
+ // Update the inner part of the Video Control
+ void resizeInnerVout( );
- // Get TopWindow associated with the video control
- virtual TopWindow* getWindow() { return CtrlGeneric::getWindow(); }
+ // Get TopWindow associated with the video control
+ virtual TopWindow* getWindow() { return CtrlGeneric::getWindow(); }
- // Get the VoutWindow associated with the video control
- virtual VoutWindow* getVoutWindow() { return m_pVoutWindow; }
+ // Get the VoutWindow associated with the video control
+ virtual VoutWindow* getVoutWindow() { return m_pVoutWindow; }
- /// Set the position and the associated layout of the control
- virtual void setLayout( GenericLayout *pLayout,
- const Position &rPosition );
+ /// Set the position and the associated layout of the control
+ virtual void setLayout( GenericLayout *pLayout,
+ const Position &rPosition );
- // resize the video Control
- virtual void resizeControl( int width, int height );
+ // resize the video Control
+ virtual void resizeControl( int width, int height );
- // Is this control useable (visibility requirements)
- virtual bool isUseable() { return m_bIsUseable; }
+ // Is this control useable (visibility requirements)
+ virtual bool isUseable() { return m_bIsUseable; }
- // Is this control used
- virtual bool isUsed() { return m_pVoutWindow ? true : false; }
+ // Is this control used
+ virtual bool isUsed() { return m_pVoutWindow ? true : false; }
- private:
- /// Associated layout
- GenericLayout &m_rLayout;
+private:
+ /// Associated layout
+ GenericLayout &m_rLayout;
- /// Autoresize parameter
- bool m_bAutoResize;
+ /// Autoresize parameter
+ bool m_bAutoResize;
- /// Difference between layout size and video size
- int m_xShift, m_yShift;
+ /// Difference between layout size and video size
+ int m_xShift, m_yShift;
- /// Is the video Control useable
- bool m_bIsUseable;
+ /// Is the video Control useable
+ bool m_bIsUseable;
- /// Vout window
- VoutWindow *m_pVoutWindow;
+ /// Vout window
+ VoutWindow *m_pVoutWindow;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_ENTER_HPP
/// Mouse enter event
class EvtEnter: public EvtInput
{
- public:
- EvtEnter( intf_thread_t *pIntf ): EvtInput( pIntf ) {}
- virtual ~EvtEnter() {}
-
- /// Return the type of event
- virtual const string getAsString() const { return "enter"; }
+public:
+ EvtEnter( intf_thread_t *pIntf ): EvtInput( pIntf ) { }
+ virtual ~EvtEnter() { }
+ virtual const string getAsString() const { return "enter"; }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_FOCUS_HPP
/// Focus change event
class EvtFocus: public EvtGeneric
{
- public:
- EvtFocus( intf_thread_t *pIntf, bool focus ): EvtGeneric( pIntf ),
- m_focus( focus ) {}
- virtual ~EvtFocus() {}
-
- /// Return the type of event
- virtual const string getAsString() const
- {
- return ( m_focus ? "focus:in" : "focus:out" );
- }
-
- private:
- /// true for a focus in, and false for a focus out
- bool m_focus;
+public:
+ EvtFocus( intf_thread_t *pIntf, bool focus )
+ : EvtGeneric( pIntf ), m_focus( focus ) { }
+ virtual ~EvtFocus() { }
+
+ virtual const string getAsString() const
+ {
+ return ( m_focus ? "focus:in" : "focus:out" );
+ }
+
+private:
+ /// true for a focus in, and false for a focus out
+ bool m_focus;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_GENERIC_HPP
/// Base class for OS events
class EvtGeneric: public SkinObject
{
- public:
- virtual ~EvtGeneric() {}
+public:
+ virtual ~EvtGeneric() { }
- /// Return the type of the event
- virtual const string getAsString() const = 0;
+ /// Return the type of the event
+ virtual const string getAsString() const = 0;
- protected:
- EvtGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ EvtGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_INPUT_HPP
/// Base class for mouse and key events
class EvtInput: public EvtGeneric
{
- public:
- virtual ~EvtInput() {}
+public:
+ virtual ~EvtInput() { }
- /// Masks for modifier keys
- static const int kModNone;
- static const int kModAlt;
- static const int kModCtrl;
- static const int kModShift;
+ /// Masks for modifier keys
+ static const int kModNone;
+ static const int kModAlt;
+ static const int kModCtrl;
+ static const int kModShift;
- /// Get the modifiers
- virtual int getMod() const { return m_mod; }
+ /// Get the modifiers
+ virtual int getMod() const { return m_mod; }
- protected:
- EvtInput( intf_thread_t *pIntf, int mod = kModNone );
+protected:
+ EvtInput( intf_thread_t *pIntf, int mod = kModNone );
- /// Add the modifier to the event string
- virtual void addModifier( string &rEvtString ) const;
+ /// Add the modifier to the event string
+ virtual void addModifier( string &rEvtString ) const;
- private:
- /// Modifiers (special key(s) pressed during the mouse event)
- int m_mod;
+private:
+ /// Modifiers (special key(s) pressed during the mouse event)
+ int m_mod;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_KEY_HPP
/// Class for keyboard events
class EvtKey: public EvtInput
{
- public:
- enum ActionType_t
- {
- kDown,
- kUp
- };
-
- EvtKey( intf_thread_t *pIntf, int key, ActionType_t action,
- int mod = kModNone ):
- EvtInput( pIntf, mod ), m_key( key ), m_action( action ) {}
- virtual ~EvtKey() {}
-
- /// Return the type of event
- virtual const string getAsString() const;
-
- int getKey() const { return m_key; }
-
- private:
- /// The concerned key, stored according to the '#define's in vlc_keys.h
- /// but without the modifiers (which are stored in EvtInput)
- int m_key;
- /// Type of action
- ActionType_t m_action;
+public:
+ enum ActionType_t
+ {
+ kDown,
+ kUp
+ };
+
+ EvtKey( intf_thread_t *I, int key, ActionType_t actn, int mod = kModNone )
+ : EvtInput( I, mod ), m_key( key ), m_action( actn ) { }
+ virtual ~EvtKey() { }
+ virtual const string getAsString() const;
+
+ int getKey() const { return m_key; }
+
+private:
+ /// The concerned key, stored according to the '#define's in vlc_keys.h
+ /// but without the modifiers (which are stored in EvtInput)
+ int m_key;
+ /// Type of action
+ ActionType_t m_action;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_LEAVE_HPP
/// Mouse leave event
class EvtLeave: public EvtInput
{
- public:
- EvtLeave( intf_thread_t *pIntf ): EvtInput( pIntf ) {}
- virtual ~EvtLeave() {}
-
- /// Return the type of event
- virtual const string getAsString() const { return "leave"; }
+public:
+ EvtLeave( intf_thread_t *pIntf ): EvtInput( pIntf ) { }
+ virtual ~EvtLeave() { }
+ virtual const string getAsString() const { return "leave"; }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_MENU_HPP
/// Mouse move event
class EvtMenu: public EvtGeneric
{
- public:
- EvtMenu( intf_thread_t *pIntf, int itemId ):
- EvtGeneric( pIntf ), m_itemId( itemId ) {}
- virtual ~EvtMenu() {}
+public:
+ EvtMenu( intf_thread_t *pIntf, int itemId )
+ : EvtGeneric( pIntf ), m_itemId( itemId ) { }
+ virtual ~EvtMenu() { }
+ virtual const string getAsString() const { return "menu"; }
- /// Return the type of event
- virtual const string getAsString() const { return "menu"; }
+ int getItemId() const { return m_itemId; }
- // Getter
- int getItemId() const { return m_itemId; }
-
- private:
- /// Coordinates of the mouse (absolute or relative)
- int m_itemId;
+private:
+ /// Coordinates of the mouse (absolute or relative)
+ int m_itemId;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_MOTION_HPP
/// Mouse move event
class EvtMotion: public EvtInput
{
- public:
- EvtMotion( intf_thread_t *pIntf, int xPos, int yPos ):
- EvtInput( pIntf ), m_xPos( xPos ), m_yPos( yPos ) {}
- virtual ~EvtMotion() {}
-
- /// Return the type of event
- virtual const string getAsString() const { return "motion"; }
-
- // Getters
- int getXPos() const { return m_xPos; }
- int getYPos() const { return m_yPos; }
-
- private:
- /// Coordinates of the mouse (absolute or relative)
- /**
- * The coordinates are absolute when the event is sent to the
- * GenericWindow, but are relative to the window when the event is
- * forwarded to the controls
- */
- int m_xPos, m_yPos;
+public:
+ EvtMotion( intf_thread_t *pIntf, int xPos, int yPos )
+ : EvtInput( pIntf ), m_xPos( xPos ), m_yPos( yPos ) { }
+ virtual ~EvtMotion() { }
+ virtual const string getAsString() const { return "motion"; }
+
+ // Getters
+ int getXPos() const { return m_xPos; }
+ int getYPos() const { return m_yPos; }
+
+private:
+ /// Coordinates of the mouse (absolute or relative)
+ /**
+ * The coordinates are absolute when the event is sent to the
+ * GenericWindow, but are relative to the window when the event is
+ * forwarded to the controls
+ */
+ int m_xPos, m_yPos;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_MOUSE_HPP
/// Class for mouse button events
class EvtMouse: public EvtInput
{
- public:
- enum ButtonType_t
- {
- kLeft,
- kMiddle,
- kRight
- };
+public:
+ enum ButtonType_t
+ {
+ kLeft,
+ kMiddle,
+ kRight
+ };
- enum ActionType_t
- {
- kDown,
- kUp,
- kDblClick
- };
+ enum ActionType_t
+ {
+ kDown,
+ kUp,
+ kDblClick
+ };
- EvtMouse( intf_thread_t *pIntf, int xPos, int yPos, ButtonType_t button,
- ActionType_t action, int mod = kModNone ):
- EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ),
- m_button( button ), m_action( action ) {}
- virtual ~EvtMouse() {}
+ EvtMouse( intf_thread_t *pIntf, int xPos, int yPos, ButtonType_t button,
+ ActionType_t action, int mod = kModNone )
+ : EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ),
+ m_button( button ), m_action( action ) { }
+ virtual ~EvtMouse() { }
+ virtual const string getAsString() const;
- // Return the event coordinates
- int getXPos() const { return m_xPos; }
- int getYPos() const { return m_yPos; }
+ // Return the event coordinates
+ int getXPos() const { return m_xPos; }
+ int getYPos() const { return m_yPos; }
- // Return the button and the action
- ButtonType_t getButton() const { return m_button; }
- ActionType_t getAction() const { return m_action; }
+ // Return the button and the action
+ ButtonType_t getButton() const { return m_button; }
+ ActionType_t getAction() const { return m_action; }
- virtual const string getAsString() const;
-
- private:
- /// Coordinates of the mouse relative to the window
- int m_xPos, m_yPos;
- /// Mouse button involved in the event
- ButtonType_t m_button;
- /// Type of action
- ActionType_t m_action;
+private:
+ /// Coordinates of the mouse relative to the window
+ int m_xPos, m_yPos;
+ /// Mouse button involved in the event
+ ButtonType_t m_button;
+ /// Type of action
+ ActionType_t m_action;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_REFRESH_HPP
/// Refresh window event
class EvtRefresh: public EvtGeneric
{
- public:
- /// Constructor with the coordinates of the area to refresh
- EvtRefresh( intf_thread_t *pIntf, int xStart, int yStart, int width,
- int height ):
- EvtGeneric( pIntf ), m_xStart( xStart ), m_yStart( yStart ),
- m_width( width ), m_height( height ) {}
-
- virtual ~EvtRefresh() {}
-
- /// Return the type of event
- virtual const string getAsString() const { return "refresh"; }
-
- /// Getters
- int getXStart() const { return m_xStart; }
- int getYStart() const { return m_yStart; }
- int getWidth() const { return m_width; }
- int getHeight() const { return m_height; }
-
- private:
- /// Coordinates and size of the area to refresh
- int m_xStart, m_yStart, m_width, m_height;
+public:
+ /// Constructor with the coordinates of the area to refresh
+ EvtRefresh( intf_thread_t *pIntf, int xStart, int yStart,
+ int width, int height )
+ : EvtGeneric( pIntf ), m_xStart( xStart ), m_yStart( yStart ),
+ m_width( width ), m_height( height ) { }
+
+ virtual ~EvtRefresh() { }
+ virtual const string getAsString() const { return "refresh"; }
+
+ /// Getters
+ int getXStart() const { return m_xStart; }
+ int getYStart() const { return m_yStart; }
+ int getWidth() const { return m_width; }
+ int getHeight() const { return m_height; }
+
+private:
+ /// Coordinates and size of the area to refresh
+ int m_xStart, m_yStart, m_width, m_height;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_SCROLL_HPP
/// Class for mouse scroll events
class EvtScroll: public EvtInput
{
- public:
- enum Direction_t
- {
- kUp,
- kDown
- };
-
- EvtScroll( intf_thread_t *pIntf, int xPos, int yPos,
- Direction_t direction, int mod = kModNone ):
- EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ),
- m_direction( direction ) {}
- virtual ~EvtScroll() {}
-
- // Return the event coordinates
- int getXPos() const { return m_xPos; }
- int getYPos() const { return m_yPos; }
-
- // Return the direction
- Direction_t getDirection() const { return m_direction; }
-
- virtual const string getAsString() const;
-
- private:
- /// Coordinates of the mouse relative to the window
- int m_xPos, m_yPos;
- /// Scroll direction
- Direction_t m_direction;
+public:
+ enum Direction_t
+ {
+ kUp,
+ kDown
+ };
+
+ EvtScroll( intf_thread_t *pIntf, int xPos, int yPos,
+ Direction_t direction, int mod = kModNone )
+ : EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ),
+ m_direction( direction ) { }
+ virtual ~EvtScroll() { }
+ virtual const string getAsString() const;
+
+ // Return the event coordinates
+ int getXPos() const { return m_xPos; }
+ int getYPos() const { return m_yPos; }
+
+ // Return the direction
+ Direction_t getDirection() const { return m_direction; }
+
+private:
+ /// Coordinates of the mouse relative to the window
+ int m_xPos, m_yPos;
+ /// Scroll direction
+ Direction_t m_direction;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EVT_SPECIAL_HPP
/// Class for non-genuine events
class EvtSpecial: public EvtGeneric
{
- public:
- enum ActionType_t
- {
- kShow,
- kHide,
- kEnable,
- kDisable
- };
-
- EvtSpecial( intf_thread_t *pIntf, ActionType_t action ):
- EvtGeneric( pIntf ), m_action( action ) {}
- virtual ~EvtSpecial() {}
-
- /// Return the type of event
- virtual const string getAsString() const;
-
- private:
- /// Type of action
- ActionType_t m_action;
+public:
+ enum ActionType_t
+ {
+ kShow,
+ kHide,
+ kEnable,
+ kDisable
+ };
+
+ EvtSpecial( intf_thread_t *pIntf, ActionType_t action )
+ : EvtGeneric( pIntf ), m_action( action ) { }
+ virtual ~EvtSpecial() { }
+ virtual const string getAsString() const;
+
+private:
+ /// Type of action
+ ActionType_t m_action;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_DRAGDROP_HPP
class MacOSXDragDrop: public SkinObject
{
- public:
- typedef long ldata_t[5];
+public:
+ typedef long ldata_t[5];
- MacOSXDragDrop( intf_thread_t *pIntf, bool playOnDrop );
- virtual ~MacOSXDragDrop() {}
+ MacOSXDragDrop( intf_thread_t *pIntf, bool playOnDrop );
+ virtual ~MacOSXDragDrop() { }
- private:
- /// Indicates whether the file(s) must be played immediately
- bool m_playOnDrop;
+private:
+ /// Indicates whether the file(s) must be played immediately
+ bool m_playOnDrop;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_FACTORY_HPP
/// Class used to instanciate MacOSX specific objects
class MacOSXFactory: public OSFactory
{
- public:
- MacOSXFactory( intf_thread_t *pIntf );
- virtual ~MacOSXFactory();
+public:
+ MacOSXFactory( intf_thread_t *pIntf );
+ virtual ~MacOSXFactory();
- /// Initialization method
- virtual bool init();
+ /// Initialization method
+ virtual bool init();
- /// Instantiate an object OSGraphics
- virtual OSGraphics *createOSGraphics( int width, int height );
+ /// Instantiate an object OSGraphics
+ virtual OSGraphics *createOSGraphics( int width, int height );
- /// Get the instance of the singleton OSLoop
- virtual OSLoop *getOSLoop();
+ /// Get the instance of the singleton OSLoop
+ virtual OSLoop *getOSLoop();
- /// Destroy the instance of OSLoop
- virtual void destroyOSLoop();
+ /// Destroy the instance of OSLoop
+ virtual void destroyOSLoop();
- /// Instantiate an OSTimer with the given callback
- virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
+ /// Instantiate an OSTimer with the given callback
+ virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
- /// Minimize all the windows
- virtual void minimize();
+ /// Minimize all the windows
+ virtual void minimize();
- /// Restore the minimized windows
- virtual void restore();
+ /// Restore the minimized windows
+ virtual void restore();
- /// Add an icon in the system tray
- virtual void addInTray();
+ /// Add an icon in the system tray
+ virtual void addInTray();
- /// Remove the icon from the system tray
- virtual void removeFromTray();
+ /// Remove the icon from the system tray
+ virtual void removeFromTray();
- /// Show the task in the task bar
- virtual void addInTaskBar();
+ /// Show the task in the task bar
+ virtual void addInTaskBar();
- /// Remove the task from the task bar
- virtual void removeFromTaskBar();
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar();
- /// Instantiate an OSWindow object
- virtual OSWindow *createOSWindow( GenericWindow &rWindow,
- bool dragDrop, bool playOnDrop,
- OSWindow *pParent );
+ /// Instantiate an OSWindow object
+ virtual OSWindow *createOSWindow( GenericWindow &rWindow,
+ bool dragDrop, bool playOnDrop,
+ OSWindow *pParent );
- /// Instantiate an object OSTooltip
- virtual OSTooltip *createOSTooltip();
+ /// Instantiate an object OSTooltip
+ virtual OSTooltip *createOSTooltip();
- /// Instantiate an object OSPopup
- virtual OSPopup *createOSPopup();
+ /// Instantiate an object OSPopup
+ virtual OSPopup *createOSPopup();
- /// Get the directory separator
- virtual const string &getDirSeparator() const { return m_dirSep; }
+ /// Get the directory separator
+ virtual const string &getDirSeparator() const { return m_dirSep; }
- /// Get the resource path
- virtual const list<string> &getResourcePath() const
- { return m_resourcePath; }
+ /// Get the resource path
+ virtual const list<string> &getResourcePath() const
+ { return m_resourcePath; }
- /// Get the screen size
- virtual int getScreenWidth() const;
- virtual int getScreenHeight() const;
+ /// Get the screen size
+ virtual int getScreenWidth() const;
+ virtual int getScreenHeight() const;
- /// Get the work area (screen area without taskbars)
- virtual SkinsRect getWorkArea() const;
+ /// Get the work area (screen area without taskbars)
+ virtual SkinsRect getWorkArea() const;
- /// Get the position of the mouse
- virtual void getMousePos( int &rXPos, int &rYPos ) const;
+ /// Get the position of the mouse
+ virtual void getMousePos( int &rXPos, int &rYPos ) const;
- /// Change the cursor
- virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
+ /// Change the cursor
+ virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
- /// Delete a directory recursively
- virtual void rmDir( const string &rPath );
+ /// Delete a directory recursively
+ virtual void rmDir( const string &rPath );
- private:
- /// Directory separator
- const string m_dirSep;
- /// Resource path
- list<string> m_resourcePath;
+private:
+ /// Directory separator
+ const string m_dirSep;
+ /// Resource path
+ list<string> m_resourcePath;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_GRAPHICS_HPP
/// MacOSX implementation of OSGraphics
class MacOSXGraphics: public OSGraphics
{
- public:
- MacOSXGraphics( intf_thread_t *pIntf, int width, int height);
+public:
+ MacOSXGraphics( intf_thread_t *pIntf, int width, int height);
- virtual ~MacOSXGraphics();
+ virtual ~MacOSXGraphics();
- /// Clear the graphics
- virtual void clear();
+ /// Clear the graphics
+ virtual void clear();
- /// Draw another graphics on this one
- virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1 );
+ /// Draw another graphics on this one
+ virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1 );
- /// Render a bitmap on this graphics
- virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1,
- bool blend = false );
+ /// Render a bitmap on this graphics
+ virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1,
+ bool blend = false );
- /// Draw a filled rectangle on the grahics (color is #RRGGBB)
- virtual void fillRect( int left, int top, int width, int height,
- uint32_t color );
+ /// Draw a filled rectangle on the grahics (color is #RRGGBB)
+ virtual void fillRect( int left, int top, int width, int height,
+ uint32_t color );
- /// Draw an empty rectangle on the grahics (color is #RRGGBB)
- virtual void drawRect( int left, int top, int width, int height,
- uint32_t color );
+ /// Draw an empty rectangle on the grahics (color is #RRGGBB)
+ virtual void drawRect( int left, int top, int width, int height,
+ uint32_t color );
- /// Set the shape of a window with the mask of this graphics.
- virtual void applyMaskToWindow( OSWindow &rWindow );
+ /// Set the shape of a window with the mask of this graphics.
+ virtual void applyMaskToWindow( OSWindow &rWindow );
- /// Copy the graphics on a window
- virtual void copyToWindow( OSWindow &rWindow, int xSrc,
- int ySrc, int width, int height,
- int xDest, int yDest );
+ /// Copy the graphics on a window
+ virtual void copyToWindow( OSWindow &rWindow, int xSrc,
+ int ySrc, int width, int height,
+ int xDest, int yDest );
- /// Tell whether the pixel at the given position is visible
- virtual bool hit( int x, int y ) const;
+ /// Tell whether the pixel at the given position is visible
+ virtual bool hit( int x, int y ) const;
- /// Getters
- virtual int getWidth() const { return m_width; }
- virtual int getHeight() const { return m_height; }
+ /// Getters
+ virtual int getWidth() const { return m_width; }
+ virtual int getHeight() const { return m_height; }
- private:
- /// Size of the image
- int m_width, m_height;
+private:
+ /// Size of the image
+ int m_width, m_height;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_LOOP_HPP
/// Main event loop for MacOSX (singleton)
class MacOSXLoop: public OSLoop
{
- public:
- /// Get the instance of MacOSXLoop
- static OSLoop *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of MacOSXLoop
+ static OSLoop *instance( intf_thread_t *pIntf );
- /// Destroy the instance of MacOSXLoop
- static void destroy( intf_thread_t *pIntf );
+ /// Destroy the instance of MacOSXLoop
+ static void destroy( intf_thread_t *pIntf );
- /// Enter the event loop
- virtual void run();
+ /// Enter the event loop
+ virtual void run();
- /// Exit the main loop
- virtual void exit();
+ /// Exit the main loop
+ virtual void exit();
- // Handle a window event
- void registerWindow( GenericWindow &rGenWin, WindowRef win );
+ // Handle a window event
+ void registerWindow( GenericWindow &rGenWin, WindowRef win );
- private:
- // Private because it's a singleton
- MacOSXLoop( intf_thread_t *pIntf );
- virtual ~MacOSXLoop();
- // Flag set to exit the loop
- bool m_exit;
+private:
+ // Private because it's a singleton
+ MacOSXLoop( intf_thread_t *pIntf );
+ virtual ~MacOSXLoop();
+ // Flag set to exit the loop
+ bool m_exit;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_POPUP_HPP
/// MacOSX implementation of OSPopup
class MacOSXPopup: public OSPopup
{
- public:
- MacOSXPopup( intf_thread_t *pIntf );
+public:
+ MacOSXPopup( intf_thread_t *pIntf );
- virtual ~MacOSXPopup();
+ virtual ~MacOSXPopup();
- /// Show the popup menu at the given (absolute) corrdinates
- virtual void show( int xPos, int yPos );
+ /// Show the popup menu at the given (absolute) corrdinates
+ virtual void show( int xPos, int yPos );
- /// Hide the popup menu
- virtual void hide();
+ /// Hide the popup menu
+ virtual void hide();
- /// Append a new menu item with the given label to the popup menu
- virtual void addItem( const string &rLabel, int pos );
+ /// Append a new menu item with the given label to the popup menu
+ virtual void addItem( const string &rLabel, int pos );
- /// Create a dummy menu item to separate sections
- virtual void addSeparator( int pos );
+ /// Create a dummy menu item to separate sections
+ virtual void addSeparator( int pos );
- /// Return the position of the item identified by the given id
- virtual int getPosFromId( int id ) const;
+ /// Return the position of the item identified by the given id
+ virtual int getPosFromId( int id ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_TIMER_HPP
// MacOSX specific timer
class MacOSXTimer: public OSTimer
{
- public:
- MacOSXTimer( intf_thread_t *pIntf, CmdGeneric &rCmd );
- virtual ~MacOSXTimer();
+public:
+ MacOSXTimer( intf_thread_t *pIntf, CmdGeneric &rCmd );
+ virtual ~MacOSXTimer();
- /// (Re)start the timer with the given delay (in ms). If oneShot is
- /// true, stop it after the first execution of the callback.
- virtual void start( int delay, bool oneShot );
+ /// (Re)start the timer with the given delay (in ms). If oneShot is
+ /// true, stop it after the first execution of the callback.
+ virtual void start( int delay, bool oneShot );
- /// Stop the timer
- virtual void stop();
+ /// Stop the timer
+ virtual void stop();
- private:
- /// Command to execute
- CmdGeneric &m_rCommand;
+private:
+ /// Command to execute
+ CmdGeneric &m_rCommand;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_TOOLTIP_HPP
/// MacOSX implementation of OSTooltip
class MacOSXTooltip: public OSTooltip
{
- public:
- MacOSXTooltip( intf_thread_t *pIntf );
+public:
+ MacOSXTooltip( intf_thread_t *pIntf );
- virtual ~MacOSXTooltip();
+ virtual ~MacOSXTooltip();
- /// Show the tooltip
- virtual void show( int left, int top, OSGraphics &rText );
+ /// Show the tooltip
+ virtual void show( int left, int top, OSGraphics &rText );
- /// Hide the tooltip
- virtual void hide();
-
- private:
+ /// Hide the tooltip
+ virtual void hide();
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MACOSX_WINDOW_HPP
/// MacOSX implementation of OSWindow
class MacOSXWindow: public OSWindow
{
- public:
- MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow,
- bool dragDrop, bool playOnDrop,
- MacOSXWindow *pParentWindow );
+public:
+ MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow,
+ bool dragDrop, bool playOnDrop,
+ MacOSXWindow *pParentWindow );
- virtual ~MacOSXWindow();
+ virtual ~MacOSXWindow();
- // Show the window
- virtual void show( int left, int top ) const;
+ // Show the window
+ virtual void show( int left, int top ) const;
- // Hide the window
- virtual void hide() const;
+ // Hide the window
+ virtual void hide() const;
- /// Move the window
- virtual void moveResize( int left, int top,
- int width, int height ) const;
+ /// Move the window
+ virtual void moveResize( int left, int top,
+ int width, int height ) const;
- /// Bring the window on top
- virtual void raise() const;
+ /// Bring the window on top
+ virtual void raise() const;
- /// Set the opacity of the window (0 = transparent, 255 = opaque)
- virtual void setOpacity( uint8_t value ) const;
+ /// Set the opacity of the window (0 = transparent, 255 = opaque)
+ virtual void setOpacity( uint8_t value ) const;
- /// Toggle the window on top
- virtual void toggleOnTop( bool onTop ) const;
+ /// Toggle the window on top
+ virtual void toggleOnTop( bool onTop ) const;
- /// Get the Carbon window handle
- WindowRef getWindowRef() const { return m_win; };
+ /// Get the Carbon window handle
+ WindowRef getWindowRef() const { return m_win; };
- private:
- /// Parent window
- MacOSXWindow *m_pParent;
- /// Indicates whether the window handles drag&drop events
- bool m_dragDrop;
- /// Carbon Window object
- WindowRef m_win;
+private:
+ /// Parent window
+ MacOSXWindow *m_pParent;
+ /// Indicates whether the window handles drag&drop events
+ bool m_dragDrop;
+ /// Carbon Window object
+ WindowRef m_win;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
/// Class for skin construction
class Builder: public SkinObject
{
- public:
- Builder( intf_thread_t *pIntf, const BuilderData &rData,
- const string &rPath );
- virtual ~Builder();
-
- /// Create a Theme object, ready to use.
- /// Return NULL in case of problem
- Theme *build();
-
- /// Parse an action tag and returns a command
- CmdGeneric *parseAction( const string &rAction );
-
- private:
- /// Data from the XML
- const BuilderData &m_rData;
- /// Path of the theme
- const string m_path;
-
- /// Theme under construction
- Theme *m_pTheme;
-
- void addTheme( const BuilderData::Theme &rData );
- void addIniFile( const BuilderData::IniFile &rData );
- void addBitmap( const BuilderData::Bitmap &rData );
- void addSubBitmap( const BuilderData::SubBitmap &rData );
- void addBitmapFont( const BuilderData::BitmapFont &rData );
- void addFont( const BuilderData::Font &rData );
- void addPopupMenu( const BuilderData::PopupMenu &rData );
- void addMenuItem( const BuilderData::MenuItem &rData );
- void addMenuSeparator( const BuilderData::MenuSeparator &rData );
- void addWindow( const BuilderData::Window &rData );
- void addLayout( const BuilderData::Layout &rData );
- void addAnchor( const BuilderData::Anchor &rData );
- void addButton( const BuilderData::Button &rData );
- void addCheckbox( const BuilderData::Checkbox &rData );
- void addImage( const BuilderData::Image &rData );
- void addPanel( const BuilderData::Panel &rData );
- void addText( const BuilderData::Text &rData );
- void addRadialSlider( const BuilderData::RadialSlider &rData );
- void addSlider( const BuilderData::Slider &rData );
- void addList( const BuilderData::List &rData );
- void addTree( const BuilderData::Tree &rData );
- void addVideo( const BuilderData::Video &rData );
-
- /// Compute the position of a control
- const Position makePosition( const string &rLeftTop,
- const string &rRightBottom,
- int xPos, int yPos, int width, int height,
- const GenericRect &rRect,
- bool xKeepRatio = false,
- bool yKeepRatio = false ) const;
-
- // Build the full path of a file
- string getFilePath( const string &fileName ) const;
-
- /// Get a font from its id
- GenericFont *getFont( const string &fontId );
-
- /// Function to parse "points" tags
- Bezier *getPoints( const char *pTag ) const;
-
- /// Compute a color value
- uint32_t getColor( const string &rVal ) const;
-
- /// Image handler (used to load image files)
- image_handler_t *m_pImageHandler;
+public:
+ Builder( intf_thread_t *pIntf, const BuilderData &rData,
+ const string &rPath );
+ virtual ~Builder();
+
+ /// Create a Theme object, ready to use.
+ /// Return NULL in case of problem
+ Theme *build();
+
+ /// Parse an action tag and returns a command
+ CmdGeneric *parseAction( const string &rAction );
+
+private:
+ /// Data from the XML
+ const BuilderData &m_rData;
+ /// Path of the theme
+ const string m_path;
+
+ /// Theme under construction
+ Theme *m_pTheme;
+
+ void addTheme( const BuilderData::Theme &rData );
+ void addIniFile( const BuilderData::IniFile &rData );
+ void addBitmap( const BuilderData::Bitmap &rData );
+ void addSubBitmap( const BuilderData::SubBitmap &rData );
+ void addBitmapFont( const BuilderData::BitmapFont &rData );
+ void addFont( const BuilderData::Font &rData );
+ void addPopupMenu( const BuilderData::PopupMenu &rData );
+ void addMenuItem( const BuilderData::MenuItem &rData );
+ void addMenuSeparator( const BuilderData::MenuSeparator &rData );
+ void addWindow( const BuilderData::Window &rData );
+ void addLayout( const BuilderData::Layout &rData );
+ void addAnchor( const BuilderData::Anchor &rData );
+ void addButton( const BuilderData::Button &rData );
+ void addCheckbox( const BuilderData::Checkbox &rData );
+ void addImage( const BuilderData::Image &rData );
+ void addPanel( const BuilderData::Panel &rData );
+ void addText( const BuilderData::Text &rData );
+ void addRadialSlider( const BuilderData::RadialSlider &rData );
+ void addSlider( const BuilderData::Slider &rData );
+ void addList( const BuilderData::List &rData );
+ void addTree( const BuilderData::Tree &rData );
+ void addVideo( const BuilderData::Video &rData );
+
+ /// Compute the position of a control
+ const Position makePosition( const string &rLeftTop,
+ const string &rRightBottom,
+ int xPos, int yPos, int width, int height,
+ const GenericRect &rRect,
+ bool xKeepRatio = false,
+ bool yKeepRatio = false ) const;
+
+ // Build the full path of a file
+ string getFilePath( const string &fileName ) const;
+
+ /// Get a font from its id
+ GenericFont *getFont( const string &fontId );
+
+ /// Function to parse "points" tags
+ Bezier *getPoints( const char *pTag ) const;
+
+ /// Compute a color value
+ uint32_t getColor( const string &rVal ) const;
+
+ /// Image handler (used to load image files)
+ image_handler_t *m_pImageHandler;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EXPR_EVALUATOR_HPP
/// Expression evaluator using Reverse Polish Notation
class ExprEvaluator: public SkinObject
{
- public:
- /// Constructor
- ExprEvaluator( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+public:
+ ExprEvaluator( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
+ ~ExprEvaluator() { }
- /// Destructor
- ~ExprEvaluator() {}
+ /// Clear the RPN stack and parse an expression
+ void parse( const string &rExpr );
- /// Clear the RPN stack and parse an expression
- void parse( const string &rExpr );
+ /// Pop the first token from the RPN stack.
+ /// Return NULL when the stack is empty.
+ string getToken();
- /// Pop the first token from the RPN stack.
- /// Return NULL when the stack is empty.
- string getToken();
+private:
+ /// RPN stack
+ list<string> m_stack;
- private:
- /// RPN stack
- list<string> m_stack;
-
- /// Returns true if op1 has precedency over op2
- bool hasPrecedency( const string &op1, const string &op2 ) const;
+ /// Returns true if op1 has precedency over op2
+ bool hasPrecedency( const string &op1, const string &op2 ) const;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef INTERPRETER_HPP
/// Command interpreter for scripts in the XML
class Interpreter: public SkinObject
{
- public:
- /// Get the instance of Interpreter
- static Interpreter *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of Interpreter
+ static Interpreter *instance( intf_thread_t *pIntf );
- /// Delete the instance of Interpreter
- static void destroy( intf_thread_t *pIntf );
+ /// Delete the instance of Interpreter
+ static void destroy( intf_thread_t *pIntf );
- /// Parse an action tag and returns a pointer on a command
- /// (the intepreter takes care of deleting it, don't do it
- /// yourself !)
- CmdGeneric *parseAction( const string &rAction, Theme *pTheme );
+ /// Parse an action tag and returns a pointer on a command
+ /// (the intepreter takes care of deleting it, don't do it
+ /// yourself !)
+ CmdGeneric *parseAction( const string &rAction, Theme *pTheme );
- /// Returns the boolean variable corresponding to the given name
- VarBool *getVarBool( const string &rName, Theme *pTheme );
+ /// Returns the boolean variable corresponding to the given name
+ VarBool *getVarBool( const string &rName, Theme *pTheme );
- /// Returns the percent variable corresponding to the given name
- VarPercent *getVarPercent( const string &rName, Theme *pTheme );
+ /// Returns the percent variable corresponding to the given name
+ VarPercent *getVarPercent( const string &rName, Theme *pTheme );
- /// Returns the list variable corresponding to the given name
- VarList *getVarList( const string &rName, Theme *pTheme );
+ /// Returns the list variable corresponding to the given name
+ VarList *getVarList( const string &rName, Theme *pTheme );
- /// Returns the tree variable corresponding to the given name
- VarTree *getVarTree( const string &rName, Theme *pTheme );
+ /// Returns the tree variable corresponding to the given name
+ VarTree *getVarTree( const string &rName, Theme *pTheme );
- /// Get a constant value
- string getConstant( const string &rValue );
+ /// Get a constant value
+ string getConstant( const string &rValue );
- private:
- /// Map of global commands
- map<string, CmdGenericPtr> m_commandMap;
+private:
+ /// Map of global commands
+ map<string, CmdGenericPtr> m_commandMap;
- // Private because it is a singleton
- Interpreter( intf_thread_t *pIntf );
- virtual ~Interpreter() {}
+ // Private because it is a singleton
+ Interpreter( intf_thread_t *pIntf );
+ virtual ~Interpreter() { }
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef SKIN_PARSER_HPP
/// Parser for the skin DTD
class SkinParser: public XMLParser
{
- public:
- SkinParser( intf_thread_t *pIntf, const string &rFileName,
- const string &rPath, bool useDTD = true,
- BuilderData *pData = NULL );
- virtual ~SkinParser();
+public:
+ SkinParser( intf_thread_t *pIntf, const string &rFileName,
+ const string &rPath, bool useDTD = true,
+ BuilderData *pData = NULL );
+ virtual ~SkinParser();
- const BuilderData &getData() const { return *m_pData; }
+ const BuilderData &getData() const { return *m_pData; }
- static int convertColor( const char *transcolor );
+ static int convertColor( const char *transcolor );
- private:
- /// Path of the theme
- const string m_path;
- /// Container for mapping data from the XML
- BuilderData *m_pData;
- /// Indicate whether the class owns the data
- bool m_ownData;
- /// Current IDs
- string m_curBitmapId;
- string m_curWindowId;
- string m_curLayoutId;
- string m_curPopupId;
- string m_curListId;
- string m_curTreeId;
- /// Current position of menu items in the popups
- list<int> m_popupPosList;
- /// Current offset of the controls
- int m_xOffset, m_yOffset;
- list<int> m_xOffsetList, m_yOffsetList;
- /// Stack of panel ids
- list<string> m_panelStack;
- /// Layer of the current control in the layout
- int m_curLayer;
- /// Set of used id
- set<string> m_idSet;
+private:
+ /// Path of the theme
+ const string m_path;
+ /// Container for mapping data from the XML
+ BuilderData *m_pData;
+ /// Indicate whether the class owns the data
+ bool m_ownData;
+ /// Current IDs
+ string m_curBitmapId;
+ string m_curWindowId;
+ string m_curLayoutId;
+ string m_curPopupId;
+ string m_curListId;
+ string m_curTreeId;
+ /// Current position of menu items in the popups
+ list<int> m_popupPosList;
+ /// Current offset of the controls
+ int m_xOffset, m_yOffset;
+ list<int> m_xOffsetList, m_yOffsetList;
+ /// Stack of panel ids
+ list<string> m_panelStack;
+ /// Layer of the current control in the layout
+ int m_curLayer;
+ /// Set of used id
+ set<string> m_idSet;
- /// Callbacks
- virtual void handleBeginElement( const string &rName,
- AttrList_t &attr );
- virtual void handleEndElement( const string &rName );
+ /// Callbacks
+ virtual void handleBeginElement( const string &rName,
+ AttrList_t &attr );
+ virtual void handleEndElement( const string &rName );
- /// Helper functions
- //@{
- bool convertBoolean( const char *value ) const;
- /// Transform to int, and check that it is in the given range (if not,
- /// the closest range boundary will be used)
- int convertInRange( const char *value, int minValue, int maxValue,
- const string &rAttribute ) const;
- //@}
+ /// Helper functions
+ //@{
+ bool convertBoolean( const char *value ) const;
+ /// Transform to int, and check that it is in the given range (if not,
+ /// the closest range boundary will be used)
+ int convertInRange( const char *value, int minValue, int maxValue,
+ const string &rAttribute ) const;
+ //@}
- /// Generate a new id
- const string generateId() const;
+ /// Generate a new id
+ const string generateId() const;
- /// Check if the id is unique, and if not generate a new one
- const string uniqueId( const string &id );
+ /// Check if the id is unique, and if not generate a new one
+ const string uniqueId( const string &id );
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef XMLPARSER_HPP
/// XML parser using libxml2 text reader API
class XMLParser: public SkinObject
{
- public:
- XMLParser( intf_thread_t *pIntf, const string &rFileName,
- bool useDTD = true );
- virtual ~XMLParser();
+public:
+ XMLParser( intf_thread_t *pIntf, const string &rFileName,
+ bool useDTD = true );
+ virtual ~XMLParser();
- /// Parse the file. Returns true on success
- bool parse();
+ /// Parse the file. Returns true on success
+ bool parse();
- protected:
- // Key comparison function for type "const char*"
- struct ltstr
+protected:
+ // Key comparison function for type "const char*"
+ struct ltstr
+ {
+ bool operator()(const char* s1, const char* s2) const
{
- bool operator()(const char* s1, const char* s2) const
- {
- return strcmp(s1, s2) < 0;
- }
- };
- /// Type for attribute lists
- typedef map<const char*, const char*, ltstr> AttrList_t;
+ return strcmp(s1, s2) < 0;
+ }
+ };
+ /// Type for attribute lists
+ typedef map<const char*, const char*, ltstr> AttrList_t;
- /// Flag for validation errors
- bool m_errors;
+ /// Flag for validation errors
+ bool m_errors;
- /// Callbacks
- virtual void handleBeginElement( const string &rName,
- AttrList_t &attr ) {}
- virtual void handleEndElement( const string &rName ) {}
+ /// Callbacks
+ virtual void handleBeginElement( const string &rName,
+ AttrList_t &attr ) { }
+ virtual void handleEndElement( const string &rName ) { }
- private:
- void LoadCatalog();
+private:
+ void LoadCatalog();
- /// Reader context
- xml_t *m_pXML;
- xml_reader_t *m_pReader;
- stream_t *m_pStream;
+ /// Reader context
+ xml_t *m_pXML;
+ xml_reader_t *m_pReader;
+ stream_t *m_pStream;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef ANCHOR_HPP
/// Class for the windows anchors
class Anchor: public SkinObject
{
- public:
- Anchor( intf_thread_t *pIntf, const Position &rPosition, int range,
- int priority, const Bezier &rCurve, GenericLayout &rLayout ):
- SkinObject( pIntf ), m_position( rPosition ),
- m_rCurve( rCurve ), m_range( range ), m_priority( priority ),
- m_rLayout( rLayout ) {}
- virtual ~Anchor() {}
-
- /**
- * Return true if the given anchor is hanged by this one
- * Two conditions are required:
- * - the other anchor must be in position of anchoring (as defined
- * by canHang())
- * - the priority of the other anchor must be lower than this one's
- */
- bool isHanging( const Anchor &rOther ) const;
-
- /**
- * Return true if the other anchor, moved by the (xOffset, yOffset)
- * vector, is "hangable" by this one (i.e. if it is in its range of
- * action), else return false.
- * When the function returns true, the xOffset and yOffset parameters
- * are modified to indicate the position that the other anchor would
- * take if hanged by this one (this position is calculated to minimize
- * the difference with the old xOffset and yOffset, so that the window
- * doesn't "jump" in a strange way).
- */
- bool canHang( const Anchor &rOther, int &xOffset, int &yOffset ) const;
-
- // Indicate whether this anchor is reduced to a single point
- bool isPoint() const { return m_rCurve.getNbCtrlPoints() == 1; }
-
- // Getters
- const Position & getPosition() const { return m_position; }
-
- int getXPosAbs() const
- {
- return (m_position.getLeft() + m_rLayout.getLeft());
- }
-
- int getYPosAbs() const
- {
- return (m_position.getTop() + m_rLayout.getTop());
- }
-
- private:
- /// Position in the layout
- Position m_position;
-
- /// Curve of the anchor
- const Bezier &m_rCurve;
-
- /// Range of action
- int m_range;
-
- /// Priority
- int m_priority;
-
- /// Parent layout
- GenericLayout &m_rLayout;
+public:
+ Anchor( intf_thread_t *pIntf, const Position &rPosition, int range,
+ int priority, const Bezier &rCurve, GenericLayout &rLayout )
+ : SkinObject( pIntf ), m_position( rPosition ), m_rCurve( rCurve ),
+ m_range( range ), m_priority( priority ), m_rLayout( rLayout ) { }
+ virtual ~Anchor() { }
+
+ /**
+ * Return true if the given anchor is hanged by this one
+ * Two conditions are required:
+ * - the other anchor must be in position of anchoring (as defined
+ * by canHang())
+ * - the priority of the other anchor must be lower than this one's
+ */
+ bool isHanging( const Anchor &rOther ) const;
+
+ /**
+ * Return true if the other anchor, moved by the (xOffset, yOffset)
+ * vector, is "hangable" by this one (i.e. if it is in its range of
+ * action), else return false.
+ * When the function returns true, the xOffset and yOffset parameters
+ * are modified to indicate the position that the other anchor would
+ * take if hanged by this one (this position is calculated to minimize
+ * the difference with the old xOffset and yOffset, so that the window
+ * doesn't "jump" in a strange way).
+ */
+ bool canHang( const Anchor &rOther, int &xOffset, int &yOffset ) const;
+
+ // Indicate whether this anchor is reduced to a single point
+ bool isPoint() const { return m_rCurve.getNbCtrlPoints() == 1; }
+
+ // Getters
+ const Position & getPosition() const { return m_position; }
+
+ int getXPosAbs() const
+ {
+ return (m_position.getLeft() + m_rLayout.getLeft());
+ }
+
+ int getYPosAbs() const
+ {
+ return (m_position.getTop() + m_rLayout.getTop());
+ }
+
+private:
+ /// Position in the layout
+ Position m_position;
+
+ /// Curve of the anchor
+ const Bezier &m_rCurve;
+
+ /// Range of action
+ int m_range;
+
+ /// Priority
+ int m_priority;
+
+ /// Parent layout
+ GenericLayout &m_rLayout;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef ANIM_BITMAP_HPP
class AnimBitmap: public SkinObject, public Box,
public Subject<AnimBitmap>
{
- public:
- AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap );
-
- virtual ~AnimBitmap();
-
- /// Start the animation
- void startAnim();
-
- /// Stop the animation
- void stopAnim();
-
- /// Draw the current frame on another graphics
- void draw( OSGraphics &rImage, int xDest, int yDest );
-
- /// Tell whether the pixel at the given position is visible
- bool hit( int x, int y ) const;
-
- /// Get the size of the current frame
- virtual int getWidth() const;
- virtual int getHeight() const;
-
- private:
- /// Bitmap stored
- const GenericBitmap &m_rBitmap;
- /// Graphics to store the bitmap
- OSGraphics *m_pImage;
- /// Number of frames
- int m_nbFrames;
- /// Frame rate
- int m_frameRate;
- /// Curent frame
- int m_curFrame;
- /// Timer for the animation
- OSTimer *m_pTimer;
-
- /// Callback for the timer
- DEFINE_CALLBACK( AnimBitmap, NextFrame );
+public:
+ AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap );
+
+ virtual ~AnimBitmap();
+
+ /// Start the animation
+ void startAnim();
+
+ /// Stop the animation
+ void stopAnim();
+
+ /// Draw the current frame on another graphics
+ void draw( OSGraphics &rImage, int xDest, int yDest );
+
+ /// Tell whether the pixel at the given position is visible
+ bool hit( int x, int y ) const;
+
+ /// Get the size of the current frame
+ virtual int getWidth() const;
+ virtual int getHeight() const;
+
+private:
+ /// Bitmap stored
+ const GenericBitmap &m_rBitmap;
+ /// Graphics to store the bitmap
+ OSGraphics *m_pImage;
+ /// Number of frames
+ int m_nbFrames;
+ /// Frame rate
+ int m_frameRate;
+ /// Curent frame
+ int m_curFrame;
+ /// Timer for the animation
+ OSTimer *m_pTimer;
+
+ /// Callback for the timer
+ DEFINE_CALLBACK( AnimBitmap, NextFrame );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef BITMAP_FONT_HPP
/// Class to handle bitmap fonts
class BitmapFont: public GenericFont
{
- public:
- BitmapFont( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
- const string &rType );
- virtual ~BitmapFont() {}
+public:
+ BitmapFont( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
+ const string &rType );
+ virtual ~BitmapFont() { }
- virtual bool init() { return true; }
+ virtual bool init() { return true; }
- /// Render a string on a bitmap.
- /// If maxWidth != -1, the text is truncated with '...'
- virtual GenericBitmap *drawString( const UString &rString,
- uint32_t color, int maxWidth = -1 ) const;
+ /// Render a string on a bitmap.
+ /// If maxWidth != -1, the text is truncated with '...'
+ virtual GenericBitmap *drawString( const UString &rString,
+ uint32_t color, int maxWidth = -1 ) const;
- /// Get the font size
- virtual int getSize() const { return m_height; }
+ /// Get the font size
+ virtual int getSize() const { return m_height; }
- private:
- /// Description of a glyph
- struct Glyph_t
- {
- Glyph_t(): m_xPos( -1 ), m_yPos( 0 ) {}
- int m_xPos, m_yPos;
- };
+private:
+ /// Description of a glyph
+ struct Glyph_t
+ {
+ Glyph_t(): m_xPos( -1 ), m_yPos( 0 ) { }
+ int m_xPos, m_yPos;
+ };
- /// Bitmap
- const GenericBitmap &m_rBitmap;
- /// Glyph size
- int m_width, m_height;
- /// Horizontal advance between two characters
- int m_advance;
- /// Horizontal advance for non-displayable characters
- int m_skip;
- /// Character table
- Glyph_t m_table[256];
+ /// Bitmap
+ const GenericBitmap &m_rBitmap;
+ /// Glyph size
+ int m_width, m_height;
+ /// Horizontal advance between two characters
+ int m_advance;
+ /// Horizontal advance for non-displayable characters
+ int m_skip;
+ /// Character table
+ Glyph_t m_table[256];
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef DIALOGS_HPP
// Dialogs provider
class Dialogs: public SkinObject
{
- public:
- /// Get the instance of Dialogs (or NULL if initialization failed)
- static Dialogs *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of Dialogs (or NULL if initialization failed)
+ static Dialogs *instance( intf_thread_t *pIntf );
- /// Delete the instance of Dialogs
- static void destroy( intf_thread_t *pIntf );
+ /// Delete the instance of Dialogs
+ static void destroy( intf_thread_t *pIntf );
- /// Show the Change Skin dialog
- void showChangeSkin();
+ /// Show the Change Skin dialog
+ void showChangeSkin();
- /// Show the Load Playlist dialog
- void showPlaylistLoad();
+ /// Show the Load Playlist dialog
+ void showPlaylistLoad();
- /// Show the Save Playlist dialog
- void showPlaylistSave();
+ /// Show the Save Playlist dialog
+ void showPlaylistSave();
- /** Show the Quick Open File dialog.
- * If play is false, just add the item in the playlist
- */
- void showFileSimple( bool play );
+ /** Show the Quick Open File dialog.
+ * If play is false, just add the item in the playlist
+ */
+ void showFileSimple( bool play );
- /** Show the Open File dialog
- * If play is false, just add the item in the playlist
- */
- void showFile( bool play );
+ /** Show the Open File dialog
+ * If play is false, just add the item in the playlist
+ */
+ void showFile( bool play );
- /** Show the Open Directory dialog
- * If play is false, just add the item in the playlist
- */
- void showDirectory( bool play );
+ /** Show the Open Directory dialog
+ * If play is false, just add the item in the playlist
+ */
+ void showDirectory( bool play );
- /** Show the Open Disc dialog
- * If play is false, just add the item in the playlist
- */
- void showDisc( bool play );
+ /** Show the Open Disc dialog
+ * If play is false, just add the item in the playlist
+ */
+ void showDisc( bool play );
- /** Show the Open Network Stream dialog
- * If play is false, just add the item in the playlist
- */
- void showNet( bool play );
+ /** Show the Open Network Stream dialog
+ * If play is false, just add the item in the playlist
+ */
+ void showNet( bool play );
- /// Show the Messages dialog
- void showMessages();
+ /// Show the Messages dialog
+ void showMessages();
- /// Show the Preferences dialog
- void showPrefs();
+ /// Show the Preferences dialog
+ void showPrefs();
- /// Show the FileInfo dialog
- void showFileInfo();
+ /// Show the FileInfo dialog
+ void showFileInfo();
- /// Show the Streaming Wizard dialog
- void showStreamingWizard();
+ /// Show the Streaming Wizard dialog
+ void showStreamingWizard();
- /// Show the Playlist
- void showPlaylist();
+ /// Show the Playlist
+ void showPlaylist();
- /// Show a popup menu
- void showPopupMenu( bool bShow, int popupType );
+ /// Show a popup menu
+ void showPopupMenu( bool bShow, int popupType );
- /// Show an interaction dialog
- void showInteraction( interaction_dialog_t * );
+ /// Show an interaction dialog
+ void showInteraction( interaction_dialog_t * );
- private:
- // Private because it's a singleton
- Dialogs( intf_thread_t *pIntf );
- ~Dialogs();
+private:
+ // Private because it's a singleton
+ Dialogs( intf_thread_t *pIntf );
+ ~Dialogs();
- /// DlgCallback is the type of the callbacks of the open/save dialog
- typedef void DlgCallback( intf_dialog_args_t *pArg );
+ /// DlgCallback is the type of the callbacks of the open/save dialog
+ typedef void DlgCallback( intf_dialog_args_t *pArg );
- /// Possible flags for the open/save dialog
- enum flags_t
- {
- kOPEN = 0x01,
- kSAVE = 0x02,
- kMULTIPLE = 0x04
- };
+ /// Possible flags for the open/save dialog
+ enum flags_t
+ {
+ kOPEN = 0x01,
+ kSAVE = 0x02,
+ kMULTIPLE = 0x04
+ };
- /// Initialization method
- bool init();
+ /// Initialization method
+ bool init();
- /** Show a generic open/save dialog, initialized with the given
- * parameters
- * The 'flags' parameter is a logical or of the flags_t values
- */
- void showFileGeneric( const string &rTitle, const string &rExtensions,
- DlgCallback callback, int flags );
+ /** Show a generic open/save dialog, initialized with the given
+ * parameters
+ * The 'flags' parameter is a logical or of the flags_t values
+ */
+ void showFileGeneric( const string &rTitle, const string &rExtensions,
+ DlgCallback callback, int flags );
- /// Callback for the Change Skin dialog
- static void showChangeSkinCB( intf_dialog_args_t *pArg );
+ /// Callback for the Change Skin dialog
+ static void showChangeSkinCB( intf_dialog_args_t *pArg );
- /// Callback for the Load Playlist dialog
- static void showPlaylistLoadCB( intf_dialog_args_t *pArg );
+ /// Callback for the Load Playlist dialog
+ static void showPlaylistLoadCB( intf_dialog_args_t *pArg );
- /// Callback for the Save Playlist dialog
- static void showPlaylistSaveCB( intf_dialog_args_t *pArg );
+ /// Callback for the Save Playlist dialog
+ static void showPlaylistSaveCB( intf_dialog_args_t *pArg );
- /// Dialogs provider module
- intf_thread_t *m_pProvider;
- module_t *m_pModule;
+ /// Dialogs provider module
+ intf_thread_t *m_pProvider;
+ module_t *m_pModule;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef FILE_BITMAP_HPP
/// Class for file bitmaps
class FileBitmap: public GenericBitmap
{
- public:
- /// Load a bitmap from a file. aColor is the transparency
- /// color, in the format 0xRRGGBB
- FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
- string fileName, uint32_t aColor, int nbFrames = 1,
- int fps = 0 );
-
- virtual ~FileBitmap();
-
- /// Get the width of the bitmap
- virtual int getWidth() const { return m_width; }
-
- /// Get the heighth of the bitmap
- virtual int getHeight() const { return m_height; }
-
- /// Get a linear buffer containing the image data.
- /// Each pixel is stored in 4 bytes in the order B,G,R,A
- virtual uint8_t *getData() const;
-
- private:
- /// Size of the bitmap.
- int m_width, m_height;
- /// Buffer containing the image data.
- uint8_t *m_pData;
+public:
+ /// Load a bitmap from a file. aColor is the transparency
+ /// color, in the format 0xRRGGBB
+ FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
+ string fileName, uint32_t aColor, int nbFrames = 1,
+ int fps = 0 );
+
+ virtual ~FileBitmap();
+
+ /// Get the width of the bitmap
+ virtual int getWidth() const { return m_width; }
+
+ /// Get the heighth of the bitmap
+ virtual int getHeight() const { return m_height; }
+
+ /// Get a linear buffer containing the image data.
+ /// Each pixel is stored in 4 bytes in the order B,G,R,A
+ virtual uint8_t *getData() const;
+
+private:
+ /// Size of the bitmap.
+ int m_width, m_height;
+ /// Buffer containing the image data.
+ uint8_t *m_pData;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef FT2_BITMAP_HPP
/// Class for rendering freetype glyphs on a bitmap
class FT2Bitmap: public GenericBitmap
{
- public:
- /// Create an empty bitmap
- FT2Bitmap( intf_thread_t *pIntf, int width, int height );
+public:
+ /// Create an empty bitmap
+ FT2Bitmap( intf_thread_t *pIntf, int width, int height );
- virtual ~FT2Bitmap();
+ virtual ~FT2Bitmap();
- /// Get the width of the bitmap
- virtual int getWidth() const { return m_width; }
+ /// Get the width of the bitmap
+ virtual int getWidth() const { return m_width; }
- /// Get the heighth of the bitmap
- virtual int getHeight() const { return m_height; }
+ /// Get the heighth of the bitmap
+ virtual int getHeight() const { return m_height; }
- /// Get a linear buffer containing the image data.
- /// Each pixel is stored in 4 bytes in the order B,G,R,A
- virtual uint8_t *getData() const { return m_pData; }
+ /// Get a linear buffer containing the image data.
+ /// Each pixel is stored in 4 bytes in the order B,G,R,A
+ virtual uint8_t *getData() const { return m_pData; }
- /// Render a glyph on the bitmap at the given position
- void draw( const FT_Bitmap &rBitmap, int left, int top,
- uint32_t color );
+ /// Render a glyph on the bitmap at the given position
+ void draw( const FT_Bitmap &rBitmap, int left, int top,
+ uint32_t color );
- private:
- /// Bitmap size
- int m_width, m_height;
- /// Image data buffer
- uint8_t *m_pData;
+private:
+ /// Bitmap size
+ int m_width, m_height;
+ /// Image data buffer
+ uint8_t *m_pData;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef FT2_FONT_HPP
/// Freetype2 font
class FT2Font: public GenericFont
{
- public:
- FT2Font( intf_thread_t *pIntf, const string &rName, int size );
- virtual ~FT2Font();
+public:
+ FT2Font( intf_thread_t *pIntf, const string &rName, int size );
+ virtual ~FT2Font();
- /// Initialize the object. Returns false if it failed
- virtual bool init();
+ /// Initialize the object. Returns false if it failed
+ virtual bool init();
- /// Render a string on a bitmap.
- /// If maxWidth != -1, the text is truncated with '...'
- virtual GenericBitmap *drawString( const UString &rString,
- uint32_t color, int maxWidth = -1 ) const;
+ /// Render a string on a bitmap.
+ /// If maxWidth != -1, the text is truncated with '...'
+ virtual GenericBitmap *drawString( const UString &rString,
+ uint32_t color, int maxWidth = -1 ) const;
- /// Get the text height
- virtual int getSize() const { return m_height; }
+ /// Get the text height
+ virtual int getSize() const { return m_height; }
- private:
- typedef struct
- {
- FT_Glyph m_glyph;
- FT_BBox m_size;
- int m_index;
- int m_advance;
- } Glyph_t;
- typedef map<uint32_t,Glyph_t> GlyphMap_t;
+private:
+ typedef struct
+ {
+ FT_Glyph m_glyph;
+ FT_BBox m_size;
+ int m_index;
+ int m_advance;
+ } Glyph_t;
+ typedef map<uint32_t,Glyph_t> GlyphMap_t;
- /// File name
- const string m_name;
- /// Buffer to store the font
- void *m_buffer;
- /// Pixel size of the font
- int m_size;
- /// Handle to FT library
- FT_Library m_lib;
- /// Font face
- FT_Face m_face;
- /// Font metrics
- int m_height, m_ascender, m_descender;
- /// Glyph cache
- mutable GlyphMap_t m_glyphCache;
+ /// File name
+ const string m_name;
+ /// Buffer to store the font
+ void *m_buffer;
+ /// Pixel size of the font
+ int m_size;
+ /// Handle to FT library
+ FT_Library m_lib;
+ /// Font face
+ FT_Face m_face;
+ /// Font metrics
+ int m_height, m_ascender, m_descender;
+ /// Glyph cache
+ mutable GlyphMap_t m_glyphCache;
- /// Get the glyph corresponding to the given code
- Glyph_t &getGlyph( uint32_t code ) const;
+ /// Get the glyph corresponding to the given code
+ Glyph_t &getGlyph( uint32_t code ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef GENERIC_BITMAP_HPP
/// Generic interface for bitmaps
class GenericBitmap: public SkinObject, public Box
{
- public:
- virtual ~GenericBitmap() {}
+public:
+ virtual ~GenericBitmap() { }
- /// Get a linear buffer containing the image data.
- /// Each pixel is stored in 4 bytes in the order B,G,R,A
- virtual uint8_t *getData() const = 0;
+ /// Get a linear buffer containing the image data.
+ /// Each pixel is stored in 4 bytes in the order B,G,R,A
+ virtual uint8_t *getData() const = 0;
- /// Get the number of frames in the bitmap
- int getNbFrames() const { return m_nbFrames; }
+ /// Get the number of frames in the bitmap
+ int getNbFrames() const { return m_nbFrames; }
- /// Get the number of frames per second (for animated bitmaps)
- int getFrameRate() const { return m_frameRate; }
+ /// Get the number of frames per second (for animated bitmaps)
+ int getFrameRate() const { return m_frameRate; }
- protected:
- GenericBitmap( intf_thread_t *pIntf, int nbFrames = 1, int fps = 0);
+protected:
+ GenericBitmap( intf_thread_t *pIntf, int nbFrames = 1, int fps = 0);
- private:
- /// Number of frames
- int m_nbFrames;
- /// Frame rate
- int m_frameRate;
+private:
+ /// Number of frames
+ int m_nbFrames;
+ /// Frame rate
+ int m_frameRate;
};
/// Basic bitmap implementation
class BitmapImpl: public GenericBitmap
{
- public:
- /// Create an empty bitmap of the given size
- BitmapImpl( intf_thread_t *pIntf, int width, int height,
- int nbFrames = 1, int fps = 0 );
- ~BitmapImpl();
-
- /// Get the width of the bitmap
- virtual int getWidth() const { return m_width; }
-
- /// Get the heighth of the bitmap
- virtual int getHeight() const { return m_height; }
-
- /// Get a linear buffer containing the image data.
- /// Each pixel is stored in 4 bytes in the order B,G,R,A
- virtual uint8_t *getData() const { return m_pData; }
-
- // Copy a region of another bitmap on this bitmap
- bool drawBitmap( const GenericBitmap &rSource, int xSrc, int ySrc,
- int xDest, int yDest, int width, int height );
-
- private:
- /// Size of the bitmap.
- int m_width, m_height;
- /// Buffer containing the image data.
- uint8_t *m_pData;
+public:
+ /// Create an empty bitmap of the given size
+ BitmapImpl( intf_thread_t *pIntf, int width, int height,
+ int nbFrames = 1, int fps = 0 );
+ ~BitmapImpl();
+
+ /// Get the width of the bitmap
+ virtual int getWidth() const { return m_width; }
+
+ /// Get the heighth of the bitmap
+ virtual int getHeight() const { return m_height; }
+
+ /// Get a linear buffer containing the image data.
+ /// Each pixel is stored in 4 bytes in the order B,G,R,A
+ virtual uint8_t *getData() const { return m_pData; }
+
+ // Copy a region of another bitmap on this bitmap
+ bool drawBitmap( const GenericBitmap &rSource, int xSrc, int ySrc,
+ int xDest, int yDest, int width, int height );
+
+private:
+ /// Size of the bitmap.
+ int m_width, m_height;
+ /// Buffer containing the image data.
+ uint8_t *m_pData;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef GENERIC_FONT_HPP
/// Base class for fonts
class GenericFont: public SkinObject
{
- public:
- virtual ~GenericFont() {}
+public:
+ virtual ~GenericFont() { }
- virtual bool init() = 0;
+ virtual bool init() = 0;
- /// Render a string on a bitmap.
- /// If maxWidth != -1, the text is truncated with '...'
- /// The Bitmap is _not_ owned by this object
- virtual GenericBitmap *drawString( const UString &rString,
- uint32_t color, int maxWidth = -1 ) const = 0;
+ /// Render a string on a bitmap.
+ /// If maxWidth != -1, the text is truncated with '...'
+ /// The Bitmap is _not_ owned by this object
+ virtual GenericBitmap *drawString( const UString &rString,
+ uint32_t color, int maxWidth = -1 ) const = 0;
- /// Get the font size
- virtual int getSize() const = 0;
+ /// Get the font size
+ virtual int getSize() const = 0;
- protected:
- GenericFont( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ GenericFont( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
typedef CountedPtr<GenericFont> GenericFontPtr;
class rect
{
public:
- rect( int v_x = 0, int v_y = 0,
- int v_width = 0, int v_height = 0 )
- : x( v_x), y( v_y ), width( v_width), height( v_height)
- {}
- ~rect(){}
+ rect( int v_x = 0, int v_y = 0, int v_width = 0, int v_height = 0 )
+ : x( v_x ), y( v_y ), width( v_width ), height( v_height ) { }
+ ~rect() { }
int x;
int y;
int width;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef GENERIC_LAYOUT_HPP
struct LayeredControl
{
LayeredControl( CtrlGeneric *pControl, int layer ):
- m_pControl( pControl ), m_layer( layer ) {}
+ m_pControl( pControl ), m_layer( layer ) { }
/// Pointer on the control
CtrlGeneric *m_pControl;
/// Base class for layouts
class GenericLayout: public SkinObject
{
- public:
- GenericLayout( intf_thread_t *pIntf, int width, int height,
- int minWidth, int maxWidth, int minHeight,
- int maxHeight );
-
- virtual ~GenericLayout();
-
- /// Attach the layout to a window
- virtual void setWindow( TopWindow *pWindow );
-
- /// Get the associated window, if any
- virtual TopWindow *getWindow() const { return m_pWindow; }
-
- /// Called by a control which wants to capture the mouse
- virtual void onControlCapture( const CtrlGeneric &rCtrl );
-
- /// Called by a control which wants to release the mouse
- virtual void onControlRelease( const CtrlGeneric &rCtrl );
-
- /// Refresh the window
- virtual void refreshAll();
-
- /// Refresh a rectangular portion of the window
- virtual void refreshRect( int x, int y, int width, int height );
-
- /// Get the image of the layout
- virtual OSGraphics *getImage() const { return m_pImage; }
-
- /// Get the position of the layout (relative to the screen)
- /**
- * Note: These values are different from the m_rect.getLeft() and
- * m_rect.getTop(), which always return 0.
- * The latter methods are there as a "root rect" for the panels and
- * controls, since each control knows its parent rect, but returns
- * coordinates relative to the root rect.
- */
- virtual int getLeft() const { return m_pWindow->getLeft(); }
- virtual int getTop() const { return m_pWindow->getTop(); }
-
- /// Get the size of the layout
- virtual int getWidth() const { return m_rect.getWidth(); }
- virtual int getHeight() const { return m_rect.getHeight(); }
- virtual const GenericRect &getRect() const { return m_rect; }
-
- /// Get the minimum and maximum size of the layout
- virtual int getMinWidth() const { return m_minWidth; }
- virtual int getMaxWidth() const { return m_maxWidth; }
- virtual int getMinHeight() const { return m_minHeight; }
- virtual int getMaxHeight() const { return m_maxHeight; }
-
- /// specific refresh window (if video controls)
- virtual void computeRefresh( int x, int y, int width, int height );
-
- /// Resize the layout
- virtual void resize( int width, int height );
-
- /**
- * Add a control in the layout at the given position, and
- * the optional given layer
- */
- virtual void addControl( CtrlGeneric *pControl,
- const Position &rPosition,
- int layer );
-
- /// Get the list of the controls in this layout, by layer order
- virtual const list<LayeredControl> &getControlList() const;
-
- /// Called by a control when its image has changed
- /**
- * The arguments indicate the size of the rectangle to refresh,
- * and the offset (from the control position) of this rectangle.
- * Use a negative width or height to refresh the layout completely
- */
- virtual void onControlUpdate( const CtrlGeneric &rCtrl,
- int width, int height,
- int xOffSet, int yOffSet );
-
- /// Get the list of the anchors of this layout
- virtual const list<Anchor*>& getAnchorList() const;
-
- /// Add an anchor to this layout
- virtual void addAnchor( Anchor *pAnchor );
-
- /// Called when the layout is shown
- virtual void onShow();
-
- /// Called when the layout is hidden
- virtual void onHide();
-
- /// Give access to the "active layout" variable
- // FIXME: we give read/write access
- VarBoolImpl &getActiveVar() { return *m_pVarActive; }
-
- private:
- /// Parent window of the layout
- TopWindow *m_pWindow;
- /// Layout size
- SkinsRect m_rect;
- int m_minWidth, m_maxWidth;
- int m_minHeight, m_maxHeight;
- /// Image of the layout
- OSGraphics *m_pImage;
- /// List of the controls in the layout
- list<LayeredControl> m_controlList;
- /// Video control(s)
- set<CtrlVideo *> m_pVideoCtrlSet;
- /// List of the anchors in the layout
- list<Anchor*> m_anchorList;
- /// Flag to know if the layout is visible
- bool m_visible;
- /// Variable for the "active state" of the layout
- /**
- * Note: the layout is not an observer on this variable, because it
- * cannot be changed externally (i.e. without an explicit change of
- * layout). This way, we avoid using a setActiveLayoutInner method.
- */
- mutable VarBoolImpl *m_pVarActive;
+public:
+ GenericLayout( intf_thread_t *pIntf, int width, int height,
+ int minWidth, int maxWidth, int minHeight, int maxHeight );
+
+ virtual ~GenericLayout();
+
+ /// Attach the layout to a window
+ virtual void setWindow( TopWindow *pWindow );
+
+ /// Get the associated window, if any
+ virtual TopWindow *getWindow() const { return m_pWindow; }
+
+ /// Called by a control which wants to capture the mouse
+ virtual void onControlCapture( const CtrlGeneric &rCtrl );
+
+ /// Called by a control which wants to release the mouse
+ virtual void onControlRelease( const CtrlGeneric &rCtrl );
+
+ /// Refresh the window
+ virtual void refreshAll();
+
+ /// Refresh a rectangular portion of the window
+ virtual void refreshRect( int x, int y, int width, int height );
+
+ /// Get the image of the layout
+ virtual OSGraphics *getImage() const { return m_pImage; }
+
+ /// Get the position of the layout (relative to the screen)
+ /**
+ * Note: These values are different from the m_rect.getLeft() and
+ * m_rect.getTop(), which always return 0.
+ * The latter methods are there as a "root rect" for the panels and
+ * controls, since each control knows its parent rect, but returns
+ * coordinates relative to the root rect.
+ */
+ virtual int getLeft() const { return m_pWindow->getLeft(); }
+ virtual int getTop() const { return m_pWindow->getTop(); }
+
+ /// Get the size of the layout
+ virtual int getWidth() const { return m_rect.getWidth(); }
+ virtual int getHeight() const { return m_rect.getHeight(); }
+ virtual const GenericRect &getRect() const { return m_rect; }
+
+ /// Get the minimum and maximum size of the layout
+ virtual int getMinWidth() const { return m_minWidth; }
+ virtual int getMaxWidth() const { return m_maxWidth; }
+ virtual int getMinHeight() const { return m_minHeight; }
+ virtual int getMaxHeight() const { return m_maxHeight; }
+
+ /// specific refresh window (if video controls)
+ virtual void computeRefresh( int x, int y, int width, int height );
+
+ /// Resize the layout
+ virtual void resize( int width, int height );
+
+ /**
+ * Add a control in the layout at the given position, and
+ * the optional given layer
+ */
+ virtual void addControl( CtrlGeneric *pControl,
+ const Position &rPosition,
+ int layer );
+
+ /// Get the list of the controls in this layout, by layer order
+ virtual const list<LayeredControl> &getControlList() const;
+
+ /// Called by a control when its image has changed
+ /**
+ * The arguments indicate the size of the rectangle to refresh,
+ * and the offset (from the control position) of this rectangle.
+ * Use a negative width or height to refresh the layout completely
+ */
+ virtual void onControlUpdate( const CtrlGeneric &rCtrl,
+ int width, int height,
+ int xOffSet, int yOffSet );
+
+ /// Get the list of the anchors of this layout
+ virtual const list<Anchor*>& getAnchorList() const;
+
+ /// Add an anchor to this layout
+ virtual void addAnchor( Anchor *pAnchor );
+
+ /// Called when the layout is shown
+ virtual void onShow();
+
+ /// Called when the layout is hidden
+ virtual void onHide();
+
+ /// Give access to the "active layout" variable
+ // FIXME: we give read/write access
+ VarBoolImpl &getActiveVar() { return *m_pVarActive; }
+
+private:
+ /// Parent window of the layout
+ TopWindow *m_pWindow;
+ /// Layout size
+ SkinsRect m_rect;
+ int m_minWidth, m_maxWidth;
+ int m_minHeight, m_maxHeight;
+ /// Image of the layout
+ OSGraphics *m_pImage;
+ /// List of the controls in the layout
+ list<LayeredControl> m_controlList;
+ /// Video control(s)
+ set<CtrlVideo *> m_pVideoCtrlSet;
+ /// List of the anchors in the layout
+ list<Anchor*> m_anchorList;
+ /// Flag to know if the layout is visible
+ bool m_visible;
+ /// Variable for the "active state" of the layout
+ /**
+ * Note: the layout is not an observer on this variable, because it
+ * cannot be changed externally (i.e. without an explicit change of
+ * layout). This way, we avoid using a setActiveLayoutInner method.
+ */
+ mutable VarBoolImpl *m_pVarActive;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef GENERIC_WINDOW_HPP
/// Generic window class
class GenericWindow: public SkinObject, public Observer<VarBool>
{
- private:
- friend class WindowManager;
- friend class VoutManager;
- friend class CtrlVideo;
- public:
- GenericWindow( intf_thread_t *pIntf, int xPos, int yPos,
- bool dragDrop, bool playOnDrop,
- GenericWindow *pParent = NULL );
- virtual ~GenericWindow();
-
- /// Methods to process OS events.
- virtual void processEvent( EvtFocus &rEvtFocus ) {}
- virtual void processEvent( EvtMenu &rEvtMenu ) {}
- virtual void processEvent( EvtMotion &rEvtMotion ) {}
- virtual void processEvent( EvtMouse &rEvtMouse ) {}
- virtual void processEvent( EvtLeave &rEvtLeave ) {}
- virtual void processEvent( EvtKey &rEvtKey ) {}
- virtual void processEvent( EvtScroll &rEvtScroll ) {}
-
- virtual void processEvent( EvtRefresh &rEvtRefresh );
-
- /// Resize the window
- virtual void resize( int width, int height );
-
- /// Refresh an area of the window
- virtual void refresh( int left, int top, int width, int height ) {}
-
- /// Get the coordinates of the window
- int getLeft() const { return m_left; }
- int getTop() const { return m_top; }
- int getWidth() const { return m_width; }
- int getHeight() const { return m_height; }
-
- /// Give access to the visibility variable
- VarBool &getVisibleVar() { return *m_pVarVisible; }
-
- /// Window type, mainly useful when overloaded (for VoutWindow)
- virtual string getType() const { return "Generic"; }
-
- /// windows handle
- void* getOSHandle() const;
-
- /// reparent
- void setParent( GenericWindow* pParent, int x, int y, int w, int h );
-
- protected:
- /// Get the OS window
- OSWindow *getOSWindow() const { return m_pOsWindow; }
-
- /// These methods do not need to be public since they are accessed
- /// only by the window manager or by inheritant classes.
- //@{
- /// Show the window
- virtual void show() const;
-
- /// Hide the window
- virtual void hide() const;
-
- /// Move the window
- virtual void move( int left, int top );
-
- /// Bring the window on top
- virtual void raise() const;
-
- /// Set the opacity of the window (0 = transparent, 255 = opaque)
- virtual void setOpacity( uint8_t value );
-
- /// Toggle the window on top
- virtual void toggleOnTop( bool onTop ) const;
- //@}
-
- /// Actually show the window
- virtual void innerShow();
-
- /// Actually hide the window
- virtual void innerHide();
-
- private:
- /// Window position and size
- int m_left, m_top, m_width, m_height;
- /// OS specific implementation
- OSWindow *m_pOsWindow;
- /// Variable for the visibility of the window
- mutable VarBoolImpl *m_pVarVisible;
-
- /// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarBool> &rVariable , void*);
+private:
+ friend class WindowManager;
+ friend class VoutManager;
+ friend class CtrlVideo;
+public:
+ GenericWindow( intf_thread_t *pIntf, int xPos, int yPos,
+ bool dragDrop, bool playOnDrop,
+ GenericWindow *pParent = NULL );
+ virtual ~GenericWindow();
+
+ /// Methods to process OS events.
+ virtual void processEvent( EvtFocus &rEvtFocus ) { }
+ virtual void processEvent( EvtMenu &rEvtMenu ) { }
+ virtual void processEvent( EvtMotion &rEvtMotion ) { }
+ virtual void processEvent( EvtMouse &rEvtMouse ) { }
+ virtual void processEvent( EvtLeave &rEvtLeave ) { }
+ virtual void processEvent( EvtKey &rEvtKey ) { }
+ virtual void processEvent( EvtScroll &rEvtScroll ) { }
+
+ virtual void processEvent( EvtRefresh &rEvtRefresh );
+
+ /// Resize the window
+ virtual void resize( int width, int height );
+
+ /// Refresh an area of the window
+ virtual void refresh( int left, int top, int width, int height ) { }
+
+ /// Get the coordinates of the window
+ int getLeft() const { return m_left; }
+ int getTop() const { return m_top; }
+ int getWidth() const { return m_width; }
+ int getHeight() const { return m_height; }
+
+ /// Give access to the visibility variable
+ VarBool &getVisibleVar() { return *m_pVarVisible; }
+
+ /// Window type, mainly useful when overloaded (for VoutWindow)
+ virtual string getType() const { return "Generic"; }
+
+ /// windows handle
+ void* getOSHandle() const;
+
+ /// reparent
+ void setParent( GenericWindow* pParent, int x, int y, int w, int h );
+
+protected:
+ /// Get the OS window
+ OSWindow *getOSWindow() const { return m_pOsWindow; }
+
+ /// These methods do not need to be public since they are accessed
+ /// only by the window manager or by inheritant classes.
+ //@{
+ /// Show the window
+ virtual void show() const;
+
+ /// Hide the window
+ virtual void hide() const;
+
+ /// Move the window
+ virtual void move( int left, int top );
+
+ /// Bring the window on top
+ virtual void raise() const;
+
+ /// Set the opacity of the window (0 = transparent, 255 = opaque)
+ virtual void setOpacity( uint8_t value );
+
+ /// Toggle the window on top
+ virtual void toggleOnTop( bool onTop ) const;
+ //@}
+
+ /// Actually show the window
+ virtual void innerShow();
+
+ /// Actually hide the window
+ virtual void innerHide();
+
+private:
+ /// Window position and size
+ int m_left, m_top, m_width, m_height;
+ /// OS specific implementation
+ OSWindow *m_pOsWindow;
+ /// Variable for the visibility of the window
+ mutable VarBoolImpl *m_pVarVisible;
+
+ /// Method called when the observed variable is modified
+ virtual void onUpdate( Subject<VarBool> &rVariable , void*);
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef INI_FILE_HPP
/// INI file parser
class IniFile: public SkinObject
{
- public:
- IniFile( intf_thread_t *pIntf, const string &rName,
- const string &rPath );
- virtual ~IniFile() {}
+public:
+ IniFile( intf_thread_t *pIntf, const string &rName,
+ const string &rPath );
+ virtual ~IniFile() { }
- /// Parse the INI file and fill the VarManager
- void parseFile();
+ /// Parse the INI file and fill the VarManager
+ void parseFile();
- private:
- string m_name;
- string m_path;
+private:
+ string m_name;
+ string m_path;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef LOGGER_HPP
// Logger class
class Logger: public SkinObject
{
- public:
- /// Get the instance of Logger
- /// Returns NULL if initialization failed
- static Logger *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of Logger
+ /// Returns NULL if initialization failed
+ static Logger *instance( intf_thread_t *pIntf );
- /// Delete the instance of Logger
- static void destroy( intf_thread_t *pIntf );
+ /// Delete the instance of Logger
+ static void destroy( intf_thread_t *pIntf );
- /// Print an error message
- void error( const string &rMsg );
+ /// Print an error message
+ void error( const string &rMsg );
- /// Print a warning
- void warn( const string &rMsg );
+ /// Print a warning
+ void warn( const string &rMsg );
- private:
- // Private because it's a singleton
- Logger( intf_thread_t *pIntf );
- ~Logger();
+private:
+ // Private because it's a singleton
+ Logger( intf_thread_t *pIntf );
+ ~Logger();
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_FACTORY_HPP
/// Abstract factory used to instantiate OS specific objects.
class OSFactory: public SkinObject
{
- public:
- enum CursorType_t
- {
- kDefaultArrow,
- kResizeNS,
- kResizeWE,
- kResizeNWSE,
- kResizeNESW
- };
+public:
+ enum CursorType_t
+ {
+ kDefaultArrow,
+ kResizeNS,
+ kResizeWE,
+ kResizeNWSE,
+ kResizeNESW
+ };
- /**
- * Initialization method overloaded in derived classes.
- * It must return false if the init failed.
- */
- virtual bool init() { return true; }
+ /**
+ * Initialization method overloaded in derived classes.
+ * It must return false if the init failed.
+ */
+ virtual bool init() { return true; }
- /**
- * Get the right instance of OSFactory.
- * Returns NULL if initialization of the concrete factory failed.
- */
- static OSFactory *instance( intf_thread_t *pIntf );
+ /**
+ * Get the right instance of OSFactory.
+ * Returns NULL if initialization of the concrete factory failed.
+ */
+ static OSFactory *instance( intf_thread_t *pIntf );
- /// Delete the instance of OSFactory
- static void destroy( intf_thread_t *pIntf );
+ /// Delete the instance of OSFactory
+ static void destroy( intf_thread_t *pIntf );
- /// Instantiate an object OSGraphics
- virtual OSGraphics *createOSGraphics( int width, int height ) = 0;
+ /// Instantiate an object OSGraphics
+ virtual OSGraphics *createOSGraphics( int width, int height ) = 0;
- /// Get the instance of the singleton OSLoop
- virtual OSLoop *getOSLoop() = 0;
+ /// Get the instance of the singleton OSLoop
+ virtual OSLoop *getOSLoop() = 0;
- /// Destroy the instance of OSLoop
- virtual void destroyOSLoop() = 0;
+ /// Destroy the instance of OSLoop
+ virtual void destroyOSLoop() = 0;
- /// Minimize all the windows
- virtual void minimize() = 0;
+ /// Minimize all the windows
+ virtual void minimize() = 0;
- /// Restore the minimized windows
- virtual void restore() = 0;
+ /// Restore the minimized windows
+ virtual void restore() = 0;
- /// Add an icon in the system tray
- virtual void addInTray() = 0;
+ /// Add an icon in the system tray
+ virtual void addInTray() = 0;
- /// Remove the icon from the system tray
- virtual void removeFromTray() = 0;
+ /// Remove the icon from the system tray
+ virtual void removeFromTray() = 0;
- /// Show the task in the task bar
- virtual void addInTaskBar() = 0;
+ /// Show the task in the task bar
+ virtual void addInTaskBar() = 0;
- /// Remove the task from the task bar
- virtual void removeFromTaskBar() = 0;
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar() = 0;
- /// Instantiate an OSTimer with the given command
- virtual OSTimer *createOSTimer( CmdGeneric &rCmd ) = 0;
+ /// Instantiate an OSTimer with the given command
+ virtual OSTimer *createOSTimer( CmdGeneric &rCmd ) = 0;
- /// Instantiate an object OSWindow
- virtual OSWindow *createOSWindow( GenericWindow &rWindow,
- bool dragDrop, bool playOnDrop,
- OSWindow *pParent ) = 0;
+ /// Instantiate an object OSWindow
+ virtual OSWindow *createOSWindow( GenericWindow &rWindow,
+ bool dragDrop, bool playOnDrop,
+ OSWindow *pParent ) = 0;
- /// Instantiate an object OSTooltip
- virtual OSTooltip *createOSTooltip() = 0;
+ /// Instantiate an object OSTooltip
+ virtual OSTooltip *createOSTooltip() = 0;
- /// Instantiate an object OSPopup
- virtual OSPopup *createOSPopup() = 0;
+ /// Instantiate an object OSPopup
+ virtual OSPopup *createOSPopup() = 0;
- /// Get the directory separator
- virtual const string &getDirSeparator() const = 0;
+ /// Get the directory separator
+ virtual const string &getDirSeparator() const = 0;
- /// Get the resource path
- virtual const list<string> &getResourcePath() const = 0;
+ /// Get the resource path
+ virtual const list<string> &getResourcePath() const = 0;
- /// Get the screen size
- virtual int getScreenWidth() const = 0;
- virtual int getScreenHeight() const = 0;
+ /// Get the screen size
+ virtual int getScreenWidth() const = 0;
+ virtual int getScreenHeight() const = 0;
- /// Get the work area (screen area without taskbars)
- virtual SkinsRect getWorkArea() const = 0;
+ /// Get the work area (screen area without taskbars)
+ virtual SkinsRect getWorkArea() const = 0;
- /// Get the position of the mouse
- virtual void getMousePos( int &rXPos, int &rYPos ) const = 0;
+ /// Get the position of the mouse
+ virtual void getMousePos( int &rXPos, int &rYPos ) const = 0;
- /// Change the cursor
- virtual void changeCursor( CursorType_t type ) const = 0;
+ /// Change the cursor
+ virtual void changeCursor( CursorType_t type ) const = 0;
- /// Delete a directory recursively
- virtual void rmDir( const string &rPath ) = 0;
+ /// Delete a directory recursively
+ virtual void rmDir( const string &rPath ) = 0;
- protected:
- // Protected because it's a singleton
- OSFactory( intf_thread_t* pIntf ): SkinObject( pIntf ) {}
- virtual ~OSFactory() {}
+protected:
+ // Protected because it's a singleton
+ OSFactory( intf_thread_t* pIntf ): SkinObject( pIntf ) { }
+ virtual ~OSFactory() { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_GRAPHICS_HPP
/// OS specific graphics class
class OSGraphics: public SkinObject, public Box
{
- public:
- virtual ~OSGraphics() {}
+public:
+ virtual ~OSGraphics() { }
- /// Clear the graphics
- virtual void clear() = 0;
+ /// Clear the graphics
+ virtual void clear() = 0;
- /// Draw another graphics on this one
- virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1 ) = 0;
+ /// Draw another graphics on this one
+ virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1 ) = 0;
- /// Render a bitmap on this graphics
- virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1,
- bool blend = false) = 0;
+ /// Render a bitmap on this graphics
+ virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1,
+ bool blend = false) = 0;
- /// Draw a filled rectangle on the grahics (color is #RRGGBB)
- virtual void fillRect( int left, int top, int width, int height,
- uint32_t color ) = 0;
+ /// Draw a filled rectangle on the grahics (color is #RRGGBB)
+ virtual void fillRect( int left, int top, int width, int height,
+ uint32_t color ) = 0;
- /// Draw an empty rectangle on the grahics (color is #RRGGBB)
- virtual void drawRect( int left, int top, int width, int height,
- uint32_t color ) = 0;
+ /// Draw an empty rectangle on the grahics (color is #RRGGBB)
+ virtual void drawRect( int left, int top, int width, int height,
+ uint32_t color ) = 0;
- /// Set the shape of a window with the mask of this graphics.
- virtual void applyMaskToWindow( OSWindow &rWindow ) = 0;
+ /// Set the shape of a window with the mask of this graphics.
+ virtual void applyMaskToWindow( OSWindow &rWindow ) = 0;
- /// Copy the graphics on a window
- virtual void copyToWindow( OSWindow &rWindow, int xSrc,
- int ySrc, int width, int height,
- int xDest, int yDest ) = 0;
+ /// Copy the graphics on a window
+ virtual void copyToWindow( OSWindow &rWindow, int xSrc,
+ int ySrc, int width, int height,
+ int xDest, int yDest ) = 0;
- /// Tell whether the pixel at the given position is visible
- virtual bool hit( int x, int y ) const = 0;
+ /// Tell whether the pixel at the given position is visible
+ virtual bool hit( int x, int y ) const = 0;
- protected:
- OSGraphics( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ OSGraphics( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
typedef CountedPtr<OSGraphics> OSGraphicsPtr;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_LOOP_HPP
/// Abstract class for the main event loop
class OSLoop: public SkinObject
{
- public:
- virtual ~OSLoop() {}
+public:
+ virtual ~OSLoop() { }
- /// Enter the main loop
- virtual void run() = 0;
+ /// Enter the main loop
+ virtual void run() = 0;
- /// Exit the main loop
- virtual void exit() = 0;
+ /// Exit the main loop
+ virtual void exit() = 0;
- protected:
- OSLoop( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ OSLoop( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_POPUP_HPP
/// Base class for OS specific Popup Windows
class OSPopup: public SkinObject
{
- public:
- virtual ~OSPopup() {}
+public:
+ virtual ~OSPopup() { }
- /// Show the popup menu at the given (absolute) corrdinates
- virtual void show( int xPos, int yPos ) = 0;
+ /// Show the popup menu at the given (absolute) corrdinates
+ virtual void show( int xPos, int yPos ) = 0;
- /// Hide the popup menu
- virtual void hide() = 0;
+ /// Hide the popup menu
+ virtual void hide() = 0;
- /// Append a new menu item with the given label to the popup menu
- virtual void addItem( const string &rLabel, int pos ) = 0;
+ /// Append a new menu item with the given label to the popup menu
+ virtual void addItem( const string &rLabel, int pos ) = 0;
- /// Create a dummy menu item to separate sections
- virtual void addSeparator( int pos ) = 0;
+ /// Create a dummy menu item to separate sections
+ virtual void addSeparator( int pos ) = 0;
- /// Return the position of the item identified by the given id
- virtual int getPosFromId( int id ) const = 0;
+ /// Return the position of the item identified by the given id
+ virtual int getPosFromId( int id ) const = 0;
- protected:
- OSPopup( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ OSPopup( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_TIMER_HPP
// Base class for OS-specific timers
class OSTimer: public SkinObject
{
- public:
- virtual ~OSTimer() {}
+public:
+ virtual ~OSTimer() { }
- /// (Re)start the timer with the given delay (in ms). If oneShot is
- /// true, stop it after the first execution of the callback.
- virtual void start( int delay, bool oneShot ) = 0;
+ /// (Re)start the timer with the given delay (in ms). If oneShot is
+ /// true, stop it after the first execution of the callback.
+ virtual void start( int delay, bool oneShot ) = 0;
- /// Stop the timer
- virtual void stop() = 0;
+ /// Stop the timer
+ virtual void stop() = 0;
- protected:
- OSTimer( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ OSTimer( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_TOOLTIP_HPP
/// Base class for OS specific Tooltip Windows
class OSTooltip: public SkinObject
{
- public:
- virtual ~OSTooltip() {}
+public:
+ virtual ~OSTooltip() { }
- /// Show the tooltip
- virtual void show( int left, int top, OSGraphics &rText ) = 0;
+ /// Show the tooltip
+ virtual void show( int left, int top, OSGraphics &rText ) = 0;
- /// Hide the tooltip
- virtual void hide() = 0;
+ /// Hide the tooltip
+ virtual void hide() = 0;
- protected:
- OSTooltip( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ OSTooltip( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OS_WINDOW_HPP
/// OS specific delegate class for GenericWindow
class OSWindow: public SkinObject
{
- public:
- virtual ~OSWindow() {}
+public:
+ virtual ~OSWindow() { }
- // Show the window
- virtual void show() const = 0;
+ // Show the window
+ virtual void show() const = 0;
- // Hide the window
- virtual void hide() const = 0;
+ // Hide the window
+ virtual void hide() const = 0;
- /// Move and resize the window
- virtual void moveResize( int left, int top,
- int width, int height ) const = 0;
+ /// Move and resize the window
+ virtual void moveResize( int left, int top,
+ int width, int height ) const = 0;
- /// Bring the window on top
- virtual void raise() const = 0;
+ /// Bring the window on top
+ virtual void raise() const = 0;
- /// Set the opacity of the window (0 = transparent, 255 = opaque)
- virtual void setOpacity( uint8_t value ) const = 0;
+ /// Set the opacity of the window (0 = transparent, 255 = opaque)
+ virtual void setOpacity( uint8_t value ) const = 0;
- /// Toggle the window on top
- virtual void toggleOnTop( bool onTop ) const = 0;
+ /// Toggle the window on top
+ virtual void toggleOnTop( bool onTop ) const = 0;
- /// getter for handler
- virtual void* getOSHandle( ) const = 0;
+ /// getter for handler
+ virtual void* getOSHandle( ) const = 0;
- /// reparent the window
- virtual void reparent( void* OSHandle, int x, int y, int w, int h ) = 0;
+ /// reparent the window
+ virtual void reparent( void* OSHandle, int x, int y, int w, int h ) = 0;
- protected:
- OSWindow( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ OSWindow( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef POPUP_HPP
/// Class handling a popup menu
class Popup: public SkinObject
{
- public:
- Popup( intf_thread_t *pIntf, WindowManager &rWindowManager );
- virtual ~Popup() {}
+public:
+ Popup( intf_thread_t *pIntf, WindowManager &rWindowManager );
+ virtual ~Popup() { }
- void show( int xPos, int yPos );
- void hide();
+ void show( int xPos, int yPos );
+ void hide();
- // XXX: it would be nice to use a UString here, if X11 supports it for
- // its menu items (Windows doesn't, unfortunately)
- /// Insert a new menu item to the popup menu, at the position pos
- void addItem( const string &rLabel, CmdGeneric &rCmd, int pos );
+ // XXX: it would be nice to use a UString here, if X11 supports it for
+ // its menu items (Windows doesn't, unfortunately)
+ /// Insert a new menu item to the popup menu, at the position pos
+ void addItem( const string &rLabel, CmdGeneric &rCmd, int pos );
- /// Create a dummy menu item to separate sections
- void addSeparator( int pos );
+ /// Create a dummy menu item to separate sections
+ void addSeparator( int pos );
- /// Execute the action corresponding to the chosen menu item
- void handleEvent( const EvtMenu &rEvent );
+ /// Execute the action corresponding to the chosen menu item
+ void handleEvent( const EvtMenu &rEvent );
- private:
- /// OS specific implementation
- OSPopup *m_pOsPopup;
+private:
+ /// OS specific implementation
+ OSPopup *m_pOsPopup;
- /// Window manager
- WindowManager &m_rWindowManager;
+ /// Window manager
+ WindowManager &m_rWindowManager;
- /// Actions for the menu items, indexed by the position in the menu
- map<int, CmdGeneric *> m_actions;
+ /// Actions for the menu items, indexed by the position in the menu
+ map<int, CmdGeneric *> m_actions;
};
typedef CountedPtr<Popup> PopupPtr;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef SCALED_BITMAP_HPP
/// Class for scaling bitmaps
class ScaledBitmap: public GenericBitmap
{
- public:
- /// Create a scaled bitmap from the given bitmap and size
- ScaledBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
- int width, int height );
+public:
+ /// Create a scaled bitmap from the given bitmap and size
+ ScaledBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
+ int width, int height );
- virtual ~ScaledBitmap();
+ virtual ~ScaledBitmap();
- /// Get the width of the bitmap
- virtual int getWidth() const { return m_width; }
+ /// Get the width of the bitmap
+ virtual int getWidth() const { return m_width; }
- /// Get the heighth of the bitmap
- virtual int getHeight() const { return m_height; }
+ /// Get the heighth of the bitmap
+ virtual int getHeight() const { return m_height; }
- /// Get a linear buffer containing the image data.
- /// Each pixel is stored in 4 bytes in the order B,G,R,A
- virtual uint8_t *getData() const { return m_pData; }
+ /// Get a linear buffer containing the image data.
+ /// Each pixel is stored in 4 bytes in the order B,G,R,A
+ virtual uint8_t *getData() const { return m_pData; }
- private:
- /// Bitmap size
- int m_width, m_height;
- /// Image data buffer
- uint8_t *m_pData;
+private:
+ /// Bitmap size
+ int m_width, m_height;
+ /// Image data buffer
+ uint8_t *m_pData;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
/// Base class for all skin classes
class SkinObject
{
- public:
- SkinObject( intf_thread_t *pIntf ): m_pIntf( pIntf ) {}
- virtual ~SkinObject() {}
+public:
+ SkinObject( intf_thread_t *pIntf ): m_pIntf( pIntf ) { }
+ virtual ~SkinObject() { }
- /// Getter (public because it is used in C callbacks in the win32
- /// interface)
- intf_thread_t *getIntf() const { return m_pIntf; }
+ /// Getter (public because it is used in C callbacks in the win32
+ /// interface)
+ intf_thread_t *getIntf() const { return m_pIntf; }
- private:
- intf_thread_t *m_pIntf;
+private:
+ intf_thread_t *m_pIntf;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef THEME_HPP
/// Class storing the data of the current theme
class Theme: public SkinObject
{
- private:
- friend class Builder;
- friend class Interpreter;
- public:
- Theme( intf_thread_t *pIntf ): SkinObject( pIntf ),
- m_windowManager( getIntf() ) {}
- virtual ~Theme();
+private:
+ friend class Builder;
+ friend class Interpreter;
+public:
+ Theme( intf_thread_t *pIntf ): SkinObject( pIntf ),
+ m_windowManager( getIntf() ) { }
+ virtual ~Theme();
- void loadConfig();
- void saveConfig();
+ void loadConfig();
+ void saveConfig();
- GenericBitmap *getBitmapById( const string &id ) const;
- GenericFont *getFontById( const string &id ) const;
- Popup *getPopupById( const string &id ) const;
- TopWindow *getWindowById( const string &id ) const;
- GenericLayout *getLayoutById( const string &id ) const;
- CtrlGeneric *getControlById( const string &id ) const;
- Position *getPositionById( const string &id ) const;
+ GenericBitmap *getBitmapById( const string &id ) const;
+ GenericFont *getFontById( const string &id ) const;
+ Popup *getPopupById( const string &id ) const;
+ TopWindow *getWindowById( const string &id ) const;
+ GenericLayout *getLayoutById( const string &id ) const;
+ CtrlGeneric *getControlById( const string &id ) const;
+ Position *getPositionById( const string &id ) const;
- WindowManager &getWindowManager() { return m_windowManager; }
+ WindowManager &getWindowManager() { return m_windowManager; }
- private:
- /// Store the bitmaps by ID
- map<string, GenericBitmapPtr> m_bitmaps;
- /// Store the fonts by ID
- map<string, GenericFontPtr> m_fonts;
- /// Store the popups by ID
- map<string, PopupPtr> m_popups;
- /// Store the windows by ID
- map<string, TopWindowPtr> m_windows;
- /// Store the layouts by ID
- map<string, GenericLayoutPtr> m_layouts;
- /// Store the controls by ID
- map<string, CtrlGenericPtr> m_controls;
- /// Store the panel positions by ID
- map<string, PositionPtr> m_positions;
- /// Store the commands
- list<CmdGenericPtr> m_commands;
- /// Store the Bezier curves
- list<BezierPtr> m_curves;
- /// Store the variables
- list<VariablePtr> m_vars;
+private:
+ /// Store the bitmaps by ID
+ map<string, GenericBitmapPtr> m_bitmaps;
+ /// Store the fonts by ID
+ map<string, GenericFontPtr> m_fonts;
+ /// Store the popups by ID
+ map<string, PopupPtr> m_popups;
+ /// Store the windows by ID
+ map<string, TopWindowPtr> m_windows;
+ /// Store the layouts by ID
+ map<string, GenericLayoutPtr> m_layouts;
+ /// Store the controls by ID
+ map<string, CtrlGenericPtr> m_controls;
+ /// Store the panel positions by ID
+ map<string, PositionPtr> m_positions;
+ /// Store the commands
+ list<CmdGenericPtr> m_commands;
+ /// Store the Bezier curves
+ list<BezierPtr> m_curves;
+ /// Store the variables
+ list<VariablePtr> m_vars;
- WindowManager m_windowManager;
+ WindowManager m_windowManager;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef THEME_LOADER_HPP
class ThemeLoader: public SkinObject
{
- public:
- ThemeLoader( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
- virtual ~ThemeLoader() {}
+public:
+ ThemeLoader( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
+ virtual ~ThemeLoader() { }
- /// The expected fileName must be an UTF-8 string
- bool load( const string &fileName );
+ /// The expected fileName must be an UTF-8 string
+ bool load( const string &fileName );
- private:
+private:
#if defined( HAVE_ZLIB_H )
- /// Extract files from an archive (handles tar.gz and zip)
- /**
- * Expects a string from the current locale.
- */
- bool extract( const string &fileName );
+ /// Extract files from an archive (handles tar.gz and zip)
+ /**
+ * Expects a string from the current locale.
+ */
+ bool extract( const string &fileName );
- /// Extract files from a tar.gz archive
- /**
- * Expects strings from the current locale.
- */
- bool extractTarGz( const string &tarFile, const string &rootDir );
+ /// Extract files from a tar.gz archive
+ /**
+ * Expects strings from the current locale.
+ */
+ bool extractTarGz( const string &tarFile, const string &rootDir );
- /// Extract files from a .zip archive
- /**
- * Expects strings from the current locale.
- */
- bool extractZip( const string &zipFile, const string &rootDir );
+ /// Extract files from a .zip archive
+ /**
+ * Expects strings from the current locale.
+ */
+ bool extractZip( const string &zipFile, const string &rootDir );
- /// Extract the current file from a .zip archive
- /**
- * Expects a string from the current locale.
- */
- bool extractFileInZip( unzFile file, const string &rootDir );
+ /// Extract the current file from a .zip archive
+ /**
+ * Expects a string from the current locale.
+ */
+ bool extractFileInZip( unzFile file, const string &rootDir );
- /// Clean up the temporary files created by the extraction
- /**
- * Expects a string from the current locale.
- */
- void deleteTempFiles( const string &path );
+ /// Clean up the temporary files created by the extraction
+ /**
+ * Expects a string from the current locale.
+ */
+ void deleteTempFiles( const string &path );
#endif
- /// Parse the XML file given as a parameter and build the skin
- /**
- * Expects UTF8 strings
- */
- bool parse( const string &path, const string &xmlFile );
+ /// Parse the XML file given as a parameter and build the skin
+ /**
+ * Expects UTF8 strings
+ */
+ bool parse( const string &path, const string &xmlFile );
- /// Recursively look for the XML file from rootDir.
- /**
- * The first corresponding file found will be chosen and themeFilePath
- * will be updated accordingly.
- * The method returns true if a theme file was found, false otherwise.
- * rootDir and rFilename must both be strings in the current locale,
- * whereas themeFilePath will be in UTF8.
- */
- bool findFile( const string &rootDir, const string &rFileName,
- string &themeFilePath );
+ /// Recursively look for the XML file from rootDir.
+ /**
+ * The first corresponding file found will be chosen and themeFilePath
+ * will be updated accordingly.
+ * The method returns true if a theme file was found, false otherwise.
+ * rootDir and rFilename must both be strings in the current locale,
+ * whereas themeFilePath will be in UTF8.
+ */
+ bool findFile( const string &rootDir, const string &rFileName,
+ string &themeFilePath );
- /// Get the base path of a file
- string getFilePath( const string &rFullPath );
+ /// Get the base path of a file
+ string getFilePath( const string &rFullPath );
- /// Replace '/' separators by the actual separator of the OS
- string fixDirSeparators( const string &rPath );
+ /// Replace '/' separators by the actual separator of the OS
+ string fixDirSeparators( const string &rPath );
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef THEME_REPOSITORY_HPP
/// Singleton object handling the list of available themes
class ThemeRepository: public SkinObject
{
- public:
- /// Get the instance of ThemeRepository
- /// Returns NULL if the initialization of the object failed
- static ThemeRepository *instance( intf_thread_t *pIntf );
-
- /// Delete the instance of ThemeRepository
- static void destroy( intf_thread_t *pIntf );
-
- protected:
- // Protected because it is a singleton
- ThemeRepository( intf_thread_t *pIntf );
- virtual ~ThemeRepository();
-
- private:
-
- /// Look for themes in a directory
- void parseDirectory( const string &rDir );
-
- /// Callback for menu item selection
- static int changeSkin( vlc_object_t *pThis, char const *pVariable,
- vlc_value_t oldval, vlc_value_t newval,
- void *pData );
+public:
+ /// Get the instance of ThemeRepository
+ /// Returns NULL if the initialization of the object failed
+ static ThemeRepository *instance( intf_thread_t *pIntf );
+
+ /// Delete the instance of ThemeRepository
+ static void destroy( intf_thread_t *pIntf );
+
+protected:
+ // Protected because it is a singleton
+ ThemeRepository( intf_thread_t *pIntf );
+ virtual ~ThemeRepository();
+
+private:
+ /// Look for themes in a directory
+ void parseDirectory( const string &rDir );
+
+ /// Callback for menu item selection
+ static int changeSkin( vlc_object_t *pThis, char const *pVariable,
+ vlc_value_t oldval, vlc_value_t newval,
+ void *pData );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef TOOLTIP_HPP
class Tooltip: public SkinObject, public Observer<VarText>
{
- public:
- /// Create a tooltip with the given font and delay (in milliseconds)
- Tooltip( intf_thread_t *pIntf, const GenericFont &rFont, int delay );
+public:
+ /// Create a tooltip with the given font and delay (in milliseconds)
+ Tooltip( intf_thread_t *pIntf, const GenericFont &rFont, int delay );
- virtual ~Tooltip();
+ virtual ~Tooltip();
- /// Draw the tooltip and show it after the delay
- void show();
+ /// Draw the tooltip and show it after the delay
+ void show();
- /// Hide the tooltip and cancel the timer if a tooltip is waiting for
- /// display
- void hide();
+ /// Hide the tooltip and cancel the timer if a tooltip is waiting for
+ /// display
+ void hide();
- private:
- /// Font
- const GenericFont &m_rFont;
- /// Delay before popping the tooltip
- int m_delay;
- /// Timer to wait before showing the tooltip
- OSTimer *m_pTimer;
- /// OS specific tooltip window
- OSTooltip *m_pOsTooltip;
- /// Image of the tooltip
- OSGraphics *m_pImage;
- /// Position of the tooltip
- int m_xPos, m_yPos;
+private:
+ /// Font
+ const GenericFont &m_rFont;
+ /// Delay before popping the tooltip
+ int m_delay;
+ /// Timer to wait before showing the tooltip
+ OSTimer *m_pTimer;
+ /// OS specific tooltip window
+ OSTooltip *m_pOsTooltip;
+ /// Image of the tooltip
+ OSGraphics *m_pImage;
+ /// Position of the tooltip
+ int m_xPos, m_yPos;
- /// Method called when the observed variable is modified
- virtual void onUpdate( Subject<VarText> &rVariable, void * );
+ /// Method called when the observed variable is modified
+ virtual void onUpdate( Subject<VarText> &rVariable, void * );
- /// Display text of the tooltip
- void displayText( const UString &rText );
+ /// Display text of the tooltip
+ void displayText( const UString &rText );
- /// Build m_pImage with the given text
- void makeImage( const UString &rText );
+ /// Build m_pImage with the given text
+ void makeImage( const UString &rText );
- /// Callback to show the tooltip window
- DEFINE_CALLBACK( Tooltip, Show );
+ /// Callback to show the tooltip window
+ DEFINE_CALLBACK( Tooltip, Show );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef TOP_WINDOW_HPP
/// Class to handle top-level windows
class TopWindow: public GenericWindow
{
- private:
- friend class WindowManager;
- public:
- TopWindow( intf_thread_t *pIntf, int xPos, int yPos,
- WindowManager &rWindowManager,
- bool dragDrop, bool playOnDrop, bool visible );
- virtual ~TopWindow();
-
- /// Methods to process OS events.
- virtual void processEvent( EvtRefresh &rEvtRefresh );
- virtual void processEvent( EvtFocus &rEvtFocus );
- virtual void processEvent( EvtMenu &rEvtMenu );
- virtual void processEvent( EvtMotion &rEvtMotion );
- virtual void processEvent( EvtMouse &rEvtMouse );
- virtual void processEvent( EvtLeave &rEvtLeave );
- virtual void processEvent( EvtKey &rEvtKey );
- virtual void processEvent( EvtScroll &rEvtScroll );
-
- /// Forward an event to a control
- virtual void forwardEvent( EvtGeneric &rEvt, CtrlGeneric &rCtrl );
-
- // Refresh an area of the window
- virtual void refresh( int left, int top, int width, int height );
-
- /// Get the active layout
- virtual const GenericLayout& getActiveLayout() const;
-
- /// Update the shape of the window from the active layout
- virtual void updateShape();
-
- /// Called by a control that wants to capture the mouse
- virtual void onControlCapture( const CtrlGeneric &rCtrl );
-
- /// Called by a control that wants to release the mouse
- virtual void onControlRelease( const CtrlGeneric &rCtrl );
-
- /// Called by a control when its tooltip changed
- virtual void onTooltipChange( const CtrlGeneric &rCtrl );
-
- /// Get the "maximized" variable
- VarBool &getMaximizedVar() { return *m_pVarMaximized; }
-
- /// Get the initial visibility status
- bool isVisible() const { return m_visible; }
-
- protected:
- /// Actually show the window
- virtual void innerShow();
-
- /// Actually hide the window
- virtual void innerHide();
-
- private:
- /**
- * These methods are only used by the window manager
- */
- //@{
- /// Change the active layout
- virtual void setActiveLayout( GenericLayout *pLayout );
- //@}
-
- /// Initial visibility status
- bool m_visible;
- /// Window manager
- WindowManager &m_rWindowManager;
- /// Current active layout of the window
- GenericLayout *m_pActiveLayout;
- /// Last control on which the mouse was over
- CtrlGeneric *m_pLastHitControl;
- /// Control that has captured the mouse
- CtrlGeneric *m_pCapturingControl;
- /// Control that has the focus
- CtrlGeneric *m_pFocusControl;
- /// Current key modifier (also used for mouse)
- int m_currModifier;
-
- /// Variable for the visibility of the window
- VarBoolImpl *m_pVarMaximized;
-
- /**
- * Find the uppest control in the layout hit by the mouse, and send
- * it an enter event if needed
- */
- CtrlGeneric *findHitControl( int xPos, int yPos );
-
- /**
- * Update the lastHitControl pointer and send a leave event to the
- * right control
- */
- void setLastHit( CtrlGeneric *pNewHitControl );
+private:
+ friend class WindowManager;
+public:
+ TopWindow( intf_thread_t *pIntf, int xPos, int yPos,
+ WindowManager &rWindowManager,
+ bool dragDrop, bool playOnDrop, bool visible );
+ virtual ~TopWindow();
+
+ /// Methods to process OS events.
+ virtual void processEvent( EvtRefresh &rEvtRefresh );
+ virtual void processEvent( EvtFocus &rEvtFocus );
+ virtual void processEvent( EvtMenu &rEvtMenu );
+ virtual void processEvent( EvtMotion &rEvtMotion );
+ virtual void processEvent( EvtMouse &rEvtMouse );
+ virtual void processEvent( EvtLeave &rEvtLeave );
+ virtual void processEvent( EvtKey &rEvtKey );
+ virtual void processEvent( EvtScroll &rEvtScroll );
+
+ /// Forward an event to a control
+ virtual void forwardEvent( EvtGeneric &rEvt, CtrlGeneric &rCtrl );
+
+ // Refresh an area of the window
+ virtual void refresh( int left, int top, int width, int height );
+
+ /// Get the active layout
+ virtual const GenericLayout& getActiveLayout() const;
+
+ /// Update the shape of the window from the active layout
+ virtual void updateShape();
+
+ /// Called by a control that wants to capture the mouse
+ virtual void onControlCapture( const CtrlGeneric &rCtrl );
+
+ /// Called by a control that wants to release the mouse
+ virtual void onControlRelease( const CtrlGeneric &rCtrl );
+
+ /// Called by a control when its tooltip changed
+ virtual void onTooltipChange( const CtrlGeneric &rCtrl );
+
+ /// Get the "maximized" variable
+ VarBool &getMaximizedVar() { return *m_pVarMaximized; }
+
+ /// Get the initial visibility status
+ bool isVisible() const { return m_visible; }
+
+protected:
+ /// Actually show the window
+ virtual void innerShow();
+
+ /// Actually hide the window
+ virtual void innerHide();
+
+private:
+ /**
+ * These methods are only used by the window manager
+ */
+ //@{
+ /// Change the active layout
+ virtual void setActiveLayout( GenericLayout *pLayout );
+ //@}
+
+ /// Initial visibility status
+ bool m_visible;
+ /// Window manager
+ WindowManager &m_rWindowManager;
+ /// Current active layout of the window
+ GenericLayout *m_pActiveLayout;
+ /// Last control on which the mouse was over
+ CtrlGeneric *m_pLastHitControl;
+ /// Control that has captured the mouse
+ CtrlGeneric *m_pCapturingControl;
+ /// Control that has the focus
+ CtrlGeneric *m_pFocusControl;
+ /// Current key modifier (also used for mouse)
+ int m_currModifier;
+
+ /// Variable for the visibility of the window
+ VarBoolImpl *m_pVarMaximized;
+
+ /**
+ * Find the uppest control in the layout hit by the mouse, and send
+ * it an enter event if needed
+ */
+ CtrlGeneric *findHitControl( int xPos, int yPos );
+
+ /**
+ * Update the lastHitControl pointer and send a leave event to the
+ * right control
+ */
+ void setLastHit( CtrlGeneric *pNewHitControl );
};
typedef CountedPtr<TopWindow> TopWindowPtr;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VAR_MANAGER_HPP
class VarManager: public SkinObject
{
- public:
- /// Get the instance of VarManager
- static VarManager *instance( intf_thread_t *pIntf );
-
- /// Delete the instance of VarManager
- static void destroy( intf_thread_t *pIntf );
-
- /// Register a named variable in the manager
- void registerVar( const VariablePtr &rcVar, const string &rName );
-
- /// Register an anonymous variable in the manager
- void registerVar( const VariablePtr &rcVar );
-
- /// Get a variable by its name (NULL if not found)
- Variable *getVar( const string &rName );
-
- /// Get a variable by its name and check the type (NULL if not found)
- Variable *getVar( const string &rName, const string &rType );
-
- /// Get the tooltip text variable
- VarText &getTooltipText() { return *m_pTooltipText; }
-
- /// Get the help text variable
- VarText &getHelpText() { return *m_pHelpText; }
-
- /// Register a constant value
- void registerConst( const string &rName, const string &rValue);
-
- /// Get a constant value by its name
- string getConst( const string &rName );
-
- private:
- /// Tooltip text
- VarText *m_pTooltipText;
- /// Help text
- VarText *m_pHelpText;
- /// Map of named registered variables
- map<string, VariablePtr> m_varMap;
- /// List of named registed variables
- list<string> m_varList;
- /// List of anonymous registed variables
- list<VariablePtr> m_anonVarList;
- /// Map of constant values
- map<string, string> m_constMap;
-
- /// Private because it is a singleton
- VarManager( intf_thread_t *pIntf );
- virtual ~VarManager();
+public:
+ /// Get the instance of VarManager
+ static VarManager *instance( intf_thread_t *pIntf );
+
+ /// Delete the instance of VarManager
+ static void destroy( intf_thread_t *pIntf );
+
+ /// Register a named variable in the manager
+ void registerVar( const VariablePtr &rcVar, const string &rName );
+
+ /// Register an anonymous variable in the manager
+ void registerVar( const VariablePtr &rcVar );
+
+ /// Get a variable by its name (NULL if not found)
+ Variable *getVar( const string &rName );
+
+ /// Get a variable by its name and check the type (NULL if not found)
+ Variable *getVar( const string &rName, const string &rType );
+
+ /// Get the tooltip text variable
+ VarText &getTooltipText() { return *m_pTooltipText; }
+
+ /// Get the help text variable
+ VarText &getHelpText() { return *m_pHelpText; }
+
+ /// Register a constant value
+ void registerConst( const string &rName, const string &rValue);
+
+ /// Get a constant value by its name
+ string getConst( const string &rName );
+
+private:
+ /// Tooltip text
+ VarText *m_pTooltipText;
+ /// Help text
+ VarText *m_pHelpText;
+ /// Map of named registered variables
+ map<string, VariablePtr> m_varMap;
+ /// List of named registed variables
+ list<string> m_varList;
+ /// List of anonymous registed variables
+ list<VariablePtr> m_anonVarList;
+ /// Map of constant values
+ map<string, string> m_constMap;
+
+ /// Private because it is a singleton
+ VarManager( intf_thread_t *pIntf );
+ virtual ~VarManager();
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLCPROC_HPP
/// Singleton object handling VLC internal state and playlist
class VlcProc: public SkinObject
{
- public:
- /// Get the instance of VlcProc
- /// Returns NULL if the initialization of the object failed
- static VlcProc *instance( intf_thread_t *pIntf );
-
- /// Delete the instance of VlcProc
- static void destroy( intf_thread_t *pIntf );
-
- /// Getter for the playtree variable
- Playtree &getPlaytreeVar() { return *((Playtree*)m_cPlaytree.get()); }
-
- /// Getter for the time variable
- StreamTime &getTimeVar() { return *((StreamTime*)(m_cVarTime.get())); }
-
- /// Getter for the volume variable
- Volume &getVolumeVar() { return *((Volume*)(m_cVarVolume.get())); }
-
- /// Getter for the stream name variable
- VarText &getStreamNameVar()
- { return *((VarText*)(m_cVarStreamName.get())); }
-
- /// Getter for the stream URI variable
- VarText &getStreamURIVar()
- { return *((VarText*)(m_cVarStreamURI.get())); }
-
- /// Getter for the stream bitrate variable
- VarText &getStreamBitRateVar()
- { return *((VarText*)(m_cVarStreamBitRate.get())); }
-
- /// Getter for the stream sample rate variable
- VarText &getStreamSampleRateVar()
- { return *((VarText*)(m_cVarStreamSampleRate.get())); }
-
- /// Getter for the vout size variable
- VarBox &getVoutSizeVar() { return m_varVoutSize; }
-
- /// Indicate whether the embedded video output is currently used
- bool isVoutUsed() const { return m_pVout != NULL; }
-
- /// update equalizer
- void update_equalizer( );
-
- void on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_bit_rate_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_sample_rate_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_can_record_changed( vlc_object_t* p_obj, vlc_value_t newVal );
-
- void on_random_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_loop_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_repeat_changed( vlc_object_t* p_obj, vlc_value_t newVal );
-
- void on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal );
- void on_audio_filter_changed( vlc_object_t* p_obj, vlc_value_t newVal );
-
- protected:
- // Protected because it is a singleton
- VlcProc( intf_thread_t *pIntf );
- virtual ~VlcProc();
-
- private:
- /// Timer to call manage() regularly (via doManage())
- OSTimer *m_pTimer;
- /// Playtree variable
- VariablePtr m_cPlaytree;
- VariablePtr m_cVarRandom;
- VariablePtr m_cVarLoop;
- VariablePtr m_cVarRepeat;
- /// Variable for current position of the stream
- VariablePtr m_cVarTime;
- /// Variable for audio volume
- VariablePtr m_cVarVolume;
- /// Variable for current stream properties
- VariablePtr m_cVarStreamName;
- VariablePtr m_cVarStreamURI;
- VariablePtr m_cVarStreamBitRate;
- VariablePtr m_cVarStreamSampleRate;
- /// Variable for the "mute" state
- VariablePtr m_cVarMute;
- /// Variables related to the input
- VariablePtr m_cVarPlaying;
- VariablePtr m_cVarStopped;
- VariablePtr m_cVarPaused;
- VariablePtr m_cVarSeekable;
- VariablePtr m_cVarRecordable;
- VariablePtr m_cVarRecording;
- /// Variables related to the vout
- VariablePtr m_cVarFullscreen;
- VarBox m_varVoutSize;
- VariablePtr m_cVarHasVout;
- /// Variables related to audio
- VariablePtr m_cVarHasAudio;
- /// Equalizer variables
- EqualizerBands m_varEqBands;
- VariablePtr m_cVarEqPreamp;
- VariablePtr m_cVarEqualizer;
- /// Variable for DVD detection
- VariablePtr m_cVarDvdActive;
-
- /// Vout thread
- vout_thread_t *m_pVout;
- /// Audio output
- aout_instance_t *m_pAout;
- bool m_bEqualizer_started;
-
- /**
- * Poll VLC internals to update the status (volume, current time in
- * the stream, current filename, play/pause/stop status, ...)
- * This function should be called regurlarly, since there is no
- * callback mechanism (yet?) to automatically update a variable when
- * the internal status changes
- */
- void manage();
-
- // reset variables when input is over
- void reset_input();
-
- // init variables (libvlc and playlist levels)
- void init_variables();
-
- /// Define the command that calls manage()
- DEFINE_CALLBACK( VlcProc, Manage );
-
- /// Update the stream name variable
- void updateStreamName();
-
- /// Callback for intf-change variable
- static int onIntfChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for intf-show variable
- static int onIntfShow( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for input-current variable
- static int onInputNew( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for item-change variable
- static int onItemChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for item-change variable
- static int onItemAppend( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for item-change variable
- static int onItemDelete( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for skins2-to-load variable
- static int onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for interaction variable
- static int onInteraction( vlc_object_t *pObj, const char *pVariable,
+public:
+ /// Get the instance of VlcProc
+ /// Returns NULL if the initialization of the object failed
+ static VlcProc *instance( intf_thread_t *pIntf );
+
+ /// Delete the instance of VlcProc
+ static void destroy( intf_thread_t *pIntf );
+
+ /// Getter for the playtree variable
+ Playtree &getPlaytreeVar() { return *((Playtree*)m_cPlaytree.get()); }
+
+ /// Getter for the time variable
+ StreamTime &getTimeVar() { return *((StreamTime*)(m_cVarTime.get())); }
+
+ /// Getter for the volume variable
+ Volume &getVolumeVar() { return *((Volume*)(m_cVarVolume.get())); }
+
+ /// Getter for the stream name variable
+ VarText &getStreamNameVar()
+ { return *((VarText*)(m_cVarStreamName.get())); }
+
+ /// Getter for the stream URI variable
+ VarText &getStreamURIVar()
+ { return *((VarText*)(m_cVarStreamURI.get())); }
+
+ /// Getter for the stream bitrate variable
+ VarText &getStreamBitRateVar()
+ { return *((VarText*)(m_cVarStreamBitRate.get())); }
+
+ /// Getter for the stream sample rate variable
+ VarText &getStreamSampleRateVar()
+ { return *((VarText*)(m_cVarStreamSampleRate.get())); }
+
+ /// Getter for the vout size variable
+ VarBox &getVoutSizeVar() { return m_varVoutSize; }
+
+ /// Indicate whether the embedded video output is currently used
+ bool isVoutUsed() const { return m_pVout != NULL; }
+
+ /// update equalizer
+ void update_equalizer( );
+
+ void on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_bit_rate_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_sample_rate_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_can_record_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+
+ void on_random_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_loop_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_repeat_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+
+ void on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+ void on_audio_filter_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+
+protected:
+ // Protected because it is a singleton
+ VlcProc( intf_thread_t *pIntf );
+ virtual ~VlcProc();
+
+private:
+ /// Timer to call manage() regularly (via doManage())
+ OSTimer *m_pTimer;
+ /// Playtree variable
+ VariablePtr m_cPlaytree;
+ VariablePtr m_cVarRandom;
+ VariablePtr m_cVarLoop;
+ VariablePtr m_cVarRepeat;
+ /// Variable for current position of the stream
+ VariablePtr m_cVarTime;
+ /// Variable for audio volume
+ VariablePtr m_cVarVolume;
+ /// Variable for current stream properties
+ VariablePtr m_cVarStreamName;
+ VariablePtr m_cVarStreamURI;
+ VariablePtr m_cVarStreamBitRate;
+ VariablePtr m_cVarStreamSampleRate;
+ /// Variable for the "mute" state
+ VariablePtr m_cVarMute;
+ /// Variables related to the input
+ VariablePtr m_cVarPlaying;
+ VariablePtr m_cVarStopped;
+ VariablePtr m_cVarPaused;
+ VariablePtr m_cVarSeekable;
+ VariablePtr m_cVarRecordable;
+ VariablePtr m_cVarRecording;
+ /// Variables related to the vout
+ VariablePtr m_cVarFullscreen;
+ VarBox m_varVoutSize;
+ VariablePtr m_cVarHasVout;
+ /// Variables related to audio
+ VariablePtr m_cVarHasAudio;
+ /// Equalizer variables
+ EqualizerBands m_varEqBands;
+ VariablePtr m_cVarEqPreamp;
+ VariablePtr m_cVarEqualizer;
+ /// Variable for DVD detection
+ VariablePtr m_cVarDvdActive;
+
+ /// Vout thread
+ vout_thread_t *m_pVout;
+ /// Audio output
+ aout_instance_t *m_pAout;
+ bool m_bEqualizer_started;
+
+ /**
+ * Poll VLC internals to update the status (volume, current time in
+ * the stream, current filename, play/pause/stop status, ...)
+ * This function should be called regurlarly, since there is no
+ * callback mechanism (yet?) to automatically update a variable when
+ * the internal status changes
+ */
+ void manage();
+
+ // reset variables when input is over
+ void reset_input();
+
+ // init variables (libvlc and playlist levels)
+ void init_variables();
+
+ /// Define the command that calls manage()
+ DEFINE_CALLBACK( VlcProc, Manage );
+
+ /// Update the stream name variable
+ void updateStreamName();
+
+ /// Callback for intf-change variable
+ static int onIntfChange( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Callback for intf-show variable
+ static int onIntfShow( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Callback for input-current variable
+ static int onInputNew( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Callback for item-change variable
+ static int onItemChange( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Callback for item-change variable
+ static int onItemAppend( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Callback for item-change variable
+ static int onItemDelete( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Callback for skins2-to-load variable
+ static int onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam );
+
+ /// Generic Callback
+ static int onGenericCallback( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam );
- /// Callback for equalizer-bands variable
- static int onEqBandsChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Callback for equalizer-preamp variable
- static int onEqPreampChange( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
- /// Generic Callback
- static int onGenericCallback( vlc_object_t *pObj, const char *pVariable,
- vlc_value_t oldVal, vlc_value_t newVal,
- void *pParam );
-
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VOUTMANAGER_HPP
{
public:
SavedWnd( vout_window_t* pWnd, VoutWindow* pVoutWindow = NULL,
- CtrlVideo* pCtrlVideo = NULL, int height = 0, int width = 0 ) :
- pWnd( pWnd ), pVoutWindow( pVoutWindow ), pCtrlVideo( pCtrlVideo ),
- height( height ), width( width ) {}
-
- ~SavedWnd() {}
+ CtrlVideo* pCtrlVideo = NULL, int height = 0, int width = 0 )
+ : pWnd( pWnd ), pVoutWindow( pVoutWindow ),
+ pCtrlVideo( pCtrlVideo ), height( height ), width( width ) { }
+ ~SavedWnd() { }
vout_window_t* pWnd;
VoutWindow *pVoutWindow;
class VoutMainWindow: public GenericWindow
{
- public:
-
- VoutMainWindow( intf_thread_t *pIntf, int left = 0, int top = 0 ) :
- GenericWindow( pIntf, left, top, false, false, NULL )
- {
- resize( 10, 10 );
- move( -50, -50 );
- }
- virtual ~VoutMainWindow() {}
+public:
+ VoutMainWindow( intf_thread_t *pIntf, int left = 0, int top = 0 ) :
+ GenericWindow( pIntf, left, top, false, false, NULL )
+ {
+ resize( 10, 10 );
+ move( -50, -50 );
+ }
+ virtual ~VoutMainWindow() { }
};
/// Singleton object handling VLC internal state and playlist
class VoutManager: public SkinObject
{
- public:
- /// Get the instance of VoutManager
- /// Returns NULL if the initialization of the object failed
- static VoutManager *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of VoutManager
+ /// Returns NULL if the initialization of the object failed
+ static VoutManager *instance( intf_thread_t *pIntf );
- /// Delete the instance of VoutManager
- static void destroy( intf_thread_t *pIntf );
+ /// Delete the instance of VoutManager
+ static void destroy( intf_thread_t *pIntf );
- /// Accept Wnd
- void* acceptWnd( vout_window_t* pWnd );
+ /// Accept Wnd
+ void* acceptWnd( vout_window_t* pWnd );
- /// Release Wnd
- void releaseWnd( vout_window_t* pWnd );
+ /// Release Wnd
+ void releaseWnd( vout_window_t* pWnd );
- /// set size Wnd
- void setSizeWnd( vout_window_t* pWnd, int width, int height );
+ /// set size Wnd
+ void setSizeWnd( vout_window_t* pWnd, int width, int height );
- /// set fullscreen Wnd
- void setFullscreenWnd( vout_window_t* pWnd, bool b_fullscreen );
+ /// set fullscreen Wnd
+ void setFullscreenWnd( vout_window_t* pWnd, bool b_fullscreen );
- /// Callback to request a vout window
- static void *getWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
+ /// Callback to request a vout window
+ static void *getWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
- // Window provider (release)
- static void releaseWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
+ // Window provider (release)
+ static void releaseWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
- /// Callback to change a vout window
- static int controlWindow( struct vout_window_t *pWnd,
- int query, va_list args );
+ /// Callback to change a vout window
+ static int controlWindow( struct vout_window_t *pWnd,
+ int query, va_list args );
- // Register Video Controls (when building theme)
- void registerCtrlVideo( CtrlVideo* p_CtrlVideo );
+ // Register Video Controls (when building theme)
+ void registerCtrlVideo( CtrlVideo* p_CtrlVideo );
- // save and restore vouts (when changing theme)
- void saveVoutConfig( );
- void restoreVoutConfig( bool b_success );
+ // save and restore vouts (when changing theme)
+ void saveVoutConfig( );
+ void restoreVoutConfig( bool b_success );
- // save and restore vouts (when swapping Layout)
- void discardVout( CtrlVideo* pCtrlVideo );
- void requestVout( CtrlVideo* pCtrlVideo );
+ // save and restore vouts (when swapping Layout)
+ void discardVout( CtrlVideo* pCtrlVideo );
+ void requestVout( CtrlVideo* pCtrlVideo );
- // get a useable video Control
- CtrlVideo* getBestCtrlVideo( );
+ // get a useable video Control
+ CtrlVideo* getBestCtrlVideo( );
- // get the VoutMainWindow
- VoutMainWindow* getVoutMainWindow() { return m_pVoutMainWindow; }
+ // get the VoutMainWindow
+ VoutMainWindow* getVoutMainWindow() { return m_pVoutMainWindow; }
- // test if vout are running
- bool hasVout() { return ( m_SavedWndVec.size() != 0 ) ; }
+ // test if vout are running
+ bool hasVout() { return ( m_SavedWndVec.size() != 0 ) ; }
- protected:
- // Protected because it is a singleton
- VoutManager( intf_thread_t *pIntf );
- virtual ~VoutManager();
+protected:
+ // Protected because it is a singleton
+ VoutManager( intf_thread_t *pIntf );
+ virtual ~VoutManager();
- private:
+private:
- vector<CtrlVideo *> m_pCtrlVideoVec;
- vector<CtrlVideo *> m_pCtrlVideoVecBackup;
- vector<SavedWnd> m_SavedWndVec;
+ vector<CtrlVideo *> m_pCtrlVideoVec;
+ vector<CtrlVideo *> m_pCtrlVideoVecBackup;
+ vector<SavedWnd> m_SavedWndVec;
- VoutMainWindow* m_pVoutMainWindow;
+ VoutMainWindow* m_pVoutMainWindow;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VOUT_WINDOW_HPP
/// Class to handle a video output window
class VoutWindow: private GenericWindow
{
- public:
+public:
- VoutWindow( intf_thread_t *pIntf, vout_window_t* pWnd,
- int width, int height, GenericWindow* pParent = NULL );
- virtual ~VoutWindow();
+ VoutWindow( intf_thread_t *pIntf, vout_window_t* pWnd,
+ int width, int height, GenericWindow* pParent = NULL );
+ virtual ~VoutWindow();
- // counter used for debugging purpose
- static int count;
+ // counter used for debugging purpose
+ static int count;
- /// Make some functions public
- //@{
- using GenericWindow::show;
- using GenericWindow::hide;
- using GenericWindow::move;
- using GenericWindow::resize;
- using GenericWindow::getOSHandle;
- //@}
+ /// Make some functions public
+ //@{
+ using GenericWindow::show;
+ using GenericWindow::hide;
+ using GenericWindow::move;
+ using GenericWindow::resize;
+ using GenericWindow::getOSHandle;
+ //@}
- /// get the parent window
- virtual GenericWindow* getWindow( ) { return m_pParentWindow; }
+ /// get the parent window
+ virtual GenericWindow* getWindow( ) { return m_pParentWindow; }
- /// hotkeys processing
- virtual void processEvent( EvtKey &rEvtKey );
+ /// hotkeys processing
+ virtual void processEvent( EvtKey &rEvtKey );
- /// set and get Video Control for VoutWindow
- virtual void setCtrlVideo( CtrlVideo* pCtrlVideo );
- virtual CtrlVideo* getCtrlVideo( ) { return m_pCtrlVideo; }
+ /// set and get Video Control for VoutWindow
+ virtual void setCtrlVideo( CtrlVideo* pCtrlVideo );
+ virtual CtrlVideo* getCtrlVideo( ) { return m_pCtrlVideo; }
- /// toggle fullscreen mode
- virtual void setFullscreen( bool b_fullscreen );
- virtual bool isFullscreen() { return m_bFullscreen; }
+ /// toggle fullscreen mode
+ virtual void setFullscreen( bool b_fullscreen );
+ virtual bool isFullscreen() { return m_bFullscreen; }
- /// get original size of vout
- virtual int getOriginalWidth( ) { return original_width; }
- virtual int getOriginalHeight( ) { return original_height; }
+ /// get original size of vout
+ virtual int getOriginalWidth( ) { return original_width; }
+ virtual int getOriginalHeight( ) { return original_height; }
- /// set original size of vout
- virtual void setOriginalWidth( int width ) { original_width = width; }
- virtual void setOriginalHeight( int height ) { original_height = height; }
+ /// set original size of vout
+ virtual void setOriginalWidth( int width ) { original_width = width; }
+ virtual void setOriginalHeight( int height ) { original_height = height; }
- virtual string getType() const { return "Vout"; }
+ virtual string getType() const { return "Vout"; }
- private:
+private:
- /// vout thread
- vout_window_t* m_pWnd;
+ /// vout thread
+ vout_window_t* m_pWnd;
- /// original width and height
- int original_width;
- int original_height;
+ /// original width and height
+ int original_width;
+ int original_height;
- /// fulscreen mode indicator
- bool m_bFullscreen;
+ /// fulscreen mode indicator
+ bool m_bFullscreen;
- /// VideoControl attached to it
- CtrlVideo* m_pCtrlVideo;
+ /// VideoControl attached to it
+ CtrlVideo* m_pCtrlVideo;
- /// Parent Window
- GenericWindow* m_pParentWindow;
+ /// Parent Window
+ GenericWindow* m_pParentWindow;
};
typedef CountedPtr<VoutWindow> VoutWindowPtr;
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WINDOW_MANAGER_HPP
/// Window manager for skin windows
class WindowManager: public SkinObject
{
- public:
- /// Direction of the resizing
- enum Direction_t
- {
- kResizeE, // East
- kResizeSE, // South-East
- kResizeS, // South
- kNone // Reserved for internal use
- };
+public:
+ /// Direction of the resizing
+ enum Direction_t
+ {
+ kResizeE, // East
+ kResizeSE, // South-East
+ kResizeS, // South
+ kNone // Reserved for internal use
+ };
+ WindowManager( intf_thread_t *pIntf );
+ virtual ~WindowManager();
- /// Constructor
- WindowManager( intf_thread_t *pIntf);
+ /**
+ * Add a window to the list of known windows. Necessary if you want
+ * your window to be movable...
+ */
+ void registerWindow( TopWindow &rWindow );
- /// Destructor
- virtual ~WindowManager();
+ /// Remove a previously registered window
+ void unregisterWindow( TopWindow &rWindow );
- /**
- * Add a window to the list of known windows. Necessary if you want
- * your window to be movable...
- */
- void registerWindow( TopWindow &rWindow );
+ /// Tell the window manager that a move is initiated for rWindow
+ void startMove( TopWindow &rWindow );
- /// Remove a previously registered window
- void unregisterWindow( TopWindow &rWindow );
+ /// Tell the window manager that the current move ended
+ void stopMove();
- /// Tell the window manager that a move is initiated for rWindow
- void startMove( TopWindow &rWindow );
-
- /// Tell the window manager that the current move ended
- void stopMove();
-
- /**
- * Move the rWindow window to (left, top), and move all its
- * anchored windows.
- * If a new anchoring is detected, the windows will move accordingly.
- */
- void move( TopWindow &rWindow, int left, int top ) const;
-
- /// Tell the window manager that a resize is initiated for rLayout
- void startResize( GenericLayout &rLayout, Direction_t direction );
-
- /// Tell the window manager that the current resizing ended
- void stopResize();
-
- /**
- * Resize the rLayout layout to (width, height), and move all its
- * anchored windows, if some anchors are moved during the resizing.
- * If a new anchoring is detected, the windows will move (or resize)
- * accordingly.
- */
- void resize( GenericLayout &rLayout, int width, int height ) const;
-
- /// Maximize the given window
- void maximize( TopWindow &rWindow );
-
- /// Unmaximize the given window
- void unmaximize( TopWindow &rWindow );
-
- /// Raise all the registered windows
- void raiseAll() const;
-
- /// Show all the registered windows
- void showAll( bool firstTime = false ) const;
-
- /// Hide all the registered windows
- void hideAll() const;
-
- /// Synchronize the windows with their visibility variable
- void synchVisibility() const;
-
- /// Save the current visibility of the windows
- void saveVisibility();
-
- /// Restore the saved visibility of the windows
- void restoreVisibility() const;
-
- /// Raise the given window
- void raise( TopWindow &rWindow ) const { rWindow.raise(); }
-
- /// Show the given window
- void show( TopWindow &rWindow ) const { rWindow.show(); }
-
- /// Hide the given window
- void hide( TopWindow &rWindow ) const { rWindow.hide(); }
-
- /// Toggle all the windows on top
- void toggleOnTop();
-
- /// Set the magnetism of screen edges
- void setMagnetValue( int magnet ) { m_magnet = magnet; }
-
- /// Set the alpha value of the static windows
- void setAlphaValue( int alpha ) { m_alpha = alpha; }
-
- /// Set the alpha value of the moving windows
- void setMoveAlphaValue( int moveAlpha ) { m_moveAlpha = moveAlpha; }
-
- /// Create the tooltip window
- void createTooltip( const GenericFont &rTipFont );
-
- /// Show the tooltip window
- void showTooltip();
-
- /// Hide the tooltip window
- void hideTooltip();
-
- /// Add a layout of the given window. This new layout will be the
- /// active one.
- void addLayout( TopWindow &rWindow, GenericLayout &rLayout );
-
- /// Change the active layout of the given window
- void setActiveLayout( TopWindow &rWindow, GenericLayout &rLayout );
-
- /// Mark the given popup as active
- void setActivePopup( Popup &rPopup ) { m_pPopup = &rPopup; }
-
- /// Return the active popup, or NULL if none is active
- Popup * getActivePopup() const { return m_pPopup; }
-
- private:
- /// Some useful typedefs for lazy people like me
- typedef set<TopWindow*> WinSet_t;
- typedef list<Anchor*> AncList_t;
-
- /// Dependencies map
- /**
- * This map represents the graph of anchored windows: it associates
- * to a given window all the windows that are directly anchored by it.
- * This is not transitive, i.e. if a is in m_dep[b] and if b is in
- * m_dep[c], it doesn't mean that a is in m_dep[c] (in fact, it
- * would be extremely rare...)
- */
- map<TopWindow*, WinSet_t> m_dependencies;
- /// Store all the windows
- WinSet_t m_allWindows;
- /**
- * Store the windows that were visible when saveVisibility() was
- * last called.
- */
- WinSet_t m_savedWindows;
- /// Store the moving windows
- /**
- * This set is updated at every start of move.
- */
- WinSet_t m_movingWindows;
- /**
- * Store the moving windows in the context of resizing
- * These sets are updated at every start of move
- */
- //@{
- WinSet_t m_resizeMovingE;
- WinSet_t m_resizeMovingS;
- WinSet_t m_resizeMovingSE;
- //@}
- /// Indicate whether the windows are currently on top
- VariablePtr m_cVarOnTop;
- /// Magnetism of the screen edges (= scope of action)
- int m_magnet;
- /// Alpha value of the static windows
- int m_alpha;
- /// Alpha value of the moving windows
- int m_moveAlpha;
- /// Direction of the current resizing
- Direction_t m_direction;
- /// Rect of the last maximized window
- SkinsRect m_maximizeRect;
- /// Tooltip
- Tooltip *m_pTooltip;
- /// Active popup, if any
- Popup *m_pPopup;
-
- /// Recursively build a set of windows anchored to the one given.
- void buildDependSet( WinSet_t &rWinSet, TopWindow *pWindow );
-
- /// Check anchoring
- /**
- * This function updates xOffset and yOffset, to take care of a new
- * anchoring (if any)
- */
- void checkAnchors( TopWindow *pWindow,
- int &xOffset, int &yOffset ) const;
+ /**
+ * Move the rWindow window to (left, top), and move all its
+ * anchored windows.
+ * If a new anchoring is detected, the windows will move accordingly.
+ */
+ void move( TopWindow &rWindow, int left, int top ) const;
+
+ /// Tell the window manager that a resize is initiated for rLayout
+ void startResize( GenericLayout &rLayout, Direction_t direction );
+
+ /// Tell the window manager that the current resizing ended
+ void stopResize();
+
+ /**
+ * Resize the rLayout layout to (width, height), and move all its
+ * anchored windows, if some anchors are moved during the resizing.
+ * If a new anchoring is detected, the windows will move (or resize)
+ * accordingly.
+ */
+ void resize( GenericLayout &rLayout, int width, int height ) const;
+
+ /// Maximize the given window
+ void maximize( TopWindow &rWindow );
+
+ /// Unmaximize the given window
+ void unmaximize( TopWindow &rWindow );
+
+ /// Raise all the registered windows
+ void raiseAll() const;
+
+ /// Show all the registered windows
+ void showAll( bool firstTime = false ) const;
+
+ /// Hide all the registered windows
+ void hideAll() const;
+
+ /// Synchronize the windows with their visibility variable
+ void synchVisibility() const;
+
+ /// Save the current visibility of the windows
+ void saveVisibility();
+
+ /// Restore the saved visibility of the windows
+ void restoreVisibility() const;
+
+ /// Raise the given window
+ void raise( TopWindow &rWindow ) const { rWindow.raise(); }
+
+ /// Show the given window
+ void show( TopWindow &rWindow ) const { rWindow.show(); }
+
+ /// Hide the given window
+ void hide( TopWindow &rWindow ) const { rWindow.hide(); }
+
+ /// Toggle all the windows on top
+ void toggleOnTop();
+
+ /// Set the magnetism of screen edges
+ void setMagnetValue( int magnet ) { m_magnet = magnet; }
+
+ /// Set the alpha value of the static windows
+ void setAlphaValue( int alpha ) { m_alpha = alpha; }
+
+ /// Set the alpha value of the moving windows
+ void setMoveAlphaValue( int moveAlpha ) { m_moveAlpha = moveAlpha; }
+
+ /// Create the tooltip window
+ void createTooltip( const GenericFont &rTipFont );
+
+ /// Show the tooltip window
+ void showTooltip();
+
+ /// Hide the tooltip window
+ void hideTooltip();
+
+ /// Add a layout of the given window. This new layout will be the
+ /// active one.
+ void addLayout( TopWindow &rWindow, GenericLayout &rLayout );
+
+ /// Change the active layout of the given window
+ void setActiveLayout( TopWindow &rWindow, GenericLayout &rLayout );
+
+ /// Mark the given popup as active
+ void setActivePopup( Popup &rPopup ) { m_pPopup = &rPopup; }
+
+ /// Return the active popup, or NULL if none is active
+ Popup * getActivePopup() const { return m_pPopup; }
+
+private:
+ /// Some useful typedefs for lazy people like me
+ typedef set<TopWindow*> WinSet_t;
+ typedef list<Anchor*> AncList_t;
+
+ /// Dependencies map
+ /**
+ * This map represents the graph of anchored windows: it associates
+ * to a given window all the windows that are directly anchored by it.
+ * This is not transitive, i.e. if a is in m_dep[b] and if b is in
+ * m_dep[c], it doesn't mean that a is in m_dep[c] (in fact, it
+ * would be extremely rare...)
+ */
+ map<TopWindow*, WinSet_t> m_dependencies;
+ /// Store all the windows
+ WinSet_t m_allWindows;
+ /**
+ * Store the windows that were visible when saveVisibility() was
+ * last called.
+ */
+ WinSet_t m_savedWindows;
+ /// Store the moving windows
+ /**
+ * This set is updated at every start of move.
+ */
+ WinSet_t m_movingWindows;
+ /**
+ * Store the moving windows in the context of resizing
+ * These sets are updated at every start of move
+ */
+ //@{
+ WinSet_t m_resizeMovingE;
+ WinSet_t m_resizeMovingS;
+ WinSet_t m_resizeMovingSE;
+ //@}
+ /// Indicate whether the windows are currently on top
+ VariablePtr m_cVarOnTop;
+ /// Magnetism of the screen edges (= scope of action)
+ int m_magnet;
+ /// Alpha value of the static windows
+ int m_alpha;
+ /// Alpha value of the moving windows
+ int m_moveAlpha;
+ /// Direction of the current resizing
+ Direction_t m_direction;
+ /// Rect of the last maximized window
+ SkinsRect m_maximizeRect;
+ /// Tooltip
+ Tooltip *m_pTooltip;
+ /// Active popup, if any
+ Popup *m_pPopup;
+
+ /// Recursively build a set of windows anchored to the one given.
+ void buildDependSet( WinSet_t &rWinSet, TopWindow *pWindow );
+
+ /// Check anchoring
+ /**
+ * This function updates xOffset and yOffset, to take care of a new
+ * anchoring (if any)
+ */
+ void checkAnchors( TopWindow *pWindow, int &xOffset, int &yOffset ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef BEZIER_HPP
/// Class for Bezier curves
class Bezier: public SkinObject
{
- public:
- /// Values to indicate which coordinate(s) must be checked to consider
- /// that two points are distinct
- enum Flag_t
- {
- kCoordsBoth, // x or y must be different (default)
- kCoordsX, // only x is different
- kCoordsY // only y is different
- };
-
- Bezier( intf_thread_t *p_intf,
- const vector<float> &pAbscissas,
- const vector<float> &pOrdinates,
- Flag_t flag = kCoordsBoth );
- ~Bezier() {}
-
- /// Get the number of control points used to define the curve
- int getNbCtrlPoints() const { return m_nbCtrlPt; }
-
- /// Return the percentage (between 0 and 1) of the curve point nearest
- /// from (x, y)
- float getNearestPercent( int x, int y ) const;
-
- /// Return the distance of (x, y) to the curve, corrected
- /// by the (optional) given scale factors
- float getMinDist( int x, int y, float xScale = 1.0f,
- float yScale = 1.0f ) const;
-
- /// Get the coordinates of the point at t percent of
- /// the curve (t must be between 0 and 1)
- void getPoint( float t, int &x, int &y ) const;
-
- /// Get the width (maximum abscissa) of the curve
- int getWidth() const;
-
- /// Get the height (maximum ordinate) of the curve
- int getHeight() const;
-
- private:
- /// Number of control points
- int m_nbCtrlPt;
- /// vectors containing the coordinates of the control points
- vector<float> m_ptx;
- vector<float> m_pty;
- /// Vector containing precalculated factoriels
- vector<float> m_ft;
-
- /// Number of points (=pixels) used by the curve
- int m_nbPoints;
- /// Vectors with the coordinates of the different points of the curve
- vector<int> m_leftVect;
- vector<int> m_topVect;
- /// Vector with the percentages associated with the points of the curve
- vector<float> m_percVect;
-
- /// Return the index of the curve point that is the nearest from (x, y)
- int findNearestPoint( int x, int y ) const;
- /// Compute the coordinates of a point corresponding to a given
- /// percentage
- void computePoint( float t, int &x, int &y ) const;
- /// Helper function to compute a coefficient of the curve
- inline float computeCoeff( int i, int n, float t ) const;
- /// x^n
- inline float power( float x, int n ) const;
+public:
+ /// Values to indicate which coordinate(s) must be checked to consider
+ /// that two points are distinct
+ enum Flag_t
+ {
+ kCoordsBoth, // x or y must be different (default)
+ kCoordsX, // only x is different
+ kCoordsY // only y is different
+ };
+
+ Bezier( intf_thread_t *p_intf,
+ const vector<float> &pAbscissas,
+ const vector<float> &pOrdinates,
+ Flag_t flag = kCoordsBoth );
+ ~Bezier() { }
+
+ /// Get the number of control points used to define the curve
+ int getNbCtrlPoints() const { return m_nbCtrlPt; }
+
+ /// Return the percentage (between 0 and 1) of the curve point nearest
+ /// from (x, y)
+ float getNearestPercent( int x, int y ) const;
+
+ /// Return the distance of (x, y) to the curve, corrected
+ /// by the (optional) given scale factors
+ float getMinDist( int x, int y, float xScale = 1.0f,
+ float yScale = 1.0f ) const;
+
+ /// Get the coordinates of the point at t percent of
+ /// the curve (t must be between 0 and 1)
+ void getPoint( float t, int &x, int &y ) const;
+
+ /// Get the width (maximum abscissa) of the curve
+ int getWidth() const;
+
+ /// Get the height (maximum ordinate) of the curve
+ int getHeight() const;
+
+private:
+ /// Number of control points
+ int m_nbCtrlPt;
+ /// vectors containing the coordinates of the control points
+ vector<float> m_ptx;
+ vector<float> m_pty;
+ /// Vector containing precalculated factoriels
+ vector<float> m_ft;
+
+ /// Number of points (=pixels) used by the curve
+ int m_nbPoints;
+ /// Vectors with the coordinates of the different points of the curve
+ vector<int> m_leftVect;
+ vector<int> m_topVect;
+ /// Vector with the percentages associated with the points of the curve
+ vector<float> m_percVect;
+
+ /// Return the index of the curve point that is the nearest from (x, y)
+ int findNearestPoint( int x, int y ) const;
+ /// Compute the coordinates of a point corresponding to a given
+ /// percentage
+ void computePoint( float t, int &x, int &y ) const;
+ /// Helper function to compute a coefficient of the curve
+ inline float computeCoeff( int i, int n, float t ) const;
+ /// x^n
+ inline float power( float x, int n ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef FSM_HPP
/// This class implements a Finite State Machine (FSM)
class FSM: public SkinObject
{
- public:
- FSM( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
- virtual ~FSM() {}
+public:
+ FSM( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
+ virtual ~FSM() { }
- /// Add a state to the machine
- void addState( const string &state );
+ /// Add a state to the machine
+ void addState( const string &state );
- /// Add a transition to the machine
- void addTransition( const string &state1, const string &event,
- const string &state2,
- CmdGeneric *pCmd = NULL );
+ /// Add a transition to the machine
+ void addTransition( const string &state1, const string &event,
+ const string &state2,
+ CmdGeneric *pCmd = NULL );
- /// Retrieve the current state
- const string &getState() const { return m_currentState; }
+ /// Retrieve the current state
+ const string &getState() const { return m_currentState; }
- /// Set the current state, without bothering about transitions
- void setState( const string &state );
+ /// Set the current state, without bothering about transitions
+ void setState( const string &state );
- /// Find a transition from the current state with the input event,
- /// change the state, and call the associated callback (if any).
- void handleTransition( const string &event );
+ /// Find a transition from the current state with the input event,
+ /// change the state, and call the associated callback (if any).
+ void handleTransition( const string &event );
- private:
- /// A Key_t contains the initial state of a transition, and a string
- /// characterizing an event (for example: "mouse:left:down:ctrl")
- typedef pair<string, string> Key_t;
+private:
+ /// A Key_t contains the initial state of a transition, and a string
+ /// characterizing an event (for example: "mouse:left:down:ctrl")
+ typedef pair<string, string> Key_t;
- /// A Data_t contains the final state of a transition, and a callback
- /// to execute when the transition is applied
- typedef pair<string, CmdGeneric*> Data_t;
+ /// A Data_t contains the final state of a transition, and a callback
+ /// to execute when the transition is applied
+ typedef pair<string, CmdGeneric*> Data_t;
- /// Current state of the machine
- string m_currentState;
+ /// Current state of the machine
+ string m_currentState;
- /// Set containing the different states
- set<string> m_states;
+ /// Set containing the different states
+ set<string> m_states;
- /// Map containing the different transitions between defined types
- /// It associates a final state (and potentially a callback)
- /// with a couple of the form: (currentState, triggerEvent)
- map<Key_t, Data_t> m_transitions;
+ /// Map containing the different transitions between defined types
+ /// It associates a final state (and potentially a callback)
+ /// with a couple of the form: (currentState, triggerEvent)
+ map<Key_t, Data_t> m_transitions;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef OBSERVER_HPP
/// Template for subjects in the Observer design pattern
template <class S, class ARG = void> class Subject
{
- public:
- virtual ~Subject() {}
-
- /// Remove all observers; should only be used for debugging purposes
- virtual void clearObservers()
- {
- m_observers.clear();
- }
-
- /// Add an observer to this subject
- /// Note: adding twice the same observer is not harmful
- virtual void addObserver( Observer<S, ARG>* pObserver )
- {
- m_observers.insert( pObserver );
- }
-
- /// Remove an observer from this subject
- /// Note: removing twice the same observer is not harmful
- virtual void delObserver( Observer<S, ARG>* pObserver )
- {
- m_observers.erase( pObserver );
- }
-
- /// Notify the observers when the status has changed
- virtual void notify( ARG *arg )
+public:
+ virtual ~Subject() { }
+
+ /// Remove all observers; should only be used for debugging purposes
+ virtual void clearObservers()
+ {
+ m_observers.clear();
+ }
+
+ /// Add an observer to this subject
+ /// Note: adding twice the same observer is not harmful
+ virtual void addObserver( Observer<S, ARG>* pObserver )
+ {
+ m_observers.insert( pObserver );
+ }
+
+ /// Remove an observer from this subject
+ /// Note: removing twice the same observer is not harmful
+ virtual void delObserver( Observer<S, ARG>* pObserver )
+ {
+ m_observers.erase( pObserver );
+ }
+
+ /// Notify the observers when the status has changed
+ virtual void notify( ARG *arg )
+ {
+ // This stupid gcc 3.2 needs "typename"
+ typename set<Observer<S, ARG>*>::const_iterator iter;
+ for( iter = m_observers.begin(); iter != m_observers.end();
+ iter++ )
{
- // This stupid gcc 3.2 needs "typename"
- typename set<Observer<S, ARG>*>::const_iterator iter;
- for( iter = m_observers.begin(); iter != m_observers.end();
- iter++ )
+ if( *iter == NULL )
{
- if( *iter == NULL )
- {
- fprintf( stderr, "iter NULL !\n" );
- return;
- }
- (*iter)->onUpdate( *this , arg );
+ fprintf( stderr, "iter NULL !\n" );
+ return;
}
+ (*iter)->onUpdate( *this , arg );
}
+ }
- /// Notify without any argument
- virtual void notify() { notify( NULL ); }
+ /// Notify without any argument
+ virtual void notify() { notify( NULL ); }
- protected:
- Subject() {}
+protected:
+ Subject() { }
- private:
- /// Set of observers for this subject
- set<Observer<S, ARG>*> m_observers;
+private:
+ /// Set of observers for this subject
+ set<Observer<S, ARG>*> m_observers;
};
/// Template for observers in the Observer design pattern
template <class S, class ARG = void> class Observer
{
- public:
- virtual ~Observer() {}
+public:
+ virtual ~Observer() { }
- /// Method called when the subject is modified
- virtual void onUpdate( Subject<S, ARG> &rSubject, ARG *arg) = 0;
+ /// Method called when the subject is modified
+ virtual void onUpdate( Subject<S, ARG> &rSubject, ARG *arg) = 0;
- protected:
- Observer() {}
+protected:
+ Observer() { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef POINTER_HPP
/// Reference couting pointer
template <class T> class CountedPtr
{
- public:
- explicit CountedPtr( T *pPtr = 0 ): m_pCounter( 0 )
- {
- if( pPtr ) m_pCounter = new Counter( pPtr );
- }
+public:
+ explicit CountedPtr( T *pPtr = 0 ): m_pCounter( 0 )
+ {
+ if( pPtr ) m_pCounter = new Counter( pPtr );
+ }
- ~CountedPtr() { release(); }
+ ~CountedPtr() { release(); }
- CountedPtr(const CountedPtr &rPtr ) { acquire( rPtr.m_pCounter ); }
+ CountedPtr(const CountedPtr &rPtr ) { acquire( rPtr.m_pCounter ); }
- CountedPtr &operator=( const CountedPtr &rPtr )
+ CountedPtr &operator=( const CountedPtr &rPtr )
+ {
+ if( this != &rPtr )
{
- if( this != &rPtr )
- {
- release();
- acquire( rPtr.m_pCounter );
- }
- return *this;
+ release();
+ acquire( rPtr.m_pCounter );
}
+ return *this;
+ }
- T &operator*() const { return *m_pCounter->m_pPtr; }
+ T &operator*() const { return *m_pCounter->m_pPtr; }
- T *operator->() const {return m_pCounter->m_pPtr; }
+ T *operator->() const {return m_pCounter->m_pPtr; }
- T *get() const { return m_pCounter ? m_pCounter->m_pPtr : 0; }
+ T *get() const { return m_pCounter ? m_pCounter->m_pPtr : 0; }
- bool unique() const
- {
- return ( m_pCounter ? m_pCounter->m_count == 1 : true );
- }
+ bool unique() const
+ {
+ return ( m_pCounter ? m_pCounter->m_count == 1 : true );
+ }
- private:
- struct Counter
- {
- Counter( T* pPtr = 0, unsigned int c = 1 ):
- m_pPtr( pPtr ), m_count( c ) {}
- T* m_pPtr;
- unsigned int m_count;
- } *m_pCounter;
+private:
+ struct Counter
+ {
+ Counter( T* pPtr = 0, unsigned int c = 1 )
+ : m_pPtr( pPtr ), m_count( c ) { }
+ T* m_pPtr;
+ unsigned int m_count;
+ } *m_pCounter;
- void acquire( Counter* pCount )
- {
- m_pCounter = pCount;
- if( pCount ) ++pCount->m_count;
- }
+ void acquire( Counter* pCount )
+ {
+ m_pCounter = pCount;
+ if( pCount ) ++pCount->m_count;
+ }
- void release()
+ void release()
+ {
+ if( m_pCounter )
{
- if( m_pCounter )
+ if( --m_pCounter->m_count == 0 )
{
- if( --m_pCounter->m_count == 0 )
- {
- delete m_pCounter->m_pPtr;
- delete m_pCounter;
- }
- m_pCounter = 0;
+ delete m_pCounter->m_pPtr;
+ delete m_pCounter;
}
+ m_pCounter = 0;
}
+ }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef POSITION_HPP
/// Interface for rectangular objects
class Box
{
- public:
- virtual ~Box() {}
+public:
+ virtual ~Box() { }
- /// Get the size of the box
- virtual int getWidth() const = 0;
- virtual int getHeight() const = 0;
+ /// Get the size of the box
+ virtual int getWidth() const = 0;
+ virtual int getHeight() const = 0;
};
/// Interface for rectangular objects with a position
class GenericRect: public Box
{
- public:
- virtual int getLeft() const = 0;
- virtual int getTop() const = 0;
+public:
+ virtual int getLeft() const = 0;
+ virtual int getTop() const = 0;
};
/// Characterization of a rectangle
class SkinsRect: public GenericRect
{
- public:
- SkinsRect( int left, int top, int right, int bottom );
-
- virtual int getLeft() const { return m_left; }
- virtual int getTop() const { return m_top; }
- virtual int getRight() const { return m_right; }
- virtual int getBottom() const { return m_bottom; }
- virtual int getWidth() const { return m_right - m_left; }
- virtual int getHeight() const { return m_bottom - m_top; }
-
- private:
- int m_left;
- int m_top;
- int m_right;
- int m_bottom;
+public:
+ SkinsRect( int left, int top, int right, int bottom );
+
+ virtual int getLeft() const { return m_left; }
+ virtual int getTop() const { return m_top; }
+ virtual int getRight() const { return m_right; }
+ virtual int getBottom() const { return m_bottom; }
+ virtual int getWidth() const { return m_right - m_left; }
+ virtual int getHeight() const { return m_bottom - m_top; }
+
+private:
+ int m_left;
+ int m_top;
+ int m_right;
+ int m_bottom;
};
/// Relative position of a rectangle in a box
/**
* Note: Even if the object is tied to its direct container rectangle, the
- * coordinates returned by getLeft(), getTop(), getRight() and getBottom() are
- * not relative to the direct container (which is usually a panel or the layout)
- * but to the root container (i.e. the layout).
+ * coordinates returned by getLeft(), getTop(), getRight() and getBottom()
+ * are not relative to the direct container (which is usually a panel or
+ * the layout) but to the root container (i.e. the layout).
*/
class Position: public GenericRect
{
- public:
- /// Type for reference edge/corner
- enum Ref_t
- {
- /// Coordinates are relative to the upper left corner
- kLeftTop,
- /// Coordinates are relative to the upper right corner
- kRightTop,
- /// Coordinates are relative to the lower left corner
- kLeftBottom,
- /// Coordinates are relative to the lower right corner
- kRightBottom
- };
-
- /// Create a new position relative to the given box
- Position( int left, int top, int right, int bottom,
- const GenericRect &rRect,
- Ref_t refLeftTop, Ref_t refRightBottom,
- bool xKeepRatio, bool yKeepRatio );
-
- ~Position() {}
-
- /// Get the position relative to the left top corner of the box
- virtual int getLeft() const;
- virtual int getTop() const;
- int getRight() const;
- int getBottom() const;
- /// Get the size of the rectangle
- virtual int getWidth() const;
- virtual int getHeight() const;
- /// Get the reference corners
- Ref_t getRefLeftTop() const { return m_refLeftTop; }
- Ref_t getRefRightBottom() const { return m_refRighBottom; }
-
- private:
- /// Position and reference edge/corner
- int m_left;
- int m_top;
- int m_right;
- int m_bottom;
- const GenericRect &m_rRect;
- Ref_t m_refLeftTop;
- Ref_t m_refRighBottom;
- /// "Keep ratio" mode
- bool m_xKeepRatio;
- bool m_yKeepRatio;
- /// Initial width ratio (usually between 0 and 1)
- double m_xRatio;
- /// Initial height ratio (usually between 0 and 1)
- double m_yRatio;
+public:
+ /// Type for reference edge/corner
+ enum Ref_t
+ {
+ /// Coordinates are relative to the upper left corner
+ kLeftTop,
+ /// Coordinates are relative to the upper right corner
+ kRightTop,
+ /// Coordinates are relative to the lower left corner
+ kLeftBottom,
+ /// Coordinates are relative to the lower right corner
+ kRightBottom
+ };
+
+ /// Create a new position relative to the given box
+ Position( int left, int top, int right, int bottom,
+ const GenericRect &rRect,
+ Ref_t refLeftTop, Ref_t refRightBottom,
+ bool xKeepRatio, bool yKeepRatio );
+
+ ~Position() { }
+
+ /// Get the position relative to the left top corner of the box
+ virtual int getLeft() const;
+ virtual int getTop() const;
+ int getRight() const;
+ int getBottom() const;
+ /// Get the size of the rectangle
+ virtual int getWidth() const;
+ virtual int getHeight() const;
+ /// Get the reference corners
+ Ref_t getRefLeftTop() const { return m_refLeftTop; }
+ Ref_t getRefRightBottom() const { return m_refRighBottom; }
+
+private:
+ /// Position and reference edge/corner
+ int m_left;
+ int m_top;
+ int m_right;
+ int m_bottom;
+ const GenericRect &m_rRect;
+ Ref_t m_refLeftTop;
+ Ref_t m_refRighBottom;
+ /// "Keep ratio" mode
+ bool m_xKeepRatio;
+ bool m_yKeepRatio;
+ /// Initial width ratio (usually between 0 and 1)
+ double m_xRatio;
+ /// Initial height ratio (usually between 0 and 1)
+ double m_yRatio;
};
typedef CountedPtr<Position> PositionPtr;
/// Variable implementing the Box interface
class VarBox: public Variable, public Box, public Subject<VarBox>
{
- public:
- VarBox( intf_thread_t *pIntf, int width = 0, int height = 0 );
+public:
+ VarBox( intf_thread_t *pIntf, int width = 0, int height = 0 );
- virtual ~VarBox() {}
+ virtual ~VarBox() { }
- /// Get the variable type
- virtual const string &getType() const { return m_type; }
+ /// Get the variable type
+ virtual const string &getType() const { return m_type; }
- /// Get the size of the box
- virtual int getWidth() const;
- virtual int getHeight() const;
+ /// Get the size of the box
+ virtual int getWidth() const;
+ virtual int getHeight() const;
- /// Change the size of the box
- void setSize( int width, int height );
+ /// Change the size of the box
+ void setSize( int width, int height );
- private:
- /// Variable type
- static const string m_type;
- /// Size
- int m_width, m_height;
+private:
+ /// Variable type
+ static const string m_type;
+ /// Size
+ int m_width, m_height;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef USTRING_HPP
// Class for UNICODE strings handling
class UString: public SkinObject
{
- public:
- static const uint32_t npos;
-
- /// Copy constructor
- UString( const UString &rOther );
-
- /// Create a new unicode string from an UTF8 string
- UString( intf_thread_t *pIntf, const char *pString );
-
- ~UString();
-
- /// Get the unicode string
- const uint32_t *u_str() const { return m_pString; }
-
- /// Get the length of the string
- uint32_t length() const { return m_length; }
- uint32_t size() const { return m_length; }
-
- /// Comparison
- bool operator ==( const UString &rOther ) const;
- bool operator !=( const UString &rOther ) const;
- bool operator <( const UString &rOther ) const;
- bool operator <=( const UString &rOther ) const;
- bool operator >( const UString &rOther ) const;
- bool operator >=( const UString &rOther ) const;
- /// Assignment
- UString& operator =( const UString &rOther );
- /// Concatenation with assignment
- UString& operator +=( const UString &rOther );
- /// Concatenation
- const UString operator +( const UString &rOther ) const;
- const UString operator +( const char *pString ) const;
-
-
- /// Search for the first occurance of the substring specified by str
- /// in this string, starting at position. If found, it returns the
- /// index of the first character of the matching substring. If not
- /// found, it returns npos
- uint32_t find( const UString &str, uint32_t position = 0 ) const;
- uint32_t find( const char *pString, uint32_t position = 0 ) const;
-
- /// Insert elements of str in place of n1 elements in this string,
- /// starting at position position
- void replace( uint32_t position, uint32_t n1, const UString &str );
- void replace( uint32_t position, uint32_t n1, const char *pString );
-
- /// Returns a string composed of copies of the lesser of n and size()
- /// characters in this string starting at index position
- UString substr( uint32_t position = 0, uint32_t n = npos) const;
-
- /// Build a string from an integer
- static UString fromInt(intf_thread_t *pIntf, int number);
-
- private:
- /// Unicode string
- uint32_t *m_pString;
- /// String length
- uint32_t m_length;
+public:
+ static const uint32_t npos;
+
+ /// Copy constructor
+ UString( const UString &rOther );
+
+ /// Create a new unicode string from an UTF8 string
+ UString( intf_thread_t *pIntf, const char *pString );
+
+ ~UString();
+
+ /// Get the unicode string
+ const uint32_t *u_str() const { return m_pString; }
+
+ /// Get the length of the string
+ uint32_t length() const { return m_length; }
+ uint32_t size() const { return m_length; }
+
+ /// Comparison
+ bool operator ==( const UString &rOther ) const;
+ bool operator !=( const UString &rOther ) const;
+ bool operator <( const UString &rOther ) const;
+ bool operator <=( const UString &rOther ) const;
+ bool operator >( const UString &rOther ) const;
+ bool operator >=( const UString &rOther ) const;
+ /// Assignment
+ UString& operator =( const UString &rOther );
+ /// Concatenation with assignment
+ UString& operator +=( const UString &rOther );
+ /// Concatenation
+ const UString operator +( const UString &rOther ) const;
+ const UString operator +( const char *pString ) const;
+
+
+ /// Search for the first occurance of the substring specified by str
+ /// in this string, starting at position. If found, it returns the
+ /// index of the first character of the matching substring. If not
+ /// found, it returns npos
+ uint32_t find( const UString &str, uint32_t position = 0 ) const;
+ uint32_t find( const char *pString, uint32_t position = 0 ) const;
+
+ /// Insert elements of str in place of n1 elements in this string,
+ /// starting at position position
+ void replace( uint32_t position, uint32_t n1, const UString &str );
+ void replace( uint32_t position, uint32_t n1, const char *pString );
+
+ /// Returns a string composed of copies of the lesser of n and size()
+ /// characters in this string starting at index position
+ UString substr( uint32_t position = 0, uint32_t n = npos) const;
+
+ /// Build a string from an integer
+ static UString fromInt(intf_thread_t *pIntf, int number);
+
+private:
+ /// Unicode string
+ uint32_t *m_pString;
+ /// String length
+ uint32_t m_length;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VAR_BOOL_HPP
/// Interface for read-only boolean variable
class VarBool: public Variable, public Subject<VarBool>
{
- public:
- /// Get the variable type
- virtual const string &getType() const { return m_type; }
+public:
+ /// Get the variable type
+ virtual const string &getType() const { return m_type; }
- /// Get the boolean value
- virtual bool get() const = 0;
+ /// Get the boolean value
+ virtual bool get() const = 0;
- protected:
- VarBool( intf_thread_t *pIntf ): Variable( pIntf ) {}
- virtual ~VarBool() {}
+protected:
+ VarBool( intf_thread_t *pIntf ): Variable( pIntf ) { }
+ virtual ~VarBool() { }
- private:
- /// Variable type
- static const string m_type;
+private:
+ /// Variable type
+ static const string m_type;
};
/// Constant true VarBool
class VarBoolTrue: public VarBool
{
- public:
- VarBoolTrue( intf_thread_t *pIntf ): VarBool( pIntf ) {}
- virtual ~VarBoolTrue() {}
- virtual bool get() const { return true; }
+public:
+ VarBoolTrue( intf_thread_t *pIntf ): VarBool( pIntf ) { }
+ virtual ~VarBoolTrue() { }
+ virtual bool get() const { return true; }
};
/// Constant false VarBool
class VarBoolFalse: public VarBool
{
- public:
- VarBoolFalse( intf_thread_t *pIntf ): VarBool( pIntf ) {}
- virtual ~VarBoolFalse() {}
- virtual bool get() const { return false; }
+public:
+ VarBoolFalse( intf_thread_t *pIntf ): VarBool( pIntf ) { }
+ virtual ~VarBoolFalse() { }
+ virtual bool get() const { return false; }
};
/// Boolean variable implementation (read/write)
class VarBoolImpl: public VarBool
{
- public:
- VarBoolImpl( intf_thread_t *pIntf );
- virtual ~VarBoolImpl() {}
+public:
+ VarBoolImpl( intf_thread_t *pIntf );
+ virtual ~VarBoolImpl() { }
- // Get the boolean value
- virtual bool get() const { return m_value; }
+ // Get the boolean value
+ virtual bool get() const { return m_value; }
- /// Set the internal value
- virtual void set( bool value );
+ /// Set the internal value
+ virtual void set( bool value );
- private:
- /// Boolean value
- bool m_value;
+private:
+ /// Boolean value
+ bool m_value;
};
/// Conjunction of two boolean variables (AND)
class VarBoolAndBool: public VarBool, public Observer<VarBool>
{
- public:
- VarBoolAndBool( intf_thread_t *pIntf, VarBool &rVar1, VarBool &rVar2 );
- virtual ~VarBoolAndBool();
+public:
+ VarBoolAndBool( intf_thread_t *pIntf, VarBool &rVar1, VarBool &rVar2 );
+ virtual ~VarBoolAndBool();
+ virtual bool get() const { return m_rVar1.get() && m_rVar2.get(); }
- // Get the boolean value
- virtual bool get() const { return m_rVar1.get() && m_rVar2.get(); }
+ // Called when one of the observed variables is changed
+ void onUpdate( Subject<VarBool> &rVariable, void* );
- // Called when one of the observed variables is changed
- void onUpdate( Subject<VarBool> &rVariable, void* );
-
- private:
- /// Boolean variables
- VarBool &m_rVar1, &m_rVar2;
+private:
+ /// Boolean variables
+ VarBool &m_rVar1, &m_rVar2;
};
/// Disjunction of two boolean variables (OR)
class VarBoolOrBool: public VarBool, public Observer<VarBool>
{
- public:
- VarBoolOrBool( intf_thread_t *pIntf, VarBool &rVar1, VarBool &rVar2 );
- virtual ~VarBoolOrBool();
-
- // Get the boolean value
- virtual bool get() const { return m_rVar1.get() || m_rVar2.get(); }
+public:
+ VarBoolOrBool( intf_thread_t *pIntf, VarBool &rVar1, VarBool &rVar2 );
+ virtual ~VarBoolOrBool();
+ virtual bool get() const { return m_rVar1.get() || m_rVar2.get(); }
- // Called when one of the observed variables is changed
- void onUpdate( Subject<VarBool> &rVariable, void* );
+ // Called when one of the observed variables is changed
+ void onUpdate( Subject<VarBool> &rVariable, void* );
- private:
- /// Boolean variables
- VarBool &m_rVar1, &m_rVar2;
+private:
+ /// Boolean variables
+ VarBool &m_rVar1, &m_rVar2;
};
/// Negation of a boolean variable (NOT)
class VarNotBool: public VarBool, public Observer<VarBool>
{
- public:
- VarNotBool( intf_thread_t *pIntf, VarBool &rVar );
- virtual ~VarNotBool();
-
- // Get the boolean value
- virtual bool get() const { return !m_rVar.get(); }
+public:
+ VarNotBool( intf_thread_t *pIntf, VarBool &rVar );
+ virtual ~VarNotBool();
+ virtual bool get() const { return !m_rVar.get(); }
- // Called when the observed variable is changed
- void onUpdate( Subject<VarBool> &rVariable, void* );
+ // Called when the observed variable is changed
+ void onUpdate( Subject<VarBool> &rVariable, void* );
- private:
- /// Boolean variable
- VarBool &m_rVar;
+private:
+ /// Boolean variable
+ VarBool &m_rVar;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VAR_LIST_HPP
/// List variable
class VarList: public Variable, public Subject<VarList>
{
- public:
- VarList( intf_thread_t *pIntf );
- virtual ~VarList();
+public:
+ VarList( intf_thread_t *pIntf );
+ virtual ~VarList();
- /// Get the variable type
- virtual const string &getType() const { return m_type; }
+ /// Get the variable type
+ virtual const string &getType() const { return m_type; }
- /// Add a pointer on a string in the list
- virtual void add( const UStringPtr &rcString );
+ /// Add a pointer on a string in the list
+ virtual void add( const UStringPtr &rcString );
- /// Remove the selected elements from the list
- virtual void delSelected();
+ /// Remove the selected elements from the list
+ virtual void delSelected();
- /// Remove all the elements from the list
- virtual void clear();
+ /// Remove all the elements from the list
+ virtual void clear();
- /// Get the number of items in the list
- int size() const { return m_list.size(); }
+ /// Get the number of items in the list
+ int size() const { return m_list.size(); }
- /// Type of an element in the list
- struct Elem_t
- {
- UStringPtr m_cString;
- bool m_selected;
- bool m_playing;
+ /// Type of an element in the list
+ struct Elem_t
+ {
+ UStringPtr m_cString;
+ bool m_selected;
+ bool m_playing;
- Elem_t( const UStringPtr &rcString, bool selected = false, bool
- playing = false ):
- m_cString( rcString ), m_selected( selected ),
- m_playing( playing) {}
- };
+ Elem_t( const UStringPtr &rcString,
+ bool selected = false, bool playing = false )
+ : m_cString( rcString ),
+ m_selected( selected ), m_playing( playing ) { }
+ };
- /// Iterators
- typedef list<Elem_t>::iterator Iterator;
- typedef list<Elem_t>::const_iterator ConstIterator;
+ /// Iterators
+ typedef list<Elem_t>::iterator Iterator;
+ typedef list<Elem_t>::const_iterator ConstIterator;
- /// Beginning of the list
- Iterator begin() { return m_list.begin(); }
- ConstIterator begin() const { return m_list.begin(); }
+ /// Beginning of the list
+ Iterator begin() { return m_list.begin(); }
+ ConstIterator begin() const { return m_list.begin(); }
- /// End of the list
- Iterator end() { return m_list.end(); }
- ConstIterator end() const { return m_list.end(); }
+ /// End of the list
+ Iterator end() { return m_list.end(); }
+ ConstIterator end() const { return m_list.end(); }
- /// Return an iterator on the n'th element of the list
- Iterator operator[]( int n );
- ConstIterator operator[]( int n ) const;
+ /// Return an iterator on the n'th element of the list
+ Iterator operator[]( int n );
+ ConstIterator operator[]( int n ) const;
- /// Execute the action associated to this item
- virtual void action( Elem_t *pItem ) {}
+ /// Execute the action associated to this item
+ virtual void action( Elem_t *pItem ) { }
- /// Get a reference on the position variable
- VarPercent &getPositionVar() const
- { return *((VarPercent*)m_cPosition.get()); }
+ /// Get a reference on the position variable
+ VarPercent &getPositionVar() const
+ { return *((VarPercent*)m_cPosition.get()); }
- /// Get a counted pointer on the position variable
- const VariablePtr &getPositionVarPtr() const { return m_cPosition; }
+ /// Get a counted pointer on the position variable
+ const VariablePtr &getPositionVarPtr() const { return m_cPosition; }
- protected:
- /// List of elements
- list<Elem_t> m_list;
+protected:
+ /// List of elements
+ list<Elem_t> m_list;
- private:
- /// Variable type
- static const string m_type;
- /// Position variable
- VariablePtr m_cPosition;
+private:
+ /// Variable type
+ static const string m_type;
+ /// Position variable
+ VariablePtr m_cPosition;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VAR_PERCENT_HPP
/// Percentage variable
class VarPercent: public Variable, public Subject<VarPercent>
{
- public:
- VarPercent( intf_thread_t *pIntf ): Variable( pIntf ), m_value( 0 ) {}
- virtual ~VarPercent() {}
-
- /// Get the variable type
- virtual const string &getType() const { return m_type; }
-
- /// Set the internal value
- virtual void set( float percentage );
- virtual float get() const { return m_value; }
-
- private:
- /// Variable type
- static const string m_type;
- /// Percent value
- float m_value;
+public:
+ VarPercent( intf_thread_t *pIntf ): Variable( pIntf ), m_value( 0 ) { }
+ virtual ~VarPercent() { }
+
+ /// Get the variable type
+ virtual const string &getType() const { return m_type; }
+
+ /// Set the internal value
+ virtual void set( float percentage );
+ virtual float get() const { return m_value; }
+
+private:
+ /// Variable type
+ static const string m_type;
+ /// Percent value
+ float m_value;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VAR_TEXT_HPP
public Observer<VarPercent>,
public Observer<VarText>
{
- public:
- // Set substVars to true to replace "$X" variables in the text
- VarText( intf_thread_t *pIntf, bool substVars = true );
- virtual ~VarText();
+public:
+ // Set substVars to true to replace "$X" variables in the text
+ VarText( intf_thread_t *pIntf, bool substVars = true );
+ virtual ~VarText();
- /// Get the variable type
- virtual const string &getType() const { return m_type; }
+ /// Get the variable type
+ virtual const string &getType() const { return m_type; }
- /// Set the internal value
- virtual void set( const UString &rText );
- virtual const UString get() const;
+ /// Set the internal value
+ virtual void set( const UString &rText );
+ virtual const UString get() const;
- /// Methods called when an observed variable is modified
- virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
- virtual void onUpdate( Subject<VarText> &rVariable, void* );
+ /// Methods called when an observed variable is modified
+ virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
+ virtual void onUpdate( Subject<VarText> &rVariable, void* );
- private:
- /// Stop observing other variables
- void delObservers();
+private:
+ /// Stop observing other variables
+ void delObservers();
- /// Variable type
- static const string m_type;
- /// The text of the variable
- UString m_text;
- /// Actual text after having replaced the variables
- UString m_lastText;
- /// Flag to activate or not "$X" variables substitution
- bool m_substVars;
+ /// Variable type
+ static const string m_type;
+ /// The text of the variable
+ UString m_text;
+ /// Actual text after having replaced the variables
+ UString m_lastText;
+ /// Flag to activate or not "$X" variables substitution
+ bool m_substVars;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VAR_TREE_HPP
/// Tree variable
class VarTree: public Variable, public Subject<VarTree, tree_update>
{
- public:
- VarTree( intf_thread_t *pIntf );
+public:
+ VarTree( intf_thread_t *pIntf );
- VarTree( intf_thread_t *pIntf, VarTree *pParent, int id,
- const UStringPtr &rcString, bool selected, bool playing,
- bool expanded,bool readonly, void *pData );
+ VarTree( intf_thread_t *pIntf, VarTree *pParent, int id,
+ const UStringPtr &rcString, bool selected, bool playing,
+ bool expanded,bool readonly, void *pData );
- virtual ~VarTree();
+ virtual ~VarTree();
- /// Get the variable type
- virtual const string &getType() const { return m_type; }
+ /// Get the variable type
+ virtual const string &getType() const { return m_type; }
- /// Add a pointer on string in the children's list
- virtual void add( int id, const UStringPtr &rcString, bool selected,
- bool playing, bool expanded, bool readonly,
- void *pData );
+ /// Add a pointer on string in the children's list
+ virtual void add( int id, const UStringPtr &rcString, bool selected,
+ bool playing, bool expanded, bool readonly,
+ void *pData );
- /// Remove the selected item from the children's list
- virtual void delSelected();
+ /// Remove the selected item from the children's list
+ virtual void delSelected();
- /// Remove all elements from the children's list
- virtual void clear();
+ /// Remove all elements from the children's list
+ virtual void clear();
- /// \todo Use accessors for these fields ?
- int m_id;
- UStringPtr m_cString;
- bool m_selected;
- bool m_playing;
- bool m_expanded;
- bool m_deleted;
- void *m_pData;
+ /// \todo Use accessors for these fields ?
+ int m_id;
+ UStringPtr m_cString;
+ bool m_selected;
+ bool m_playing;
+ bool m_expanded;
+ bool m_deleted;
+ void *m_pData;
- inline bool isReadonly() { return m_readonly; };
+ inline bool isReadonly() { return m_readonly; };
- /// Get the number of children
- int size() const { return m_children.size(); }
+ /// Get the number of children
+ int size() const { return m_children.size(); }
- /// Iterators
- typedef list<VarTree>::iterator Iterator;
- typedef list<VarTree>::const_iterator ConstIterator;
+ /// Iterators
+ typedef list<VarTree>::iterator Iterator;
+ typedef list<VarTree>::const_iterator ConstIterator;
- /// Begining of the children's list
- Iterator begin() { return m_children.begin(); }
- ConstIterator begin() const { return m_children.begin(); }
+ /// Begining of the children's list
+ Iterator begin() { return m_children.begin(); }
+ ConstIterator begin() const { return m_children.begin(); }
- /// End of children's list
- Iterator end() { return m_children.end(); }
- ConstIterator end() const { return m_children.end(); }
+ /// End of children's list
+ Iterator end() { return m_children.end(); }
+ ConstIterator end() const { return m_children.end(); }
- /// Back of children's list
- VarTree &back() { return m_children.back(); }
+ /// Back of children's list
+ VarTree &back() { return m_children.back(); }
- /// Return an iterator on the n'th element of the children's list
- Iterator operator[]( int n );
- ConstIterator operator[]( int n ) const;
+ /// Return an iterator on the n'th element of the children's list
+ Iterator operator[]( int n );
+ ConstIterator operator[]( int n ) const;
- /// Parent node
- VarTree *parent() { return m_pParent; }
- void checkParents( VarTree *pParent );
+ /// Parent node
+ VarTree *parent() { return m_pParent; }
+ void checkParents( VarTree *pParent );
- /// Get next sibling
- Iterator getNextSibling( Iterator );
+ /// Get next sibling
+ Iterator getNextSibling( Iterator );
- Iterator next_uncle();
- Iterator prev_uncle();
+ Iterator next_uncle();
+ Iterator prev_uncle();
- /// Get root node
- VarTree *root()
- {
- VarTree *parent = this;
- while( parent->parent() != NULL )
- parent = parent->parent();
- return parent;
- }
+ /// Get root node
+ VarTree *root()
+ {
+ VarTree *parent = this;
+ while( parent->parent() != NULL )
+ parent = parent->parent();
+ return parent;
+ }
- /// Get first leaf
- Iterator firstLeaf();
+ /// Get first leaf
+ Iterator firstLeaf();
- void removeChild( VarTree::Iterator item )
- {
- m_children.erase( item );
- }
+ void removeChild( VarTree::Iterator item )
+ {
+ m_children.erase( item );
+ }
- /// Execute the action associated to this item
- virtual void action( VarTree *pItem ) {}
+ /// Execute the action associated to this item
+ virtual void action( VarTree *pItem ) { }
- /// Get a reference on the position variable
- VarPercent &getPositionVar() const
- { return *((VarPercent*)m_cPosition.get()); }
+ /// Get a reference on the position variable
+ VarPercent &getPositionVar() const
+ { return *((VarPercent*)m_cPosition.get()); }
- /// Get a counted pointer on the position variable
- const VariablePtr &getPositionVarPtr() const { return m_cPosition; }
+ /// Get a counted pointer on the position variable
+ const VariablePtr &getPositionVarPtr() const { return m_cPosition; }
- /// Count the number of items that should be displayed if the playlist window wasn't limited
- int visibleItems();
+ /// Count the number of items that should be displayed if the
+ /// playlist window wasn't limited
+ int visibleItems();
- /// Count the number of leafs in the tree
- int countLeafs();
+ /// Count the number of leafs in the tree
+ int countLeafs();
- /// Return iterator to the n'th visible item
- Iterator getVisibleItem( int n );
+ /// Return iterator to the n'th visible item
+ Iterator getVisibleItem( int n );
- /// Return iterator to the n'th leaf
- Iterator getLeaf( int n );
+ /// Return iterator to the n'th leaf
+ Iterator getLeaf( int n );
- /// Given an iterator to a visible item, return the next visible item
- Iterator getNextVisibleItem( Iterator it );
+ /// Given an iterator to a visible item, return the next visible item
+ Iterator getNextVisibleItem( Iterator it );
- /// Given an it to a visible item, return the previous visible item
- Iterator getPrevVisibleItem( Iterator it );
+ /// Given an it to a visible item, return the previous visible item
+ Iterator getPrevVisibleItem( Iterator it );
- /// Given an iterator to an item, return the next item
- Iterator getNextItem( Iterator it );
+ /// Given an iterator to an item, return the next item
+ Iterator getNextItem( Iterator it );
- /// Given an iterator to an item, return the previous item
- Iterator getPrevItem( Iterator it );
+ /// Given an iterator to an item, return the previous item
+ Iterator getPrevItem( Iterator it );
- /// Given an iterator to an item, return the next leaf
- Iterator getNextLeaf( Iterator it );
+ /// Given an iterator to an item, return the next leaf
+ Iterator getNextLeaf( Iterator it );
- /// Given an iterator to an item, return the previous leaf
- Iterator getPrevLeaf( Iterator it );
+ /// Given an iterator to an item, return the previous leaf
+ Iterator getPrevLeaf( Iterator it );
- /// Find a children node with the given id
- Iterator findById( int id );
+ /// Find a children node with the given id
+ Iterator findById( int id );
- /// Ensure an item is expanded
- void ensureExpanded( VarTree::Iterator );
+ /// Ensure an item is expanded
+ void ensureExpanded( VarTree::Iterator );
- /// Get depth (root depth is 0)
- int depth()
- {
- VarTree *parent = this;
- int depth = 0;
- while( ( parent = parent->parent() ) != NULL )
- depth++;
- return depth;
- }
+ /// Get depth (root depth is 0)
+ int depth()
+ {
+ VarTree *parent = this;
+ int depth = 0;
+ while( ( parent = parent->parent() ) != NULL )
+ depth++;
+ return depth;
+ }
- private:
- /// List of children
- list<VarTree> m_children;
+private:
+ /// List of children
+ list<VarTree> m_children;
- /// Pointer to parent node
- VarTree *m_pParent;
+ /// Pointer to parent node
+ VarTree *m_pParent;
- bool m_readonly;
+ bool m_readonly;
- /// Variable type
- static const string m_type;
+ /// Variable type
+ static const string m_type;
- /// Position variable
- VariablePtr m_cPosition;
+ /// Position variable
+ VariablePtr m_cPosition;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VARIABLE_HPP
/// Base class for variable objects
class Variable: public SkinObject
{
- public:
- virtual ~Variable() {}
+public:
+ virtual ~Variable() { }
- /// Get the variable type
- virtual const string &getType() const = 0;
+ /// Get the variable type
+ virtual const string &getType() const = 0;
- protected:
- Variable( intf_thread_t *pIntf ): SkinObject( pIntf ) {}
+protected:
+ Variable( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EQUALIZER_HPP
/// Variable for graphical equalizer
class EqualizerBands: public SkinObject, public Observer<VarPercent>
{
- public:
- /// Number of bands
- static const int kNbBands = 10;
+public:
+ /// Number of bands
+ static const int kNbBands = 10;
- EqualizerBands( intf_thread_t *pIntf );
- virtual ~EqualizerBands();
+ EqualizerBands( intf_thread_t *pIntf );
+ virtual ~EqualizerBands();
- /// Set the equalizer bands from a configuration string,
- /// e.g. "1 5.2 -3.6 0 0 2.5 0 0 0 0"
- void set( string bands );
+ /// Set the equalizer bands from a configuration string,
+ /// e.g. "1 5.2 -3.6 0 0 2.5 0 0 0 0"
+ void set( string bands );
- /// Return the variable for a specific band
- VariablePtr getBand( int band );
+ /// Return the variable for a specific band
+ VariablePtr getBand( int band );
- private:
- /// Array of equalizer bands
- VariablePtr m_cBands[kNbBands];
- /// Flag set when an update is in progress
- bool m_isUpdating;
+private:
+ /// Array of equalizer bands
+ VariablePtr m_cBands[kNbBands];
+ /// Flag set when an update is in progress
+ bool m_isUpdating;
- /// Callback for band updates
- virtual void onUpdate( Subject<VarPercent> &rBand , void *);
+ /// Callback for band updates
+ virtual void onUpdate( Subject<VarPercent> &rBand , void *);
};
/// Variable for equalizer preamp
class EqualizerPreamp: public VarPercent
{
- public:
- EqualizerPreamp( intf_thread_t *pIntf );
- virtual ~EqualizerPreamp() {}
+public:
+ EqualizerPreamp( intf_thread_t *pIntf );
+ virtual ~EqualizerPreamp() { }
- virtual void set( float percentage, bool updateVLC );
+ virtual void set( float percentage, bool updateVLC );
- void set( float percentage ) { set( percentage, true ); }
+ void set( float percentage ) { set( percentage, true ); }
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef PLAYTREE_HPP
/// Variable for VLC playlist (new tree format)
class Playtree: public VarTree
{
- public:
- Playtree( intf_thread_t *pIntf );
- virtual ~Playtree();
+public:
+ Playtree( intf_thread_t *pIntf );
+ virtual ~Playtree();
- /// Remove the selected elements from the list
- virtual void delSelected();
+ /// Remove the selected elements from the list
+ virtual void delSelected();
- /// Execute the action associated to this item
- virtual void action( VarTree *pItem );
+ /// Execute the action associated to this item
+ virtual void action( VarTree *pItem );
- /// Function called to notify playlist changes
- void onChange();
+ /// Function called to notify playlist changes
+ void onChange();
- /// Function called to notify playlist item update
- void onUpdateItem( int id );
+ /// Function called to notify playlist item update
+ void onUpdateItem( int id );
- /// Function called to notify playlist item append
- void onAppend( playlist_add_t * );
+ /// Function called to notify playlist item append
+ void onAppend( playlist_add_t * );
- /// Function called to notify playlist item delete
- void onDelete( int );
+ /// Function called to notify playlist item delete
+ void onDelete( int );
- /// Items waiting to be appended
- int i_items_to_append;
+ /// Items waiting to be appended
+ int i_items_to_append;
- private:
- /// VLC playlist object
- playlist_t *m_pPlaylist;
+private:
+ /// VLC playlist object
+ playlist_t *m_pPlaylist;
- /// Build the list from the VLC playlist
- void buildTree();
+ /// Build the list from the VLC playlist
+ void buildTree();
- /// Update Node's children
- void buildNode( playlist_item_t *p_node, VarTree &m_pNode );
+ /// Update Node's children
+ void buildNode( playlist_item_t *p_node, VarTree &m_pNode );
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef TIME_HPP
/// Variable for VLC stream time
class StreamTime: public VarPercent
{
- public:
- StreamTime( intf_thread_t *pIntf ): VarPercent( pIntf ) {}
- virtual ~StreamTime() {}
-
- virtual void set( float percentage, bool updateVLC );
-
- virtual void set( float percentage ) { set( percentage, true ); }
-
- /// Return a string containing a value from 0 to 100
- virtual const string getAsStringPercent() const;
- /// Return the current time formatted as a time display (h:mm:ss)
- virtual const string getAsStringCurrTime( bool bShortFormat = false ) const;
- /// Return the time left formatted as a time display (h:mm:ss)
- virtual const string getAsStringTimeLeft( bool bShortFormat = false ) const;
- /// Return the duration formatted as a time display (h:mm:ss)
- virtual const string getAsStringDuration( bool bShortFormat = false ) const;
-
- private:
- /// Convert a number of seconds into "h:mm:ss" format
- const string formatTime( int seconds, bool bShortFormat ) const;
+public:
+ StreamTime( intf_thread_t *pIntf ): VarPercent( pIntf ) { }
+ virtual ~StreamTime() { }
+
+ virtual void set( float percentage, bool updateVLC );
+
+ virtual void set( float percentage ) { set( percentage, true ); }
+
+ /// Return a string containing a value from 0 to 100
+ virtual const string getAsStringPercent() const;
+ /// Return the current time formatted as a time display (h:mm:ss)
+ virtual const string getAsStringCurrTime( bool bShortFormat = false ) const;
+ /// Return the time left formatted as a time display (h:mm:ss)
+ virtual const string getAsStringTimeLeft( bool bShortFormat = false ) const;
+ /// Return the duration formatted as a time display (h:mm:ss)
+ virtual const string getAsStringDuration( bool bShortFormat = false ) const;
+
+private:
+ /// Convert a number of seconds into "h:mm:ss" format
+ const string formatTime( int seconds, bool bShortFormat ) const;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VOLUME_HPP
/// Variable for VLC volume
class Volume: public VarPercent
{
- public:
- Volume( intf_thread_t *pIntf );
- virtual ~Volume() {}
+public:
+ Volume( intf_thread_t *pIntf );
+ virtual ~Volume() { }
- virtual void set( float percentage, bool updateVLC );
+ virtual void set( float percentage, bool updateVLC );
- virtual void set( float percentage ) { set( percentage, true ); }
+ virtual void set( float percentage ) { set( percentage, true ); }
- virtual string getAsStringPercent() const;
+ virtual string getAsStringPercent() const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_DRAGDROP_HPP
class Win32DragDrop: public SkinObject, public IDropTarget
{
- public:
- Win32DragDrop( intf_thread_t *pIntf, bool playOnDrop );
- virtual ~Win32DragDrop() {}
+public:
+ Win32DragDrop( intf_thread_t *pIntf, bool playOnDrop );
+ virtual ~Win32DragDrop() { }
- protected:
- // IUnknown methods
- STDMETHOD(QueryInterface)( REFIID riid, void FAR* FAR* ppvObj );
- STDMETHOD_(ULONG, AddRef)();
- STDMETHOD_(ULONG, Release)();
+protected:
+ // IUnknown methods
+ STDMETHOD(QueryInterface)( REFIID riid, void FAR* FAR* ppvObj );
+ STDMETHOD_(ULONG, AddRef)();
+ STDMETHOD_(ULONG, Release)();
- // IDropTarget methods
- STDMETHOD(DragEnter)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
- POINTL pt, DWORD *pdwEffect );
- STDMETHOD(DragOver)( DWORD grfKeyState, POINTL pt, DWORD *pdwEffect );
- STDMETHOD(DragLeave)();
- STDMETHOD(Drop)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
- POINTL pt, DWORD *pdwEffect );
+ // IDropTarget methods
+ STDMETHOD(DragEnter)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
+ POINTL pt, DWORD *pdwEffect );
+ STDMETHOD(DragOver)( DWORD grfKeyState, POINTL pt, DWORD *pdwEffect );
+ STDMETHOD(DragLeave)();
+ STDMETHOD(Drop)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
+ POINTL pt, DWORD *pdwEffect );
- private:
- /// Internal reference counter
- unsigned long m_references;
- /// Indicates whether the file(s) must be played immediately
- bool m_playOnDrop;
+private:
+ /// Internal reference counter
+ unsigned long m_references;
+ /// Indicates whether the file(s) must be played immediately
+ bool m_playOnDrop;
- /// Helper function
- void HandleDrop( HDROP HDrop );
+ /// Helper function
+ void HandleDrop( HDROP HDrop );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_FACTORY_HPP
/// Class used to instanciate Win32 specific objects
class Win32Factory: public OSFactory
{
- public:
- Win32Factory( intf_thread_t *pIntf );
- virtual ~Win32Factory();
+public:
+ Win32Factory( intf_thread_t *pIntf );
+ virtual ~Win32Factory();
- /// Initialization method
- virtual bool init();
+ /// Initialization method
+ virtual bool init();
- /// Instantiate an object OSGraphics
- virtual OSGraphics *createOSGraphics( int width, int height );
+ /// Instantiate an object OSGraphics
+ virtual OSGraphics *createOSGraphics( int width, int height );
- /// Get the instance of the singleton OSLoop
- virtual OSLoop *getOSLoop();
+ /// Get the instance of the singleton OSLoop
+ virtual OSLoop *getOSLoop();
- /// Destroy the instance of OSLoop
- virtual void destroyOSLoop();
+ /// Destroy the instance of OSLoop
+ virtual void destroyOSLoop();
- /// Minimize all the windows
- virtual void minimize();
+ /// Minimize all the windows
+ virtual void minimize();
- /// Restore the minimized windows
- virtual void restore();
+ /// Restore the minimized windows
+ virtual void restore();
- /// Add an icon in the system tray
- virtual void addInTray();
+ /// Add an icon in the system tray
+ virtual void addInTray();
- /// Remove the icon from the system tray
- virtual void removeFromTray();
+ /// Remove the icon from the system tray
+ virtual void removeFromTray();
- /// Show the task in the task bar
- virtual void addInTaskBar();
+ /// Show the task in the task bar
+ virtual void addInTaskBar();
- /// Remove the task from the task bar
- virtual void removeFromTaskBar();
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar();
- /// Instantiate an OSTimer with the given command
- virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
+ /// Instantiate an OSTimer with the given command
+ virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
- /// Instantiate an OSWindow object
- virtual OSWindow *createOSWindow( GenericWindow &rWindow,
- bool dragDrop, bool playOnDrop,
- OSWindow *pParent );
+ /// Instantiate an OSWindow object
+ virtual OSWindow *createOSWindow( GenericWindow &rWindow,
+ bool dragDrop, bool playOnDrop,
+ OSWindow *pParent );
- /// Instantiate an object OSTooltip
- virtual OSTooltip *createOSTooltip();
+ /// Instantiate an object OSTooltip
+ virtual OSTooltip *createOSTooltip();
- /// Instantiate an object OSPopup
- virtual OSPopup *createOSPopup();
+ /// Instantiate an object OSPopup
+ virtual OSPopup *createOSPopup();
- /// Get the directory separator
- virtual const string &getDirSeparator() const { return m_dirSep; }
+ /// Get the directory separator
+ virtual const string &getDirSeparator() const { return m_dirSep; }
- /// Get the resource path
- virtual const list<string> &getResourcePath() const
- { return m_resourcePath; }
+ /// Get the resource path
+ virtual const list<string> &getResourcePath() const
+ { return m_resourcePath; }
- /// Get the screen size
- virtual int getScreenWidth() const;
- virtual int getScreenHeight() const;
+ /// Get the screen size
+ virtual int getScreenWidth() const;
+ virtual int getScreenHeight() const;
- /// Get the work area (screen area without taskbars)
- virtual SkinsRect getWorkArea() const;
+ /// Get the work area (screen area without taskbars)
+ virtual SkinsRect getWorkArea() const;
- /// Get the position of the mouse
- virtual void getMousePos( int &rXPos, int &rYPos ) const;
+ /// Get the position of the mouse
+ virtual void getMousePos( int &rXPos, int &rYPos ) const;
- /// Change the cursor
- virtual void changeCursor( CursorType_t type ) const;
+ /// Change the cursor
+ virtual void changeCursor( CursorType_t type ) const;
- /// Delete a directory recursively
- virtual void rmDir( const string &rPath );
+ /// Delete a directory recursively
+ virtual void rmDir( const string &rPath );
- /// Map to find the GenericWindow associated with a Win32Window
- map<HWND, GenericWindow*> m_windowMap;
+ /// Map to find the GenericWindow associated with a Win32Window
+ map<HWND, GenericWindow*> m_windowMap;
- /// Functions dynamically loaded from the dll, because they don't exist
- /// on Win9x/NT4
- // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
- BOOL (WINAPI *TransparentBlt)( HDC, int, int, int, int,
- HDC, int, int, int, int, UINT );
- BOOL (WINAPI *AlphaBlend)( HDC, int, int, int, int,
- HDC, int, int, int, int, BLENDFUNCTION );
+ /// Functions dynamically loaded from the dll, because they don't exist
+ /// on Win9x/NT4
+ // We dynamically load msimg32.dll to get a pointer to TransparentBlt()
+ BOOL (WINAPI *TransparentBlt)( HDC, int, int, int, int,
+ HDC, int, int, int, int, UINT );
+ BOOL (WINAPI *AlphaBlend)( HDC, int, int, int, int,
+ HDC, int, int, int, int, BLENDFUNCTION );
- // Idem for user32.dll and SetLayeredWindowAttributes()
- BOOL (WINAPI *SetLayeredWindowAttributes)( HWND, COLORREF,
- BYTE, DWORD );
+ // Idem for user32.dll and SetLayeredWindowAttributes()
+ BOOL (WINAPI *SetLayeredWindowAttributes)( HWND, COLORREF,
+ BYTE, DWORD );
- private:
- /// Handle of the instance
- HINSTANCE m_hInst;
- /// Handle of the parent window
- HWND m_hParentWindow;
- /// Structure for the system tray
- NOTIFYICONDATA m_trayIcon;
- /// Handle on msimg32.dll (for TransparentBlt)
- HINSTANCE m_hMsimg32;
- /// Handle on user32.dll (for SetLayeredWindowAttributes)
- HINSTANCE m_hUser32;
- /// Directory separator
- const string m_dirSep;
- /// Resource path
- list<string> m_resourcePath;
+private:
+ /// Handle of the instance
+ HINSTANCE m_hInst;
+ /// Handle of the parent window
+ HWND m_hParentWindow;
+ /// Structure for the system tray
+ NOTIFYICONDATA m_trayIcon;
+ /// Handle on msimg32.dll (for TransparentBlt)
+ HINSTANCE m_hMsimg32;
+ /// Handle on user32.dll (for SetLayeredWindowAttributes)
+ HINSTANCE m_hUser32;
+ /// Directory separator
+ const string m_dirSep;
+ /// Resource path
+ list<string> m_resourcePath;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_GRAPHICS_HPP
/// Win32 implementation of OSGraphics
class Win32Graphics: public OSGraphics
{
- public:
- Win32Graphics( intf_thread_t *pIntf, int width, int height );
- virtual ~Win32Graphics();
+public:
+ Win32Graphics( intf_thread_t *pIntf, int width, int height );
+ virtual ~Win32Graphics();
- /// Clear the graphics
- virtual void clear();
+ /// Clear the graphics
+ virtual void clear();
- /// Render a bitmap on this graphics
- virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1,
- bool blend = false );
+ /// Render a bitmap on this graphics
+ virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1,
+ bool blend = false );
- /// Draw another graphics on this one
- virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1 );
+ /// Draw another graphics on this one
+ virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1 );
- /// Draw an empty rectangle on the grahics (color is #RRGGBB)
- virtual void drawRect( int left, int top, int width, int height,
- uint32_t color );
+ /// Draw an empty rectangle on the grahics (color is #RRGGBB)
+ virtual void drawRect( int left, int top, int width, int height,
+ uint32_t color );
- /// Draw a filled rectangle on the grahics (color is #RRGGBB)
- virtual void fillRect( int left, int top, int width, int height,
- uint32_t color );
+ /// Draw a filled rectangle on the grahics (color is #RRGGBB)
+ virtual void fillRect( int left, int top, int width, int height,
+ uint32_t color );
- /// Set the shape of a window with the mask of this graphics.
- virtual void applyMaskToWindow( OSWindow &rWindow );
+ /// Set the shape of a window with the mask of this graphics.
+ virtual void applyMaskToWindow( OSWindow &rWindow );
- /// Copy the graphics on a window
- virtual void copyToWindow( OSWindow &rWindow, int xSrc,
- int ySrc, int width, int height,
- int xDest, int yDest );
+ /// Copy the graphics on a window
+ virtual void copyToWindow( OSWindow &rWindow, int xSrc,
+ int ySrc, int width, int height,
+ int xDest, int yDest );
- /// Tell whether the pixel at the given position is visible
- virtual bool hit( int x, int y ) const;
+ /// Tell whether the pixel at the given position is visible
+ virtual bool hit( int x, int y ) const;
- /// Getters for the size
- virtual int getWidth() const { return m_width; }
- virtual int getHeight() const { return m_height; }
+ /// Getters for the size
+ virtual int getWidth() const { return m_width; }
+ virtual int getHeight() const { return m_height; }
- /// Get the device context handler
- virtual HDC getDC() const { return m_hDC; }
+ /// Get the device context handler
+ virtual HDC getDC() const { return m_hDC; }
- /// Get the mask
- virtual HRGN getMask() const { return m_mask; }
+ /// Get the mask
+ virtual HRGN getMask() const { return m_mask; }
- private:
- /// Size of the image
- int m_width, m_height;
+private:
+ /// Size of the image
+ int m_width, m_height;
- /// Device context
- HDC m_hDC;
+ /// Device context
+ HDC m_hDC;
- /// Transparency mask
- HRGN m_mask;
+ /// Transparency mask
+ HRGN m_mask;
- /// Add a segment in a region
- void addSegmentInRegion( HRGN &rMask, int start, int end, int line );
+ /// Add a segment in a region
+ void addSegmentInRegion( HRGN &rMask, int start, int end, int line );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_LOOP_HPP
/// Main event loop for Win32
class Win32Loop: public OSLoop
{
- public:
- /// Get the instance of Win32Loop
- static OSLoop *instance( intf_thread_t *pIntf );
+public:
+ /// Get the instance of Win32Loop
+ static OSLoop *instance( intf_thread_t *pIntf );
- /// Destroy the instance of Win32Loop
- static void destroy( intf_thread_t *pIntf );
+ /// Destroy the instance of Win32Loop
+ static void destroy( intf_thread_t *pIntf );
- /// Enter the event loop
- virtual void run();
+ /// Enter the event loop
+ virtual void run();
- /// Exit the main loop
- virtual void exit();
+ /// Exit the main loop
+ virtual void exit();
- private:
- // Private because it is a singleton
- Win32Loop( intf_thread_t *pIntf );
- virtual ~Win32Loop();
+private:
+ // Private because it is a singleton
+ Win32Loop( intf_thread_t *pIntf );
+ virtual ~Win32Loop();
- /// Map associating special (i.e. non ascii) virtual key codes with
- /// internal vlc key codes
- map<int, int> virtKeyToVlcKey;
+ /// Map associating special (i.e. non ascii) virtual key codes with
+ /// internal vlc key codes
+ map<int, int> virtKeyToVlcKey;
- /// Helper function to find the modifier in a Windows message
- int getMod( WPARAM wParam ) const;
+ /// Helper function to find the modifier in a Windows message
+ int getMod( WPARAM wParam ) const;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_POPUP_HPP
/// Win32 implementation of OSPopup
class Win32Popup: public OSPopup
{
- public:
- Win32Popup( intf_thread_t *pIntf, HWND hAssociatedWindow );
+public:
+ Win32Popup( intf_thread_t *pIntf, HWND hAssociatedWindow );
- virtual ~Win32Popup();
+ virtual ~Win32Popup();
- /// Show the popup menu at the given (absolute) corrdinates
- virtual void show( int xPos, int yPos );
+ /// Show the popup menu at the given (absolute) corrdinates
+ virtual void show( int xPos, int yPos );
- /// Hide the popup menu
- virtual void hide();
+ /// Hide the popup menu
+ virtual void hide();
- /// Append a new menu item with the given label to the popup menu
- virtual void addItem( const string &rLabel, int pos );
+ /// Append a new menu item with the given label to the popup menu
+ virtual void addItem( const string &rLabel, int pos );
- /// Create a dummy menu item to separate sections
- virtual void addSeparator( int pos );
+ /// Create a dummy menu item to separate sections
+ virtual void addSeparator( int pos );
- /// Return the position of the item identified by the given id
- virtual int getPosFromId( int id ) const { return id; }
+ /// Return the position of the item identified by the given id
+ virtual int getPosFromId( int id ) const { return id; }
- private:
- /// Menu handle
- HMENU m_hMenu;
- /// Handle of the window which will receive the menu events
- HWND m_hWnd;
+private:
+ /// Menu handle
+ HMENU m_hMenu;
+ /// Handle of the window which will receive the menu events
+ HWND m_hWnd;
- /**
- * Find the item before which to insert another item so that the
- * newly added item is at the position pos _when the whole menu has
- * been built_ (no assumption is made for the order of insertion of the
- * items)
- */
- unsigned int findInsertionPoint( unsigned int pos ) const;
+ /**
+ * Find the item before which to insert another item so that the
+ * newly added item is at the position pos _when the whole menu has
+ * been built_ (no assumption is made for the order of insertion of
+ * the items)
+ */
+ unsigned int findInsertionPoint( unsigned int pos ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_TIMER_HPP
// Win32 specific timer
class Win32Timer: public OSTimer
{
- public:
- Win32Timer( intf_thread_t *pIntf, CmdGeneric &rCmd, HWND hWnd );
- virtual ~Win32Timer();
+public:
+ Win32Timer( intf_thread_t *pIntf, CmdGeneric &rCmd, HWND hWnd );
+ virtual ~Win32Timer();
- /// (Re)start the timer with the given delay (in ms). If oneShot is
- /// true, stop it after the first execution of the callback.
- virtual void start( int delay, bool oneShot );
+ /// (Re)start the timer with the given delay (in ms). If oneShot is
+ /// true, stop it after the first execution of the callback.
+ virtual void start( int delay, bool oneShot );
- /// Stop the timer
- virtual void stop();
+ /// Stop the timer
+ virtual void stop();
- /// Execute the callback
- void execute();
+ /// Execute the callback
+ void execute();
- private:
- /// Command to execute
- CmdGeneric &m_rCommand;
+private:
+ /// Command to execute
+ CmdGeneric &m_rCommand;
- /// Delay between two execute
- mtime_t m_interval;
+ /// Delay between two execute
+ mtime_t m_interval;
- /// Flag to tell whether the timer must be stopped after the
- /// first execution
- bool m_oneShot;
+ /// Flag to tell whether the timer must be stopped after the
+ /// first execution
+ bool m_oneShot;
- /// Handle of the window to which the timer will be attached
- HWND m_hWnd;
+ /// Handle of the window to which the timer will be attached
+ HWND m_hWnd;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_TOOLTIP_HPP
/// Win32 implementation of OSTooltip
class Win32Tooltip: public OSTooltip
{
- public:
- Win32Tooltip( intf_thread_t *pIntf, HINSTANCE hInst,
- HWND hParentWindow );
+public:
+ Win32Tooltip( intf_thread_t *pIntf, HINSTANCE hInst, HWND hParentWindow );
- virtual ~Win32Tooltip();
+ virtual ~Win32Tooltip();
- /// Show the tooltip
- virtual void show( int left, int top, OSGraphics &rText );
+ /// Show the tooltip
+ virtual void show( int left, int top, OSGraphics &rText );
- /// Hide the tooltip
- virtual void hide();
+ /// Hide the tooltip
+ virtual void hide();
- private:
- /// Window ID
- HWND m_hWnd;
+private:
+ /// Window ID
+ HWND m_hWnd;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef WIN32_WINDOW_HPP
/// Win32 implementation of OSWindow
class Win32Window: public OSWindow
{
- public:
- Win32Window( intf_thread_t *pIntf, GenericWindow &rWindow,
- HINSTANCE hInst, HWND hParentWindow,
- bool dragDrop, bool playOnDrop,
- Win32Window *pParentWindow );
- virtual ~Win32Window();
-
- // Show the window
- virtual void show() const;
-
- // Hide the window
- virtual void hide() const;
-
- /// Move and resize the window
- virtual void moveResize( int left, int top,
- int width, int height ) const;
-
- /// Bring the window on top
- virtual void raise() const;
-
- /// Set the opacity of the window (0 = transparent, 255 = opaque)
- virtual void setOpacity( uint8_t value ) const;
-
- /// Toggle the window on top
- virtual void toggleOnTop( bool onTop ) const;
-
- /// Getter for the window handle
- HWND getHandle() const { return m_hWnd; }
-
- /// Getter for the window handle
- void* getOSHandle() const { return (void*) m_hWnd; }
-
- /// reparent the window
- void reparent( void* OSHandle, int x, int y, int w, int h );
-
- private:
- /// Window handle
- HWND m_hWnd;
- /// Window parent's handle
- HWND m_hWnd_parent;
- /// Indicates whether the window handles drag&drop events
- bool m_dragDrop;
- /// Drop target
- LPDROPTARGET m_pDropTarget;
- /// Indicates whether the window is layered
- mutable bool m_isLayered;
- /// Parent window
- Win32Window *m_pParent;
+public:
+ Win32Window( intf_thread_t *pIntf, GenericWindow &rWindow,
+ HINSTANCE hInst, HWND hParentWindow,
+ bool dragDrop, bool playOnDrop,
+ Win32Window *pParentWindow );
+ virtual ~Win32Window();
+
+ // Show the window
+ virtual void show() const;
+
+ // Hide the window
+ virtual void hide() const;
+
+ /// Move and resize the window
+ virtual void moveResize( int left, int top, int width, int height ) const;
+
+ /// Bring the window on top
+ virtual void raise() const;
+
+ /// Set the opacity of the window (0 = transparent, 255 = opaque)
+ virtual void setOpacity( uint8_t value ) const;
+
+ /// Toggle the window on top
+ virtual void toggleOnTop( bool onTop ) const;
+
+ /// Getter for the window handle
+ HWND getHandle() const { return m_hWnd; }
+
+ /// Getter for the window handle
+ void* getOSHandle() const { return (void*) m_hWnd; }
+
+ /// reparent the window
+ void reparent( void* OSHandle, int x, int y, int w, int h );
+
+private:
+ /// Window handle
+ HWND m_hWnd;
+ /// Window parent's handle
+ HWND m_hWnd_parent;
+ /// Indicates whether the window handles drag&drop events
+ bool m_dragDrop;
+ /// Drop target
+ LPDROPTARGET m_pDropTarget;
+ /// Indicates whether the window is layered
+ mutable bool m_isLayered;
+ /// Parent window
+ Win32Window *m_pParent;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_DISPLAY_HPP
/// Class for encapsulation of a X11 Display
class X11Display: public SkinObject
{
- public:
- X11Display( intf_thread_t *pIntf );
- virtual ~X11Display();
-
- /// Get the display
- Display *getDisplay() const { return m_pDisplay; }
-
- /// Get the visual
- Visual *getVisual() const { return m_pVisual; }
-
- /// Get the pixel size
- int getPixelSize() const { return m_pixelSize; }
-
- /// Get the graphics context
- GC getGC() const { return m_gc; }
-
- /// Get the colormap
- Colormap getColormap() const { return m_colormap; }
-
- /// Type of function to put RGBA values into a pixel
- typedef void (X11Display::*MakePixelFunc_t)( uint8_t *pPixel,
- uint8_t r, uint8_t g, uint8_t b, uint8_t a ) const;
-
- /// Get a pointer on the right blendPixel implementation
- MakePixelFunc_t getBlendPixel() const { return blendPixelImpl; }
-
- /// Get a pointer on the right putPixel implementation
- MakePixelFunc_t getPutPixel() const { return putPixelImpl; }
-
- /// Get the pixel value corresponding to the given colors
- unsigned long getPixelValue( uint8_t r, uint8_t g, uint8_t b ) const;
-
- /// Get the main window ID
- Window getMainWindow() const { return m_mainWindow; }
-
- //XXX
- Window m_voutWindow;
-
- private:
- /// Dummy parent window for the task bar
- Window m_mainWindow;
- /// Display parameters
- Display *m_pDisplay;
- Visual *m_pVisual;
- int m_pixelSize;
- GC m_gc;
- Colormap m_colormap;
- int m_redLeftShift, m_redRightShift;
- int m_greenLeftShift, m_greenRightShift;
- int m_blueLeftShift, m_blueRightShift;
- /// Pointer on the right implementation of blendPixel
- MakePixelFunc_t blendPixelImpl;
- /// Pointer on the right implementation of putPixel
- MakePixelFunc_t putPixelImpl;
-
- /// Calculate shifts from a color mask
- void getShifts( uint32_t mask, int &rLeftShift,
- int &rRightShift ) const;
-
- /// 8 bpp version of blendPixel
- void blendPixel8( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+public:
+ X11Display( intf_thread_t *pIntf );
+ virtual ~X11Display();
+
+ /// Get the display
+ Display *getDisplay() const { return m_pDisplay; }
+
+ /// Get the visual
+ Visual *getVisual() const { return m_pVisual; }
+
+ /// Get the pixel size
+ int getPixelSize() const { return m_pixelSize; }
+
+ /// Get the graphics context
+ GC getGC() const { return m_gc; }
+
+ /// Get the colormap
+ Colormap getColormap() const { return m_colormap; }
+
+ /// Type of function to put RGBA values into a pixel
+ typedef void (X11Display::*MakePixelFunc_t)( uint8_t *pPixel,
+ uint8_t r, uint8_t g, uint8_t b, uint8_t a ) const;
+
+ /// Get a pointer on the right blendPixel implementation
+ MakePixelFunc_t getBlendPixel() const { return blendPixelImpl; }
+
+ /// Get a pointer on the right putPixel implementation
+ MakePixelFunc_t getPutPixel() const { return putPixelImpl; }
+
+ /// Get the pixel value corresponding to the given colors
+ unsigned long getPixelValue( uint8_t r, uint8_t g, uint8_t b ) const;
+
+ /// Get the main window ID
+ Window getMainWindow() const { return m_mainWindow; }
+
+ //XXX
+ Window m_voutWindow;
+
+private:
+ /// Dummy parent window for the task bar
+ Window m_mainWindow;
+ /// Display parameters
+ Display *m_pDisplay;
+ Visual *m_pVisual;
+ int m_pixelSize;
+ GC m_gc;
+ Colormap m_colormap;
+ int m_redLeftShift, m_redRightShift;
+ int m_greenLeftShift, m_greenRightShift;
+ int m_blueLeftShift, m_blueRightShift;
+ /// Pointer on the right implementation of blendPixel
+ MakePixelFunc_t blendPixelImpl;
+ /// Pointer on the right implementation of putPixel
+ MakePixelFunc_t putPixelImpl;
+
+ /// Calculate shifts from a color mask
+ void getShifts( uint32_t mask, int &rLeftShift,
+ int &rRightShift ) const;
+
+ /// 8 bpp version of blendPixel
+ void blendPixel8( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
+
+ /// 16 bpp MSB first version of blendPixel
+ void blendPixel16MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
uint8_t a ) const;
- /// 16 bpp MSB first version of blendPixel
- void blendPixel16MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 16 bpp LSB first version of blendPixel
+ void blendPixel16LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
- /// 16 bpp LSB first version of blendPixel
- void blendPixel16LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 24/32 bpp MSB first version of blendPixel
+ void blendPixel32MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
- /// 24/32 bpp MSB first version of blendPixel
- void blendPixel32MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 24/32 bpp LSB first version of blendPixel
+ void blendPixel32LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
- /// 24/32 bpp LSB first version of blendPixel
- void blendPixel32LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 8 bpp version of putPixel
+ void putPixel8( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
- /// 8 bpp version of putPixel
- void putPixel8( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ /// 16 bpp MSB first version of putPixel
+ void putPixel16MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
uint8_t a ) const;
- /// 16 bpp MSB first version of putPixel
- void putPixel16MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
-
- /// 16 bpp LSB first version of putPixel
- void putPixel16LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 16 bpp LSB first version of putPixel
+ void putPixel16LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
- /// 24/32 bpp MSB first version of putPixel
- void putPixel32MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 24/32 bpp MSB first version of putPixel
+ void putPixel32MSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
- /// 24/32 bpp LSB first version of putPixel
- void putPixel32LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
- uint8_t a ) const;
+ /// 24/32 bpp LSB first version of putPixel
+ void putPixel32LSB( uint8_t *pPixel, uint8_t r, uint8_t g, uint8_t b,
+ uint8_t a ) const;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_DRAGDROP_HPP
class X11DragDrop: public SkinObject
{
- public:
- typedef long ldata_t[5];
-
- X11DragDrop( intf_thread_t *pIntf, X11Display &rDisplay, Window win,
- bool playOnDrop );
- virtual ~X11DragDrop() {}
-
- void dndEnter( ldata_t data );
- void dndPosition( ldata_t data );
- void dndLeave( ldata_t data );
- void dndDrop( ldata_t data );
-
- private:
- /// X11 display
- X11Display &m_rDisplay;
- /// Window ID
- Window m_wnd;
- /// Indicates whether the file(s) must be played immediately
- bool m_playOnDrop;
- /// Target type
- Atom m_target;
+public:
+ typedef long ldata_t[5];
+
+ X11DragDrop( intf_thread_t *pIntf, X11Display &rDisplay, Window win,
+ bool playOnDrop );
+ virtual ~X11DragDrop() { }
+
+ void dndEnter( ldata_t data );
+ void dndPosition( ldata_t data );
+ void dndLeave( ldata_t data );
+ void dndDrop( ldata_t data );
+
+private:
+ /// X11 display
+ X11Display &m_rDisplay;
+ /// Window ID
+ Window m_wnd;
+ /// Indicates whether the file(s) must be played immediately
+ bool m_playOnDrop;
+ /// Target type
+ Atom m_target;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_FACTORY_HPP
/// Class used to instanciate X11 specific objects
class X11Factory: public OSFactory
{
- public:
- /// Map to find the GenericWindow associated to a X11Window
- map<Window, GenericWindow*> m_windowMap;
- /// Map to find the Dnd object associated to a X11Window
- map<Window, X11DragDrop*> m_dndMap;
+public:
+ /// Map to find the GenericWindow associated to a X11Window
+ map<Window, GenericWindow*> m_windowMap;
+ /// Map to find the Dnd object associated to a X11Window
+ map<Window, X11DragDrop*> m_dndMap;
- X11Factory( intf_thread_t *pIntf );
- virtual ~X11Factory();
+ X11Factory( intf_thread_t *pIntf );
+ virtual ~X11Factory();
- /// Initialization method
- virtual bool init();
+ /// Initialization method
+ virtual bool init();
- /// Instantiate an object OSGraphics
- virtual OSGraphics *createOSGraphics( int width, int height );
+ /// Instantiate an object OSGraphics
+ virtual OSGraphics *createOSGraphics( int width, int height );
- /// Get the instance of the singleton OSLoop
- virtual OSLoop *getOSLoop();
+ /// Get the instance of the singleton OSLoop
+ virtual OSLoop *getOSLoop();
- /// Destroy the instance of OSLoop
- virtual void destroyOSLoop();
+ /// Destroy the instance of OSLoop
+ virtual void destroyOSLoop();
- /// Instantiate an OSTimer with the given command
- virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
+ /// Instantiate an OSTimer with the given command
+ virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
- /// Minimize all the windows
- virtual void minimize();
+ /// Minimize all the windows
+ virtual void minimize();
- /// Restore the minimized windows
- virtual void restore();
+ /// Restore the minimized windows
+ virtual void restore();
- /// Add an icon in the system tray
- virtual void addInTray();
+ /// Add an icon in the system tray
+ virtual void addInTray();
- /// Remove the icon from the system tray
- virtual void removeFromTray();
+ /// Remove the icon from the system tray
+ virtual void removeFromTray();
- /// Show the task in the task bar
- virtual void addInTaskBar();
+ /// Show the task in the task bar
+ virtual void addInTaskBar();
- /// Remove the task from the task bar
- virtual void removeFromTaskBar();
+ /// Remove the task from the task bar
+ virtual void removeFromTaskBar();
- /// Instantiate an OSWindow object
- virtual OSWindow *createOSWindow( GenericWindow &rWindow,
- bool dragDrop, bool playOnDrop,
- OSWindow *pParent );
+ /// Instantiate an OSWindow object
+ virtual OSWindow *createOSWindow( GenericWindow &rWindow,
+ bool dragDrop, bool playOnDrop,
+ OSWindow *pParent );
- /// Instantiate an object OSTooltip
- virtual OSTooltip *createOSTooltip();
+ /// Instantiate an object OSTooltip
+ virtual OSTooltip *createOSTooltip();
- /// Instantiate an object OSPopup
- virtual OSPopup *createOSPopup();
+ /// Instantiate an object OSPopup
+ virtual OSPopup *createOSPopup();
- /// Get the directory separator
- virtual const string &getDirSeparator() const { return m_dirSep; }
+ /// Get the directory separator
+ virtual const string &getDirSeparator() const { return m_dirSep; }
- /// Get the resource path
- virtual const list<string> &getResourcePath() const
- { return m_resourcePath; }
+ /// Get the resource path
+ virtual const list<string> &getResourcePath() const
+ { return m_resourcePath; }
- /// Get the screen size
- virtual int getScreenWidth() const;
- virtual int getScreenHeight() const;
+ /// Get the screen size
+ virtual int getScreenWidth() const;
+ virtual int getScreenHeight() const;
- /// Get the work area (screen area without taskbars)
- virtual SkinsRect getWorkArea() const;
+ /// Get the work area (screen area without taskbars)
+ virtual SkinsRect getWorkArea() const;
- /// Get the position of the mouse
- virtual void getMousePos( int &rXPos, int &rYPos ) const;
+ /// Get the position of the mouse
+ virtual void getMousePos( int &rXPos, int &rYPos ) const;
- /// Change the cursor
- virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
+ /// Change the cursor
+ virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
- /// Delete a directory recursively
- virtual void rmDir( const string &rPath );
+ /// Delete a directory recursively
+ virtual void rmDir( const string &rPath );
- /// Get the timer loop
- X11TimerLoop *getTimerLoop() const { return m_pTimerLoop; }
+ /// Get the timer loop
+ X11TimerLoop *getTimerLoop() const { return m_pTimerLoop; }
- private:
- /// X11 display
- X11Display *m_pDisplay;
- /// Timer loop
- X11TimerLoop *m_pTimerLoop;
- /// Directory separator
- const string m_dirSep;
- /// Resource path
- list<string> m_resourcePath;
+private:
+ /// X11 display
+ X11Display *m_pDisplay;
+ /// Timer loop
+ X11TimerLoop *m_pTimerLoop;
+ /// Directory separator
+ const string m_dirSep;
+ /// Resource path
+ list<string> m_resourcePath;
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_GRAPHICS_HPP
/// X11 implementation of OSGraphics
class X11Graphics: public OSGraphics
{
- public:
- X11Graphics( intf_thread_t *pIntf, X11Display &rDisplay, int width,
- int height);
-
- virtual ~X11Graphics();
-
- /// Clear the graphics
- virtual void clear();
-
- /// Draw another graphics on this one
- virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1 );
-
- /// Render a bitmap on this graphics
- virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
- int ySrc = 0, int xDest = 0, int yDest = 0,
- int width = -1, int height = -1,
- bool blend = false );
-
- /// Draw a filled rectangle on the grahics (color is #RRGGBB)
- virtual void fillRect( int left, int top, int width, int height,
- uint32_t color );
-
- /// Draw an empty rectangle on the grahics (color is #RRGGBB)
- virtual void drawRect( int left, int top, int width, int height,
- uint32_t color );
-
- /// Set the shape of a window with the mask of this graphics.
- virtual void applyMaskToWindow( OSWindow &rWindow );
-
- /// Copy the graphics on a window
- virtual void copyToWindow( OSWindow &rWindow, int xSrc,
- int ySrc, int width, int height,
- int xDest, int yDest );
-
- /// Tell whether the pixel at the given position is visible
- virtual bool hit( int x, int y ) const;
-
- /// Getters
- virtual int getWidth() const { return m_width; }
- virtual int getHeight() const { return m_height; }
-
- /// Get the pixmap ID
- Pixmap getDrawable() const { return m_pixmap; }
- /// Get the transparency mask
- Region getMask() const { return m_mask; }
-
- private:
- /// X11 display
- X11Display &m_rDisplay;
- /// Size of the image
- int m_width, m_height;
- /// Pixmap
- Pixmap m_pixmap;
- /// Transparency mask
- Region m_mask;
- /// Graphics context
- GC m_gc;
-
- /// Add an horizontal segment in a region
- void addHSegmentInRegion( Region &rMask, int xStart,
- int xEnd, int y );
- /// Add a vertical segment in a region
- void addVSegmentInRegion( Region &rMask, int yStart,
- int yEnd, int x );
+public:
+ X11Graphics( intf_thread_t *pIntf, X11Display &rDisplay, int width,
+ int height);
+
+ virtual ~X11Graphics();
+
+ /// Clear the graphics
+ virtual void clear();
+
+ /// Draw another graphics on this one
+ virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1 );
+
+ /// Render a bitmap on this graphics
+ virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
+ int ySrc = 0, int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1,
+ bool blend = false );
+
+ /// Draw a filled rectangle on the grahics (color is #RRGGBB)
+ virtual void fillRect( int left, int top, int width, int height,
+ uint32_t color );
+
+ /// Draw an empty rectangle on the grahics (color is #RRGGBB)
+ virtual void drawRect( int left, int top, int width, int height,
+ uint32_t color );
+
+ /// Set the shape of a window with the mask of this graphics.
+ virtual void applyMaskToWindow( OSWindow &rWindow );
+
+ /// Copy the graphics on a window
+ virtual void copyToWindow( OSWindow &rWindow, int xSrc,
+ int ySrc, int width, int height,
+ int xDest, int yDest );
+
+ /// Tell whether the pixel at the given position is visible
+ virtual bool hit( int x, int y ) const;
+
+ /// Getters
+ virtual int getWidth() const { return m_width; }
+ virtual int getHeight() const { return m_height; }
+
+ /// Get the pixmap ID
+ Pixmap getDrawable() const { return m_pixmap; }
+ /// Get the transparency mask
+ Region getMask() const { return m_mask; }
+
+private:
+ /// X11 display
+ X11Display &m_rDisplay;
+ /// Size of the image
+ int m_width, m_height;
+ /// Pixmap
+ Pixmap m_pixmap;
+ /// Transparency mask
+ Region m_mask;
+ /// Graphics context
+ GC m_gc;
+
+ /// Add an horizontal segment in a region
+ void addHSegmentInRegion( Region &rMask, int xStart, int xEnd, int y );
+ /// Add a vertical segment in a region
+ void addVSegmentInRegion( Region &rMask, int yStart, int yEnd, int x );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_LOOP_HPP
/// Main event loop for X11 (singleton)
class X11Loop: public OSLoop
{
- public:
- /// Get the instance of X11Loop
- static OSLoop *instance( intf_thread_t *pIntf, X11Display &rDisplay );
+public:
+ /// Get the instance of X11Loop
+ static OSLoop *instance( intf_thread_t *pIntf, X11Display &rDisplay );
- /// Destroy the instance of X11Loop
- static void destroy( intf_thread_t *pIntf );
+ /// Destroy the instance of X11Loop
+ static void destroy( intf_thread_t *pIntf );
- /// Enter the event loop
- virtual void run();
+ /// Enter the event loop
+ virtual void run();
- /// Exit the main loop
- virtual void exit();
+ /// Exit the main loop
+ virtual void exit();
- private:
- /// X11 Display
- X11Display &m_rDisplay;
- /// Flag set on exit
- bool m_exit;
- /// Date and position of the last left-click
- mtime_t m_lastClickTime;
- int m_lastClickPosX, m_lastClickPosY;
- /// Maximum interval between clicks for a double-click (in microsec)
- static int m_dblClickDelay;
- /// Map associating special (i.e. non ascii) virtual key codes with
- /// internal vlc key codes
- map<KeySym, int> keysymToVlcKey;
+private:
+ /// X11 Display
+ X11Display &m_rDisplay;
+ /// Flag set on exit
+ bool m_exit;
+ /// Date and position of the last left-click
+ mtime_t m_lastClickTime;
+ int m_lastClickPosX, m_lastClickPosY;
+ /// Maximum interval between clicks for a double-click (in microsec)
+ static int m_dblClickDelay;
+ /// Map associating special (i.e. non ascii) virtual key codes with
+ /// internal vlc key codes
+ map<KeySym, int> keysymToVlcKey;
- // Private because it's a singleton
- X11Loop( intf_thread_t *pIntf, X11Display &rDisplay );
- virtual ~X11Loop();
+ // Private because it's a singleton
+ X11Loop( intf_thread_t *pIntf, X11Display &rDisplay );
+ virtual ~X11Loop();
- /// Handle the next X11 event
- void handleX11Event();
+ /// Handle the next X11 event
+ void handleX11Event();
};
#endif
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_POPUP_HPP
/// X11 implementation of OSPopup
class X11Popup: public OSPopup
{
- public:
- X11Popup( intf_thread_t *pIntf, X11Display & );
+public:
+ X11Popup( intf_thread_t *pIntf, X11Display & );
- virtual ~X11Popup();
+ virtual ~X11Popup();
- /// Show the popup menu at the given (absolute) corrdinates
- virtual void show( int xPos, int yPos );
+ /// Show the popup menu at the given (absolute) corrdinates
+ virtual void show( int xPos, int yPos );
- /// Hide the popup menu
- virtual void hide();
+ /// Hide the popup menu
+ virtual void hide();
- /// Append a new menu item with the given label to the popup menu
- virtual void addItem( const string &rLabel, int pos );
+ /// Append a new menu item with the given label to the popup menu
+ virtual void addItem( const string &rLabel, int pos );
- /// Create a dummy menu item to separate sections
- virtual void addSeparator( int pos );
+ /// Create a dummy menu item to separate sections
+ virtual void addSeparator( int pos );
- /// Return the position of the item identified by the given id
- virtual int getPosFromId( int id ) const;
+ /// Return the position of the item identified by the given id
+ virtual int getPosFromId( int id ) const;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_TIMER_HPP
// X11 specific timer
class X11Timer: public OSTimer
{
- public:
- X11Timer( intf_thread_t *pIntf, CmdGeneric &rCmd );
- virtual ~X11Timer();
-
- /// (Re)start the timer with the given delay (in ms). If oneShot is
- /// true, stop it after the first execution of the callback.
- virtual void start( int delay, bool oneShot );
-
- /// Stop the timer
- virtual void stop();
-
- mtime_t getNextDate() const;
-
- /// Execute the callback.
- /// Returns false if the timer must be removed after
- bool execute();
-
- private:
- /// Command to execute
- CmdGeneric &m_rCommand;
- /// Timer loop
- X11TimerLoop *m_pTimerLoop;
- /// Delay between two execute
- mtime_t m_interval;
- /// Next date at which the timer must be executed
- mtime_t m_nextDate;
- /// Flag to tell if the timer must be stopped after the first execution
- bool m_oneShot;
+public:
+ X11Timer( intf_thread_t *pIntf, CmdGeneric &rCmd );
+ virtual ~X11Timer();
+
+ /// (Re)start the timer with the given delay (in ms). If oneShot is
+ /// true, stop it after the first execution of the callback.
+ virtual void start( int delay, bool oneShot );
+
+ /// Stop the timer
+ virtual void stop();
+
+ mtime_t getNextDate() const;
+
+ /// Execute the callback.
+ /// Returns false if the timer must be removed after
+ bool execute();
+
+private:
+ /// Command to execute
+ CmdGeneric &m_rCommand;
+ /// Timer loop
+ X11TimerLoop *m_pTimerLoop;
+ /// Delay between two execute
+ mtime_t m_interval;
+ /// Next date at which the timer must be executed
+ mtime_t m_nextDate;
+ /// Flag to tell if the timer must be stopped after the first execution
+ bool m_oneShot;
};
/// Class to manage a set of timers
class X11TimerLoop: public SkinObject
{
- public:
- /// Create the timer loop with the communication number of the X11
- /// display
- X11TimerLoop( intf_thread_t *pIntf, int connectionNumber );
- virtual ~X11TimerLoop();
-
- /// Add a timer in the manager
- void addTimer( X11Timer &rTimer );
-
- /// Remove a timer from the manager
- void removeTimer( X11Timer &rTimer );
-
- /// Wait for the next timer and execute it
- void waitNextTimer();
-
- private:
- /// Connection number of the X11 display
- int m_connectionNumber;
- /// List of timers
- list<X11Timer*> m_timers;
-
- /// Sleep for delay milliseconds, unless an X11 event is received
- /// Returns true if the sleep has been interupted.
- bool sleep( int delay );
+public:
+ /// Create the timer loop with the communication number of the X11
+ /// display
+ X11TimerLoop( intf_thread_t *pIntf, int connectionNumber );
+ virtual ~X11TimerLoop();
+
+ /// Add a timer in the manager
+ void addTimer( X11Timer &rTimer );
+
+ /// Remove a timer from the manager
+ void removeTimer( X11Timer &rTimer );
+
+ /// Wait for the next timer and execute it
+ void waitNextTimer();
+
+private:
+ /// Connection number of the X11 display
+ int m_connectionNumber;
+ /// List of timers
+ list<X11Timer*> m_timers;
+
+ /// Sleep for delay milliseconds, unless an X11 event is received.
+ /// Returns true if the sleep has been interupted.
+ bool sleep( int delay );
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_TOOLTIP_HPP
/// X11 implementation of OSTooltip
class X11Tooltip: public OSTooltip
{
- public:
- X11Tooltip( intf_thread_t *pIntf, X11Display &rDisplay );
+public:
+ X11Tooltip( intf_thread_t *pIntf, X11Display &rDisplay );
- virtual ~X11Tooltip();
+ virtual ~X11Tooltip();
- /// Show the tooltip
- virtual void show( int left, int top, OSGraphics &rText );
+ /// Show the tooltip
+ virtual void show( int left, int top, OSGraphics &rText );
- /// Hide the tooltip
- virtual void hide();
+ /// Hide the tooltip
+ virtual void hide();
- private:
- /// X11 display
- X11Display &m_rDisplay;
- /// Window ID
- Window m_wnd;
+private:
+ /// X11 display
+ X11Display &m_rDisplay;
+ /// Window ID
+ Window m_wnd;
};
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef X11_WINDOW_HPP
/// X11 implementation of OSWindow
class X11Window: public OSWindow
{
- public:
- X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
- X11Display &rDisplay, bool dragDrop, bool playOnDrop,
- X11Window *pParentWindow );
+public:
+ X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
+ X11Display &rDisplay, bool dragDrop, bool playOnDrop,
+ X11Window *pParentWindow );
- virtual ~X11Window();
+ virtual ~X11Window();
- // Show the window
- virtual void show() const;
+ // Show the window
+ virtual void show() const;
- // Hide the window
- virtual void hide() const;
+ // Hide the window
+ virtual void hide() const;
- /// Move the window
- virtual void moveResize( int left, int top,
- int width, int height ) const;
+ /// Move the window
+ virtual void moveResize( int left, int top,
+ int width, int height ) const;
- /// Bring the window on top
- virtual void raise() const;
+ /// Bring the window on top
+ virtual void raise() const;
- /// Set the opacity of the window (0 = transparent, 255 = opaque)
- virtual void setOpacity( uint8_t value ) const;
+ /// Set the opacity of the window (0 = transparent, 255 = opaque)
+ virtual void setOpacity( uint8_t value ) const;
- /// Toggle the window on top
- virtual void toggleOnTop( bool onTop ) const;
+ /// Toggle the window on top
+ virtual void toggleOnTop( bool onTop ) const;
- /// Get the window ID
- Window getDrawable() const { return m_wnd; }
+ /// Get the window ID
+ Window getDrawable() const { return m_wnd; }
- /// Getter for the handler
- void* getOSHandle() const { return (void*) m_wnd; }
+ /// Getter for the handler
+ void* getOSHandle() const { return (void*) m_wnd; }
- /// Getter for the handler
- void* getParentOSHandle() const { return (void*) m_wnd_parent; }
+ /// Getter for the handler
+ void* getParentOSHandle() const { return (void*) m_wnd_parent; }
- /// reparent the window
- void reparent( void* OSHandle, int x, int y, int w, int h );
+ /// reparent the window
+ void reparent( void* OSHandle, int x, int y, int w, int h );
- private:
- /// X11 display
- X11Display &m_rDisplay;
- /// Window ID
- 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
- X11DragDrop *m_pDropTarget;
+private:
+ /// X11 display
+ X11Display &m_rDisplay;
+ /// Window ID
+ 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
+ X11DragDrop *m_pDropTarget;
};