]> git.sesse.net Git - vlc/commitdiff
* Fixed mouse events
authorEmmanuel Puig <karibu@videolan.org>
Tue, 15 Apr 2003 16:42:02 +0000 (16:42 +0000)
committerEmmanuel Puig <karibu@videolan.org>
Tue, 15 Apr 2003 16:42:02 +0000 (16:42 +0000)
modules/gui/skins/gtk2/gtk2_theme.cpp
modules/gui/skins/gtk2/gtk2_window.cpp
modules/gui/skins/src/window.cpp

index 20d52cbabedb174b6253fac88faac57225ac162d..517eeffb8ff0554a598a3c62cd0c93d97ec558f9 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_theme.cpp: GTK2 implementation of the Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_theme.cpp,v 1.10 2003/04/15 01:19:11 ipkiss Exp $
+ * $Id: gtk2_theme.cpp,v 1.11 2003/04/15 16:42:02 karibu Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -240,7 +240,7 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible,
 
     WindowList.push_back( (Window *)new OSWindow( p_intf, hwnd, x, y, visible,
         fadetime, alpha, movealpha, dragdrop ) ) ;*/
-        
+
     GdkWindowAttr attr;
     attr.event_mask = GDK_ALL_EVENTS_MASK;
     attr.width = 0;
index 49c36f1043f20226ee30488ad9150ba3fbb6b002..8c565830688e13a701f99ca4811dfe6f6ac2df78 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_window.cpp: GTK2 implementation of the Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_window.cpp,v 1.10 2003/04/15 11:46:19 ipkiss Exp $
+ * $Id: gtk2_window.cpp,v 1.11 2003/04/15 16:42:02 karibu Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -162,8 +162,6 @@ bool GTK2Window::ProcessOSEvent( Event *evt )
     unsigned int p1  = evt->GetParam1();
     int          p2  = evt->GetParam2();
 
-    fprintf( stderr, "salut %li\n", evt->GetMessage() );
-
     switch( msg )
     {
         case GDK_EXPOSE:
@@ -179,53 +177,57 @@ bool GTK2Window::ProcessOSEvent( Event *evt )
 //            TrackEvent.dwHoverTime = 1;
 //            TrackMouseEvent( &TrackEvent );
             if( LButtonDown )
-                MouseMove( ((GdkEventButton *)p2)->x_root, ((GdkEventButton *)p2)->y_root,
-                           1 );
+                MouseMove( (int)( (GdkEventButton *)p2 )->x,
+                           (int)( (GdkEventButton *)p2 )->y, 1 );
             else if( RButtonDown )
-                MouseMove( ((GdkEventButton *)p2)->x_root, ((GdkEventButton *)p2)->y_root,
-                           2 );
+                MouseMove( (int)( (GdkEventButton *)p2 )->x,
+                           (int)( (GdkEventButton *)p2 )->y, 2 );
             else
-                MouseMove( ((GdkEventButton *)p2)->x_root, ((GdkEventButton *)p2)->y_root,
-                           0 );
-
+                MouseMove( (int)( (GdkEventButton *)p2 )->x,
+                           (int)( (GdkEventButton *)p2 )->y, 0 );
+            gdk_window_get_pointer( gWnd, 0, 0, 0 );
             return true;
 
 
         case GDK_BUTTON_PRESS:
-            switch( ((GdkEventButton *)p2)->button )
+            switch( ( (GdkEventButton *)p2 )->button )
             {
                 case 1:
                     // Left button
                     LButtonDown = true;
-                    MouseDown( ((GdkEventButton *)p2)->x_root,
-                               ((GdkEventButton *)p2)->y_root, 1 );
+                    MouseDown( (int)( (GdkEventButton *)p2 )->x,
+                               (int)( (GdkEventButton *)p2 )->y, 1 );
                     break;
+
                 case 3:
                     // Right button
                     RButtonDown = true;
-                    MouseDown( ((GdkEventButton *)p2)->x_root,
-                               ((GdkEventButton *)p2)->y_root, 2 );
+                    MouseDown( (int)( (GdkEventButton *)p2 )->x,
+                               (int)( (GdkEventButton *)p2 )->y, 2 );
                     break;
+
                 default:
                     break;
             }
             return true;
 
         case GDK_BUTTON_RELEASE:
-            switch( ((GdkEventButton *)p2)->button )
+            switch( ( (GdkEventButton *)p2 )->button )
             {
                 case 1:
                     // Left button
                     LButtonDown = false;
-                    MouseUp( ((GdkEventButton *)p2)->x_root,
-                             ((GdkEventButton *)p2)->y_root, 1 );
+                    MouseUp( (int)( (GdkEventButton *)p2 )->x,
+                             (int)( (GdkEventButton *)p2 )->y, 1 );
                     break;
+
                 case 3:
                     // Right button
                     RButtonDown = false;
-                    MouseUp( ((GdkEventButton *)p2)->x_root,
-                             ((GdkEventButton *)p2)->y_root, 2 );
+                    MouseUp( (int)( (GdkEventButton *)p2 )->x,
+                             (int)( (GdkEventButton *)p2 )->y, 2 );
                     break;
+
                 default:
                     break;
             }
@@ -275,7 +277,6 @@ void GTK2Window::RefreshFromImage( int x, int y, int w, int h )
 
 */
 
- fprintf(stderr, "window %d %d %d %d\n", x, y, w, h);
     gdk_draw_drawable( gWnd, gc, (( GTK2Graphics* )Image )->GetImage(),
             x, y, x, y, w, h );
 }
index f14954aed0401da62607c2202dca8f7e7d0d86ac..3303aa634f2dd8b4b69aa4c8462570ac40a71f94 100644 (file)
@@ -2,7 +2,7 @@
  * window.cpp: Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.9 2003/04/15 01:19:11 ipkiss Exp $
+ * $Id: window.cpp,v 1.10 2003/04/15 16:42:02 karibu Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -39,6 +39,7 @@
 #include "theme.h"
 #include "skin_common.h"
 
+#include <stdio.h>
 
 
 //---------------------------------------------------------------------------
@@ -309,6 +310,8 @@ void Window::MouseDown( int x, int y, int button )
 {
     // Checking event in controls
 
+    fprintf( stderr, "  -> mousedown\n" );
+
     for( int i = ControlList.size() - 1; i >= 0 ; i-- )
     {
         if( ControlList[i]->MouseDown( x, y, button ) )
@@ -322,8 +325,6 @@ void Window::MouseMove( int x, int y, int button  )
 {
     int i;
 
-    fprintf( stderr, "pouet %i\n", button );
-
     // Move window if selected !
     if( WindowMoving )
     {
@@ -383,6 +384,8 @@ void Window::MouseUp( int x, int y, int button )
         WindowMoving = false;
     }
 
+    fprintf( stderr, "  -> mouseup\n" );
+
     // Checking event in controls
     for( i = ControlList.size() - 1; i >= 0 ; i-- )
     {