* 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.15 2003/04/15 20:33:58 karibu Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
//---------------------------------------------------------------------------
GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
bool visible, int transition, int normalalpha, int movealpha,
- bool dragdrop )
+ bool dragdrop, string name )
: Window( p_intf, x, y, visible, transition, normalalpha, movealpha,
dragdrop )
{
gWnd = gwnd;
gc = gdk_gc_new( gwnd );
+ Name = name;
+
LButtonDown = false;
RButtonDown = false;
/*
unsigned int p1 = evt->GetParam1();
int p2 = evt->GetParam2();
- fprintf( stderr, "salut %li\n", evt->GetMessage() );
-
switch( msg )
{
case GDK_EXPOSE:
RefreshFromImage( 0, 0, Width, Height );
return true;
-
case GDK_MOTION_NOTIFY:
-// TRACKMOUSEEVENT TrackEvent;
-// TrackEvent.cbSize = sizeof( TRACKMOUSEEVENT );
-// TrackEvent.dwFlags = TME_LEAVE;
-// TrackEvent.hwndTrack = hWnd;
-// 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;
}
return true;
-/*
- case WM_RBUTTONDOWN:
- MouseDown( LOWORD( p2 ), HIWORD( p2 ), 2 );
- return true;
-
- case WM_RBUTTONUP:
- MouseUp( LOWORD( p2 ), HIWORD( p2 ), 2 );
+ case GDK_LEAVE_NOTIFY:
+ OSAPI_PostMessage( this, WINDOW_LEAVE, 0, 0 );
return true;
-
+/*
case WM_LBUTTONDBLCLK:
MouseDblClick( LOWORD( p2 ), HIWORD( p2 ), 1 );
return true;
- case WM_MOUSELEAVE:
- OSAPI_PostMessage( this, WINDOW_LEAVE, 0, 0 );
- return true;
*/
default:
return false;
*/
- 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 );
}
p_intf->p_sys->p_theme->MoveSkinMagnet( this,
WindowX + x - CursorX, WindowY + y - CursorY );
- fprintf( stderr, "---------\n" );
}
//---------------------------------------------------------------------------
void GTK2Window::WindowManualMoveInit()