Commit bebef5dc authored by JP Dinger's avatar JP Dinger

Skins2: Cosmetics, 100% pure. We don't indent for labels in C, we don't in C++.

parent b25aa5bf
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef ASYNC_QUEUE_HPP #ifndef ASYNC_QUEUE_HPP
...@@ -36,38 +36,38 @@ class OSTimer; ...@@ -36,38 +36,38 @@ class OSTimer;
/// Asynchronous queue for commands /// Asynchronous queue for commands
class AsyncQueue: public SkinObject class AsyncQueue: public SkinObject
{ {
public: public:
/// Get the instance of AsyncQueue /// Get the instance of AsyncQueue
/// Returns NULL if initialization failed. /// Returns NULL if initialization failed.
static AsyncQueue *instance( intf_thread_t *pIntf ); static AsyncQueue *instance( intf_thread_t *pIntf );
/// Destroy the instance of AsyncQueue /// Destroy the instance of AsyncQueue
static void destroy( intf_thread_t *pIntf ); static void destroy( intf_thread_t *pIntf );
/// Add a command in the queue, after having removed the commands /// Add a command in the queue, after having removed the commands
/// of the same type already in the queue if needed /// of the same type already in the queue if needed
void push( const CmdGenericPtr &rcCommand, bool removePrev = true ); void push( const CmdGenericPtr &rcCommand, bool removePrev = true );
/// Remove the commands of the given type /// Remove the commands of the given type
void remove( const string &rType , const CmdGenericPtr &rcCommand ); void remove( const string &rType , const CmdGenericPtr &rcCommand );
/// Flush the queue and execute the commands /// Flush the queue and execute the commands
void flush(); void flush();
private: private:
/// Command queue /// Command queue
list<CmdGenericPtr> m_cmdList; list<CmdGenericPtr> m_cmdList;
/// Timer /// Timer
OSTimer *m_pTimer; OSTimer *m_pTimer;
/// Mutex /// Mutex
vlc_mutex_t m_lock; vlc_mutex_t m_lock;
// Private because it is a singleton // Private because it is a singleton
AsyncQueue( intf_thread_t *pIntf ); AsyncQueue( intf_thread_t *pIntf );
virtual ~AsyncQueue(); virtual ~AsyncQueue();
// Callback to flush the queue // Callback to flush the queue
DEFINE_CALLBACK( AsyncQueue, Flush ); DEFINE_CALLBACK( AsyncQueue, Flush );
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_ADD_ITEM_HPP #ifndef CMD_ADD_ITEM_HPP
...@@ -32,22 +32,18 @@ ...@@ -32,22 +32,18 @@
/// "Add item" command /// "Add item" command
class CmdAddItem: public CmdGeneric class CmdAddItem: public CmdGeneric
{ {
public: public:
CmdAddItem( intf_thread_t *pIntf, const string &rName, bool playNow ): CmdAddItem( intf_thread_t *pIntf, const string &rName, bool playNow )
CmdGeneric( pIntf ), m_name( rName ), m_playNow( playNow ) {} : CmdGeneric( pIntf ), m_name( rName ), m_playNow( playNow ) { }
virtual ~CmdAddItem() {} virtual ~CmdAddItem() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "add item"; }
virtual void execute();
private:
/// Return the type of the command /// Name of the item to enqueue
virtual string getType() const { return "add item"; } string m_name;
/// Should we play the item immediately?
private: bool m_playNow;
/// Name of the item to enqueue
string m_name;
/// Should we play the item immediately?
bool m_playNow;
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_AUDIO_HPP #ifndef CMD_AUDIO_HPP
...@@ -29,20 +29,16 @@ ...@@ -29,20 +29,16 @@
/// Command to enable/disable the equalizer /// Command to enable/disable the equalizer
class CmdSetEqualizer: public CmdGeneric class CmdSetEqualizer: public CmdGeneric
{ {
public: public:
CmdSetEqualizer( intf_thread_t *pIntf, bool iEnable ): CmdSetEqualizer( intf_thread_t *pIntf, bool iEnable )
CmdGeneric( pIntf ), m_enable( iEnable ) {} : CmdGeneric( pIntf ), m_enable( iEnable ) { }
virtual ~CmdSetEqualizer() {} virtual ~CmdSetEqualizer() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "set equalizer"; }
virtual void execute();
private:
/// Return the type of the command /// Enable or disable the equalizer
virtual string getType() const { return "set equalizer"; } bool m_enable;
private:
/// Enable or disable the equalizer
bool m_enable;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_CHANGE_SKIN_HPP #ifndef CMD_CHANGE_SKIN_HPP
...@@ -31,20 +31,16 @@ ...@@ -31,20 +31,16 @@
/// "Change Skin" command /// "Change Skin" command
class CmdChangeSkin: public CmdGeneric class CmdChangeSkin: public CmdGeneric
{ {
public: public:
CmdChangeSkin( intf_thread_t *pIntf, const string &rFile ): CmdChangeSkin( intf_thread_t *pIntf, const string &rFile ):
CmdGeneric( pIntf ), m_file( rFile ) {} CmdGeneric( pIntf ), m_file( rFile ) { }
virtual ~CmdChangeSkin() {} virtual ~CmdChangeSkin() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "change skin"; }
virtual void execute();
private:
/// Return the type of the command /// Skin file to load
virtual string getType() const { return "change skin"; } string m_file;
private:
/// Skin file to load
string m_file;
}; };
#endif #endif
...@@ -17,68 +17,65 @@ ...@@ -17,68 +17,65 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_GENERIC_HPP #ifndef CMD_GENERIC_HPP
#define CMD_GENERIC_HPP #define CMD_GENERIC_HPP
#include <string>
#include "../src/skin_common.hpp" #include "../src/skin_common.hpp"
#include "../utils/pointer.hpp" #include "../utils/pointer.hpp"
#include <string>
/// Macro to define the prototype of simple commands /// Macro to define the prototype of simple commands
#define DEFINE_COMMAND( name, type ) \ #define DEFINE_COMMAND( name, type ) \
class Cmd##name: public CmdGeneric \ class Cmd##name: public CmdGeneric \
{ \ { public: \
public: \ Cmd##name( intf_thread_t *pIntf ): CmdGeneric( pIntf ) { } \
Cmd##name( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {} \ virtual ~Cmd##name() { } \
virtual ~Cmd##name() {} \ virtual void execute(); \
virtual void execute(); \ virtual string getType() const { return type; } \
virtual string getType() const { return type; } \
\
}; };
/// Macro to define a "callback" command inside a class /// Macro to define a "callback" command inside a class
#define DEFINE_CALLBACK( parent, action ) \ #define DEFINE_CALLBACK( parent, action ) \
class Cmd##action: public CmdGeneric \ class Cmd##action: public CmdGeneric \
{ \ { \
public: \ public: \
Cmd##action( parent *pParent ): \ Cmd##action( parent *pParent ): \
CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) {} \ CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) { } \
virtual ~Cmd##action() {} \ virtual ~Cmd##action() { } \
virtual void execute(); \ virtual void execute(); \
virtual string getType() const { return "Cmd" #parent #action; } \ virtual string getType() const { return "Cmd" #parent #action; } \
private: \ private: \
parent *m_pParent; \ parent *m_pParent; \
\ } m_cmd##action; \
} m_cmd##action; \
friend class Cmd##action; friend class Cmd##action;
/// Base class for skins commands /// Base class for skins commands
class CmdGeneric: public SkinObject class CmdGeneric: public SkinObject
{ {
public: public:
virtual ~CmdGeneric() {} virtual ~CmdGeneric() { }
/// This method does the real job of the command /// This method does the real job of the command
virtual void execute() = 0; virtual void execute() = 0;
/// Return the type of the command /// Return the type of the command
virtual string getType() const { return ""; } virtual string getType() const { return ""; }
/// During queue reductions, check if we really want to remove /// During queue reductions, check if we really want to remove
/// this command. /// this command.
virtual bool checkRemove( CmdGeneric * ) const { return true; } virtual bool checkRemove( CmdGeneric * ) const { return true; }
protected: protected:
CmdGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) {} CmdGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_LAYOUT_HPP #ifndef CMD_LAYOUT_HPP
...@@ -33,20 +33,16 @@ class GenericLayout; ...@@ -33,20 +33,16 @@ class GenericLayout;
/// "Change layout" command /// "Change layout" command
class CmdLayout: public CmdGeneric class CmdLayout: public CmdGeneric
{ {
public: public:
CmdLayout( intf_thread_t *pIntf, TopWindow &rWindow, CmdLayout( intf_thread_t *pIntf, TopWindow &rWindow,
GenericLayout &rLayout ); GenericLayout &rLayout );
virtual ~CmdLayout() {} virtual ~CmdLayout() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "change layout"; }
virtual void execute();
private:
/// Return the type of the command TopWindow &m_rWindow;
virtual string getType() const { return "change layout"; } GenericLayout &m_rLayout;
private:
TopWindow &m_rWindow;
GenericLayout &m_rLayout;
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_MINIMIZE_HPP #ifndef CMD_MINIMIZE_HPP
...@@ -36,48 +36,40 @@ DEFINE_COMMAND(Restore, "restore" ) ...@@ -36,48 +36,40 @@ DEFINE_COMMAND(Restore, "restore" )
/// Command to maximize a window /// Command to maximize a window
class CmdMaximize: public CmdGeneric class CmdMaximize: public CmdGeneric
{ {
public: public:
/// Maximize the given layout /// Maximize the given layout
CmdMaximize( intf_thread_t *pIntf, WindowManager &rWindowManager, CmdMaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
TopWindow &rWindow ); TopWindow &rWindow );
virtual ~CmdMaximize() {} virtual ~CmdMaximize() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "maximize"; }
virtual void execute();
private:
/// Return the type of the command WindowManager &m_rWindowManager;
virtual string getType() const { return "maximize"; } TopWindow &m_rWindow;
private:
WindowManager &m_rWindowManager;
TopWindow &m_rWindow;
}; };
/// Command to unmaximize a window /// Command to unmaximize a window
class CmdUnmaximize: public CmdGeneric class CmdUnmaximize: public CmdGeneric
{ {
public: public:
/// Unmaximize the given layout /// Unmaximize the given layout
CmdUnmaximize( intf_thread_t *pIntf, WindowManager &rWindowManager, CmdUnmaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
TopWindow &rWindow ); TopWindow &rWindow );
virtual ~CmdUnmaximize() {} virtual ~CmdUnmaximize() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "unmaximize"; }
virtual void execute();
private:
/// Return the type of the command WindowManager &m_rWindowManager;
virtual string getType() const { return "unmaximize"; } TopWindow &m_rWindow;
private:
WindowManager &m_rWindowManager;
TopWindow &m_rWindow;
}; };
DEFINE_COMMAND(AddInTray, "add in tray" ) DEFINE_COMMAND( AddInTray, "add in tray" )
DEFINE_COMMAND(RemoveFromTray, "remove from tray" ) DEFINE_COMMAND( RemoveFromTray, "remove from tray" )
DEFINE_COMMAND(AddInTaskBar, "add in taskbar" ) DEFINE_COMMAND( AddInTaskBar, "add in taskbar" )
DEFINE_COMMAND(RemoveFromTaskBar, "remove from taskbar" ) DEFINE_COMMAND( RemoveFromTaskBar, "remove from taskbar" )
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_MUXER_HPP #ifndef CMD_MUXER_HPP
...@@ -31,20 +31,16 @@ ...@@ -31,20 +31,16 @@
/// This command only contains other commands (composite pattern) /// This command only contains other commands (composite pattern)
class CmdMuxer: public CmdGeneric class CmdMuxer: public CmdGeneric
{ {
public: public:
CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList ): CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList ):
CmdGeneric( pIntf ), m_list( rList ) {} CmdGeneric( pIntf ), m_list( rList ) { }
virtual ~CmdMuxer() {} virtual ~CmdMuxer() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "muxer"; }
virtual void execute();
private:
/// Return the type of the command /// List of commands we will execute sequentially
virtual string getType() const { return "muxer"; } list<CmdGeneric*> m_list;
private:
/// List of commands we will execute sequentially
list<CmdGeneric*> m_list;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_PLAYLIST_HPP #ifndef CMD_PLAYLIST_HPP
...@@ -32,20 +32,16 @@ ...@@ -32,20 +32,16 @@
/// Command to delete the selected items from a list /// Command to delete the selected items from a list
class CmdPlaylistDel: public CmdGeneric class CmdPlaylistDel: public CmdGeneric
{ {
public: public:
CmdPlaylistDel( intf_thread_t *pIntf, VarList &rList ): CmdPlaylistDel( intf_thread_t *pIntf, VarList &rList )
CmdGeneric( pIntf ), m_rList( rList ) {} : CmdGeneric( pIntf ), m_rList( rList ) { }
virtual ~CmdPlaylistDel() {} virtual ~CmdPlaylistDel() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playlist del"; }
virtual void execute();
private:
/// Return the type of the command /// List
virtual string getType() const { return "playlist del"; } VarList &m_rList;
private:
/// List
VarList &m_rList;
}; };
...@@ -65,100 +61,80 @@ DEFINE_COMMAND( PlaylistFirst, "playlist first" ) ...@@ -65,100 +61,80 @@ DEFINE_COMMAND( PlaylistFirst, "playlist first" )
/// Command to set the random state /// Command to set the random state
class CmdPlaylistRandom: public CmdGeneric class CmdPlaylistRandom: public CmdGeneric
{ {
public: public:
CmdPlaylistRandom( intf_thread_t *pIntf, bool value ): CmdPlaylistRandom( intf_thread_t *pIntf, bool value )
CmdGeneric( pIntf ), m_value( value ) {} : CmdGeneric( pIntf ), m_value( value ) { }
virtual ~CmdPlaylistRandom() {} virtual ~CmdPlaylistRandom() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playlist random"; }
virtual void execute();
private:
/// Return the type of the command /// Random state
virtual string getType() const { return "playlist random"; } bool m_value;
private:
/// Random state
bool m_value;
}; };
/// Command to set the loop state /// Command to set the loop state
class CmdPlaylistLoop: public CmdGeneric class CmdPlaylistLoop: public CmdGeneric
{ {
public: public:
CmdPlaylistLoop( intf_thread_t *pIntf, bool value ): CmdPlaylistLoop( intf_thread_t *pIntf, bool value )
CmdGeneric( pIntf ), m_value( value ) {} : CmdGeneric( pIntf ), m_value( value ) { }
virtual ~CmdPlaylistLoop() {} virtual ~CmdPlaylistLoop() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playlist loop"; }
virtual void execute();
private:
/// Return the type of the command /// Loop state
virtual string getType() const { return "playlist loop"; } bool m_value;
private:
/// Loop state
bool m_value;
}; };
/// Command to set the repeat state /// Command to set the repeat state
class CmdPlaylistRepeat: public CmdGeneric class CmdPlaylistRepeat: public CmdGeneric
{ {
public: public:
CmdPlaylistRepeat( intf_thread_t *pIntf, bool value ): CmdPlaylistRepeat( intf_thread_t *pIntf, bool value )
CmdGeneric( pIntf ), m_value( value ) {} : CmdGeneric( pIntf ), m_value( value ) { }
virtual ~CmdPlaylistRepeat() {} virtual ~CmdPlaylistRepeat() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playlist repeat"; }
virtual void execute();
private:
/// Return the type of the command /// Repeat state
virtual string getType() const { return "playlist repeat"; } bool m_value;
private:
/// Repeat state
bool m_value;
}; };
/// Command to load a playlist /// Command to load a playlist
class CmdPlaylistLoad: public CmdGeneric class CmdPlaylistLoad: public CmdGeneric
{ {
public: public:
CmdPlaylistLoad( intf_thread_t *pIntf, const string& rFile ): CmdPlaylistLoad( intf_thread_t *pIntf, const string& rFile )
CmdGeneric( pIntf ), m_file( rFile ) {} : CmdGeneric( pIntf ), m_file( rFile ) { }
virtual ~CmdPlaylistLoad() {} virtual ~CmdPlaylistLoad() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playlist load"; }
virtual void execute();
private:
/// Return the type of the command /// Playlist file to load
virtual string getType() const { return "playlist load"; } string m_file;
private:
/// Playlist file to load
string m_file;
}; };
/// Command to save a playlist /// Command to save a playlist
class CmdPlaylistSave: public CmdGeneric class CmdPlaylistSave: public CmdGeneric
{ {
public: public:
CmdPlaylistSave( intf_thread_t *pIntf, const string& rFile ): CmdPlaylistSave( intf_thread_t *pIntf, const string& rFile )
CmdGeneric( pIntf ), m_file( rFile ) {} : CmdGeneric( pIntf ), m_file( rFile ) { }
virtual ~CmdPlaylistSave() {} virtual ~CmdPlaylistSave() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playlist save"; }
virtual void execute();
private:
/// Return the type of the command /// Playlist file to save
virtual string getType() const { return "playlist save"; } string m_file;
private:
/// Playlist file to save
string m_file;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_PLAYTREE_HPP #ifndef CMD_PLAYTREE_HPP
...@@ -33,20 +33,16 @@ ...@@ -33,20 +33,16 @@
/// Command to delete the selected items from a tree /// Command to delete the selected items from a tree
class CmdPlaytreeDel: public CmdGeneric class CmdPlaytreeDel: public CmdGeneric
{ {
public: public:
CmdPlaytreeDel( intf_thread_t *pIntf, VarTree &rTree ): CmdPlaytreeDel( intf_thread_t *pIntf, VarTree &rTree )
CmdGeneric( pIntf ), m_rTree( rTree ) {} : CmdGeneric( pIntf ), m_rTree( rTree ) { }
virtual ~CmdPlaytreeDel() {} virtual ~CmdPlaytreeDel() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playtree del"; }
virtual void execute();
private:
/// Return the type of the command /// Tree
virtual string getType() const { return "playtree del"; } VarTree &m_rTree;
private:
/// Tree
VarTree &m_rTree;
}; };
/// Command to sort the playtree /// Command to sort the playtree
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_RESIZE_HPP #ifndef CMD_RESIZE_HPP
...@@ -36,83 +36,67 @@ class CtrlVideo; ...@@ -36,83 +36,67 @@ class CtrlVideo;
/// Command to resize a layout /// Command to resize a layout
class CmdResize: public CmdGeneric class CmdResize: public CmdGeneric
{ {
public: public:
/// Resize the given layout /// Resize the given layout
CmdResize( intf_thread_t *pIntf, const WindowManager &rWindowManager, CmdResize( intf_thread_t *pIntf, const WindowManager &rWindowManager,
GenericLayout &rLayout, int width, int height ); GenericLayout &rLayout, int width, int height );
virtual ~CmdResize() {} virtual ~CmdResize() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "resize"; }
virtual void execute();
private:
/// Return the type of the command const WindowManager &m_rWindowManager;
virtual string getType() const { return "resize"; } GenericLayout &m_rLayout;
int m_width, m_height;
private:
const WindowManager &m_rWindowManager;
GenericLayout &m_rLayout;
int m_width, m_height;
}; };
/// Command to resize the inner vout window /// Command to resize the inner vout window
class CmdResizeInnerVout: public CmdGeneric class CmdResizeInnerVout: public CmdGeneric
{ {
public: public:
/// Resize the given layout /// Resize the given layout
CmdResizeInnerVout( intf_thread_t *pIntf, CtrlVideo* pCtrlVideo ); CmdResizeInnerVout( intf_thread_t *pIntf, CtrlVideo* pCtrlVideo );
virtual ~CmdResizeInnerVout() {} virtual ~CmdResizeInnerVout() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "resize inner vout"; }
virtual void execute();
private:
/// Return the type of the command CtrlVideo* m_pCtrlVideo;
virtual string getType() const { return "resize inner vout"; }
private:
CtrlVideo* m_pCtrlVideo;
}; };
/// Command to resize the vout window /// Command to resize the vout window
class CmdResizeVout: public CmdGeneric class CmdResizeVout: public CmdGeneric
{ {
public: public:
/// Resize the given layout /// Resize the given layout
CmdResizeVout( intf_thread_t *pIntf, vout_window_t* pWnd, CmdResizeVout( intf_thread_t *pIntf, vout_window_t* pWnd,
int width, int height ); int width, int height );
virtual ~CmdResizeVout() {} virtual ~CmdResizeVout() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "resize vout"; }
virtual void execute();
private:
/// Return the type of the command vout_window_t* m_pWnd;
virtual string getType() const { return "resize vout"; } int m_width, m_height;
private:
vout_window_t* m_pWnd;
int m_width, m_height;
}; };
/// Command to toggle Fullscreen /// Command to toggle Fullscreen
class CmdSetFullscreen: public CmdGeneric class CmdSetFullscreen: public CmdGeneric
{ {
public: public:
/// Resize the given layout /// Resize the given layout
CmdSetFullscreen( intf_thread_t *pIntf, vout_window_t* pWnd, CmdSetFullscreen( intf_thread_t *pIntf, vout_window_t* pWnd,
bool fullscreen ); bool fullscreen );
virtual ~CmdSetFullscreen() {} virtual ~CmdSetFullscreen() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "toogle fullscreen"; }
virtual void execute();
private:
/// Return the type of the command vout_window_t* m_pWnd;
virtual string getType() const { return "toogle fullscreen"; } bool m_bFullscreen;
private:
vout_window_t* m_pWnd;
bool m_bFullscreen;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_SHOW_WINDOW_HPP #ifndef CMD_SHOW_WINDOW_HPP
...@@ -35,91 +35,77 @@ ...@@ -35,91 +35,77 @@
/// Command to show a window /// Command to show a window
class CmdShowWindow: public CmdGeneric class CmdShowWindow: public CmdGeneric
{ {
public: public:
CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager, CmdShowWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
TopWindow &rWin ): TopWindow &rWin ):
CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {} CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { }
virtual ~CmdShowWindow() {} virtual ~CmdShowWindow() { }
virtual void execute() { m_rWinManager.show( m_rWin ); }
/// This method does the real job of the command virtual string getType() const { return "show window"; }
virtual void execute() { m_rWinManager.show( m_rWin ); }
private:
/// Return the type of the command /// Reference to the window manager
virtual string getType() const { return "show window"; } WindowManager &m_rWinManager;
/// Reference to the window
private: TopWindow &m_rWin;
/// Reference to the window manager
WindowManager &m_rWinManager;
/// Reference to the window
TopWindow &m_rWin;
}; };
/// Command to hide a window /// Command to hide a window
class CmdHideWindow: public CmdGeneric class CmdHideWindow: public CmdGeneric
{ {
public: public:
CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager, CmdHideWindow( intf_thread_t *pIntf, WindowManager &rWinManager,
TopWindow &rWin ): TopWindow &rWin ):
CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) {} CmdGeneric( pIntf ), m_rWinManager( rWinManager ), m_rWin( rWin ) { }
virtual ~CmdHideWindow() {} virtual ~CmdHideWindow() { }
virtual void execute() { m_rWinManager.hide( m_rWin ); }
/// This method does the real job of the command virtual string getType() const { return "hide window"; }
virtual void execute() { m_rWinManager.hide( m_rWin ); }
private:
/// Return the type of the command /// Reference to the window manager
virtual string getType() const { return "hide window"; } WindowManager &m_rWinManager;
/// Reference to the window
private: TopWindow &m_rWin;
/// Reference to the window manager
WindowManager &m_rWinManager;
/// Reference to the window
TopWindow &m_rWin;
}; };
/// Command to raise all windows /// Command to raise all windows
class CmdRaiseAll: public CmdGeneric class CmdRaiseAll: public CmdGeneric
{ {
public: public:
CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ): CmdRaiseAll( intf_thread_t *pIntf, WindowManager &rWinManager ):
CmdGeneric( pIntf ), m_rWinManager( rWinManager ) {} CmdGeneric( pIntf ), m_rWinManager( rWinManager ) { }
virtual ~CmdRaiseAll() {} virtual ~CmdRaiseAll() { }
virtual void execute() { m_rWinManager.raiseAll(); }
/// This method does the real job of the command virtual string getType() const { return "raise all windows"; }
virtual void execute() { m_rWinManager.raiseAll(); }
private:
/// Return the type of the command /// Reference to the window manager
virtual string getType() const { return "raise all windows"; } WindowManager &m_rWinManager;
private:
/// Reference to the window manager
WindowManager &m_rWinManager;
}; };
/// Command to show a popup menu /// Command to show a popup menu
class CmdShowPopup: public CmdGeneric class CmdShowPopup: public CmdGeneric
{ {
public: public:
CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ): CmdShowPopup( intf_thread_t *pIntf, Popup &rPopup ):
CmdGeneric( pIntf ), m_rPopup( rPopup ) {} CmdGeneric( pIntf ), m_rPopup( rPopup ) { }
virtual ~CmdShowPopup() {} virtual ~CmdShowPopup() { }
/// This method does the real job of the command virtual void execute()
virtual void execute() {
{ int x, y;
int x, y; OSFactory::instance( getIntf() )->getMousePos( x, y );
OSFactory::instance( getIntf() )->getMousePos( x, y ); m_rPopup.show( x, y );
m_rPopup.show( x, y ); }
}
virtual string getType() const { return "show popup"; }
/// Return the type of the command
virtual string getType() const { return "show popup"; } private:
/// Reference to the popup
private: Popup &m_rPopup;
/// Reference to the popup
Popup &m_rPopup;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_UPDATE_ITEM_HPP #ifndef CMD_UPDATE_ITEM_HPP
...@@ -31,19 +31,15 @@ ...@@ -31,19 +31,15 @@
/// Udate item command /// Udate item command
class CmdUpdateItem: public CmdGeneric class CmdUpdateItem: public CmdGeneric
{ {
public: public:
CmdUpdateItem( intf_thread_t *pIntf, VarText &rStreamName, VarText &rStreamURI ) : CmdUpdateItem( intf_thread_t *I,VarText &N,VarText &U )
CmdGeneric( pIntf ), m_rStreamName(rStreamName), m_rStreamURI(rStreamURI) {} : CmdGeneric(I), m_rStreamName(N), m_rStreamURI(U) { }
virtual ~CmdUpdateItem() {} virtual ~CmdUpdateItem() { }
virtual void execute();
virtual string getType() const { return "update item"; }
/// This method does the real job of the command private:
virtual void execute(); VarText &m_rStreamName;
VarText &m_rStreamURI;
/// Return the type of the command
virtual string getType() const { return "update item"; }
private:
VarText &m_rStreamName;
VarText &m_rStreamURI;
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_VARS_HPP #ifndef CMD_VARS_HPP
...@@ -40,130 +40,101 @@ DEFINE_COMMAND( PlaytreeChanged, "playtree changed" ) ...@@ -40,130 +40,101 @@ DEFINE_COMMAND( PlaytreeChanged, "playtree changed" )
/// Command to notify the playtree of an item update /// Command to notify the playtree of an item update
class CmdPlaytreeUpdate: public CmdGeneric class CmdPlaytreeUpdate: public CmdGeneric
{ {
public: public:
CmdPlaytreeUpdate( intf_thread_t *pIntf, int id ): CmdPlaytreeUpdate( intf_thread_t *pIntf, int id ):
CmdGeneric( pIntf ), m_id( id ) {} CmdGeneric( pIntf ), m_id( id ) { }
virtual ~CmdPlaytreeUpdate() {} virtual ~CmdPlaytreeUpdate() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playtree update"; }
virtual void execute();
/// Only accept removal of command if they concern the same item
/// Return the type of the command virtual bool checkRemove( CmdGeneric * ) const;
virtual string getType() const { return "playtree update"; }
private:
/// Only accept removal of command if they concern the same item /// Playlist item ID
virtual bool checkRemove( CmdGeneric * ) const; int m_id;
private:
/// Playlist item ID
int m_id;
}; };
/// Command to notify the playtree of an item append /// Command to notify the playtree of an item append
class CmdPlaytreeAppend: public CmdGeneric class CmdPlaytreeAppend: public CmdGeneric
{ {
public: public:
CmdPlaytreeAppend( intf_thread_t *pIntf, playlist_add_t *p_add ) : CmdPlaytreeAppend( intf_thread_t *pIntf, playlist_add_t *p_add ):
CmdGeneric( pIntf ), m_pAdd( p_add ) {} CmdGeneric( pIntf ), m_pAdd( p_add ) { }
virtual ~CmdPlaytreeAppend() {} virtual ~CmdPlaytreeAppend() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playtree append"; }
virtual void execute();
private:
/// Return the type of the command playlist_add_t * m_pAdd;
virtual string getType() const { return "playtree append"; }
private:
playlist_add_t * m_pAdd;
}; };
/// Command to notify the playtree of an item deletion /// Command to notify the playtree of an item deletion
class CmdPlaytreeDelete: public CmdGeneric class CmdPlaytreeDelete: public CmdGeneric
{ {
public: public:
CmdPlaytreeDelete( intf_thread_t *pIntf, int i_id ) : CmdPlaytreeDelete( intf_thread_t *pIntf, int i_id ):
CmdGeneric( pIntf ), m_id( i_id ) {} CmdGeneric( pIntf ), m_id( i_id ) { }
virtual ~CmdPlaytreeDelete() {} virtual ~CmdPlaytreeDelete() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "playtree append"; }
virtual void execute();
private:
/// Return the type of the command int m_id;
virtual string getType() const { return "playtree append"; }
private:
int m_id;
}; };
/// Command to set a text variable /// Command to set a text variable
class CmdSetText: public CmdGeneric class CmdSetText: public CmdGeneric
{ {
public: public:
CmdSetText( intf_thread_t *pIntf, VarText &rText, CmdSetText( intf_thread_t *pIntf, VarText &rText, const UString &rValue ):
const UString &rValue ): CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) { }
CmdGeneric( pIntf ), m_rText( rText ), m_value( rValue ) {} virtual ~CmdSetText() { }
virtual ~CmdSetText() {} virtual void execute();
virtual string getType() const { return "set text"; }
/// This method does the real job of the command
virtual void execute(); private:
/// Text variable to set
/// Return the type of the command VarText &m_rText;
virtual string getType() const { return "set text"; } /// Value to set
const UString m_value;
private:
/// Text variable to set
VarText &m_rText;
/// Value to set
const UString m_value;
}; };
/// Command to set the equalizer preamp /// Command to set the equalizer preamp
class CmdSetEqPreamp: public CmdGeneric class CmdSetEqPreamp: public CmdGeneric
{ {
public: public:
CmdSetEqPreamp( intf_thread_t *pIntf, EqualizerPreamp &rPreamp, CmdSetEqPreamp( intf_thread_t *I, EqualizerPreamp &P, float v )
float value ): : CmdGeneric( I ), m_rPreamp( P ), m_value( v ) { }
CmdGeneric( pIntf ), m_rPreamp( rPreamp ), m_value( value ) {} virtual ~CmdSetEqPreamp() { }
virtual ~CmdSetEqPreamp() {} virtual void execute();
virtual string getType() const { return "set equalizer preamp"; }
/// This method does the real job of the command
virtual void execute(); private:
/// Preamp variable to set
/// Return the type of the command EqualizerPreamp &m_rPreamp;
virtual string getType() const { return "set equalizer preamp"; } /// Value to set
float m_value;
private:
/// Preamp variable to set
EqualizerPreamp &m_rPreamp;
/// Value to set
float m_value;
}; };
/// Command to set the equalizerbands /// Command to set the equalizerbands
class CmdSetEqBands: public CmdGeneric class CmdSetEqBands: public CmdGeneric
{ {
public: public:
CmdSetEqBands( intf_thread_t *pIntf, EqualizerBands &rEqBands, CmdSetEqBands( intf_thread_t *I, EqualizerBands &B, const string &V )
const string &rValue ): : CmdGeneric( I ), m_rEqBands( B ), m_value( V ) { }
CmdGeneric( pIntf ), m_rEqBands( rEqBands ), m_value( rValue ) {} virtual ~CmdSetEqBands() { }
virtual ~CmdSetEqBands() {} virtual void execute();
virtual string getType() const { return "set equalizer bands"; }
/// This method does the real job of the command
virtual void execute(); private:
/// Equalizer variable to set
/// Return the type of the command EqualizerBands &m_rEqBands;
virtual string getType() const { return "set equalizer bands"; } /// Value to set
const string m_value;
private:
/// Equalizer variable to set
EqualizerBands &m_rEqBands;
/// Value to set
const string m_value;
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CMD_VOUTWINDOW_HPP #ifndef CMD_VOUTWINDOW_HPP
...@@ -31,38 +31,30 @@ ...@@ -31,38 +31,30 @@
/// Command to create a vout window /// Command to create a vout window
class CmdNewVoutWindow: public CmdGeneric class CmdNewVoutWindow: public CmdGeneric
{ {
public: public:
/// Create a vout window /// Create a vout window
CmdNewVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd ); CmdNewVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
virtual ~CmdNewVoutWindow() {} virtual ~CmdNewVoutWindow() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "new vout window"; }
virtual void execute();
private:
/// Return the type of the command vout_window_t* m_pWnd;
virtual string getType() const { return "new vout window"; }
private:
vout_window_t* m_pWnd;
}; };
/// Command to release a vout window /// Command to release a vout window
class CmdReleaseVoutWindow: public CmdGeneric class CmdReleaseVoutWindow: public CmdGeneric
{ {
public: public:
/// Release a vout window /// Release a vout window
CmdReleaseVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd ); CmdReleaseVoutWindow( intf_thread_t *pIntf, vout_window_t *pWnd );
virtual ~CmdReleaseVoutWindow() {} virtual ~CmdReleaseVoutWindow() { }
virtual void execute();
/// This method does the real job of the command virtual string getType() const { return "new vout window"; }
virtual void execute();
private:
/// Return the type of the command vout_window_t* m_pWnd;
virtual string getType() const { return "new vout window"; }
private:
vout_window_t* m_pWnd;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_BUTTON_HPP #ifndef CTRL_BUTTON_HPP
...@@ -36,59 +36,58 @@ class CmdGeneric; ...@@ -36,59 +36,58 @@ class CmdGeneric;
/// Base class for button controls /// Base class for button controls
class CtrlButton: public CtrlGeneric, public Observer<AnimBitmap> class CtrlButton: public CtrlGeneric, public Observer<AnimBitmap>
{ {
public: public:
/// Create a button with 3 images /// Create a button with 3 images
CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp, CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
const GenericBitmap &rBmpOver, const GenericBitmap &rBmpOver, const GenericBitmap &rBmpDown,
const GenericBitmap &rBmpDown, CmdGeneric &rCommand, const UString &rTooltip,
CmdGeneric &rCommand, const UString &rTooltip, const UString &rHelp, VarBool *pVisible );
const UString &rHelp, VarBool *pVisible );
virtual ~CtrlButton();
virtual ~CtrlButton();
/// Handle an event
/// Handle an event virtual void handleEvent( EvtGeneric &rEvent );
virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control
/// Check whether coordinates are inside the control virtual bool mouseOver( int x, int y ) const;
virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics
/// Draw the control on the given graphics virtual void draw( OSGraphics &rImage, int xDest, int yDest );
virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Get the text of the tooltip
/// Get the text of the tooltip virtual UString getTooltipText() const { return m_tooltip; }
virtual UString getTooltipText() const { return m_tooltip; }
/// Get the type of control (custom RTTI)
/// Get the type of control (custom RTTI) virtual string getType() const { return "button"; }
virtual string getType() const { return "button"; }
private:
private: /// Finite state machine of the control
/// Finite state machine of the control FSM m_fsm;
FSM m_fsm; /// Command triggered by the button
/// Command triggered by the button CmdGeneric &m_rCommand;
CmdGeneric &m_rCommand; /// Tooltip text
/// Tooltip text const UString m_tooltip;
const UString m_tooltip; /// Images of the button in the different states
/// Images of the button in the different states AnimBitmap m_imgUp, m_imgOver, m_imgDown;
AnimBitmap m_imgUp, m_imgOver, m_imgDown; /// Current image
/// Current image AnimBitmap *m_pImg;
AnimBitmap *m_pImg;
/// Callback objects
/// Callback objects DEFINE_CALLBACK( CtrlButton, UpOverDownOver )
DEFINE_CALLBACK( CtrlButton, UpOverDownOver ) DEFINE_CALLBACK( CtrlButton, DownOverUpOver )
DEFINE_CALLBACK( CtrlButton, DownOverUpOver ) DEFINE_CALLBACK( CtrlButton, DownOverDown )
DEFINE_CALLBACK( CtrlButton, DownOverDown ) DEFINE_CALLBACK( CtrlButton, DownDownOver )
DEFINE_CALLBACK( CtrlButton, DownDownOver ) DEFINE_CALLBACK( CtrlButton, UpOverUp )
DEFINE_CALLBACK( CtrlButton, UpOverUp ) DEFINE_CALLBACK( CtrlButton, UpUpOver )
DEFINE_CALLBACK( CtrlButton, UpUpOver ) DEFINE_CALLBACK( CtrlButton, DownUp )
DEFINE_CALLBACK( CtrlButton, DownUp ) DEFINE_CALLBACK( CtrlButton, UpHidden )
DEFINE_CALLBACK( CtrlButton, UpHidden ) DEFINE_CALLBACK( CtrlButton, HiddenUp )
DEFINE_CALLBACK( CtrlButton, HiddenUp )
/// Change the current image
/// Change the current image void setImage( AnimBitmap *pImg );
void setImage( AnimBitmap *pImg );
/// Method called when an animated bitmap changes
/// Method called when an animated bitmap changes virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_CHECKBOX_HPP #ifndef CTRL_CHECKBOX_HPP
...@@ -38,84 +38,84 @@ class CmdGeneric; ...@@ -38,84 +38,84 @@ class CmdGeneric;
/// Base class for checkbox controls /// Base class for checkbox controls
class CtrlCheckbox: public CtrlGeneric, public Observer<AnimBitmap> class CtrlCheckbox: public CtrlGeneric, public Observer<AnimBitmap>
{ {
public: public:
/// Create a checkbox with 6 images /// Create a checkbox with 6 images
CtrlCheckbox( intf_thread_t *pIntf, CtrlCheckbox( intf_thread_t *pIntf,
const GenericBitmap &rBmpUp1, const GenericBitmap &rBmpUp1,
const GenericBitmap &rBmpOver1, const GenericBitmap &rBmpOver1,
const GenericBitmap &rBmpDown1, const GenericBitmap &rBmpDown1,
const GenericBitmap &rBmpUp2, const GenericBitmap &rBmpUp2,
const GenericBitmap &rBmpOver2, const GenericBitmap &rBmpOver2,
const GenericBitmap &rBmpDown2, const GenericBitmap &rBmpDown2,
CmdGeneric &rCommand1, CmdGeneric &rCommand2, CmdGeneric &rCommand1, CmdGeneric &rCommand2,
const UString &rTooltip1, const UString &rTooltip2, const UString &rTooltip1, const UString &rTooltip2,
VarBool &rVariable, const UString &rHelp, VarBool &rVariable, const UString &rHelp,
VarBool *pVisible); VarBool *pVisible);
virtual ~CtrlCheckbox(); virtual ~CtrlCheckbox();
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Get the text of the tooltip XXX /// Get the text of the tooltip XXX
virtual UString getTooltipText() const { return *m_pTooltip; } virtual UString getTooltipText() const { return *m_pTooltip; }
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "checkbox"; } virtual string getType() const { return "checkbox"; }
private: private:
/// Finite state machine of the control /// Finite state machine of the control
FSM m_fsm; FSM m_fsm;
/// Observed variable /// Observed variable
VarBool &m_rVariable; VarBool &m_rVariable;
/// Commands for the 2 states /// Commands for the 2 states
CmdGeneric &m_rCommand1, &m_rCommand2; CmdGeneric &m_rCommand1, &m_rCommand2;
/// Current command /// Current command
CmdGeneric *m_pCommand; CmdGeneric *m_pCommand;
/// Tooltip texts for the 2 states /// Tooltip texts for the 2 states
const UString m_tooltip1, m_tooltip2; const UString m_tooltip1, m_tooltip2;
/// Current tooltip /// Current tooltip
const UString *m_pTooltip; const UString *m_pTooltip;
/// Images of the checkbox in the different states /// Images of the checkbox in the different states
AnimBitmap m_imgUp1, m_imgOver1, m_imgDown1; AnimBitmap m_imgUp1, m_imgOver1, m_imgDown1;
AnimBitmap m_imgUp2, m_imgOver2, m_imgDown2; AnimBitmap m_imgUp2, m_imgOver2, m_imgDown2;
/// Current set of images (pointing to 1 or 2) /// Current set of images (pointing to 1 or 2)
/// In fact, we consider here that a checkbox acts like 2 buttons, in a /// 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 /// symetric way; this is a small trick to avoid multiplicating the
/// callbacks (and it could be extended easily to support 3 buttons or /// callbacks (and it could be extended easily to support 3 buttons or
/// more...) /// more...)
AnimBitmap *m_pImgUp, *m_pImgOver, *m_pImgDown; AnimBitmap *m_pImgUp, *m_pImgOver, *m_pImgDown;
/// Current image /// Current image
AnimBitmap *m_pImgCurrent; AnimBitmap *m_pImgCurrent;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlCheckbox, UpOverDownOver ) DEFINE_CALLBACK( CtrlCheckbox, UpOverDownOver )
DEFINE_CALLBACK( CtrlCheckbox, DownOverUpOver ) DEFINE_CALLBACK( CtrlCheckbox, DownOverUpOver )
DEFINE_CALLBACK( CtrlCheckbox, DownOverDown ) DEFINE_CALLBACK( CtrlCheckbox, DownOverDown )
DEFINE_CALLBACK( CtrlCheckbox, DownDownOver ) DEFINE_CALLBACK( CtrlCheckbox, DownDownOver )
DEFINE_CALLBACK( CtrlCheckbox, UpOverUp ) DEFINE_CALLBACK( CtrlCheckbox, UpOverUp )
DEFINE_CALLBACK( CtrlCheckbox, UpUpOver ) DEFINE_CALLBACK( CtrlCheckbox, UpUpOver )
DEFINE_CALLBACK( CtrlCheckbox, DownUp ) DEFINE_CALLBACK( CtrlCheckbox, DownUp )
DEFINE_CALLBACK( CtrlCheckbox, UpHidden ) DEFINE_CALLBACK( CtrlCheckbox, UpHidden )
DEFINE_CALLBACK( CtrlCheckbox, HiddenUp ) DEFINE_CALLBACK( CtrlCheckbox, HiddenUp )
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onVarBoolUpdate( VarBool &rVariable ); virtual void onVarBoolUpdate( VarBool &rVariable );
/// Method called when an animated bitmap changes /// Method called when an animated bitmap changes
virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* ); virtual void onUpdate( Subject<AnimBitmap> &rBitmap, void* );
/// Change the current image /// Change the current image
void setImage( AnimBitmap *pImg ); void setImage( AnimBitmap *pImg );
/// Helper function to update the current state of images /// Helper function to update the current state of images
void changeButton(); void changeButton();
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_FLAT_HPP #ifndef CTRL_FLAT_HPP
...@@ -31,12 +31,11 @@ ...@@ -31,12 +31,11 @@
/// Base class for "mover controls" and images /// Base class for "mover controls" and images
class CtrlFlat: public CtrlGeneric class CtrlFlat: public CtrlGeneric
{ {
protected: protected:
CtrlFlat( intf_thread_t *pIntf, const UString &rHelp, CtrlFlat( intf_thread_t *pIntf, const UString &rHelp, VarBool *pVisible )
VarBool *pVisible ): : CtrlGeneric( pIntf, rHelp, pVisible ) { }
CtrlGeneric( pIntf, rHelp, pVisible ) {}
virtual ~CtrlFlat() {} virtual ~CtrlFlat() { }
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_GENERIC_HPP #ifndef CTRL_GENERIC_HPP
...@@ -43,102 +43,102 @@ class VarBool; ...@@ -43,102 +43,102 @@ class VarBool;
/// Base class for controls /// Base class for controls
class CtrlGeneric: public SkinObject, public Observer<VarBool> class CtrlGeneric: public SkinObject, public Observer<VarBool>
{ {
public: public:
virtual ~CtrlGeneric(); virtual ~CtrlGeneric();
/// Handle an event on the control /// Handle an event on the control
virtual void handleEvent( EvtGeneric &rEvent ) {} virtual void handleEvent( EvtGeneric &rEvent ) { }
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const { return false; } virtual bool mouseOver( int x, int y ) const { return false; }
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ) {} virtual void draw( OSGraphics &rImage, int xDest, int yDest ) { }
/// Set the position and the associated layout of the control /// Set the position and the associated layout of the control
virtual void setLayout( GenericLayout *pLayout, virtual void setLayout( GenericLayout *pLayout,
const Position &rPosition ); const Position &rPosition );
/// Get the position of the control in the layout, if any /// Get the position of the control in the layout, if any
virtual const Position *getPosition() const { return m_pPosition; } virtual const Position *getPosition() const { return m_pPosition; }
/// Get the text of the tooltip /// Get the text of the tooltip
virtual UString getTooltipText() const virtual UString getTooltipText() const
{ return UString( getIntf(), "" ); } { return UString( getIntf(), "" ); }
/** /**
* Overload this method if you want to do something special when * Overload this method if you want to do something special when
* the layout is resized * the layout is resized
*/ */
virtual void onResize() {} virtual void onResize() { }
/// Get the help text /// Get the help text
virtual const UString &getHelpText() const { return m_help; } virtual const UString &getHelpText() const { return m_help; }
/// Return true if the control can gain the focus /// Return true if the control can gain the focus
virtual bool isFocusable() const { return false; } virtual bool isFocusable() const { return false; }
/// Return true if the control is visible /// Return true if the control is visible
virtual bool isVisible() const; virtual bool isVisible() const;
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return ""; } virtual string getType() const { return ""; }
protected: protected:
// If pVisible is NULL, the control is always visible // If pVisible is NULL, the control is always visible
CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp, CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
VarBool *pVisible = NULL ); VarBool *pVisible = NULL );
/** /**
* Tell the layout when the image has changed, with the size of the * Tell the layout when the image has changed, with the size of the
* rectangle to repaint and its offset. * rectangle to repaint and its offset.
* Use the default values to repaint the whole window * Use the default values to repaint the whole window
*/ */
virtual void notifyLayout( int witdh = -1, int height = -1, virtual void notifyLayout( int witdh = -1, int height = -1,
int xOffSet = 0, int yOffSet = 0 ) const; int xOffSet = 0, int yOffSet = 0 ) const;
/** /**
* Same as notifyLayout(), but takes optional images as parameters. * Same as notifyLayout(), but takes optional images as parameters.
* The maximum size(s) of the images will be used for repainting. * The maximum size(s) of the images will be used for repainting.
*/ */
void notifyLayoutMaxSize( const Box *pImg1 = NULL, void notifyLayoutMaxSize( const Box *pImg1 = NULL,
const Box *pImg2 = NULL ); const Box *pImg2 = NULL );
/// Ask the layout to capture the mouse /// Ask the layout to capture the mouse
virtual void captureMouse() const; virtual void captureMouse() const;
/// Ask the layout to release the mouse /// Ask the layout to release the mouse
virtual void releaseMouse() const; virtual void releaseMouse() const;
/// Notify the window the tooltip has changed /// Notify the window the tooltip has changed
virtual void notifyTooltipChange() const; virtual void notifyTooltipChange() const;
/// Get the associated window, if any /// Get the associated window, if any
virtual TopWindow *getWindow() const; virtual TopWindow *getWindow() const;
/** /**
* Overload this method if you want to do something special when * Overload this method if you want to do something special when
* the Position object is set * the Position object is set
*/ */
virtual void onPositionChange() {} virtual void onPositionChange() { }
/// Overload this method to get notified of bool variable changes /// Overload this method to get notified of bool variable changes
virtual void onVarBoolUpdate( VarBool &rVar ) {} virtual void onVarBoolUpdate( VarBool &rVar ) { }
/// Method called when an observed bool variable is changed /// Method called when an observed bool variable is changed
virtual void onUpdate( Subject<VarBool> &rVariable , void* ); virtual void onUpdate( Subject<VarBool> &rVariable , void* );
/// Associated layout /// Associated layout
GenericLayout *m_pLayout; GenericLayout *m_pLayout;
/// Visibility variable /// Visibility variable
VarBool *m_pVisible; VarBool *m_pVisible;
private: private:
/// Position in the layout /// Position in the layout
Position *m_pPosition; Position *m_pPosition;
/// Help text /// Help text
UString m_help; UString m_help;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_IMAGE_HPP #ifndef CTRL_IMAGE_HPP
...@@ -36,41 +36,41 @@ class CmdGeneric; ...@@ -36,41 +36,41 @@ class CmdGeneric;
/// Control image /// Control image
class CtrlImage: public CtrlFlat class CtrlImage: public CtrlFlat
{ {
public: public:
/// Resize methods /// Resize methods
enum resize_t enum resize_t
{ {
kMosaic, // Repeat the base image in a mosaic kMosaic, // Repeat the base image in a mosaic
kScale // Scale the base image kScale // Scale the base image
}; };
// Create an image with the given bitmap (which is NOT copied) // Create an image with the given bitmap (which is NOT copied)
CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap, CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
CmdGeneric &rCommand, resize_t resizeMethod, CmdGeneric &rCommand, resize_t resizeMethod,
const UString &rHelp, VarBool *pVisible ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlImage(); virtual ~CtrlImage();
/// Handle an event on the control /// Handle an event on the control
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "image"; } virtual string getType() const { return "image"; }
private: private:
/// Bitmap /// Bitmap
const GenericBitmap &m_rBitmap; const GenericBitmap &m_rBitmap;
/// Buffer to stored the rendered bitmap /// Buffer to stored the rendered bitmap
OSGraphics *m_pImage; OSGraphics *m_pImage;
/// Command triggered by a double-click on the image /// Command triggered by a double-click on the image
CmdGeneric &m_rCommand; CmdGeneric &m_rCommand;
/// Resize method /// Resize method
resize_t m_resizeMethod; resize_t m_resizeMethod;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_LIST_HPP #ifndef CTRL_LIST_HPP
...@@ -38,69 +38,69 @@ class GenericBitmap; ...@@ -38,69 +38,69 @@ class GenericBitmap;
class CtrlList: public CtrlGeneric, public Observer<VarList>, class CtrlList: public CtrlGeneric, public Observer<VarList>,
public Observer<VarPercent> public Observer<VarPercent>
{ {
public: public:
CtrlList( intf_thread_t *pIntf, VarList &rList, CtrlList( intf_thread_t *pIntf, VarList &rList,
const GenericFont &rFont, const GenericBitmap *pBitmap, const GenericFont &rFont, const GenericBitmap *pBitmap,
uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1, uint32_t fgcolor, uint32_t playcolor, uint32_t bgcolor1,
uint32_t bgcolor2, uint32_t selColor, uint32_t bgcolor2, uint32_t selColor,
const UString &rHelp, VarBool *pVisible ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlList(); virtual ~CtrlList();
/// Handle an event on the control. /// Handle an event on the control.
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control. /// Check whether coordinates are inside the control.
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Called when the layout is resized /// Called when the layout is resized
virtual void onResize(); virtual void onResize();
/// Return true if the control can gain the focus /// Return true if the control can gain the focus
virtual bool isFocusable() const { return true; } virtual bool isFocusable() const { return true; }
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "list"; } virtual string getType() const { return "list"; }
private: private:
/// List associated to the control /// List associated to the control
VarList &m_rList; VarList &m_rList;
/// Font /// Font
const GenericFont &m_rFont; const GenericFont &m_rFont;
/// Background bitmap /// Background bitmap
/** If NULL, the 2 background colors defined below will be used */ /** If NULL, the 2 background colors defined below will be used */
const GenericBitmap *m_pBitmap; const GenericBitmap *m_pBitmap;
/// Color of normal text /// Color of normal text
uint32_t m_fgColor; uint32_t m_fgColor;
/// Color of the playing item /// Color of the playing item
uint32_t m_playColor; uint32_t m_playColor;
/// Background colors, used when no background bitmap is given /// Background colors, used when no background bitmap is given
uint32_t m_bgColor1, m_bgColor2; uint32_t m_bgColor1, m_bgColor2;
/// Background of selected items /// Background of selected items
uint32_t m_selColor; uint32_t m_selColor;
/// Pointer on the last selected item in the list /// Pointer on the last selected item in the list
VarList::Elem_t *m_pLastSelected; VarList::Elem_t *m_pLastSelected;
/// Image of the control /// Image of the control
OSGraphics *m_pImage; OSGraphics *m_pImage;
/// Last position /// Last position
int m_lastPos; int m_lastPos;
/// Method called when the list variable is modified /// Method called when the list variable is modified
virtual void onUpdate( Subject<VarList> &rList, void* ); virtual void onUpdate( Subject<VarList> &rList, void* );
/// Method called when the position variable of the list is modified /// Method called when the position variable of the list is modified
virtual void onUpdate( Subject<VarPercent> &rPercent, void* ); virtual void onUpdate( Subject<VarPercent> &rPercent, void* );
/// Called when the position is set /// Called when the position is set
virtual void onPositionChange(); virtual void onPositionChange();
/// Check if the list must be scrolled /// Check if the list must be scrolled
void autoScroll(); void autoScroll();
/// Draw the image of the control /// Draw the image of the control
void makeImage(); void makeImage();
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_MOVE_HPP #ifndef CTRL_MOVE_HPP
...@@ -36,51 +36,51 @@ class WindowManager; ...@@ -36,51 +36,51 @@ class WindowManager;
/// Control for moving windows /// Control for moving windows
class CtrlMove: public CtrlFlat class CtrlMove: public CtrlFlat
{ {
public: public:
CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager, CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
CtrlFlat &rCtrl, TopWindow &rWindow, CtrlFlat &rCtrl, TopWindow &rWindow,
const UString &rHelp, VarBool *pVisible ); const UString &rHelp, VarBool *pVisible );
virtual ~CtrlMove() {} virtual ~CtrlMove() { }
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the decorated control /// Check whether coordinates are inside the decorated control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Set the position and the associated layout of the decorated control /// Set the position and the associated layout of the decorated control
virtual void setLayout( GenericLayout *pLayout, virtual void setLayout( GenericLayout *pLayout,
const Position &rPosition ); const Position &rPosition );
/// Get the position of the decorated control in the layout, if any /// Get the position of the decorated control in the layout, if any
virtual const Position *getPosition() const; virtual const Position *getPosition() const;
/// Method called when the control is resized /// Method called when the control is resized
virtual void onResize(); virtual void onResize();
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return m_rCtrl.getType(); } virtual string getType() const { return m_rCtrl.getType(); }
private: private:
FSM m_fsm; FSM m_fsm;
/// Window manager /// Window manager
WindowManager &m_rWindowManager; WindowManager &m_rWindowManager;
/// Decorated CtrlFlat /// Decorated CtrlFlat
CtrlFlat &m_rCtrl; CtrlFlat &m_rCtrl;
/// The window moved by this control /// The window moved by this control
TopWindow &m_rWindow; TopWindow &m_rWindow;
/// The last received event /// The last received event
EvtGeneric *m_pEvt; EvtGeneric *m_pEvt;
/// Position of the click that started the move /// Position of the click that started the move
int m_xPos, m_yPos; int m_xPos, m_yPos;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlMove, MovingMoving ) DEFINE_CALLBACK( CtrlMove, MovingMoving )
DEFINE_CALLBACK( CtrlMove, StillMoving ) DEFINE_CALLBACK( CtrlMove, StillMoving )
DEFINE_CALLBACK( CtrlMove, MovingStill ) DEFINE_CALLBACK( CtrlMove, MovingStill )
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_RADIALSLIDER_HPP #ifndef CTRL_RADIALSLIDER_HPP
...@@ -38,60 +38,60 @@ class VarPercent; ...@@ -38,60 +38,60 @@ class VarPercent;
/// Radial slider /// Radial slider
class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent> class CtrlRadialSlider: public CtrlGeneric, public Observer<VarPercent>
{ {
public: public:
/// Create a radial slider with the given image, which must be /// Create a radial slider with the given image, which must be
/// composed of numImg subimages of the same size /// composed of numImg subimages of the same size
CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq, CtrlRadialSlider( intf_thread_t *pIntf, const GenericBitmap &rBmpSeq,
int numImg, VarPercent &rVariable, float minAngle, int numImg, VarPercent &rVariable, float minAngle,
float maxAngle, const UString &rHelp, float maxAngle, const UString &rHelp,
VarBool *pVisible ); VarBool *pVisible );
virtual ~CtrlRadialSlider(); virtual ~CtrlRadialSlider();
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "radial_slider"; } virtual string getType() const { return "radial_slider"; }
private: private:
/// Finite state machine of the control /// Finite state machine of the control
FSM m_fsm; FSM m_fsm;
/// Number of sub-images in the slider image /// Number of sub-images in the slider image
int m_numImg; int m_numImg;
/// Variable associated to the slider /// Variable associated to the slider
VarPercent &m_rVariable; VarPercent &m_rVariable;
/// Min and max angles of the button /// Min and max angles of the button
float m_minAngle, m_maxAngle; float m_minAngle, m_maxAngle;
/// Position of the cursor /// Position of the cursor
int m_position; int m_position;
/// Size of an image /// Size of an image
int m_width, m_height; int m_width, m_height;
/// The last received event /// The last received event
EvtGeneric *m_pEvt; EvtGeneric *m_pEvt;
/// Sequence of images /// Sequence of images
OSGraphics *m_pImgSeq; OSGraphics *m_pImgSeq;
/// Last saved position /// Last saved position
int m_lastPos; int m_lastPos;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlRadialSlider, UpDown ) DEFINE_CALLBACK( CtrlRadialSlider, UpDown )
DEFINE_CALLBACK( CtrlRadialSlider, DownUp ) DEFINE_CALLBACK( CtrlRadialSlider, DownUp )
DEFINE_CALLBACK( CtrlRadialSlider, Move ) DEFINE_CALLBACK( CtrlRadialSlider, Move )
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable, void* ); virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
/// Change the position of the cursor, with the given position of /// Change the position of the cursor, with the given position of
/// the mouse (relative to the layout). Is blocking is true, the /// the mouse (relative to the layout). Is blocking is true, the
/// the cursor cannot do more than a half turn /// the cursor cannot do more than a half turn
void setCursor( int posX, int posY, bool blocking ); void setCursor( int posX, int posY, bool blocking );
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_RESIZE_HPP #ifndef CTRL_RESIZE_HPP
...@@ -36,63 +36,63 @@ class WindowManager; ...@@ -36,63 +36,63 @@ class WindowManager;
/// Control decorator for resizing windows /// Control decorator for resizing windows
class CtrlResize: public CtrlFlat class CtrlResize: public CtrlFlat
{ {
public: public:
CtrlResize( intf_thread_t *pIntf, WindowManager &rWindowManager, CtrlResize( intf_thread_t *pIntf, WindowManager &rWindowManager,
CtrlFlat &rCtrl, GenericLayout &rLayout, CtrlFlat &rCtrl, GenericLayout &rLayout,
const UString &rHelp, VarBool *pVisible, const UString &rHelp, VarBool *pVisible,
WindowManager::Direction_t direction ); WindowManager::Direction_t direction );
virtual ~CtrlResize() {} virtual ~CtrlResize() { }
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the decorated control /// Check whether coordinates are inside the decorated control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Set the position and the associated layout of the decorated control /// Set the position and the associated layout of the decorated control
virtual void setLayout( GenericLayout *pLayout, virtual void setLayout( GenericLayout *pLayout,
const Position &rPosition ); const Position &rPosition );
/// Get the position of the decorated control in the layout, if any /// Get the position of the decorated control in the layout, if any
virtual const Position *getPosition() const; virtual const Position *getPosition() const;
/// Method called when the control is resized /// Method called when the control is resized
virtual void onResize(); virtual void onResize();
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return m_rCtrl.getType(); } virtual string getType() const { return m_rCtrl.getType(); }
private: private:
FSM m_fsm; FSM m_fsm;
/// Window manager /// Window manager
WindowManager &m_rWindowManager; WindowManager &m_rWindowManager;
/// Decorated CtrlFlat /// Decorated CtrlFlat
CtrlFlat &m_rCtrl; CtrlFlat &m_rCtrl;
/// The layout resized by this control /// The layout resized by this control
GenericLayout &m_rLayout; GenericLayout &m_rLayout;
/// The last received event /// The last received event
EvtGeneric *m_pEvt; EvtGeneric *m_pEvt;
/// Position of the click that started the resizing /// Position of the click that started the resizing
int m_xPos, m_yPos; int m_xPos, m_yPos;
/// Direction of the resizing /// Direction of the resizing
WindowManager::Direction_t m_direction; WindowManager::Direction_t m_direction;
/// Change the cursor, based on the given direction /// Change the cursor, based on the given direction
void changeCursor( WindowManager::Direction_t direction ) const; void changeCursor( WindowManager::Direction_t direction ) const;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlResize, OutStill ) DEFINE_CALLBACK( CtrlResize, OutStill )
DEFINE_CALLBACK( CtrlResize, StillOut ) DEFINE_CALLBACK( CtrlResize, StillOut )
DEFINE_CALLBACK( CtrlResize, StillStill ) DEFINE_CALLBACK( CtrlResize, StillStill )
DEFINE_CALLBACK( CtrlResize, StillResize ) DEFINE_CALLBACK( CtrlResize, StillResize )
DEFINE_CALLBACK( CtrlResize, ResizeStill ) DEFINE_CALLBACK( CtrlResize, ResizeStill )
DEFINE_CALLBACK( CtrlResize, ResizeResize ) DEFINE_CALLBACK( CtrlResize, ResizeResize )
// Size of the layout, before resizing // Size of the layout, before resizing
int m_width, m_height; int m_width, m_height;
}; };
#endif #endif
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_SLIDER_HPP #ifndef CTRL_SLIDER_HPP
...@@ -39,131 +39,131 @@ class VarPercent; ...@@ -39,131 +39,131 @@ class VarPercent;
/// Cursor of a slider /// Cursor of a slider
class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent> class CtrlSliderCursor: public CtrlGeneric, public Observer<VarPercent>
{ {
public: public:
/// Create a cursor with 3 images (which are NOT copied, be careful) /// Create a cursor with 3 images (which are NOT copied, be careful)
/// If pVisible is NULL, the control is always visible /// If pVisible is NULL, the control is always visible
CtrlSliderCursor( intf_thread_t *pIntf, const GenericBitmap &rBmpUp, CtrlSliderCursor( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
const GenericBitmap &rBmpOver, const GenericBitmap &rBmpOver,
const GenericBitmap &rBmpDown, const GenericBitmap &rBmpDown,
const Bezier &rCurve, VarPercent &rVariable, const Bezier &rCurve, VarPercent &rVariable,
VarBool *pVisible, const UString &rTooltip, VarBool *pVisible, const UString &rTooltip,
const UString &rHelp ); const UString &rHelp );
virtual ~CtrlSliderCursor(); virtual ~CtrlSliderCursor();
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Get the text of the tooltip /// Get the text of the tooltip
virtual UString getTooltipText() const { return m_tooltip; } virtual UString getTooltipText() const { return m_tooltip; }
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "slider_cursor"; } virtual string getType() const { return "slider_cursor"; }
private: private:
/// Finite state machine of the control /// Finite state machine of the control
FSM m_fsm; FSM m_fsm;
/// Variable associated to the cursor /// Variable associated to the cursor
VarPercent &m_rVariable; VarPercent &m_rVariable;
/// Tooltip text /// Tooltip text
const UString m_tooltip; const UString m_tooltip;
/// Initial size of the control /// Initial size of the control
int m_width, m_height; int m_width, m_height;
/// Position of the cursor /// Position of the cursor
int m_xPosition, m_yPosition; int m_xPosition, m_yPosition;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlSliderCursor, OverDown ) DEFINE_CALLBACK( CtrlSliderCursor, OverDown )
DEFINE_CALLBACK( CtrlSliderCursor, DownOver ) DEFINE_CALLBACK( CtrlSliderCursor, DownOver )
DEFINE_CALLBACK( CtrlSliderCursor, OverUp ) DEFINE_CALLBACK( CtrlSliderCursor, OverUp )
DEFINE_CALLBACK( CtrlSliderCursor, UpOver ) DEFINE_CALLBACK( CtrlSliderCursor, UpOver )
DEFINE_CALLBACK( CtrlSliderCursor, Move ) DEFINE_CALLBACK( CtrlSliderCursor, Move )
DEFINE_CALLBACK( CtrlSliderCursor, Scroll ) DEFINE_CALLBACK( CtrlSliderCursor, Scroll )
/// Last saved position of the cursor (stored as a percentage) /// Last saved position of the cursor (stored as a percentage)
float m_lastPercentage; float m_lastPercentage;
/// Offset between the mouse pointer and the center of the cursor /// Offset between the mouse pointer and the center of the cursor
int m_xOffset, m_yOffset; int m_xOffset, m_yOffset;
/// The last received event /// The last received event
EvtGeneric *m_pEvt; EvtGeneric *m_pEvt;
/// Images of the cursor in the differents states /// Images of the cursor in the differents states
OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown; OSGraphics *m_pImgUp, *m_pImgOver, *m_pImgDown;
/// Current image /// Current image
OSGraphics *m_pImg; OSGraphics *m_pImg;
/// Bezier curve of the slider /// Bezier curve of the slider
const Bezier &m_rCurve; const Bezier &m_rCurve;
/// Method called when the position variable is modified /// Method called when the position variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable, void * ); virtual void onUpdate( Subject<VarPercent> &rVariable, void * );
/// Method to compute the resize factors /// Method to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const; void getResizeFactors( float &rFactorX, float &rFactorY ) const;
/// Call notifyLayout /// Call notifyLayout
void refreshLayout(); void refreshLayout();
}; };
/// Slider background /// Slider background
class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent> class CtrlSliderBg: public CtrlGeneric, public Observer<VarPercent>
{ {
public: public:
CtrlSliderBg( intf_thread_t *pIntf, CtrlSliderBg( intf_thread_t *pIntf,
const Bezier &rCurve, VarPercent &rVariable, const Bezier &rCurve, VarPercent &rVariable,
int thickness, GenericBitmap *pBackground, int nbHoriz, int thickness, GenericBitmap *pBackground, int nbHoriz,
int nbVert, int padHoriz, int padVert, VarBool *pVisible, int nbVert, int padHoriz, int padVert, VarBool *pVisible,
const UString &rHelp ); const UString &rHelp );
virtual ~CtrlSliderBg(); virtual ~CtrlSliderBg();
/// Tell whether the mouse is over the control /// Tell whether the mouse is over the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Method called when the control is resized /// Method called when the control is resized
virtual void onResize(); virtual void onResize();
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "slider_bg"; } virtual string getType() const { return "slider_bg"; }
/// Associate a cursor to this background /// Associate a cursor to this background
void associateCursor( CtrlSliderCursor &rCursor ); void associateCursor( CtrlSliderCursor &rCursor );
private: private:
/// Cursor of the slider /// Cursor of the slider
CtrlSliderCursor *m_pCursor; CtrlSliderCursor *m_pCursor;
/// Variable associated to the slider /// Variable associated to the slider
VarPercent &m_rVariable; VarPercent &m_rVariable;
/// Thickness of the curve /// Thickness of the curve
int m_thickness; int m_thickness;
/// Bezier curve of the slider /// Bezier curve of the slider
const Bezier &m_rCurve; const Bezier &m_rCurve;
/// Initial size of the control /// Initial size of the control
int m_width, m_height; int m_width, m_height;
/// Background image sequence (optional) /// Background image sequence (optional)
GenericBitmap *m_pImgSeq; GenericBitmap *m_pImgSeq;
/// Number of images in the background bitmap /// Number of images in the background bitmap
int m_nbHoriz, m_nbVert; int m_nbHoriz, m_nbVert;
/// Number of pixels between two images /// Number of pixels between two images
int m_padHoriz, m_padVert; int m_padHoriz, m_padVert;
/// Size of a background image /// Size of a background image
int m_bgWidth, m_bgHeight; int m_bgWidth, m_bgHeight;
/// Index of the current background image /// Index of the current background image
int m_position; int m_position;
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarPercent> &rVariable, void* ); virtual void onUpdate( Subject<VarPercent> &rVariable, void* );
/// Method to compute the resize factors /// Method to compute the resize factors
void getResizeFactors( float &rFactorX, float &rFactorY ) const; void getResizeFactors( float &rFactorX, float &rFactorY ) const;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_TEXT_HPP #ifndef CTRL_TEXT_HPP
...@@ -40,100 +40,100 @@ class VarText; ...@@ -40,100 +40,100 @@ class VarText;
/// Class for control text /// Class for control text
class CtrlText: public CtrlGeneric, public Observer<VarText> class CtrlText: public CtrlGeneric, public Observer<VarText>
{ {
public: public:
enum Align_t enum Align_t
{ {
kLeft, kLeft,
kCenter, kCenter,
kRight kRight
}; };
enum Scrolling_t enum Scrolling_t
{ {
// The text starts scrolling automatically if it is larger than the // The text starts scrolling automatically if it is larger than the
// width of the control. The user can still stop it or make it // width of the control. The user can still stop it or make it
// scroll manually with the mouse. // scroll manually with the mouse.
kAutomatic, kAutomatic,
// Only manual scrolling is allowed (with the mouse) // Only manual scrolling is allowed (with the mouse)
kManual, kManual,
// No scrolling of the text is allowed // No scrolling of the text is allowed
kNone kNone
}; };
/// Create a text control with the optional given color /// Create a text control with the optional given color
CtrlText( intf_thread_t *pIntf, VarText &rVariable, CtrlText( intf_thread_t *pIntf, VarText &rVariable,
const GenericFont &rFont, const UString &rHelp, const GenericFont &rFont, const UString &rHelp,
uint32_t color, VarBool *pVisible, Scrolling_t scrollMode, uint32_t color, VarBool *pVisible, Scrolling_t scrollMode,
Align_t alignment); Align_t alignment);
virtual ~CtrlText(); virtual ~CtrlText();
/// Handle an event /// Handle an event
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Set the text of the control, with an optional color /// Set the text of the control, with an optional color
/// This takes effect immediatly /// This takes effect immediatly
void setText( const UString &rText, uint32_t color = 0xFFFFFFFF ); void setText( const UString &rText, uint32_t color = 0xFFFFFFFF );
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "text"; } virtual string getType() const { return "text"; }
private: private:
/// Finite state machine of the control /// Finite state machine of the control
FSM m_fsm; FSM m_fsm;
/// Variable associated to the control /// Variable associated to the control
VarText &m_rVariable; VarText &m_rVariable;
/// Callback objects /// Callback objects
DEFINE_CALLBACK( CtrlText, ToManual ) DEFINE_CALLBACK( CtrlText, ToManual )
DEFINE_CALLBACK( CtrlText, ManualMoving ) DEFINE_CALLBACK( CtrlText, ManualMoving )
DEFINE_CALLBACK( CtrlText, ManualStill ) DEFINE_CALLBACK( CtrlText, ManualStill )
DEFINE_CALLBACK( CtrlText, Move ) DEFINE_CALLBACK( CtrlText, Move )
/// The last received event /// The last received event
EvtGeneric *m_pEvt; EvtGeneric *m_pEvt;
/// Font used to render the text /// Font used to render the text
const GenericFont &m_rFont; const GenericFont &m_rFont;
/// Color of the text /// Color of the text
uint32_t m_color; uint32_t m_color;
/// Scrolling mode /// Scrolling mode
Scrolling_t m_scrollMode; Scrolling_t m_scrollMode;
/// Type of alignment /// Type of alignment
Align_t m_alignment; Align_t m_alignment;
/// Image of the text /// Image of the text
GenericBitmap *m_pImg; GenericBitmap *m_pImg;
/// Image of the text, repeated twice and with some blank between; /// Image of the text, repeated twice and with some blank between;
/// useful to display a 'circular' moving text... /// useful to display a 'circular' moving text...
GenericBitmap *m_pImgDouble; GenericBitmap *m_pImgDouble;
/// Current image (should always be equal to m_pImg or m_pImgDouble) /// Current image (should always be equal to m_pImg or m_pImgDouble)
GenericBitmap *m_pCurrImg; GenericBitmap *m_pCurrImg;
/// Position of the left side of the moving text (always <= 0) /// Position of the left side of the moving text (always <= 0)
int m_xPos; int m_xPos;
/// Offset between the mouse pointer and the left side of the /// Offset between the mouse pointer and the left side of the
/// moving text /// moving text
int m_xOffset; int m_xOffset;
/// Timer to move the text /// Timer to move the text
OSTimer *m_pTimer; OSTimer *m_pTimer;
/// Callback for the timer /// Callback for the timer
DEFINE_CALLBACK( CtrlText, UpdateText ); DEFINE_CALLBACK( CtrlText, UpdateText );
/// Method called when the observed variable is modified /// Method called when the observed variable is modified
virtual void onUpdate( Subject<VarText> &rVariable, void* ); virtual void onUpdate( Subject<VarText> &rVariable, void* );
/// Display the text on the control /// Display the text on the control
void displayText( const UString &rText ); void displayText( const UString &rText );
/// Helper function to set the position in the correct interval /// Helper function to set the position in the correct interval
void adjust( int &position ); void adjust( int &position );
/// Update the behaviour of the text whenever the control size changes /// Update the behaviour of the text whenever the control size changes
virtual void onPositionChange(); virtual void onPositionChange();
/// Update the behaviour of the text whenever the control size changes /// Update the behaviour of the text whenever the control size changes
virtual void onResize(); virtual void onResize();
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_TREE_HPP #ifndef CTRL_TREE_HPP
...@@ -37,119 +37,119 @@ class GenericBitmap; ...@@ -37,119 +37,119 @@ class GenericBitmap;
class CtrlTree: public CtrlGeneric, public Observer<VarTree, tree_update>, class CtrlTree: public CtrlGeneric, public Observer<VarTree, tree_update>,
public Observer<VarPercent> public Observer<VarPercent>
{ {
public: public:
CtrlTree( intf_thread_t *pIntf, CtrlTree( intf_thread_t *pIntf,
VarTree &rTree, VarTree &rTree,
const GenericFont &rFont, const GenericFont &rFont,
const GenericBitmap *pBgBitmap, const GenericBitmap *pBgBitmap,
const GenericBitmap *pItemBitmap, const GenericBitmap *pItemBitmap,
const GenericBitmap *pOpenBitmap, const GenericBitmap *pOpenBitmap,
const GenericBitmap *pClosedBitmap, const GenericBitmap *pClosedBitmap,
uint32_t fgColor, uint32_t fgColor,
uint32_t playColor, uint32_t playColor,
uint32_t bgColor1, uint32_t bgColor1,
uint32_t bgColor2, uint32_t bgColor2,
uint32_t selColor, uint32_t selColor,
const UString &rHelp, const UString &rHelp,
VarBool *pVisible, VarBool *pVisible,
VarBool *pFlat ); VarBool *pFlat );
virtual ~CtrlTree(); virtual ~CtrlTree();
/// Handle an event on the control /// Handle an event on the control
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Called when the layout is resized /// Called when the layout is resized
virtual void onResize(); virtual void onResize();
/// Return true if the control can gain the focus /// Return true if the control can gain the focus
virtual bool isFocusable() const { return true; } virtual bool isFocusable() const { return true; }
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "tree"; } virtual string getType() const { return "tree"; }
/// Make sure an item is visible /// Make sure an item is visible
/// \param item an iterator to a tree item /// \param item an iterator to a tree item
/// \return true if it changed the position /// \return true if it changed the position
bool ensureVisible( VarTree::Iterator item ); bool ensureVisible( VarTree::Iterator item );
/// Make sure an item is visible /// Make sure an item is visible
/// \param itemIndex the absolute index in the tree /// \param itemIndex the absolute index in the tree
/// \return true if it changed the position /// \return true if it changed the position
bool ensureVisible( int itemIndex ); bool ensureVisible( int itemIndex );
private: private:
/// Tree associated to the control /// Tree associated to the control
VarTree &m_rTree; VarTree &m_rTree;
/// Font /// Font
const GenericFont &m_rFont; const GenericFont &m_rFont;
/// Background bitmap /// Background bitmap
const GenericBitmap *m_pBgBitmap; const GenericBitmap *m_pBgBitmap;
/// Item (leaf) bitmap /// Item (leaf) bitmap
// (TODO : add different bitmaps for different item types // (TODO : add different bitmaps for different item types
// like in the wx playlist) // like in the wx playlist)
const GenericBitmap *m_pItemBitmap; const GenericBitmap *m_pItemBitmap;
/// Open (expanded) node bitmap /// Open (expanded) node bitmap
const GenericBitmap *m_pOpenBitmap; const GenericBitmap *m_pOpenBitmap;
/// Closed node bitmap /// Closed node bitmap
const GenericBitmap *m_pClosedBitmap; const GenericBitmap *m_pClosedBitmap;
/// Color of normal test /// Color of normal test
uint32_t m_fgColor; uint32_t m_fgColor;
/// Color of the playing item /// Color of the playing item
uint32_t m_playColor; uint32_t m_playColor;
/// Background colors, used when no background bitmap is given /// Background colors, used when no background bitmap is given
uint32_t m_bgColor1, m_bgColor2; uint32_t m_bgColor1, m_bgColor2;
/// Background of selected items /// Background of selected items
uint32_t m_selColor; uint32_t m_selColor;
/// Pointer on the last selected item in the tree /// Pointer on the last selected item in the tree
VarTree *m_pLastSelected; VarTree *m_pLastSelected;
/// Image of the control /// Image of the control
OSGraphics *m_pImage; OSGraphics *m_pImage;
/// First item in the visible area /// First item in the visible area
VarTree::Iterator m_firstPos; VarTree::Iterator m_firstPos;
/// Don't move if the position variable is updated /// Don't move if the position variable is updated
bool m_dontMove; bool m_dontMove;
/// Do we want to "flaten" the tree ? /// Do we want to "flaten" the tree ?
bool m_flat; bool m_flat;
/// Method called when the tree variable is modified /// Method called when the tree variable is modified
virtual void onUpdate( Subject<VarTree, tree_update> &rTree , virtual void onUpdate( Subject<VarTree, tree_update> &rTree ,
tree_update *); tree_update *);
// Method called when the position variable of the tree is modified // Method called when the position variable of the tree is modified
virtual void onUpdate( Subject<VarPercent> &rPercent , void *); virtual void onUpdate( Subject<VarPercent> &rPercent , void *);
/// Called when the position is set /// Called when the position is set
virtual void onPositionChange(); virtual void onPositionChange();
/// Compute the number of lines that can be displayed /// Compute the number of lines that can be displayed
int maxItems(); int maxItems();
/// Compute the item's height (depends on fonts and images used) /// Compute the item's height (depends on fonts and images used)
int itemHeight(); int itemHeight();
/// Compute the width of an item's bitmap /// Compute the width of an item's bitmap
int itemImageWidth(); int itemImageWidth();
/// Check if the tree must be scrolled /// Check if the tree must be scrolled
void autoScroll(); void autoScroll();
/// Draw the image of the control /// Draw the image of the control
void makeImage(); void makeImage();
/// Return the n'th displayed item (starting at position 0) /// Return the n'th displayed item (starting at position 0)
/** /**
* Return m_rTree.end() if such an item cannot be found (n < 0, or * Return m_rTree.end() if such an item cannot be found (n < 0, or
* n too big) * n too big)
*/ */
VarTree::Iterator findItemAtPos( int n ); VarTree::Iterator findItemAtPos( int n );
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef CTRL_VIDEO_HPP #ifndef CTRL_VIDEO_HPP
...@@ -33,79 +33,79 @@ ...@@ -33,79 +33,79 @@
/// Control video /// Control video
class CtrlVideo: public CtrlGeneric, public Observer<VarBox> class CtrlVideo: public CtrlGeneric, public Observer<VarBox>
{ {
public: public:
CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout, CtrlVideo( intf_thread_t *pIntf, GenericLayout &rLayout,
bool autoResize, const UString &rHelp, VarBool *pVisible ); bool autoResize, const UString &rHelp, VarBool *pVisible );
virtual ~CtrlVideo(); virtual ~CtrlVideo();
/// Handle an event on the control /// Handle an event on the control
virtual void handleEvent( EvtGeneric &rEvent ); virtual void handleEvent( EvtGeneric &rEvent );
/// Check whether coordinates are inside the control /// Check whether coordinates are inside the control
virtual bool mouseOver( int x, int y ) const; virtual bool mouseOver( int x, int y ) const;
/// Callback for layout resize /// Callback for layout resize
virtual void onResize(); virtual void onResize();
/// Called when the Position is set /// Called when the Position is set
virtual void onPositionChange(); virtual void onPositionChange();
/// Draw the control on the given graphics /// Draw the control on the given graphics
virtual void draw( OSGraphics &rImage, int xDest, int yDest ); virtual void draw( OSGraphics &rImage, int xDest, int yDest );
/// Get the type of control (custom RTTI) /// Get the type of control (custom RTTI)
virtual string getType() const { return "video"; } virtual string getType() const { return "video"; }
/// Method called when the vout size is updated /// Method called when the vout size is updated
virtual void onUpdate( Subject<VarBox> &rVoutSize, void* ); virtual void onUpdate( Subject<VarBox> &rVoutSize, void* );
/// Method called when visibility or ActiveLayout is updated /// Method called when visibility or ActiveLayout is updated
virtual void onUpdate( Subject<VarBool> &rVariable , void* ); virtual void onUpdate( Subject<VarBool> &rVariable , void* );
// Attach a voutWindow to a Video Control // Attach a voutWindow to a Video Control
void attachVoutWindow( VoutWindow* pVoutWindow, void attachVoutWindow( VoutWindow* pVoutWindow,
int width = -1, int height = -1 ); int width = -1, int height = -1 );
// Detach a voutWindow from a Video Control // Detach a voutWindow from a Video Control
void detachVoutWindow( ); void detachVoutWindow( );
// Update the inner part of the Video Control // Update the inner part of the Video Control
void resizeInnerVout( ); void resizeInnerVout( );
// Get TopWindow associated with the video control // Get TopWindow associated with the video control
virtual TopWindow* getWindow() { return CtrlGeneric::getWindow(); } virtual TopWindow* getWindow() { return CtrlGeneric::getWindow(); }
// Get the VoutWindow associated with the video control // Get the VoutWindow associated with the video control
virtual VoutWindow* getVoutWindow() { return m_pVoutWindow; } virtual VoutWindow* getVoutWindow() { return m_pVoutWindow; }
/// Set the position and the associated layout of the control /// Set the position and the associated layout of the control
virtual void setLayout( GenericLayout *pLayout, virtual void setLayout( GenericLayout *pLayout,
const Position &rPosition ); const Position &rPosition );
// resize the video Control // resize the video Control
virtual void resizeControl( int width, int height ); virtual void resizeControl( int width, int height );
// Is this control useable (visibility requirements) // Is this control useable (visibility requirements)
virtual bool isUseable() { return m_bIsUseable; } virtual bool isUseable() { return m_bIsUseable; }
// Is this control used // Is this control used
virtual bool isUsed() { return m_pVoutWindow ? true : false; } virtual bool isUsed() { return m_pVoutWindow ? true : false; }
private: private:
/// Associated layout /// Associated layout
GenericLayout &m_rLayout; GenericLayout &m_rLayout;
/// Autoresize parameter /// Autoresize parameter
bool m_bAutoResize; bool m_bAutoResize;
/// Difference between layout size and video size /// Difference between layout size and video size
int m_xShift, m_yShift; int m_xShift, m_yShift;
/// Is the video Control useable /// Is the video Control useable
bool m_bIsUseable; bool m_bIsUseable;
/// Vout window /// Vout window
VoutWindow *m_pVoutWindow; VoutWindow *m_pVoutWindow;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_ENTER_HPP #ifndef EVT_ENTER_HPP
...@@ -31,12 +31,10 @@ ...@@ -31,12 +31,10 @@
/// Mouse enter event /// Mouse enter event
class EvtEnter: public EvtInput class EvtEnter: public EvtInput
{ {
public: public:
EvtEnter( intf_thread_t *pIntf ): EvtInput( pIntf ) {} EvtEnter( intf_thread_t *pIntf ): EvtInput( pIntf ) { }
virtual ~EvtEnter() {} virtual ~EvtEnter() { }
virtual const string getAsString() const { return "enter"; }
/// Return the type of event
virtual const string getAsString() const { return "enter"; }
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_FOCUS_HPP #ifndef EVT_FOCUS_HPP
...@@ -31,20 +31,19 @@ ...@@ -31,20 +31,19 @@
/// Focus change event /// Focus change event
class EvtFocus: public EvtGeneric class EvtFocus: public EvtGeneric
{ {
public: public:
EvtFocus( intf_thread_t *pIntf, bool focus ): EvtGeneric( pIntf ), EvtFocus( intf_thread_t *pIntf, bool focus )
m_focus( focus ) {} : EvtGeneric( pIntf ), m_focus( focus ) { }
virtual ~EvtFocus() {} virtual ~EvtFocus() { }
/// Return the type of event virtual const string getAsString() const
virtual const string getAsString() const {
{ return ( m_focus ? "focus:in" : "focus:out" );
return ( m_focus ? "focus:in" : "focus:out" ); }
}
private:
private: /// true for a focus in, and false for a focus out
/// true for a focus in, and false for a focus out bool m_focus;
bool m_focus;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_GENERIC_HPP #ifndef EVT_GENERIC_HPP
...@@ -32,14 +32,14 @@ ...@@ -32,14 +32,14 @@
/// Base class for OS events /// Base class for OS events
class EvtGeneric: public SkinObject class EvtGeneric: public SkinObject
{ {
public: public:
virtual ~EvtGeneric() {} virtual ~EvtGeneric() { }
/// Return the type of the event /// Return the type of the event
virtual const string getAsString() const = 0; virtual const string getAsString() const = 0;
protected: protected:
EvtGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) {} EvtGeneric( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_INPUT_HPP #ifndef EVT_INPUT_HPP
...@@ -31,27 +31,27 @@ ...@@ -31,27 +31,27 @@
/// Base class for mouse and key events /// Base class for mouse and key events
class EvtInput: public EvtGeneric class EvtInput: public EvtGeneric
{ {
public: public:
virtual ~EvtInput() {} virtual ~EvtInput() { }
/// Masks for modifier keys /// Masks for modifier keys
static const int kModNone; static const int kModNone;
static const int kModAlt; static const int kModAlt;
static const int kModCtrl; static const int kModCtrl;
static const int kModShift; static const int kModShift;
/// Get the modifiers /// Get the modifiers
virtual int getMod() const { return m_mod; } virtual int getMod() const { return m_mod; }
protected: protected:
EvtInput( intf_thread_t *pIntf, int mod = kModNone ); EvtInput( intf_thread_t *pIntf, int mod = kModNone );
/// Add the modifier to the event string /// Add the modifier to the event string
virtual void addModifier( string &rEvtString ) const; virtual void addModifier( string &rEvtString ) const;
private: private:
/// Modifiers (special key(s) pressed during the mouse event) /// Modifiers (special key(s) pressed during the mouse event)
int m_mod; int m_mod;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_KEY_HPP #ifndef EVT_KEY_HPP
...@@ -31,29 +31,26 @@ ...@@ -31,29 +31,26 @@
/// Class for keyboard events /// Class for keyboard events
class EvtKey: public EvtInput class EvtKey: public EvtInput
{ {
public: public:
enum ActionType_t enum ActionType_t
{ {
kDown, kDown,
kUp kUp
}; };
EvtKey( intf_thread_t *pIntf, int key, ActionType_t action, EvtKey( intf_thread_t *I, int key, ActionType_t actn, int mod = kModNone )
int mod = kModNone ): : EvtInput( I, mod ), m_key( key ), m_action( actn ) { }
EvtInput( pIntf, mod ), m_key( key ), m_action( action ) {} virtual ~EvtKey() { }
virtual ~EvtKey() {} virtual const string getAsString() const;
/// Return the type of event int getKey() const { return m_key; }
virtual const string getAsString() const;
private:
int getKey() const { return m_key; } /// The concerned key, stored according to the '#define's in vlc_keys.h
/// but without the modifiers (which are stored in EvtInput)
private: int m_key;
/// The concerned key, stored according to the '#define's in vlc_keys.h /// Type of action
/// but without the modifiers (which are stored in EvtInput) ActionType_t m_action;
int m_key;
/// Type of action
ActionType_t m_action;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_LEAVE_HPP #ifndef EVT_LEAVE_HPP
...@@ -31,12 +31,10 @@ ...@@ -31,12 +31,10 @@
/// Mouse leave event /// Mouse leave event
class EvtLeave: public EvtInput class EvtLeave: public EvtInput
{ {
public: public:
EvtLeave( intf_thread_t *pIntf ): EvtInput( pIntf ) {} EvtLeave( intf_thread_t *pIntf ): EvtInput( pIntf ) { }
virtual ~EvtLeave() {} virtual ~EvtLeave() { }
virtual const string getAsString() const { return "leave"; }
/// Return the type of event
virtual const string getAsString() const { return "leave"; }
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_MENU_HPP #ifndef EVT_MENU_HPP
...@@ -30,20 +30,17 @@ ...@@ -30,20 +30,17 @@
/// Mouse move event /// Mouse move event
class EvtMenu: public EvtGeneric class EvtMenu: public EvtGeneric
{ {
public: public:
EvtMenu( intf_thread_t *pIntf, int itemId ): EvtMenu( intf_thread_t *pIntf, int itemId )
EvtGeneric( pIntf ), m_itemId( itemId ) {} : EvtGeneric( pIntf ), m_itemId( itemId ) { }
virtual ~EvtMenu() {} virtual ~EvtMenu() { }
virtual const string getAsString() const { return "menu"; }
/// Return the type of event int getItemId() const { return m_itemId; }
virtual const string getAsString() const { return "menu"; }
// Getter private:
int getItemId() const { return m_itemId; } /// Coordinates of the mouse (absolute or relative)
int m_itemId;
private:
/// Coordinates of the mouse (absolute or relative)
int m_itemId;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_MOTION_HPP #ifndef EVT_MOTION_HPP
...@@ -31,26 +31,24 @@ ...@@ -31,26 +31,24 @@
/// Mouse move event /// Mouse move event
class EvtMotion: public EvtInput class EvtMotion: public EvtInput
{ {
public: public:
EvtMotion( intf_thread_t *pIntf, int xPos, int yPos ): EvtMotion( intf_thread_t *pIntf, int xPos, int yPos )
EvtInput( pIntf ), m_xPos( xPos ), m_yPos( yPos ) {} : EvtInput( pIntf ), m_xPos( xPos ), m_yPos( yPos ) { }
virtual ~EvtMotion() {} virtual ~EvtMotion() { }
virtual const string getAsString() const { return "motion"; }
/// Return the type of event
virtual const string getAsString() const { return "motion"; } // Getters
int getXPos() const { return m_xPos; }
// Getters int getYPos() const { return m_yPos; }
int getXPos() const { return m_xPos; }
int getYPos() const { return m_yPos; } private:
/// Coordinates of the mouse (absolute or relative)
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
* The coordinates are absolute when the event is sent to the * forwarded to the controls
* GenericWindow, but are relative to the window when the event is */
* forwarded to the controls int m_xPos, m_yPos;
*/
int m_xPos, m_yPos;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_MOUSE_HPP #ifndef EVT_MOUSE_HPP
...@@ -31,44 +31,43 @@ ...@@ -31,44 +31,43 @@
/// Class for mouse button events /// Class for mouse button events
class EvtMouse: public EvtInput class EvtMouse: public EvtInput
{ {
public: public:
enum ButtonType_t enum ButtonType_t
{ {
kLeft, kLeft,
kMiddle, kMiddle,
kRight kRight
}; };
enum ActionType_t enum ActionType_t
{ {
kDown, kDown,
kUp, kUp,
kDblClick kDblClick
}; };
EvtMouse( intf_thread_t *pIntf, int xPos, int yPos, ButtonType_t button, EvtMouse( intf_thread_t *pIntf, int xPos, int yPos, ButtonType_t button,
ActionType_t action, int mod = kModNone ): ActionType_t action, int mod = kModNone )
EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ), : EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ),
m_button( button ), m_action( action ) {} m_button( button ), m_action( action ) { }
virtual ~EvtMouse() {} virtual ~EvtMouse() { }
virtual const string getAsString() const;
// Return the event coordinates // Return the event coordinates
int getXPos() const { return m_xPos; } int getXPos() const { return m_xPos; }
int getYPos() const { return m_yPos; } int getYPos() const { return m_yPos; }
// Return the button and the action // Return the button and the action
ButtonType_t getButton() const { return m_button; } ButtonType_t getButton() const { return m_button; }
ActionType_t getAction() const { return m_action; } ActionType_t getAction() const { return m_action; }
virtual const string getAsString() const; private:
/// Coordinates of the mouse relative to the window
private: int m_xPos, m_yPos;
/// Coordinates of the mouse relative to the window /// Mouse button involved in the event
int m_xPos, m_yPos; ButtonType_t m_button;
/// Mouse button involved in the event /// Type of action
ButtonType_t m_button; ActionType_t m_action;
/// Type of action
ActionType_t m_action;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_REFRESH_HPP #ifndef EVT_REFRESH_HPP
...@@ -31,27 +31,25 @@ ...@@ -31,27 +31,25 @@
/// Refresh window event /// Refresh window event
class EvtRefresh: public EvtGeneric class EvtRefresh: public EvtGeneric
{ {
public: public:
/// Constructor with the coordinates of the area to refresh /// Constructor with the coordinates of the area to refresh
EvtRefresh( intf_thread_t *pIntf, int xStart, int yStart, int width, EvtRefresh( intf_thread_t *pIntf, int xStart, int yStart,
int height ): int width, int height )
EvtGeneric( pIntf ), m_xStart( xStart ), m_yStart( yStart ), : EvtGeneric( pIntf ), m_xStart( xStart ), m_yStart( yStart ),
m_width( width ), m_height( height ) {} m_width( width ), m_height( height ) { }
virtual ~EvtRefresh() {} virtual ~EvtRefresh() { }
virtual const string getAsString() const { return "refresh"; }
/// Return the type of event
virtual const string getAsString() const { return "refresh"; } /// Getters
int getXStart() const { return m_xStart; }
/// Getters int getYStart() const { return m_yStart; }
int getXStart() const { return m_xStart; } int getWidth() const { return m_width; }
int getYStart() const { return m_yStart; } int getHeight() const { return m_height; }
int getWidth() const { return m_width; }
int getHeight() const { return m_height; } private:
/// Coordinates and size of the area to refresh
private: int m_xStart, m_yStart, m_width, m_height;
/// Coordinates and size of the area to refresh
int m_xStart, m_yStart, m_width, m_height;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_SCROLL_HPP #ifndef EVT_SCROLL_HPP
...@@ -31,33 +31,32 @@ ...@@ -31,33 +31,32 @@
/// Class for mouse scroll events /// Class for mouse scroll events
class EvtScroll: public EvtInput class EvtScroll: public EvtInput
{ {
public: public:
enum Direction_t enum Direction_t
{ {
kUp, kUp,
kDown kDown
}; };
EvtScroll( intf_thread_t *pIntf, int xPos, int yPos, EvtScroll( intf_thread_t *pIntf, int xPos, int yPos,
Direction_t direction, int mod = kModNone ): Direction_t direction, int mod = kModNone )
EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ), : EvtInput( pIntf, mod ), m_xPos( xPos ), m_yPos( yPos ),
m_direction( direction ) {} m_direction( direction ) { }
virtual ~EvtScroll() {} virtual ~EvtScroll() { }
virtual const string getAsString() const;
// Return the event coordinates
int getXPos() const { return m_xPos; } // Return the event coordinates
int getYPos() const { return m_yPos; } int getXPos() const { return m_xPos; }
int getYPos() const { return m_yPos; }
// Return the direction
Direction_t getDirection() const { return m_direction; } // Return the direction
Direction_t getDirection() const { return m_direction; }
virtual const string getAsString() const;
private:
private: /// Coordinates of the mouse relative to the window
/// Coordinates of the mouse relative to the window int m_xPos, m_yPos;
int m_xPos, m_yPos; /// Scroll direction
/// Scroll direction Direction_t m_direction;
Direction_t m_direction;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EVT_SPECIAL_HPP #ifndef EVT_SPECIAL_HPP
...@@ -31,25 +31,23 @@ ...@@ -31,25 +31,23 @@
/// Class for non-genuine events /// Class for non-genuine events
class EvtSpecial: public EvtGeneric class EvtSpecial: public EvtGeneric
{ {
public: public:
enum ActionType_t enum ActionType_t
{ {
kShow, kShow,
kHide, kHide,
kEnable, kEnable,
kDisable kDisable
}; };
EvtSpecial( intf_thread_t *pIntf, ActionType_t action ): EvtSpecial( intf_thread_t *pIntf, ActionType_t action )
EvtGeneric( pIntf ), m_action( action ) {} : EvtGeneric( pIntf ), m_action( action ) { }
virtual ~EvtSpecial() {} virtual ~EvtSpecial() { }
virtual const string getAsString() const;
/// Return the type of event
virtual const string getAsString() const; private:
/// Type of action
private: ActionType_t m_action;
/// Type of action
ActionType_t m_action;
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_DRAGDROP_HPP #ifndef MACOSX_DRAGDROP_HPP
...@@ -28,15 +28,15 @@ ...@@ -28,15 +28,15 @@
class MacOSXDragDrop: public SkinObject class MacOSXDragDrop: public SkinObject
{ {
public: public:
typedef long ldata_t[5]; typedef long ldata_t[5];
MacOSXDragDrop( intf_thread_t *pIntf, bool playOnDrop ); MacOSXDragDrop( intf_thread_t *pIntf, bool playOnDrop );
virtual ~MacOSXDragDrop() {} virtual ~MacOSXDragDrop() { }
private: private:
/// Indicates whether the file(s) must be played immediately /// Indicates whether the file(s) must be played immediately
bool m_playOnDrop; bool m_playOnDrop;
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_FACTORY_HPP #ifndef MACOSX_FACTORY_HPP
...@@ -30,82 +30,82 @@ ...@@ -30,82 +30,82 @@
/// Class used to instanciate MacOSX specific objects /// Class used to instanciate MacOSX specific objects
class MacOSXFactory: public OSFactory class MacOSXFactory: public OSFactory
{ {
public: public:
MacOSXFactory( intf_thread_t *pIntf ); MacOSXFactory( intf_thread_t *pIntf );
virtual ~MacOSXFactory(); virtual ~MacOSXFactory();
/// Initialization method /// Initialization method
virtual bool init(); virtual bool init();
/// Instantiate an object OSGraphics /// Instantiate an object OSGraphics
virtual OSGraphics *createOSGraphics( int width, int height ); virtual OSGraphics *createOSGraphics( int width, int height );
/// Get the instance of the singleton OSLoop /// Get the instance of the singleton OSLoop
virtual OSLoop *getOSLoop(); virtual OSLoop *getOSLoop();
/// Destroy the instance of OSLoop /// Destroy the instance of OSLoop
virtual void destroyOSLoop(); virtual void destroyOSLoop();
/// Instantiate an OSTimer with the given callback /// Instantiate an OSTimer with the given callback
virtual OSTimer *createOSTimer( CmdGeneric &rCmd ); virtual OSTimer *createOSTimer( CmdGeneric &rCmd );
/// Minimize all the windows /// Minimize all the windows
virtual void minimize(); virtual void minimize();
/// Restore the minimized windows /// Restore the minimized windows
virtual void restore(); virtual void restore();
/// Add an icon in the system tray /// Add an icon in the system tray
virtual void addInTray(); virtual void addInTray();
/// Remove the icon from the system tray /// Remove the icon from the system tray
virtual void removeFromTray(); virtual void removeFromTray();
/// Show the task in the task bar /// Show the task in the task bar
virtual void addInTaskBar(); virtual void addInTaskBar();
/// Remove the task from the task bar /// Remove the task from the task bar
virtual void removeFromTaskBar(); virtual void removeFromTaskBar();
/// Instantiate an OSWindow object /// Instantiate an OSWindow object
virtual OSWindow *createOSWindow( GenericWindow &rWindow, virtual OSWindow *createOSWindow( GenericWindow &rWindow,
bool dragDrop, bool playOnDrop, bool dragDrop, bool playOnDrop,
OSWindow *pParent ); OSWindow *pParent );
/// Instantiate an object OSTooltip /// Instantiate an object OSTooltip
virtual OSTooltip *createOSTooltip(); virtual OSTooltip *createOSTooltip();
/// Instantiate an object OSPopup /// Instantiate an object OSPopup
virtual OSPopup *createOSPopup(); virtual OSPopup *createOSPopup();
/// Get the directory separator /// Get the directory separator
virtual const string &getDirSeparator() const { return m_dirSep; } virtual const string &getDirSeparator() const { return m_dirSep; }
/// Get the resource path /// Get the resource path
virtual const list<string> &getResourcePath() const virtual const list<string> &getResourcePath() const
{ return m_resourcePath; } { return m_resourcePath; }
/// Get the screen size /// Get the screen size
virtual int getScreenWidth() const; virtual int getScreenWidth() const;
virtual int getScreenHeight() const; virtual int getScreenHeight() const;
/// Get the work area (screen area without taskbars) /// Get the work area (screen area without taskbars)
virtual SkinsRect getWorkArea() const; virtual SkinsRect getWorkArea() const;
/// Get the position of the mouse /// Get the position of the mouse
virtual void getMousePos( int &rXPos, int &rYPos ) const; virtual void getMousePos( int &rXPos, int &rYPos ) const;
/// Change the cursor /// Change the cursor
virtual void changeCursor( CursorType_t type ) const { /*TODO*/ } virtual void changeCursor( CursorType_t type ) const { /*TODO*/ }
/// Delete a directory recursively /// Delete a directory recursively
virtual void rmDir( const string &rPath ); virtual void rmDir( const string &rPath );
private: private:
/// Directory separator /// Directory separator
const string m_dirSep; const string m_dirSep;
/// Resource path /// Resource path
list<string> m_resourcePath; list<string> m_resourcePath;
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_GRAPHICS_HPP #ifndef MACOSX_GRAPHICS_HPP
...@@ -33,51 +33,51 @@ class GenericBitmap; ...@@ -33,51 +33,51 @@ class GenericBitmap;
/// MacOSX implementation of OSGraphics /// MacOSX implementation of OSGraphics
class MacOSXGraphics: public OSGraphics class MacOSXGraphics: public OSGraphics
{ {
public: public:
MacOSXGraphics( intf_thread_t *pIntf, int width, int height); MacOSXGraphics( intf_thread_t *pIntf, int width, int height);
virtual ~MacOSXGraphics(); virtual ~MacOSXGraphics();
/// Clear the graphics /// Clear the graphics
virtual void clear(); virtual void clear();
/// Draw another graphics on this one /// Draw another graphics on this one
virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0, virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
int ySrc = 0, int xDest = 0, int yDest = 0, int ySrc = 0, int xDest = 0, int yDest = 0,
int width = -1, int height = -1 ); int width = -1, int height = -1 );
/// Render a bitmap on this graphics /// Render a bitmap on this graphics
virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0, virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
int ySrc = 0, int xDest = 0, int yDest = 0, int ySrc = 0, int xDest = 0, int yDest = 0,
int width = -1, int height = -1, int width = -1, int height = -1,
bool blend = false ); bool blend = false );
/// Draw a filled rectangle on the grahics (color is #RRGGBB) /// Draw a filled rectangle on the grahics (color is #RRGGBB)
virtual void fillRect( int left, int top, int width, int height, virtual void fillRect( int left, int top, int width, int height,
uint32_t color ); uint32_t color );
/// Draw an empty rectangle on the grahics (color is #RRGGBB) /// Draw an empty rectangle on the grahics (color is #RRGGBB)
virtual void drawRect( int left, int top, int width, int height, virtual void drawRect( int left, int top, int width, int height,
uint32_t color ); uint32_t color );
/// Set the shape of a window with the mask of this graphics. /// Set the shape of a window with the mask of this graphics.
virtual void applyMaskToWindow( OSWindow &rWindow ); virtual void applyMaskToWindow( OSWindow &rWindow );
/// Copy the graphics on a window /// Copy the graphics on a window
virtual void copyToWindow( OSWindow &rWindow, int xSrc, virtual void copyToWindow( OSWindow &rWindow, int xSrc,
int ySrc, int width, int height, int ySrc, int width, int height,
int xDest, int yDest ); int xDest, int yDest );
/// Tell whether the pixel at the given position is visible /// Tell whether the pixel at the given position is visible
virtual bool hit( int x, int y ) const; virtual bool hit( int x, int y ) const;
/// Getters /// Getters
virtual int getWidth() const { return m_width; } virtual int getWidth() const { return m_width; }
virtual int getHeight() const { return m_height; } virtual int getHeight() const { return m_height; }
private: private:
/// Size of the image /// Size of the image
int m_width, m_height; int m_width, m_height;
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_LOOP_HPP #ifndef MACOSX_LOOP_HPP
...@@ -33,28 +33,28 @@ class GenericWindow; ...@@ -33,28 +33,28 @@ class GenericWindow;
/// Main event loop for MacOSX (singleton) /// Main event loop for MacOSX (singleton)
class MacOSXLoop: public OSLoop class MacOSXLoop: public OSLoop
{ {
public: public:
/// Get the instance of MacOSXLoop /// Get the instance of MacOSXLoop
static OSLoop *instance( intf_thread_t *pIntf ); static OSLoop *instance( intf_thread_t *pIntf );
/// Destroy the instance of MacOSXLoop /// Destroy the instance of MacOSXLoop
static void destroy( intf_thread_t *pIntf ); static void destroy( intf_thread_t *pIntf );
/// Enter the event loop /// Enter the event loop
virtual void run(); virtual void run();
/// Exit the main loop /// Exit the main loop
virtual void exit(); virtual void exit();
// Handle a window event // Handle a window event
void registerWindow( GenericWindow &rGenWin, WindowRef win ); void registerWindow( GenericWindow &rGenWin, WindowRef win );
private: private:
// Private because it's a singleton // Private because it's a singleton
MacOSXLoop( intf_thread_t *pIntf ); MacOSXLoop( intf_thread_t *pIntf );
virtual ~MacOSXLoop(); virtual ~MacOSXLoop();
// Flag set to exit the loop // Flag set to exit the loop
bool m_exit; bool m_exit;
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_POPUP_HPP #ifndef MACOSX_POPUP_HPP
...@@ -30,25 +30,25 @@ ...@@ -30,25 +30,25 @@
/// MacOSX implementation of OSPopup /// MacOSX implementation of OSPopup
class MacOSXPopup: public OSPopup class MacOSXPopup: public OSPopup
{ {
public: public:
MacOSXPopup( intf_thread_t *pIntf ); MacOSXPopup( intf_thread_t *pIntf );
virtual ~MacOSXPopup(); virtual ~MacOSXPopup();
/// Show the popup menu at the given (absolute) corrdinates /// Show the popup menu at the given (absolute) corrdinates
virtual void show( int xPos, int yPos ); virtual void show( int xPos, int yPos );
/// Hide the popup menu /// Hide the popup menu
virtual void hide(); virtual void hide();
/// Append a new menu item with the given label to the popup menu /// Append a new menu item with the given label to the popup menu
virtual void addItem( const string &rLabel, int pos ); virtual void addItem( const string &rLabel, int pos );
/// Create a dummy menu item to separate sections /// Create a dummy menu item to separate sections
virtual void addSeparator( int pos ); virtual void addSeparator( int pos );
/// Return the position of the item identified by the given id /// Return the position of the item identified by the given id
virtual int getPosFromId( int id ) const; virtual int getPosFromId( int id ) const;
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_TIMER_HPP #ifndef MACOSX_TIMER_HPP
...@@ -34,20 +34,20 @@ class CmdGeneric; ...@@ -34,20 +34,20 @@ class CmdGeneric;
// MacOSX specific timer // MacOSX specific timer
class MacOSXTimer: public OSTimer class MacOSXTimer: public OSTimer
{ {
public: public:
MacOSXTimer( intf_thread_t *pIntf, CmdGeneric &rCmd ); MacOSXTimer( intf_thread_t *pIntf, CmdGeneric &rCmd );
virtual ~MacOSXTimer(); virtual ~MacOSXTimer();
/// (Re)start the timer with the given delay (in ms). If oneShot is /// (Re)start the timer with the given delay (in ms). If oneShot is
/// true, stop it after the first execution of the callback. /// true, stop it after the first execution of the callback.
virtual void start( int delay, bool oneShot ); virtual void start( int delay, bool oneShot );
/// Stop the timer /// Stop the timer
virtual void stop(); virtual void stop();
private: private:
/// Command to execute /// Command to execute
CmdGeneric &m_rCommand; CmdGeneric &m_rCommand;
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_TOOLTIP_HPP #ifndef MACOSX_TOOLTIP_HPP
...@@ -32,18 +32,16 @@ class MacOSXDisplay; ...@@ -32,18 +32,16 @@ class MacOSXDisplay;
/// MacOSX implementation of OSTooltip /// MacOSX implementation of OSTooltip
class MacOSXTooltip: public OSTooltip class MacOSXTooltip: public OSTooltip
{ {
public: public:
MacOSXTooltip( intf_thread_t *pIntf ); MacOSXTooltip( intf_thread_t *pIntf );
virtual ~MacOSXTooltip(); virtual ~MacOSXTooltip();
/// Show the tooltip /// Show the tooltip
virtual void show( int left, int top, OSGraphics &rText ); virtual void show( int left, int top, OSGraphics &rText );
/// Hide the tooltip /// Hide the tooltip
virtual void hide(); virtual void hide();
private:
}; };
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef MACOSX_WINDOW_HPP #ifndef MACOSX_WINDOW_HPP
...@@ -34,42 +34,42 @@ class MacOSXDragDrop; ...@@ -34,42 +34,42 @@ class MacOSXDragDrop;
/// MacOSX implementation of OSWindow /// MacOSX implementation of OSWindow
class MacOSXWindow: public OSWindow class MacOSXWindow: public OSWindow
{ {
public: public:
MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow, MacOSXWindow( intf_thread_t *pIntf, GenericWindow &rWindow,
bool dragDrop, bool playOnDrop, bool dragDrop, bool playOnDrop,
MacOSXWindow *pParentWindow ); MacOSXWindow *pParentWindow );
virtual ~MacOSXWindow(); virtual ~MacOSXWindow();
// Show the window // Show the window
virtual void show( int left, int top ) const; virtual void show( int left, int top ) const;
// Hide the window // Hide the window
virtual void hide() const; virtual void hide() const;
/// Move the window /// Move the window
virtual void moveResize( int left, int top, virtual void moveResize( int left, int top,
int width, int height ) const; int width, int height ) const;
/// Bring the window on top /// Bring the window on top
virtual void raise() const; virtual void raise() const;
/// Set the opacity of the window (0 = transparent, 255 = opaque) /// Set the opacity of the window (0 = transparent, 255 = opaque)
virtual void setOpacity( uint8_t value ) const; virtual void setOpacity( uint8_t value ) const;
/// Toggle the window on top /// Toggle the window on top
virtual void toggleOnTop( bool onTop ) const; virtual void toggleOnTop( bool onTop ) const;
/// Get the Carbon window handle /// Get the Carbon window handle
WindowRef getWindowRef() const { return m_win; }; WindowRef getWindowRef() const { return m_win; };
private: private:
/// Parent window /// Parent window
MacOSXWindow *m_pParent; MacOSXWindow *m_pParent;
/// Indicates whether the window handles drag&drop events /// Indicates whether the window handles drag&drop events
bool m_dragDrop; bool m_dragDrop;
/// Carbon Window object /// Carbon Window object
WindowRef m_win; WindowRef m_win;
}; };
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
...@@ -47,72 +47,72 @@ class GenericRect; ...@@ -47,72 +47,72 @@ class GenericRect;
/// Class for skin construction /// Class for skin construction
class Builder: public SkinObject class Builder: public SkinObject
{ {
public: public:
Builder( intf_thread_t *pIntf, const BuilderData &rData, Builder( intf_thread_t *pIntf, const BuilderData &rData,
const string &rPath ); const string &rPath );
virtual ~Builder(); virtual ~Builder();
/// Create a Theme object, ready to use. /// Create a Theme object, ready to use.
/// Return NULL in case of problem /// Return NULL in case of problem
Theme *build(); Theme *build();
/// Parse an action tag and returns a command /// Parse an action tag and returns a command
CmdGeneric *parseAction( const string &rAction ); CmdGeneric *parseAction( const string &rAction );
private: private:
/// Data from the XML /// Data from the XML
const BuilderData &m_rData; const BuilderData &m_rData;
/// Path of the theme /// Path of the theme
const string m_path; const string m_path;
/// Theme under construction /// Theme under construction
Theme *m_pTheme; Theme *m_pTheme;
void addTheme( const BuilderData::Theme &rData ); void addTheme( const BuilderData::Theme &rData );
void addIniFile( const BuilderData::IniFile &rData ); void addIniFile( const BuilderData::IniFile &rData );
void addBitmap( const BuilderData::Bitmap &rData ); void addBitmap( const BuilderData::Bitmap &rData );
void addSubBitmap( const BuilderData::SubBitmap &rData ); void addSubBitmap( const BuilderData::SubBitmap &rData );
void addBitmapFont( const BuilderData::BitmapFont &rData ); void addBitmapFont( const BuilderData::BitmapFont &rData );
void addFont( const BuilderData::Font &rData ); void addFont( const BuilderData::Font &rData );
void addPopupMenu( const BuilderData::PopupMenu &rData ); void addPopupMenu( const BuilderData::PopupMenu &rData );
void addMenuItem( const BuilderData::MenuItem &rData ); void addMenuItem( const BuilderData::MenuItem &rData );
void addMenuSeparator( const BuilderData::MenuSeparator &rData ); void addMenuSeparator( const BuilderData::MenuSeparator &rData );
void addWindow( const BuilderData::Window &rData ); void addWindow( const BuilderData::Window &rData );
void addLayout( const BuilderData::Layout &rData ); void addLayout( const BuilderData::Layout &rData );
void addAnchor( const BuilderData::Anchor &rData ); void addAnchor( const BuilderData::Anchor &rData );
void addButton( const BuilderData::Button &rData ); void addButton( const BuilderData::Button &rData );
void addCheckbox( const BuilderData::Checkbox &rData ); void addCheckbox( const BuilderData::Checkbox &rData );
void addImage( const BuilderData::Image &rData ); void addImage( const BuilderData::Image &rData );
void addPanel( const BuilderData::Panel &rData ); void addPanel( const BuilderData::Panel &rData );
void addText( const BuilderData::Text &rData ); void addText( const BuilderData::Text &rData );
void addRadialSlider( const BuilderData::RadialSlider &rData ); void addRadialSlider( const BuilderData::RadialSlider &rData );
void addSlider( const BuilderData::Slider &rData ); void addSlider( const BuilderData::Slider &rData );
void addList( const BuilderData::List &rData ); void addList( const BuilderData::List &rData );
void addTree( const BuilderData::Tree &rData ); void addTree( const BuilderData::Tree &rData );
void addVideo( const BuilderData::Video &rData ); void addVideo( const BuilderData::Video &rData );
/// Compute the position of a control /// Compute the position of a control
const Position makePosition( const string &rLeftTop, const Position makePosition( const string &rLeftTop,
const string &rRightBottom, const string &rRightBottom,
int xPos, int yPos, int width, int height, int xPos, int yPos, int width, int height,
const GenericRect &rRect, const GenericRect &rRect,
bool xKeepRatio = false, bool xKeepRatio = false,
bool yKeepRatio = false ) const; bool yKeepRatio = false ) const;
// Build the full path of a file // Build the full path of a file
string getFilePath( const string &fileName ) const; string getFilePath( const string &fileName ) const;
/// Get a font from its id /// Get a font from its id
GenericFont *getFont( const string &fontId ); GenericFont *getFont( const string &fontId );
/// Function to parse "points" tags /// Function to parse "points" tags
Bezier *getPoints( const char *pTag ) const; Bezier *getPoints( const char *pTag ) const;
/// Compute a color value /// Compute a color value
uint32_t getColor( const string &rVal ) const; uint32_t getColor( const string &rVal ) const;
/// Image handler (used to load image files) /// Image handler (used to load image files)
image_handler_t *m_pImageHandler; image_handler_t *m_pImageHandler;
}; };
#endif #endif
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef EXPR_EVALUATOR_HPP #ifndef EXPR_EVALUATOR_HPP
...@@ -31,26 +31,23 @@ ...@@ -31,26 +31,23 @@
/// Expression evaluator using Reverse Polish Notation /// Expression evaluator using Reverse Polish Notation
class ExprEvaluator: public SkinObject class ExprEvaluator: public SkinObject
{ {
public: public:
/// Constructor ExprEvaluator( intf_thread_t *pIntf ): SkinObject( pIntf ) { }
ExprEvaluator( intf_thread_t *pIntf ): SkinObject( pIntf ) {} ~ExprEvaluator() { }
/// Destructor /// Clear the RPN stack and parse an expression
~ExprEvaluator() {} void parse( const string &rExpr );
/// Clear the RPN stack and parse an expression /// Pop the first token from the RPN stack.
void parse( const string &rExpr ); /// Return NULL when the stack is empty.
string getToken();
/// Pop the first token from the RPN stack. private:
/// Return NULL when the stack is empty. /// RPN stack
string getToken(); list<string> m_stack;
private: /// Returns true if op1 has precedency over op2
/// RPN stack bool hasPrecedency( const string &op1, const string &op2 ) const;
list<string> m_stack;
/// Returns true if op1 has precedency over op2
bool hasPrecedency( const string &op1, const string &op2 ) const;
}; };
#endif #endif
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef INTERPRETER_HPP #ifndef INTERPRETER_HPP
...@@ -38,41 +38,41 @@ class VarPercent; ...@@ -38,41 +38,41 @@ class VarPercent;
/// Command interpreter for scripts in the XML /// Command interpreter for scripts in the XML
class Interpreter: public SkinObject class Interpreter: public SkinObject
{ {
public: public:
/// Get the instance of Interpreter /// Get the instance of Interpreter
static Interpreter *instance( intf_thread_t *pIntf ); static Interpreter *instance( intf_thread_t *pIntf );
/// Delete the instance of Interpreter /// Delete the instance of Interpreter
static void destroy( intf_thread_t *pIntf ); static void destroy( intf_thread_t *pIntf );
/// Parse an action tag and returns a pointer on a command /// Parse an action tag and returns a pointer on a command
/// (the intepreter takes care of deleting it, don't do it /// (the intepreter takes care of deleting it, don't do it
/// yourself !) /// yourself !)
CmdGeneric *parseAction( const string &rAction, Theme *pTheme ); CmdGeneric *parseAction( const string &rAction, Theme *pTheme );
/// Returns the boolean variable corresponding to the given name /// Returns the boolean variable corresponding to the given name
VarBool *getVarBool( const string &rName, Theme *pTheme ); VarBool *getVarBool( const string &rName, Theme *pTheme );
/// Returns the percent variable corresponding to the given name /// Returns the percent variable corresponding to the given name
VarPercent *getVarPercent( const string &rName, Theme *pTheme ); VarPercent *getVarPercent( const string &rName, Theme *pTheme );
/// Returns the list variable corresponding to the given name /// Returns the list variable corresponding to the given name
VarList *getVarList( const string &rName, Theme *pTheme ); VarList *getVarList( const string &rName, Theme *pTheme );
/// Returns the tree variable corresponding to the given name /// Returns the tree variable corresponding to the given name
VarTree *getVarTree( const string &rName, Theme *pTheme ); VarTree *getVarTree( const string &rName, Theme *pTheme );
/// Get a constant value /// Get a constant value
string getConstant( const string &rValue ); string getConstant( const string &rValue );
private: private:
/// Map of global commands /// Map of global commands
map<string, CmdGenericPtr> m_commandMap; map<string, CmdGenericPtr> m_commandMap;
// Private because it is a singleton // Private because it is a singleton
Interpreter( intf_thread_t *pIntf ); Interpreter( intf_thread_t *pIntf );
virtual ~Interpreter() {} virtual ~Interpreter() { }
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef SKIN_PARSER_HPP #ifndef SKIN_PARSER_HPP
...@@ -32,61 +32,61 @@ ...@@ -32,61 +32,61 @@
/// Parser for the skin DTD /// Parser for the skin DTD
class SkinParser: public XMLParser class SkinParser: public XMLParser
{ {
public: public:
SkinParser( intf_thread_t *pIntf, const string &rFileName, SkinParser( intf_thread_t *pIntf, const string &rFileName,
const string &rPath, bool useDTD = true, const string &rPath, bool useDTD = true,
BuilderData *pData = NULL ); BuilderData *pData = NULL );
virtual ~SkinParser(); 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: private:
/// Path of the theme /// Path of the theme
const string m_path; const string m_path;
/// Container for mapping data from the XML /// Container for mapping data from the XML
BuilderData *m_pData; BuilderData *m_pData;
/// Indicate whether the class owns the data /// Indicate whether the class owns the data
bool m_ownData; bool m_ownData;
/// Current IDs /// Current IDs
string m_curBitmapId; string m_curBitmapId;
string m_curWindowId; string m_curWindowId;
string m_curLayoutId; string m_curLayoutId;
string m_curPopupId; string m_curPopupId;
string m_curListId; string m_curListId;
string m_curTreeId; string m_curTreeId;
/// Current position of menu items in the popups /// Current position of menu items in the popups
list<int> m_popupPosList; list<int> m_popupPosList;
/// Current offset of the controls /// Current offset of the controls
int m_xOffset, m_yOffset; int m_xOffset, m_yOffset;
list<int> m_xOffsetList, m_yOffsetList; list<int> m_xOffsetList, m_yOffsetList;
/// Stack of panel ids /// Stack of panel ids
list<string> m_panelStack; list<string> m_panelStack;
/// Layer of the current control in the layout /// Layer of the current control in the layout
int m_curLayer; int m_curLayer;
/// Set of used id /// Set of used id
set<string> m_idSet; set<string> m_idSet;
/// Callbacks /// Callbacks
virtual void handleBeginElement( const string &rName, virtual void handleBeginElement( const string &rName,
AttrList_t &attr ); AttrList_t &attr );
virtual void handleEndElement( const string &rName ); virtual void handleEndElement( const string &rName );
/// Helper functions /// Helper functions
//@{ //@{
bool convertBoolean( const char *value ) const; bool convertBoolean( const char *value ) const;
/// Transform to int, and check that it is in the given range (if not, /// Transform to int, and check that it is in the given range (if not,
/// the closest range boundary will be used) /// the closest range boundary will be used)
int convertInRange( const char *value, int minValue, int maxValue, int convertInRange( const char *value, int minValue, int maxValue,
const string &rAttribute ) const; const string &rAttribute ) const;
//@} //@}
/// Generate a new id /// Generate a new id
const string generateId() const; const string generateId() const;
/// Check if the id is unique, and if not generate a new one /// Check if the id is unique, and if not generate a new one
const string uniqueId( const string &id ); const string uniqueId( const string &id );
}; };
#endif #endif
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef XMLPARSER_HPP #ifndef XMLPARSER_HPP
...@@ -36,41 +36,41 @@ ...@@ -36,41 +36,41 @@
/// XML parser using libxml2 text reader API /// XML parser using libxml2 text reader API
class XMLParser: public SkinObject class XMLParser: public SkinObject
{ {
public: public:
XMLParser( intf_thread_t *pIntf, const string &rFileName, XMLParser( intf_thread_t *pIntf, const string &rFileName,
bool useDTD = true ); bool useDTD = true );
virtual ~XMLParser(); virtual ~XMLParser();
/// Parse the file. Returns true on success /// Parse the file. Returns true on success
bool parse(); bool parse();
protected: protected:
// Key comparison function for type "const char*" // Key comparison function for type "const char*"
struct ltstr 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;
{ }
return strcmp(s1, s2) < 0; };
} /// Type for attribute lists
}; typedef map<const char*, const char*, ltstr> AttrList_t;
/// Type for attribute lists
typedef map<const char*, const char*, ltstr> AttrList_t;
/// Flag for validation errors /// Flag for validation errors
bool m_errors; bool m_errors;
/// Callbacks /// Callbacks
virtual void handleBeginElement( const string &rName, virtual void handleBeginElement( const string &rName,
AttrList_t &attr ) {} AttrList_t &attr ) { }
virtual void handleEndElement( const string &rName ) {} virtual void handleEndElement( const string &rName ) { }
private: private:
void LoadCatalog(); void LoadCatalog();
/// Reader context /// Reader context
xml_t *m_pXML; xml_t *m_pXML;
xml_reader_t *m_pReader; xml_reader_t *m_pReader;
stream_t *m_pStream; stream_t *m_pStream;
}; };
#endif #endif
This diff is collapsed.
This diff is collapsed.
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License along
* along with this program; if not, write to the Free Software * with this program; if not, write to the Free Software Foundation, Inc.,
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef BITMAP_FONT_HPP #ifndef BITMAP_FONT_HPP
...@@ -33,39 +33,39 @@ class GenericBitmap; ...@@ -33,39 +33,39 @@ class GenericBitmap;
/// Class to handle bitmap fonts /// Class to handle bitmap fonts
class BitmapFont: public GenericFont class BitmapFont: public GenericFont
{ {
public: public:
BitmapFont( intf_thread_t *pIntf, const GenericBitmap &rBitmap, BitmapFont( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
const string &rType ); const string &rType );
virtual ~BitmapFont() {} virtual ~BitmapFont() { }
virtual bool init() { return true; } virtual bool init() { return true; }
/// Render a string on a bitmap. /// Render a string on a bitmap.
/// If maxWidth != -1, the text is truncated with '...' /// If maxWidth != -1, the text is truncated with '...'
virtual GenericBitmap *drawString( const UString &rString, virtual GenericBitmap *drawString( const UString &rString,
uint32_t color, int maxWidth = -1 ) const; uint32_t color, int maxWidth = -1 ) const;
/// Get the font size /// Get the font size
virtual int getSize() const { return m_height; } virtual int getSize() const { return m_height; }
private: private:
/// Description of a glyph /// Description of a glyph
struct Glyph_t struct Glyph_t
{ {
Glyph_t(): m_xPos( -1 ), m_yPos( 0 ) {} Glyph_t(): m_xPos( -1 ), m_yPos( 0 ) { }
int m_xPos, m_yPos; int m_xPos, m_yPos;
}; };
/// Bitmap /// Bitmap
const GenericBitmap &m_rBitmap; const GenericBitmap &m_rBitmap;
/// Glyph size /// Glyph size
int m_width, m_height; int m_width, m_height;
/// Horizontal advance between two characters /// Horizontal advance between two characters
int m_advance; int m_advance;
/// Horizontal advance for non-displayable characters /// Horizontal advance for non-displayable characters
int m_skip; int m_skip;
/// Character table /// Character table
Glyph_t m_table[256]; Glyph_t m_table[256];
}; };
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment