1 /*****************************************************************************
2 * gtk2_event.cpp: GTK2 implementation of the Event class
3 *****************************************************************************
4 * Copyright (C) 2003 VideoLAN
5 * $Id: gtk2_event.cpp,v 1.4 2003/04/13 19:09:59 asmax Exp $
7 * Authors: Cyril Deguet <asmax@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
23 *****************************************************************************/
27 //--- GTK2 -----------------------------------------------------------------
30 //--- VLC -------------------------------------------------------------------
33 //--- SKIN ------------------------------------------------------------------
37 #include "os_window.h"
40 #include "skin_common.h"
43 //---------------------------------------------------------------------------
45 //---------------------------------------------------------------------------
46 GTK2Event::GTK2Event( intf_thread_t *p_intf, string Desc, string shortcut )
47 : Event( p_intf, Desc, shortcut )
51 //---------------------------------------------------------------------------
52 GTK2Event::GTK2Event( intf_thread_t *p_intf, GdkWindow *gwnd, unsigned int msg,
53 unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
57 //---------------------------------------------------------------------------
58 GTK2Event::GTK2Event( intf_thread_t *p_intf, Window *win, unsigned int msg,
59 unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
61 gWnd = ( (GTK2Window *)win )->GetHandle();
63 //---------------------------------------------------------------------------
64 GTK2Event::~GTK2Event()
67 //---------------------------------------------------------------------------
68 bool GTK2Event::SendEvent()
70 /* if( Message != VLC_NOTHING )
72 PostMessage( hWnd, Message, Param1, Param2 );
80 //---------------------------------------------------------------------------
81 bool GTK2Event::IsEqual( Event *evt )
83 /* GTK2Event *WinEvt = (GTK2Event *)evt;
84 return( WinEvt->GetWindow() == hWnd && WinEvt->GetMessage() == Message &&
85 WinEvt->GetParam1() == Param1 && WinEvt->GetParam2() == Param2 );*/
87 //---------------------------------------------------------------------------
88 void GTK2Event::CreateOSEvent( string para1, string para2, string para3 )
94 gWnd = GetWindowFromName( para1 );
98 gWnd = GetWindowFromName( para1 );
102 gWnd = GetWindowFromName( para1 );
107 //---------------------------------------------------------------------------
108 GdkWindow *GTK2Event::GetWindowFromName( string name )
110 GTK2Window *win = (GTK2Window *)
111 p_intf->p_sys->p_theme->GetWindow( name );
117 return win->GetHandle();
120 //---------------------------------------------------------------------------