]> git.sesse.net Git - vlc/commitdiff
* Fixing a refresh bug when opening an open file dialog box
authorEmmanuel Puig <karibu@videolan.org>
Thu, 20 Mar 2003 09:29:07 +0000 (09:29 +0000)
committerEmmanuel Puig <karibu@videolan.org>
Thu, 20 Mar 2003 09:29:07 +0000 (09:29 +0000)
14 files changed:
modules/gui/skins/controls/button.cpp
modules/gui/skins/parser/flex.c
modules/gui/skins/parser/skin.c
modules/gui/skins/parser/skin.h
modules/gui/skins/src/dialog.cpp
modules/gui/skins/src/dialog.h
modules/gui/skins/src/event.h
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/src/window.cpp
modules/gui/skins/win32/win32_dialog.cpp
modules/gui/skins/win32/win32_dialog.h
modules/gui/skins/win32/win32_run.cpp
modules/gui/skins/win32/win32_window.cpp

index b8d0beb82f689470bdd607db7fdb1533367d9162..c5ac563355daed64c2e6d2c935320b1f67cff359 100644 (file)
@@ -2,7 +2,7 @@
  * button.cpp: Button control
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: button.cpp,v 1.3 2003/03/19 17:14:50 karibu Exp $
+ * $Id: button.cpp,v 1.4 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -37,8 +37,6 @@
 #include "window.h"
 #include "skin_common.h"
 
-
-
 //---------------------------------------------------------------------------
 // Control Button
 //---------------------------------------------------------------------------
@@ -184,7 +182,9 @@ bool ControlButton::MouseMove( int x, int y, int button )
         }
 
         if( MouseOverActionName != "none" )
+        {
             MouseOverAction->SendEvent();
+        }
 
         CursorIn = true;
         return true;
@@ -199,7 +199,9 @@ bool ControlButton::MouseMove( int x, int y, int button )
         }
 
         if( MouseOutActionName != "none" )
+        {
             MouseOutAction->SendEvent();
+        }
 
         CursorIn = false;
         return true;
index 9641439921f8b2ade5cf6801ba0c02804dc26788..ba0ab4d180439594706d119d3e8ce19b2ac31cd8 100644 (file)
@@ -1,7 +1,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /root/vlc-cvs/modules/gui/skins/parser/flex.c,v 1.3 2003/03/19 17:14:50 karibu Exp $
+ * $Header: /root/vlc-cvs/modules/gui/skins/parser/flex.c,v 1.4 2003/03/20 09:29:07 karibu Exp $
  */
 
 #define FLEX_SCANNER
@@ -3041,8 +3041,8 @@ static char *yy_last_accepting_cpos;
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
 #define INITIAL 0
-/* Validating XML processor for skin.dtd (Id: skin.dtd,v 1.2 2003/03/19 02:09:56 videolan Exp).
- * Generated 2003/03/19 18:16:00.
+/* Validating XML processor for skin.dtd (Id: skin.dtd,v 1.3 2003/03/19 17:14:50 karibu Exp).
+ * Generated 2003/03/20 10:30:38.
  *
  * This program was generated with the FleXML XML processor generator,
  * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
@@ -3070,7 +3070,7 @@ const char rcs_flexml_skeleton[] =
 const char rcs_flexml[] =
  "$" "Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp $";
 const char rcs_skin_dtd[] =
- "$" "Id: skin.dtd,v 1.2 2003/03/19 02:09:56 videolan Exp $";
+ "$" "Id: skin.dtd,v 1.3 2003/03/19 17:14:50 karibu Exp $";
 
 /* ANSI headers. */
 #include <unistd.h>
@@ -3830,7 +3830,7 @@ FAIL("EOF in prolog.");
   *  * skin.dtd: DTD for the VLC skins
   *  *****************************************************************************
   *  * Copyright (C) 2003 VideoLAN
-  *  * $Id: flex.c,v 1.3 2003/03/19 17:14:50 karibu Exp $
+  *  * $Id: flex.c,v 1.4 2003/03/20 09:29:07 karibu Exp $
   *  *
   *  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
   *  *          Emmanuel Puig    <karibu@via.ecp.fr>
