From: Cyril Deguet Date: Mon, 9 Jun 2003 12:33:17 +0000 (+0000) Subject: * repaired basic_skins X-Git-Tag: 0.6.0~107 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=66181839d418b6c8a220024e599f9b6172c50729;p=vlc * repaired basic_skins * removed all the compilation warnings * fixed LOTS of memory leaks in skins (gibalou, you should try valgrind on wxwindows plugin ;) --- diff --git a/modules/gui/skins/controls/button.cpp b/modules/gui/skins/controls/button.cpp index 6d75b6306e..6aced6a198 100644 --- a/modules/gui/skins/controls/button.cpp +++ b/modules/gui/skins/controls/button.cpp @@ -2,7 +2,7 @@ * button.cpp: Button control ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: button.cpp,v 1.14 2003/05/31 23:23:59 ipkiss Exp $ + * $Id: button.cpp,v 1.15 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -71,6 +71,18 @@ ControlButton::ControlButton( //--------------------------------------------------------------------------- ControlButton::~ControlButton() { + if( ClickAction ) + { + delete ClickAction; + } + if( MouseOverAction ) + { + delete MouseOverAction; + } + if( MouseOutAction ) + { + delete MouseOutAction; + } } //--------------------------------------------------------------------------- void ControlButton::Init() diff --git a/modules/gui/skins/controls/checkbox.cpp b/modules/gui/skins/controls/checkbox.cpp index 434257c148..2c685698cd 100644 --- a/modules/gui/skins/controls/checkbox.cpp +++ b/modules/gui/skins/controls/checkbox.cpp @@ -2,7 +2,7 @@ * checkbox.cpp: Checkbox control ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: checkbox.cpp,v 1.6 2003/05/02 15:53:32 gbazin Exp $ + * $Id: checkbox.cpp,v 1.7 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -95,6 +95,30 @@ ControlCheckBox::ControlCheckBox( //--------------------------------------------------------------------------- ControlCheckBox::~ControlCheckBox() { + if( ClickAction1 ) + { + delete ClickAction1; + } + if( ClickAction2 ) + { + delete ClickAction2; + } + if( MouseOverAction1 ) + { + delete MouseOverAction1; + } + if( MouseOverAction2 ) + { + delete MouseOverAction2; + } + if( MouseOutAction1 ) + { + delete MouseOutAction1; + } + if( MouseOutAction2 ) + { + delete MouseOutAction2; + } } //--------------------------------------------------------------------------- void ControlCheckBox::Init() diff --git a/modules/gui/skins/controls/image.cpp b/modules/gui/skins/controls/image.cpp index 8a53f4af4a..78d29498e1 100644 --- a/modules/gui/skins/controls/image.cpp +++ b/modules/gui/skins/controls/image.cpp @@ -2,7 +2,7 @@ * image.cpp: Image control ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: image.cpp,v 1.7 2003/05/02 15:53:32 gbazin Exp $ + * $Id: image.cpp,v 1.8 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -56,6 +56,10 @@ ControlImage::ControlImage( string id, bool visible, int x, int y, string img, //--------------------------------------------------------------------------- ControlImage::~ControlImage() { + if( MouseDownAction ) + { + delete MouseDownAction; + } } //--------------------------------------------------------------------------- void ControlImage::Init() diff --git a/modules/gui/skins/controls/playlist.cpp b/modules/gui/skins/controls/playlist.cpp index bf8b5bf99c..8324e5c227 100644 --- a/modules/gui/skins/controls/playlist.cpp +++ b/modules/gui/skins/controls/playlist.cpp @@ -2,7 +2,7 @@ * playlist.cpp: Playlist control ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: playlist.cpp,v 1.12 2003/06/08 15:22:03 asmax Exp $ + * $Id: playlist.cpp,v 1.13 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -83,6 +83,26 @@ ControlPlayList::ControlPlayList( string id, bool visible, int width, //--------------------------------------------------------------------------- ControlPlayList::~ControlPlayList() { + if( CaseLeft ) + { + delete[] CaseLeft; + } + if( CaseRight ) + { + delete[] CaseRight; + } + if( CaseTextLeft ) + { + delete[] CaseTextLeft; + } + if( Slider ) + { + delete Slider; + } + if( TextClipRgn ) + { + delete TextClipRgn; + } if( PlayList != NULL ) { vlc_object_release( PlayList ); diff --git a/modules/gui/skins/src/dialogs.cpp b/modules/gui/skins/src/dialogs.cpp index ccde7041da..6fc6e2fcd3 100644 --- a/modules/gui/skins/src/dialogs.cpp +++ b/modules/gui/skins/src/dialogs.cpp @@ -2,7 +2,7 @@ * dialogs.cpp: Handles all the different dialog boxes we provide. ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: dialogs.cpp,v 1.4 2003/06/08 16:56:48 gbazin Exp $ + * $Id: dialogs.cpp,v 1.5 2003/06/09 12:33:16 asmax Exp $ * * Authors: Gildas Bazin * @@ -422,9 +422,9 @@ void Dialogs::OnExitThread( wxCommandEvent& event ) int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val, void *param ) { +#ifndef BASIC_SKINS Dialogs *p_dialogs = (Dialogs *)param; -#ifndef BASIC_SKINS p_dialogs->ShowPopup(); #endif // BASIC_SKINS diff --git a/modules/gui/skins/src/skin_common.h b/modules/gui/skins/src/skin_common.h index 9f84548556..a33b39df5b 100644 --- a/modules/gui/skins/src/skin_common.h +++ b/modules/gui/skins/src/skin_common.h @@ -2,7 +2,7 @@ * skin_common.h: Private Skin interface description ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: skin_common.h,v 1.15 2003/06/05 21:22:27 gbazin Exp $ + * $Id: skin_common.h,v 1.16 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -65,12 +65,12 @@ struct intf_sys_t int i_index; // Set which file is being played int i_size; // Size of playlist; +#ifndef BASIC_SKINS // Interface dialogs Dialogs *p_dialogs; // Popup menu vlc_bool_t b_popup_change; -#ifndef BASIC_SKINS wxMenu *p_popup_menu; #endif diff --git a/modules/gui/skins/src/skin_main.cpp b/modules/gui/skins/src/skin_main.cpp index 8c8a636b5a..1a959c9529 100644 --- a/modules/gui/skins/src/skin_main.cpp +++ b/modules/gui/skins/src/skin_main.cpp @@ -2,7 +2,7 @@ * skin-main.cpp: skins plugin for VLC ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: skin_main.cpp,v 1.34 2003/06/08 16:56:48 gbazin Exp $ + * $Id: skin_main.cpp,v 1.35 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -188,6 +188,10 @@ static void Close ( vlc_object_t *p_this ) // Delete theme, it's important to do it correctly delete (OSTheme *)p_intf->p_sys->p_theme; +#if defined X11_SKINS + XCloseDisplay( p_intf->p_sys->display ); +#endif + // Unsuscribe to messages bank msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub ); diff --git a/modules/gui/skins/src/theme.cpp b/modules/gui/skins/src/theme.cpp index 0f84147677..be5618068a 100644 --- a/modules/gui/skins/src/theme.cpp +++ b/modules/gui/skins/src/theme.cpp @@ -2,7 +2,7 @@ * theme.cpp: Theme class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: theme.cpp,v 1.13 2003/04/29 20:36:56 ipkiss Exp $ + * $Id: theme.cpp,v 1.14 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -232,7 +232,7 @@ SkinWindow * Theme::GetWindow( string name ) //--------------------------------------------------------------------------- void Theme::MoveSkin( SkinWindow *wnd, int left, int top ) { - int x, y, oldx, oldy; + int oldx, oldy; SkinWindow *win; list::const_iterator anc; list::const_iterator hang; diff --git a/modules/gui/skins/src/themeloader.cpp b/modules/gui/skins/src/themeloader.cpp index 58060d2251..1bacb6d1c3 100644 --- a/modules/gui/skins/src/themeloader.cpp +++ b/modules/gui/skins/src/themeloader.cpp @@ -2,7 +2,7 @@ * themeloader.cpp: ThemeLoader class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: themeloader.cpp,v 1.13 2003/06/08 16:56:48 gbazin Exp $ + * $Id: themeloader.cpp,v 1.14 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -133,7 +133,7 @@ bool ThemeLoader::ExtractTarGz( const string tarfile, const string rootdir ) } if( tar_extract_all( t, (char *)rootdir.c_str() ) != 0 ) - { + { tar_close( t ); return false; } diff --git a/modules/gui/skins/src/vlcproc.cpp b/modules/gui/skins/src/vlcproc.cpp index 66ea09c5dd..3274427a07 100644 --- a/modules/gui/skins/src/vlcproc.cpp +++ b/modules/gui/skins/src/vlcproc.cpp @@ -2,7 +2,7 @@ * vlcproc.cpp: VlcProc class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: vlcproc.cpp,v 1.32 2003/06/09 06:52:07 gbazin Exp $ + * $Id: vlcproc.cpp,v 1.33 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -59,6 +59,10 @@ VlcProc::VlcProc( intf_thread_t *_p_intf ) p_intf = _p_intf; } //--------------------------------------------------------------------------- +VlcProc::~VlcProc() +{ +} +//--------------------------------------------------------------------------- bool VlcProc::EventProc( Event *evt ) { switch( evt->GetMessage() ) @@ -98,8 +102,10 @@ bool VlcProc::EventProc( Event *evt ) return true; case VLC_OPEN: +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowOpen( true ); InterfaceRefresh(); +#endif return true; case VLC_LOAD_SKIN: @@ -131,23 +137,31 @@ bool VlcProc::EventProc( Event *evt ) return true; case VLC_PLAYLIST_ADD_FILE: +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowOpen( false ); InterfaceRefresh(); +#endif return true; case VLC_LOG_SHOW: +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowMessages(); +#endif return true; case VLC_LOG_CLEAR: return true; case VLC_PREFS_SHOW: +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowPrefs(); +#endif return true; case VLC_INFO_SHOW: +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowFileInfo(); +#endif return true; case VLC_INTF_REFRESH: @@ -326,7 +340,9 @@ void VlcProc::LoadSkin() { if( p_intf->p_sys->p_new_theme_file == NULL ) { +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowOpenSkin(); +#endif } else { @@ -421,8 +437,10 @@ void VlcProc::PlayStream() if( !p_intf->p_sys->p_playlist->i_size ) { +#ifndef BASIC_SKINS p_intf->p_sys->p_dialogs->ShowOpen( true ); InterfaceRefresh(); +#endif return; } diff --git a/modules/gui/skins/src/vlcproc.h b/modules/gui/skins/src/vlcproc.h index 1675a624a0..34035b5585 100644 --- a/modules/gui/skins/src/vlcproc.h +++ b/modules/gui/skins/src/vlcproc.h @@ -2,7 +2,7 @@ * vlcproc.h: VlcProc class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: vlcproc.h,v 1.6 2003/06/03 22:18:58 gbazin Exp $ + * $Id: vlcproc.h,v 1.7 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -27,13 +27,12 @@ #ifndef VLC_SKIN_PROC #define VLC_SKIN_PROC +#include "skin_common.h" + //--- GENERAL --------------------------------------------------------------- #include using namespace std; -//--------------------------------------------------------------------------- -struct intf_thread_t; - //--------------------------------------------------------------------------- class VlcProc { diff --git a/modules/gui/skins/src/window.cpp b/modules/gui/skins/src/window.cpp index c4b775fa4a..950e3cf368 100644 --- a/modules/gui/skins/src/window.cpp +++ b/modules/gui/skins/src/window.cpp @@ -2,7 +2,7 @@ * window.cpp: Window class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: window.cpp,v 1.26 2003/06/08 16:56:48 gbazin Exp $ + * $Id: window.cpp,v 1.27 2003/06/09 12:33:16 asmax Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -87,6 +87,10 @@ SkinWindow::SkinWindow( intf_thread_t *_p_intf, int x, int y, bool visible, //--------------------------------------------------------------------------- SkinWindow::~SkinWindow() { + if( Image ) + { + delete Image; + } // Destroy the controls for( unsigned int i = 0; i < ControlList.size(); i++ ) delete ControlList[i]; @@ -420,10 +424,12 @@ void SkinWindow::MouseUp( int x, int y, int button ) } } +#ifndef BASIC_SKINS if( i < 0 && button == 2 ) { p_intf->p_sys->p_dialogs->ShowPopup(); } +#endif } //--------------------------------------------------------------------------- void SkinWindow::MouseDblClick( int x, int y, int button ) @@ -512,7 +518,6 @@ void SkinWindow::ReSize() if( Image != NULL ) delete (OSGraphics *)Image; Image = (Graphics *)new OSGraphics( p_intf, w, h, this ); -// Image = (Graphics *)new OSGraphics( w, h, this ); Size( w, h ); } diff --git a/modules/gui/skins/x11/x11_bitmap.cpp b/modules/gui/skins/x11/x11_bitmap.cpp index 79d3f55447..6fc658256f 100644 --- a/modules/gui/skins/x11/x11_bitmap.cpp +++ b/modules/gui/skins/x11/x11_bitmap.cpp @@ -2,7 +2,7 @@ * x11_bitmap.cpp: X11 implementation of the Bitmap class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_bitmap.cpp,v 1.10 2003/06/08 12:45:13 gbazin Exp $ + * $Id: x11_bitmap.cpp,v 1.11 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * @@ -59,7 +59,6 @@ X11Bitmap::X11Bitmap( intf_thread_t *_p_intf, string FileName, int AColor ) // Find the display display = p_intf->p_sys->display; int screen = DefaultScreen( display ); - int depth = DefaultDepth( display, screen ); Screen *screenptr = DefaultScreenOfDisplay( display ); Visual *visual = DefaultVisualOfScreen( screenptr ); Img = NULL; @@ -176,9 +175,9 @@ void X11Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef, //--------------------------------------------------------------------------- bool X11Bitmap::Hit( int x, int y) { - unsigned int c = (unsigned int)GetBmpPixel( x, y ); + int c = GetBmpPixel( x, y ); - if( c == -1 || c == AlphaColor ) + if( c == -1 || (unsigned int)c == AlphaColor ) return false; else return true; diff --git a/modules/gui/skins/x11/x11_dragdrop.h b/modules/gui/skins/x11/x11_dragdrop.h index a4263ad8ab..603aebacee 100644 --- a/modules/gui/skins/x11/x11_dragdrop.h +++ b/modules/gui/skins/x11/x11_dragdrop.h @@ -2,7 +2,7 @@ * x11_dragdrop.h: X11 implementation of the drag & drop ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_dragdrop.h,v 1.3 2003/06/09 00:07:09 asmax Exp $ + * $Id: x11_dragdrop.h,v 1.4 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * @@ -29,6 +29,8 @@ //--- X11 ----------------------------------------------------------------- #include +#include "../src/skin_common.h" + //--------------------------------------------------------------------------- typedef long ldata_t[5]; diff --git a/modules/gui/skins/x11/x11_event.cpp b/modules/gui/skins/x11/x11_event.cpp index 087dcd69cc..51007b09ef 100644 --- a/modules/gui/skins/x11/x11_event.cpp +++ b/modules/gui/skins/x11/x11_event.cpp @@ -2,7 +2,7 @@ * x11_event.cpp: x11 implementation of the Event class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_event.cpp,v 1.2 2003/05/19 21:39:34 asmax Exp $ + * $Id: x11_event.cpp,v 1.3 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * Emmanuel Puig @@ -49,7 +49,7 @@ X11Event::X11Event( intf_thread_t *p_intf, string Desc, string shortcut ) : Event( p_intf, Desc, shortcut ) { - Wnd = NULL; + Wnd = None; } //--------------------------------------------------------------------------- X11Event::X11Event( intf_thread_t *p_intf, Window wnd, unsigned int msg, @@ -126,7 +126,7 @@ Window X11Event::GetWindowFromName( string name ) if( win == NULL ) { - return NULL; + return None; } else { diff --git a/modules/gui/skins/x11/x11_font.cpp b/modules/gui/skins/x11/x11_font.cpp index d5270c2483..bcb77838d3 100644 --- a/modules/gui/skins/x11/x11_font.cpp +++ b/modules/gui/skins/x11/x11_font.cpp @@ -2,7 +2,7 @@ * x11_font.cpp: X11 implementation of the Font class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_font.cpp,v 1.8 2003/06/08 00:32:07 asmax Exp $ + * $Id: x11_font.cpp,v 1.9 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * @@ -55,16 +55,19 @@ X11Font::X11Font( intf_thread_t *_p_intf, string fontname, int size, size = ( size < 10 ? 8 : 12 ); snprintf( name, 256, "-*-helvetica-bold-%c-*-*-*-%i-*-*-*-*-*-*", slant, 10 * size ); - msg_Dbg( _p_intf, "loading font %s", name ); - XLOCK; - font = XLoadFont( display, name ); - FontInfo = XQueryFont( display, font ); + FontInfo = XLoadQueryFont( display, name ); + font = FontInfo->fid; + Ascent = FontInfo->max_bounds.ascent; + Descent = FontInfo->max_bounds.descent; XUNLOCK; } //--------------------------------------------------------------------------- X11Font::~X11Font() { + XLOCK; + XFreeFont( display, FontInfo ); + XUNLOCK; } //--------------------------------------------------------------------------- void X11Font::AssignFont( Graphics *dest ) @@ -82,7 +85,7 @@ void X11Font::GetSize( string text, int &w, int &h ) XUNLOCK; w = overall.rbearing - overall.lbearing; - h = FontInfo->max_bounds.ascent + FontInfo->max_bounds.descent; + h = Ascent + Descent; } //--------------------------------------------------------------------------- void X11Font::GenericPrint( Graphics *dest, string text, int x, int y, @@ -108,12 +111,10 @@ void X11Font::GenericPrint( Graphics *dest, string text, int x, int y, XSetClipRectangles( display, gc, 0, 0, &rect, 1, Unsorted ); // Render text no the drawable - XDrawString( display, drawable, gc, x, y+FontInfo->max_bounds.ascent, - text.c_str(), text.size()); + XDrawString( display, drawable, gc, x, y+Ascent, text.c_str(), text.size()); if( Underline ) { - XDrawLine( display, drawable, gc, x, y+FontInfo->max_bounds.ascent+1, - x+w, y+FontInfo->max_bounds.ascent+1 ); + XDrawLine( display, drawable, gc, x, y+Ascent+1, x+w, y+Ascent+1 ); } // Reset the clip mask diff --git a/modules/gui/skins/x11/x11_font.h b/modules/gui/skins/x11/x11_font.h index dac92bd496..0bc1bc1df5 100644 --- a/modules/gui/skins/x11/x11_font.h +++ b/modules/gui/skins/x11/x11_font.h @@ -2,7 +2,7 @@ * x11_font.h: X11 implementation of the Font class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_font.h,v 1.4 2003/06/08 00:32:07 asmax Exp $ + * $Id: x11_font.h,v 1.5 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * @@ -44,6 +44,8 @@ class X11Font : SkinFont Display *display; Font font; XFontStruct *FontInfo; + int Ascent; + int Descent; bool Underline; // Assign font to Device Context diff --git a/modules/gui/skins/x11/x11_graphics.cpp b/modules/gui/skins/x11/x11_graphics.cpp index 5477014177..9eb0a2c339 100644 --- a/modules/gui/skins/x11/x11_graphics.cpp +++ b/modules/gui/skins/x11/x11_graphics.cpp @@ -2,7 +2,7 @@ * x11_graphics.cpp: X11 implementation of the Graphics and Region classes ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_graphics.cpp,v 1.7 2003/06/08 15:22:03 asmax Exp $ + * $Id: x11_graphics.cpp,v 1.8 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * Emmanuel Puig @@ -170,7 +170,7 @@ void X11Region::Move( int x, int y ) //--------------------------------------------------------------------------- bool X11Region::Hit( int x, int y ) { - int i; + unsigned int i; x -= RefPoint.x; y -= RefPoint.y; diff --git a/modules/gui/skins/x11/x11_run.cpp b/modules/gui/skins/x11/x11_run.cpp index 616d2ae2e5..e5be46220c 100644 --- a/modules/gui/skins/x11/x11_run.cpp +++ b/modules/gui/skins/x11/x11_run.cpp @@ -2,7 +2,7 @@ * x11_run.cpp: ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_run.cpp,v 1.20 2003/06/08 18:17:50 asmax Exp $ + * $Id: x11_run.cpp,v 1.21 2003/06/09 12:33:16 asmax Exp $ * * Authors: Cyril Deguet * @@ -106,6 +106,7 @@ int ProcessEvent( intf_thread_t *p_intf, VlcProc *proc, XEvent *event ) { if( !proc->EventProc( evt ) ) { + delete (OSEvent *)evt; return 1; // Exit VLC ! } } @@ -198,7 +199,7 @@ void OSRun( intf_thread_t *p_intf ) timerManager->Destroy(); delete refreshTimer; - + delete proc; } //--------------------------------------------------------------------------- bool IsVLCEvent( unsigned int msg ) diff --git a/modules/gui/skins/x11/x11_theme.cpp b/modules/gui/skins/x11/x11_theme.cpp index 0365e33c5b..ede0429dff 100644 --- a/modules/gui/skins/x11/x11_theme.cpp +++ b/modules/gui/skins/x11/x11_theme.cpp @@ -2,7 +2,7 @@ * x11_theme.cpp: X11 implementation of the Theme class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_theme.cpp,v 1.10 2003/06/07 10:18:15 gbazin Exp $ + * $Id: x11_theme.cpp,v 1.11 2003/06/09 12:33:17 asmax Exp $ * * Authors: Cyril Deguet * @@ -59,29 +59,10 @@ X11Theme::X11Theme( intf_thread_t *_p_intf ) : Theme( _p_intf ) //--------------------------------------------------------------------------- X11Theme::~X11Theme() -{/* - // Unregister the window class if needed - WNDCLASS wndclass; - if( GetClassInfo( hinst, "SkinWindow", &wndclass ) ) - { - UnregisterClass( "SkinWindow", hinst ); - } - if( GetClassInfo( hinst, "ParentWindow", &wndclass ) ) - { - UnregisterClass( "ParentWindow", hinst ); - } - - // Delete tray icon if exists - if( ShowInTray ) - { - Shell_NotifyIcon( NIM_DELETE, &TrayIcon ); - } -*/ - // Destroy parent window -/* if( ParentWindow ) - { - gdk_window_destroy( ParentWindow ); - }*/ +{ + XLOCK; + XDestroyWindow( display, p_intf->p_sys->mainWin ); + XUNLOCK; } //--------------------------------------------------------------------------- void X11Theme::OnLoadTheme() diff --git a/modules/gui/skins/x11/x11_timer.cpp b/modules/gui/skins/x11/x11_timer.cpp index a391f501ef..02a11622b9 100644 --- a/modules/gui/skins/x11/x11_timer.cpp +++ b/modules/gui/skins/x11/x11_timer.cpp @@ -2,7 +2,7 @@ * x11_timer.cpp: helper class to implement timers ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_timer.cpp,v 1.3 2003/06/08 11:33:14 asmax Exp $ + * $Id: x11_timer.cpp,v 1.4 2003/06/09 12:33:17 asmax Exp $ * * Authors: Cyril Deguet * @@ -123,7 +123,7 @@ void X11TimerManager::Destroy() // Main timer loop -void *X11TimerManager::Thread( void *p_timer ) +void X11TimerManager::Thread( void *p_timer ) { vlc_thread_ready( (vlc_object_t*) p_timer ); diff --git a/modules/gui/skins/x11/x11_timer.h b/modules/gui/skins/x11/x11_timer.h index 892f39e35e..ef1765c073 100644 --- a/modules/gui/skins/x11/x11_timer.h +++ b/modules/gui/skins/x11/x11_timer.h @@ -2,7 +2,7 @@ * x11_timer.h: helper class to implement timers ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_timer.h,v 1.4 2003/06/08 12:45:13 gbazin Exp $ + * $Id: x11_timer.h,v 1.5 2003/06/09 12:33:17 asmax Exp $ * * Authors: Cyril Deguet * @@ -75,7 +75,7 @@ class X11TimerManager X11TimerManager( intf_thread_t *p_intf ); ~X11TimerManager(); - static void *Thread( void *p_timer ); + static void Thread( void *p_timer ); void WaitNextTimer(); public: diff --git a/modules/gui/skins/x11/x11_window.cpp b/modules/gui/skins/x11/x11_window.cpp index 9c51f9935e..9bafaa806b 100644 --- a/modules/gui/skins/x11/x11_window.cpp +++ b/modules/gui/skins/x11/x11_window.cpp @@ -2,7 +2,7 @@ * x11_window.cpp: X11 implementation of the Window class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: x11_window.cpp,v 1.18 2003/06/09 00:07:09 asmax Exp $ + * $Id: x11_window.cpp,v 1.19 2003/06/09 12:33:17 asmax Exp $ * * Authors: Cyril Deguet * @@ -136,26 +136,17 @@ X11Window::X11Window( intf_thread_t *p_intf, Window wnd, int x, int y, //--------------------------------------------------------------------------- X11Window::~X11Window() { -/* delete CursorPos; - delete WindowPos; - - if( hWnd != NULL ) + if( DragDrop ) { - DestroyWindow( hWnd ); - }*/ - + delete DropObject; + } + delete ToolTip.timer; + XLOCK; + XFreeGC( display, ToolTip.gc ); XFreeGC( display, Gc ); XDestroyWindow( display, ToolTip.window ); - - /* - if( DragDrop ) - { - // Remove the listview from the list of drop targets - RevokeDragDrop( hWnd ); - DropTarget->Release(); - // Uninitialize the OLE library - OleUninitialize(); - }*/ + XDestroyWindow( display, Wnd ); + XUNLOCK; } //--------------------------------------------------------------------------- void X11Window::OSShow( bool show ) @@ -177,7 +168,6 @@ void X11Window::OSShow( bool show ) { // Mask for transparency Region region = XCreateRegion(); - region = XCreateRegion(); for( int line = 0; line < Height; line++ ) { int start = 0, end = 0; @@ -205,6 +195,7 @@ void X11Window::OSShow( bool show ) start = end + 1; } } + XDestroyImage( image ); XShapeCombineRegion( display, Wnd, ShapeBounding, 0, 0, region, ShapeSet ); @@ -231,7 +222,7 @@ void X11Window::OSShow( bool show ) bool X11Window::ProcessOSEvent( Event *evt ) { unsigned int msg = evt->GetMessage(); - unsigned int p1 = evt->GetParam1(); + //unsigned int p1 = evt->GetParam1(); int p2 = evt->GetParam2(); int time; int posX, posY; diff --git a/modules/gui/wxwindows/preferences.cpp b/modules/gui/wxwindows/preferences.cpp index 49b19baa27..af0e2b1df7 100644 --- a/modules/gui/wxwindows/preferences.cpp +++ b/modules/gui/wxwindows/preferences.cpp @@ -2,7 +2,7 @@ * preferences.cpp : wxWindows plugin for vlc ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: preferences.cpp,v 1.18 2003/06/05 21:22:28 gbazin Exp $ + * $Id: preferences.cpp,v 1.19 2003/06/09 12:33:17 asmax Exp $ * * Authors: Gildas Bazin * @@ -730,6 +730,7 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf, combo->SetValue( wxU(p_parser->psz_longname) ); } } + vlc_list_release( p_list ); combo->SetToolTip( wxU(p_item->psz_longtext) ); config_data->control.combobox = combo;