X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fgui%2Fskins2%2Fsrc%2Fskin_common.hpp;h=8b880bb1f5d70bd1cad1e142fc99e2edf4bd6721;hb=6d5336200143e6d1ad70ef653c72265d25f67640;hp=c8037aabe25db483ffa082f845ea155d104a45af;hpb=4809df7de08ec0ea632de59bcd52bb5059cf9e40;p=vlc diff --git a/modules/gui/skins2/src/skin_common.hpp b/modules/gui/skins2/src/skin_common.hpp index c8037aabe2..8b880bb1f5 100644 --- a/modules/gui/skins2/src/skin_common.hpp +++ b/modules/gui/skins2/src/skin_common.hpp @@ -17,16 +17,22 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef SKIN_COMMON_HPP #define SKIN_COMMON_HPP -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include #include using namespace std; @@ -39,6 +45,8 @@ class OSFactory; class OSLoop; class VarManager; class VlcProc; +class VoutManager; +class ArtManager; class Theme; class ThemeRepository; @@ -53,33 +61,36 @@ class ThemeRepository; #pragma warning ( disable:4786 ) #endif -// Useful macros -#define SKINS_DELETE( p ) \ - if( p ) \ - { \ - delete p; \ - } \ - else \ - { \ - msg_Err( getIntf(), "delete NULL pointer in %s at line %d", \ - __FILE__, __LINE__ ); \ - } - +#ifdef X11_SKINS +typedef uint32_t vlc_wnd_type; +#else +typedef void* vlc_wnd_type; +#endif /// Wrapper around FromLocale, to avoid the need to call LocaleFree() static inline string sFromLocale( const string &rLocale ) { - char *s = FromLocale( rLocale.c_str() ); + const char *s = FromLocale( rLocale.c_str() ); string res = s; LocaleFree( s ); return res; } +#ifdef _WIN32 +/// Wrapper around FromWide, to avoid the need to call free() +static inline string sFromWide( const wstring &rWide ) +{ + char *s = FromWide( rWide.c_str() ); + string res = s; + free( s ); + return res; +} +#endif /// Wrapper around ToLocale, to avoid the need to call LocaleFree() static inline string sToLocale( const string &rUTF8 ) { - char *s = ToLocale( rUTF8.c_str() ); + const char *s = ToLocale( rUTF8.c_str() ); string res = s; LocaleFree( s ); return res; @@ -97,9 +108,6 @@ struct intf_sys_t /// The playlist thread playlist_t *p_playlist; - /// Message bank subscription - msg_subscription_t *p_sub; - // "Singleton" objects: MUST be initialized to NULL ! /// Logger Logger *p_logger; @@ -117,27 +125,38 @@ struct intf_sys_t VarManager *p_varManager; /// VLC state handler VlcProc *p_vlcProc; + /// Vout manager + VoutManager *p_voutManager; + /// Art manager + ArtManager *p_artManager; /// Theme repository ThemeRepository *p_repository; /// Current theme Theme *p_theme; + + /// synchronisation at start of interface + vlc_thread_t thread; + vlc_mutex_t init_lock; + vlc_cond_t init_wait; + bool b_error; + bool b_ready; }; /// Base class for all skin classes class SkinObject { - public: - SkinObject( intf_thread_t *pIntf ): m_pIntf( pIntf ) {} - virtual ~SkinObject() {} +public: + SkinObject( intf_thread_t *pIntf ): m_pIntf( pIntf ) { } + virtual ~SkinObject() { } - /// Getter (public because it is used in C callbacks in the win32 - /// interface) - intf_thread_t *getIntf() const { return m_pIntf; } + /// Getter (public because it is used in C callbacks in the win32 + /// interface) + intf_thread_t *getIntf() const { return m_pIntf; } - private: - intf_thread_t *m_pIntf; +private: + intf_thread_t *m_pIntf; };