index a6d424b1f07ba2ae4cc604e44acd6e4eea0b43b8..a5f466001e2759abc97296066570e21fb4f8aff0 100644 (file)
@@ -1,6 +1,6 @@
-/* XML application for skin.dtd (Id: skin.dtd,v 1.2 2003/03/19 02:09:56 videolan Exp).
+/* XML application for skin.dtd (Id: skin.dtd,v 1.3 2003/03/19 17:14:50 karibu Exp).
  * Includes actions from skin.act.
- * Generated 2003/03/19 18:16:00.
+ * Generated 2003/03/20 10:30:38.
  *
  * This program was generated with the FleXML XML processor generator,
  * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
index 17930264cea3ef441db206abd2ab235218fbe3e1..f957bf3cd20c2e1fc01ffec05ea300b8b8181152 100644 (file)
@@ -1,5 +1,5 @@
-/* XML processor/application API for skin.dtd (Id: skin.dtd,v 1.2 2003/03/19 02:09:56 videolan Exp).
- * Generated 2003/03/19 18:16:00.
+/* XML processor/application API for skin.dtd (Id: skin.dtd,v 1.3 2003/03/19 17:14:50 karibu Exp).
+ * Generated 2003/03/20 10:30:38.
  *
  * This program was generated with the FleXML XML processor generator,
  * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
index e0773b77f4f570622a7d43ee82c8473bf4cddf8e..456f646aa367ca8f89949ca31b3b5a42a0442173 100644 (file)
@@ -2,7 +2,7 @@
  * dialog.cpp: Classes for some dialog boxes
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: dialog.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: dialog.cpp,v 1.2 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
 //---------------------------------------------------------------------------
 // Open file dialog box
 //---------------------------------------------------------------------------
-OpenFileDialog::OpenFileDialog( string title, bool multiselect )
+OpenFileDialog::OpenFileDialog( intf_thread_t *_p_intf, string title,
+    bool multiselect )
 {
+    p_intf       = _p_intf;
     MultiSelect  = multiselect;
     Title        = title;
     Filter       = new char[200];
index 5da5a8f6a4a8ff0126d31f34732d8e18f55eacb4..d18dc28cfbd49390e2c8a03be328cec67f7fe152 100644 (file)
@@ -2,7 +2,7 @@
  * dialog.h: Classes for some dialog boxes
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: dialog.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: dialog.h,v 1.2 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -47,9 +47,12 @@ class OpenFileDialog
         string Title;
         bool   MultiSelect;
 
+        intf_thread_t *p_intf;
+
     public:
         // Constructors
-        OpenFileDialog( string title, bool multiselect );
+        OpenFileDialog( intf_thread_t *_p_intf, string title,
+                        bool multiselect );
 
         // Destructors
         virtual ~OpenFileDialog();
index 3c3146a8b6c35191d3d536ab0f6a875f03c52938..dcb736937f2cfef0f377e5f4e30514c25c19d8dc 100644 (file)
@@ -2,7 +2,7 @@
  * event.h: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: event.h,v 1.2 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -94,6 +94,8 @@ using namespace std;
 #define WINDOW_SHOW         (VLC_WINDOW + 4)
 #define WINDOW_HIDE         (VLC_WINDOW + 5)
 #define WINDOW_FADE         (VLC_WINDOW + 6)
+#define WINDOW_LEAVE        (VLC_WINDOW + 7)
+#define WINDOW_REFRESH      (VLC_WINDOW + 8)
 
 // Control event
 #define CTRL_ENABLED        (VLC_CONTROL + 1)
index 2fe3d96376315697097378056cb774d0da03202d..9cb69e812c21d1ae486858a818671578c965c8f5 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.2 2003/03/19 03:11:14 karibu Exp $
+ * $Id: skin_main.cpp,v 1.3 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -158,8 +158,8 @@ static void Run( intf_thread_t *p_intf )
 
             // Initialize file structure
             OpenFileDialog *OpenFile;
-            OpenFile = (OpenFileDialog *)new OSOpenFileDialog( _("Open skin"),
-                false );
+            OpenFile = (OpenFileDialog *)new OSOpenFileDialog( NULL,
+                _("Open skin"), false );
             OpenFile->AddFilter( _("Skin files"), "*.vlt" );
             OpenFile->AddFilter( _("Skin files"), "*.xml" );
             OpenFile->AddFilter( _("All files"), "*.*" );
index 3a1e0329dbe0431247dbc7120dac4fae4890703b..970ca3c88808cc04cfecc7e40394d8650960213c 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.2 2003/03/19 18:14:48 karibu Exp $
+ * $Id: vlcproc.cpp,v 1.3 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -313,7 +313,7 @@ void VlcProc::LoadSkin()
     {
         // Initialize file structure
         OpenFileDialog *OpenFile;
-        OpenFile = (OpenFileDialog *)new OSOpenFileDialog(
+        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( p_intf,
             _("Change skin - Open new file"), false );
         OpenFile->AddFilter( _("Skin files"), "*.vlt" );
         OpenFile->AddFilter( _("Skin files"), "*.xml" );
@@ -379,13 +379,13 @@ void VlcProc::OpenFile( bool play )
     OpenFileDialog *OpenFile;
     if( play )
     {
-        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( _("Open file"),
-                                                           false );
+        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( p_intf,
+            _("Open file"), false );
     }
     else
     {
-        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( _("Add file"),
-                                                           true );
+        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( p_intf,
+            _("Add file"), true );
     }
     OpenFile->AddFilter( _("All files"), "*.*" );
 
index 402058923508bfa6342c24cb9eb3476cc28846bd..11b03a93a6b5211993d02a6c6cdf1e4f6f7a9f1f 100644 (file)
@@ -2,7 +2,7 @@
  * window.cpp: Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.3 2003/03/19 18:14:48 karibu Exp $
+ * $Id: window.cpp,v 1.4 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -228,6 +228,14 @@ bool Window::ProcessEvent( Event *evt )
             Hide();
             return true;
 
+        case WINDOW_LEAVE:
+            MouseMove( -1, -1, 0 );
+            return true;
+
+        case WINDOW_REFRESH:
+            RefreshAll();
+            return true;
+
         default:
             // OS specific messages processing
             return ProcessOSEvent( evt );
index ffeecf2b99a9de4b12be315ff41c369b87d5df2b..41995cafa54bc2d1f85a113fbb7aead66b461179 100644 (file)
@@ -2,7 +2,7 @@
  * win32_dialog.cpp: Win32 implementation of some dialog boxes
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_dialog.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: win32_dialog.cpp,v 1.2 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -26,6 +26,7 @@
 
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
+extern intf_thread_t *g_pIntf;
 
 //--- WIN32 -----------------------------------------------------------------
 #define _WIN32_IE 0x0400    // Yes, i think it's a fucking kludge !
@@ -39,6 +40,8 @@
 #include "dialog.h"
 #include "os_dialog.h"
 #include "skin_common.h"
+#include "window.h"
+#include "os_window.h"
 #include "theme.h"
 #include "os_theme.h"
 #include "event.h"
@@ -48,8 +51,8 @@
 //---------------------------------------------------------------------------
 // Open file dialog box
 //---------------------------------------------------------------------------
-Win32OpenFileDialog::Win32OpenFileDialog( string title, bool multiselect ) :
-    OpenFileDialog( title, multiselect )
+Win32OpenFileDialog::Win32OpenFileDialog( intf_thread_t *_p_intf, string title,
+    bool multiselect ) : OpenFileDialog( _p_intf, title, multiselect )
 {
 }
 //---------------------------------------------------------------------------
@@ -103,9 +106,33 @@ bool Win32OpenFileDialog::Open()
     OpenFile.lpstrTitle  = Title.c_str();
     OpenFile.lpstrFilter = Filter;
 
+    // Remove mouse tracking event to avoid non process due to modal open box
+    if( p_intf != NULL && p_intf->p_sys->p_theme != NULL )
+    {
+        TRACKMOUSEEVENT TrackEvent;
+        TrackEvent.cbSize      = sizeof( TRACKMOUSEEVENT );\r
+        TrackEvent.dwFlags     = TME_LEAVE|TME_CANCEL;\r
+        TrackEvent.dwHoverTime = 1;
+
+        list<Window *>::const_iterator win;
+        for( win = g_pIntf->p_sys->p_theme->WindowList.begin();
+            win != g_pIntf->p_sys->p_theme->WindowList.end(); win++ )
+        {
+            TrackEvent.hwndTrack   = ( (Win32Window *)(*win) )->GetHandle();
+            TrackMouseEvent( &TrackEvent );
+        }
+    }
+
     // Show dialog box
     if( !GetOpenFileName( &OpenFile ) )
+    {
+        OSAPI_PostMessage( NULL, WINDOW_LEAVE, 0, 0 );
         return false;
+    }
+
+    // Tell windows that mouse cursor has left window because it has been
+    // unactivated
+    OSAPI_PostMessage( NULL, WINDOW_LEAVE, 0, 0 );
 
     // Find files in string result
     char * File = OpenFile.lpstrFile;
index 355bc9fc24585f1fcf4d1e138cbbed4c51c84208..0e4b7809f5d4f2af0d85d3f4be0575edacb10162 100644 (file)
@@ -2,7 +2,7 @@
  * win32_dialog.h: Win32 implementation of some dialog boxes
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_dialog.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: win32_dialog.h,v 1.2 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -42,7 +42,8 @@ class Win32OpenFileDialog : OpenFileDialog
 
     public:
         // Constructors
-        Win32OpenFileDialog( string title, bool multiselect );
+        Win32OpenFileDialog( intf_thread_t *_p_intf, string title,
+                             bool multiselect );
 
         // Destructors
         virtual ~Win32OpenFileDialog();
index 9377153d6256cd067a409ae843609f8ae3483b0a..dbd74dfc14a3efffea29ef0a3c2d1ed6fdb8ed00 100644 (file)
@@ -2,7 +2,7 @@
  * win32_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_run.cpp,v 1.2 2003/03/19 17:14:50 karibu Exp $
+ * $Id: win32_run.cpp,v 1.3 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -83,6 +83,7 @@ void OSRun( intf_thread_t *p_intf )
     // Compute windows message list
     while( GetMessage( &msg, NULL, 0, 0 ) )
     {
+
         // Translate keys
         TranslateMessage( &msg );
 
index a4e7b3b9ec51c53f767e1e9f8f6a6741cd35a564..dfdfaeeef4ed08ea0986de1b7804d783bf648784 100644 (file)
@@ -2,7 +2,7 @@
  * win32_window.cpp: Win32 implementation of the Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: win32_window.cpp,v 1.2 2003/03/19 02:09:56 videolan Exp $
+ * $Id: win32_window.cpp,v 1.3 2003/03/20 09:29:07 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -197,7 +197,7 @@ bool Win32Window::ProcessOSEvent( Event *evt )
             return true;
 
         case WM_MOUSELEAVE:
-            MouseMove( -1, -1, 0 );
+            OSAPI_PostMessage( this, WINDOW_LEAVE, 0, 0 );
             return true;
 
         default: