]> git.sesse.net Git - vlc/commitdiff
* Fiwing WINDOW_CLOSE and WINDOW_OPEN synchronization
authorEmmanuel Puig <karibu@videolan.org>
Wed, 19 Mar 2003 18:14:48 +0000 (18:14 +0000)
committerEmmanuel Puig <karibu@videolan.org>
Wed, 19 Mar 2003 18:14:48 +0000 (18:14 +0000)
modules/gui/skins/src/event.cpp
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/src/window.cpp

index 169882bb96050406edc485a82412be22ddc5fcc0..6ea7dd4186acfc5e1aa235358254af52c5c87a24 100644 (file)
@@ -2,7 +2,7 @@
  * event.cpp: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: event.cpp,v 1.2 2003/03/19 18:14:48 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -296,11 +296,11 @@ void Event::CreateEvent()
             break;
 
         case WINDOW_OPEN:
-            Param2 = GetBool( para2 );
+            Param1 = GetBool( para2 );
             break;
 
         case WINDOW_CLOSE:
-            Param2 = GetBool( para2 );
+            Param1 = GetBool( para2 );
             break;
 
         case PLAYLIST_ID_DEL:
@@ -357,7 +357,7 @@ int Event::GetBool( string expr )
     {
         return 2;
     }
-    return 2;
+    return 1;
 }
 //---------------------------------------------------------------------------
 void Event::CreateShortcut()
index bc62fa87721e094372bb2396dfe7e82b3d22c8cf..490fbb2934218fd8a8e21cf3feae33fd34573a12 100644 (file)
@@ -2,7 +2,7 @@
  * theme.cpp: Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: theme.cpp,v 1.2 2003/03/19 03:11:14 karibu Exp $
+ * $Id: theme.cpp,v 1.3 2003/03/19 18:14:48 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -87,18 +87,25 @@ void Theme::ShowTheme()
         ChangeTaskbar();
 
     list<Window *>::const_iterator win;
-    Event *evt;
+    Event *evt1;
+    Event *evt2;
 
     // Synchronize control to visible aspect
     for( win = WindowList.begin(); win != WindowList.end(); win++ )
     {
         // Synchronize windows visibility
         if( (*win)->OnStartThemeVisible )
-            evt = (Event *)new OSEvent( p_intf, (*win), WINDOW_OPEN, 0, 1 );
+        {
+            evt1 = (Event *)new OSEvent( p_intf, (*win), WINDOW_OPEN,  1, 0 );
+            evt2 = (Event *)new OSEvent( p_intf, (*win), WINDOW_CLOSE, 0, 0 );
+        }
         else
-            evt = (Event *)new OSEvent( p_intf, (*win), WINDOW_CLOSE, 0, 1 );
-
-        evt->PostSynchroMessage( true );
+        {
+            evt1 = (Event *)new OSEvent( p_intf, (*win), WINDOW_OPEN,  0, 0 );
+            evt2 = (Event *)new OSEvent( p_intf, (*win), WINDOW_CLOSE, 1, 0 );
+        }
+        evt1->PostSynchroMessage( true );
+        evt2->PostSynchroMessage( true );
     }
 
     // Initialize magnetism
index cf13cafa959535d1d6b89fb1cdeb8ea7ef93979b..3a1e0329dbe0431247dbc7120dac4fae4890703b 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: vlcproc.cpp,v 1.2 2003/03/19 18:14:48 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -78,7 +78,7 @@ bool VlcProc::EventProc( Event *evt )
                 (*win)->OnStartThemeVisible = !(*win)->IsHidden();
             }
             p_intf->p_sys->i_close_status = (int)evt->GetParam1();
-            OSAPI_PostMessage( NULL, WINDOW_CLOSE, 0, 0 );
+            OSAPI_PostMessage( NULL, WINDOW_CLOSE, 1, 0 );
             return true;
 
         case VLC_SHOW:
@@ -87,7 +87,7 @@ bool VlcProc::EventProc( Event *evt )
                  win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
             {
                 if( (*win)->OnStartThemeVisible )
-                    OSAPI_PostMessage( (*win), WINDOW_OPEN, 0, 0 );
+                    OSAPI_PostMessage( (*win), WINDOW_OPEN, 1, 0 );
             }
             p_intf->p_sys->b_all_win_closed = false;
             return true;
index 3d37cea1293172822376cd0e365698a96231a717..402058923508bfa6342c24cb9eb3476cc28846bd 100644 (file)
@@ -2,7 +2,7 @@
  * window.cpp: Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.2 2003/03/19 02:09:56 videolan Exp $
+ * $Id: window.cpp,v 1.3 2003/03/19 18:14:48 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -185,11 +185,39 @@ bool Window::ProcessEvent( Event *evt )
             return true;
 
         case WINDOW_OPEN:
-            Open();
+            switch( p1 )
+            {
+                case 0:
+                    Close();
+                    break;
+                case 1:
+                    Open();
+                    break;
+                case 2:
+                    if( Hidden )
+                        Open();
+                    else
+                        Close();
+                    break;
+            }
             return true;
 
         case WINDOW_CLOSE:
-            Close();
+            switch( p1 )
+            {
+                case 0:
+                    Open();
+                    break;
+                case 1:
+                    Close();
+                    break;
+                case 2:
+                    if( Hidden )
+                        Open();
+                    else
+                        Close();
+                    break;
+            }
             return true;
 
         case WINDOW_SHOW: