]> git.sesse.net Git - vlc/commitdiff
* reverted my previous commit: cannot work as expected
authorCyril Deguet <asmax@videolan.org>
Sun, 22 Jun 2003 12:46:49 +0000 (12:46 +0000)
committerCyril Deguet <asmax@videolan.org>
Sun, 22 Jun 2003 12:46:49 +0000 (12:46 +0000)
* src/theme.cpp: fixed a delete[] / free mismatch

12 files changed:
modules/gui/skins/parser/wrappers.cpp
modules/gui/skins/src/event.cpp
modules/gui/skins/src/event.h
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/theme.h
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/src/window.cpp
modules/gui/skins/src/window.h
modules/gui/skins/win32/win32_run.cpp
modules/gui/skins/win32/win32_theme.cpp
modules/gui/skins/x11/x11_run.cpp
modules/gui/skins/x11/x11_theme.cpp

index 76c6acacde9794740caa5b4b85860eb71785edf6..6d615be7b2f6ffaa15ae78d5cdf84e25ff9f26ad 100644 (file)
@@ -2,7 +2,7 @@
  * wrappers.cpp: Wrappers around C++ objects
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: wrappers.cpp,v 1.11 2003/06/22 00:00:28 asmax Exp $
+ * $Id: wrappers.cpp,v 1.12 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -117,7 +117,7 @@ void EndControlGroup()
 void AddAnchor( char *x, char *y, char *len, char *priority )
 {
     int XOff, YOff;
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
     
@@ -137,7 +137,7 @@ void AddImage( char *id, char *visible, char *x, char *y, char *image,
     char *event, char *help )
 {
     int XOff, YOff;
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
 
@@ -150,7 +150,7 @@ void AddRectangle( char *id, char *visible, char *x, char *y, char *w, char *h,
     char *color, char *event, char *help )
 {
     int XOff, YOff;
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
 
@@ -168,7 +168,7 @@ void AddButton(
     char *tooltiptext, char *help )
 {
     int XOff, YOff;
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
 
@@ -193,7 +193,7 @@ void AddCheckBox(
     char *tooltiptext1, char *tooltiptext2, char *help )
 {
     int XOff, YOff;
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
 
@@ -231,7 +231,7 @@ void AddSlider( char *id, char *visible, char *x, char *y, char *type, char *up,
     ConvertCoords( abs, p_abs );
     ConvertCoords( ord, p_ord );
 
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     // Move control
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
@@ -286,7 +286,7 @@ void AddPlayList( char *id, char *visible, char *x, char *y, char *width,
     ConvertCoords( abs, p_abs );
     ConvertCoords( ord, p_ord );
 
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     // Move control
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
@@ -319,7 +319,7 @@ void AddText( char *id, char *visible, char *x, char *y, char *text, char *font,
     char *help )
 {
     int XOff, YOff;
-    SkinWindow *vlcWin = SkinWindowList::Instance()->Back();
+    SkinWindow *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
 
     g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
 
index a5cb6ac291d79408078e6936f70823f0f519e9a1..73bad464d29c12dd22c0d8612ae887767469957b 100644 (file)
@@ -2,7 +2,7 @@
  * event.cpp: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.cpp,v 1.18 2003/06/22 00:00:28 asmax Exp $
+ * $Id: event.cpp,v 1.19 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -344,8 +344,8 @@ GenericControl * Event::FindControl( string id )
     list<SkinWindow *>::const_iterator win;
     unsigned int i;
 
-    for( win = SkinWindowList::Instance()->Begin();
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = p_intf->p_sys->p_theme->WindowList.begin();
+         win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
     {
         for( i = 0; i < (*win)->ControlList.size(); i++ )
         {
index 0c5419ca468eaf1fcd92d4fcbe4912cd967168b1..b548f98b62ba098e03e0992da33361cacb13280a 100644 (file)
@@ -2,7 +2,7 @@
  * event.h: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.h,v 1.11 2003/06/22 00:00:28 asmax Exp $
+ * $Id: event.h,v 1.12 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -52,7 +52,8 @@ using namespace std;
 
 // VLC messages
 #define VLC_NOTHING         (VLC_MESSAGE + 1)
-#define VLC_HIDE            (VLC_MESSAGE + 2)
+#define VLC_SHOW            (VLC_MESSAGE + 2)
+#define VLC_HIDE            (VLC_MESSAGE + 3)
 
 #define VLC_QUIT            (VLC_MESSAGE + 4)
 #define VLC_OPEN            (VLC_MESSAGE + 5)
index a7839abde198d52ab12b523a3614099aae447dc5..33a9e41051b1233d950a2b253cd9b3439b4a2703 100644 (file)
@@ -2,7 +2,7 @@
  * theme.cpp: Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: theme.cpp,v 1.15 2003/06/22 00:00:28 asmax Exp $
+ * $Id: theme.cpp,v 1.16 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -63,8 +63,7 @@ Theme::~Theme()
 {
     // Delete the windows
     list<SkinWindow *>::const_iterator win;
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         delete (OSWindow *)(*win);
     }
@@ -88,8 +87,7 @@ void Theme::ShowTheme()
     Event *evt2;
 
     // Synchronize control to visible aspect
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         // Synchronize windows visibility
         if( (*win)->OnStartThemeVisible )
@@ -110,14 +108,7 @@ void Theme::ShowTheme()
     CheckAnchors();
 
     // Show windows
-    for( list<SkinWindow *>::const_iterator win =
-        SkinWindowList::Instance()->Begin();
-        win != SkinWindowList::Instance()->End(); win++ )
-    {
-        if( (*win)->OnStartThemeVisible )
-            OSAPI_PostMessage( (*win), WINDOW_OPEN, 1, 0 );
-    }
-    p_intf->p_sys->b_all_win_closed = false;
+    OSAPI_PostMessage( NULL, VLC_SHOW, 0, 0 );
 }
 //---------------------------------------------------------------------------
 void Theme::CreateSystemMenu()
@@ -142,8 +133,7 @@ void Theme::LoadConfig()
     int x, y, v, scan;
 
     // Get config for each window
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         // Get config
         scan = sscanf( &save[i * 13], "(%4d,%4d,%1d)", &x, &y, &v );
@@ -169,8 +159,7 @@ void Theme::SaveConfig()
     int x, y;
 
     // Save config of every window
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         // Print config
         (*win)->GetPos( x, y );
@@ -209,9 +198,8 @@ void Theme::InitTheme()
 //---------------------------------------------------------------------------
 void Theme::InitWindows()
 {
-    list<SkinWindow *>::const_iterator win;
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( list<SkinWindow *>::const_iterator win = WindowList.begin();
+         win != WindowList.end(); win++ )
     {
         (*win)->Init();
     }
@@ -219,9 +207,8 @@ void Theme::InitWindows()
 //---------------------------------------------------------------------------
 void Theme::InitControls()
 {
-    list<SkinWindow *>::const_iterator win;
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( list<SkinWindow *>::const_iterator win = WindowList.begin();
+         win != WindowList.end(); win++ )
     {
         for( unsigned int i = 0; i < (*win)->ControlList.size(); i++ )
         {
@@ -232,9 +219,8 @@ void Theme::InitControls()
 //---------------------------------------------------------------------------
 SkinWindow * Theme::GetWindow( string name )
 {
-    list<SkinWindow *>::const_iterator win;
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( list<SkinWindow *>::const_iterator win = WindowList.begin();
+         win != WindowList.end(); win++ )
     {
         if( name == OSAPI_GetWindowTitle( *win ) )
         {
@@ -307,11 +293,8 @@ bool Theme::MoveSkinMagnet( SkinWindow *wnd, int left, int top )
 
     // All windows can be moved
     list<SkinWindow *>::const_iterator win;
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
-    {
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
         (*win)->Moved = false;
-    }
 
     // Move Window
     MoveSkin( wnd, NewLeft - Wx, NewTop - Wy );
@@ -327,8 +310,7 @@ void Theme::HangToAnchors( SkinWindow *wnd, int &x, int &y, bool init )
     list<Anchor *>::const_iterator win_anchor, wnd_anchor;
 
     // Parse list of windows
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         // If window is moved window
         if( (*win) == wnd )
@@ -410,8 +392,7 @@ void Theme::CheckAnchors()
     list<SkinWindow *>::const_iterator win;
     int x, y;
 
-    for( win = SkinWindowList::Instance()->Begin(); 
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         (*win)->GetPos( x, y );
         HangToAnchors( (*win), x, y, true );
index f5ed1588c6782fc959c143a5f6a8f19cde51f335..88fb7c3e0bdad96a7d962a69a868f5bf7c21db8b 100644 (file)
@@ -2,7 +2,7 @@
  * theme.h: Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: theme.h,v 1.4 2003/06/22 00:00:28 asmax Exp $
+ * $Id: theme.h,v 1.5 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -80,6 +80,9 @@ class Theme
         FontBank   *FntBank;
         OffSetBank *OffBank;
 
+        // List of the windows of the skin
+        list<SkinWindow *> WindowList;
+
         // Magetism
         void HangToAnchors( SkinWindow *wnd, int &x, int &y, bool init = false );
         bool MoveSkinMagnet( SkinWindow *wnd, int left, int top );
index 75b677505e5cfccb1b349c31b2563de3e5204117..cb06a65ac9cf77612cc4b6974ad100e14aabd3db 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.37 2003/06/22 00:00:28 asmax Exp $
+ * $Id: vlcproc.cpp,v 1.38 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -71,8 +71,8 @@ bool VlcProc::EventProc( Event *evt )
 
         case VLC_HIDE:
             for( list<SkinWindow *>::const_iterator win =
-                    SkinWindowList::Instance()->Begin();
-                 win != SkinWindowList::Instance()->End(); win++ )
+                    p_intf->p_sys->p_theme->WindowList.begin();
+                 win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
             {
                 (*win)->OnStartThemeVisible = !(*win)->IsHidden();
             }
@@ -80,6 +80,17 @@ bool VlcProc::EventProc( Event *evt )
             OSAPI_PostMessage( NULL, WINDOW_CLOSE, 1, 0 );
             return true;
 
+        case VLC_SHOW:
+            for( list<SkinWindow *>::const_iterator win =
+                    p_intf->p_sys->p_theme->WindowList.begin();
+                 win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+            {
+                if( (*win)->OnStartThemeVisible )
+                    OSAPI_PostMessage( (*win), WINDOW_OPEN, 1, 0 );
+            }
+            p_intf->p_sys->b_all_win_closed = false;
+            return true;
+
         case VLC_OPEN:
             p_intf->p_sys->p_dialogs->ShowOpen( true );
             InterfaceRefresh();
@@ -168,8 +179,8 @@ bool VlcProc::EventProcEnd()
     list<SkinWindow *>::const_iterator win;
 
     // If a window has been closed, test if all are closed !
-    for( win = SkinWindowList::Instance()->Begin();
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = p_intf->p_sys->p_theme->WindowList.begin();
+         win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
     {
         if( !(*win)->IsHidden() )   // Not all windows closed
         {
@@ -350,7 +361,7 @@ void VlcProc::LoadSkin()
         delete Loader;
 
         // Uninitialize new theme
-        delete (char *)p_intf->p_sys->p_new_theme_file;
+        delete[] p_intf->p_sys->p_new_theme_file;
         p_intf->p_sys->p_new_theme_file = NULL;
     }
 }
index 4e38c35e8e4c637c6d0b183813861f6e93e8e306..940b38128eaf72c35458a08437b55ee3f5550e5d 100644 (file)
@@ -2,11 +2,10 @@
  * window.cpp: Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.31 2003/06/22 00:00:28 asmax Exp $
+ * $Id: window.cpp,v 1.32 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
- *          Cyril Deguet     <asmax@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -545,42 +544,5 @@ void SkinWindow::GetPos( int &x, int &y )
     x = Left;
     y = Top;
 }
-
-//---------------------------------------------------------------------------
-// List of all the Skin Windows (singleton)
-//---------------------------------------------------------------------------
-SkinWindowList *SkinWindowList::_instance = NULL;
-//---------------------------------------------------------------------------
-SkinWindowList::SkinWindowList()
-{
-}
-//---------------------------------------------------------------------------
-SkinWindowList *SkinWindowList::Instance()
-{
-    if( _instance == NULL )
-    {
-        _instance = new SkinWindowList;
-    }
-    return _instance;
-}
-//---------------------------------------------------------------------------
-void SkinWindowList::Add( SkinWindow *win )
-{
-    _list.push_back( win );
-}
-//---------------------------------------------------------------------------
-SkinWindow *SkinWindowList::Back()
-{
-    return _list.back();
-}
-//---------------------------------------------------------------------------
-list<SkinWindow*>::const_iterator SkinWindowList::Begin()
-{
-    return _list.begin();
-}
-//---------------------------------------------------------------------------
-list<SkinWindow*>::const_iterator SkinWindowList::End()
-{
-    return _list.end();
-}
 //---------------------------------------------------------------------------
+
index 6bf38611206d889efdde328ec3b77ed20de9c6f9..3fb965f467dbca025a26d06c5d8b1b0a45597a77 100644 (file)
@@ -2,7 +2,7 @@
  * window.h: Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: window.h,v 1.4 2003/06/22 00:00:28 asmax Exp $
+ * $Id: window.h,v 1.5 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -146,21 +146,5 @@ class SkinWindow
         intf_thread_t *GetIntf()    { return p_intf; }
 };
 //---------------------------------------------------------------------------
-class SkinWindowList
-{
-    private:
-        static SkinWindowList *_instance;
-        list<SkinWindow*> _list;
-        
-        SkinWindowList();
-        
-    public:
-        static SkinWindowList *Instance();
-        void Add( SkinWindow *win );
-        SkinWindow *Back();
-        list<SkinWindow*>::const_iterator Begin();
-        list<SkinWindow*>::const_iterator End();
-};
-//---------------------------------------------------------------------------
 
 #endif
index eb4855a4543e0ee0ffd32bada695180ff1fde7be..dac8181e98a4b82a2c0e6692f8436260534028bd 100644 (file)
@@ -2,7 +2,7 @@
  * win32_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_run.cpp,v 1.19 2003/06/22 00:00:28 asmax Exp $
+ * $Id: win32_run.cpp,v 1.20 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -81,8 +81,8 @@ void OSRun( intf_thread_t *p_intf )
     while( GetMessage( &msg, NULL, 0, 0 ) )
     {
 
-        for( win = SkinWindowList::Instance()->Begin();
-             win != SkinWindowList::Instance()->End(); win++ )
+        for( win = p_intf->p_sys->p_theme->WindowList.begin();
+             win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
         {
             if( msg.hwnd == NULL ||
                 msg.hwnd == ((Win32Window*)(*win))->GetHandle() )
@@ -90,7 +90,7 @@ void OSRun( intf_thread_t *p_intf )
                 break;
             }
         }
-        if( win == SkinWindowList::Instance()->End() )
+        if( win == p_intf->p_sys->p_theme->WindowList.end() )
         {
 //            DispatchMessage( &msg );
 //            DefWindowProc( msg.hwnd, msg.message, msg.wParam, msg.lParam );
@@ -163,8 +163,8 @@ void OSRun( intf_thread_t *p_intf )
         **********************/
         else if( msg.hwnd == NULL )
         {
-            for( win = SkinWindowList::Instance()->Begin();
-                 win != SkinWindowList::Instance()->End(); win++ )
+            for( win = p_intf->p_sys->p_theme->WindowList.begin();
+                 win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
             {
                 (*win)->ProcessEvent( ProcessEvent );
             }
index aa88898761913b77e0aa37b0071eec885fe60f36..34d69703a978549a6e39236d95c432c867a2ce64 100644 (file)
@@ -2,7 +2,7 @@
  * win32_theme.cpp: Win32 implementation of the Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_theme.cpp,v 1.8 2003/06/22 00:00:28 asmax Exp $
+ * $Id: win32_theme.cpp,v 1.9 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -72,8 +72,8 @@ LRESULT CALLBACK Win32Proc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 
     // Find window matching with hwnd
     list<SkinWindow *>::const_iterator win;
-    for( win = SkinWindowList::Instance()->Begin();
-         win != SkinWindowList::Instance()->End(); win++ )
+    for( win = p_intf->p_sys->p_theme->WindowList.begin();
+         win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
     {
         // If it is the correct window
         if( hwnd == ( (Win32Window *)(*win) )->GetHandle() )
@@ -301,8 +301,8 @@ void Win32Theme::AddWindow( string name, int x, int y, bool visible,
 
     SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR)p_intf );
 
-    SkinWindowList::Instance()->Add( (SkinWindow *)new OSWindow( p_intf, 
-        hwnd, x, y, visible, fadetime, alpha, movealpha, dragdrop ) ) ;
+    WindowList.push_back( (SkinWindow *)new OSWindow( p_intf, hwnd, x, y,
+        visible, fadetime, alpha, movealpha, dragdrop ) ) ;
 }
 //---------------------------------------------------------------------------
 void Win32Theme::ChangeTray()
index c833dcd996e065a2a7e3dcabb6cc7b2e7767291d..10c4ae4cd1424721f9a46856c826433aef09b9db 100644 (file)
@@ -2,7 +2,7 @@
  * x11_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: x11_run.cpp,v 1.22 2003/06/22 00:00:28 asmax Exp $
+ * $Id: x11_run.cpp,v 1.23 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -113,8 +113,8 @@ int ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event )
     else if( wnd == p_intf->p_sys->mainWin )
     {
         // Broadcast event
-        for( win = SkinWindowList::Instance()->Begin();
-             win != SkinWindowList::Instance()->End(); win++ )
+        for( win = p_intf->p_sys->p_theme->WindowList.begin();
+             win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
         {
             (*win)->ProcessEvent( evt );
         }
@@ -122,8 +122,8 @@ int ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event )
     else
     {
         // Find window matching with gwnd
-        for( win = SkinWindowList::Instance()->Begin();
-             win != SkinWindowList::Instance()->End(); win++ )
+        for( win = p_intf->p_sys->p_theme->WindowList.begin();
+             win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
         {
             // If it is the correct window
             if( wnd == ( (X11Window *)(*win) )->GetHandle() )
index d968ce7be91cb2b6d95b6e31bff89a37962a7092..5b299e0043a464bb2f313204b185a2f5b86a4c4e 100644 (file)
@@ -2,7 +2,7 @@
  * x11_theme.cpp: X11 implementation of the Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: x11_theme.cpp,v 1.14 2003/06/22 00:00:28 asmax Exp $
+ * $Id: x11_theme.cpp,v 1.15 2003/06/22 12:46:49 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -126,8 +126,8 @@ void X11Theme::AddWindow( string name, int x, int y, bool visible,
     XStoreName( display, wnd, name.c_str() );
     XUNLOCK;
 
-    SkinWindowList::Instance()->Add( (SkinWindow *)new OSWindow( p_intf, wnd,
-        x, y, visible, fadetime, alpha, movealpha, dragdrop, name ) ) ;
+    WindowList.push_back( (SkinWindow *)new OSWindow( p_intf, wnd, x, y, 
+        visible, fadetime, alpha, movealpha, dragdrop, name ) ) ;
 }
 //---------------------------------------------------------------------------
 void X11Theme::ChangeTray()