]> git.sesse.net Git - vlc/commitdiff
* repaired basic_skins
authorCyril Deguet <asmax@videolan.org>
Mon, 9 Jun 2003 12:33:17 +0000 (12:33 +0000)
committerCyril Deguet <asmax@videolan.org>
Mon, 9 Jun 2003 12:33:17 +0000 (12:33 +0000)
* removed all the compilation warnings
* fixed LOTS of memory leaks in skins (gibalou, you should try valgrind
  on wxwindows plugin ;)

24 files changed:
modules/gui/skins/controls/button.cpp
modules/gui/skins/controls/checkbox.cpp
modules/gui/skins/controls/image.cpp
modules/gui/skins/controls/playlist.cpp
modules/gui/skins/src/dialogs.cpp
modules/gui/skins/src/skin_common.h
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/themeloader.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/skins/src/vlcproc.h
modules/gui/skins/src/window.cpp
modules/gui/skins/x11/x11_bitmap.cpp
modules/gui/skins/x11/x11_dragdrop.h
modules/gui/skins/x11/x11_event.cpp
modules/gui/skins/x11/x11_font.cpp
modules/gui/skins/x11/x11_font.h
modules/gui/skins/x11/x11_graphics.cpp
modules/gui/skins/x11/x11_run.cpp
modules/gui/skins/x11/x11_theme.cpp
modules/gui/skins/x11/x11_timer.cpp
modules/gui/skins/x11/x11_timer.h
modules/gui/skins/x11/x11_window.cpp
modules/gui/wxwindows/preferences.cpp

index 6d75b6306e14b90dbd46c4b2d9dbf4b7899eb515..6aced6a198105e2cd5464339d5958f1b31a6b72c 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -71,6 +71,18 @@ ControlButton::ControlButton(
 //---------------------------------------------------------------------------
 ControlButton::~ControlButton()
 {
+    if( ClickAction )
+    {
+        delete ClickAction;
+    }
+    if( MouseOverAction )
+    {
+        delete MouseOverAction;
+    }
+    if( MouseOutAction )
+    {
+        delete MouseOutAction;
+    }
 }
 //---------------------------------------------------------------------------
 void ControlButton::Init()
index 434257c148284c01292292d21883c19d9996709f..2c685698cd841872f0674d3213f4628c2e779809 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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()
index 8a53f4af4a4d17e183d4e02e08ea68b9f59f134d..78d29498e1f2de317245e42eeca781c70256bd98 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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()
index bf8b5bf99cae495bc077ac14930022bbabdac55d..8324e5c2272a8f8db4aac80d05c452bb27997bb0 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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 );
index ccde7041dad6823c16b84e6917ee11e262f6cd5b..6fc6e2fcd3b079587a3eae3febf53aae5d80e7ef 100644 (file)
@@ -2,7 +2,7 @@
  * dialogs.cpp: Handles all the different dialog boxes we provide.\r
  *****************************************************************************\r
  * Copyright (C) 2003 VideoLAN\r
- * $Id: dialogs.cpp,v 1.4 2003/06/08 16:56:48 gbazin Exp $\r
+ * $Id: dialogs.cpp,v 1.5 2003/06/09 12:33:16 asmax Exp $\r
  *\r
  * Authors: Gildas Bazin <gbazin@netcourrier.com>\r
  *\r
@@ -422,9 +422,9 @@ void Dialogs::OnExitThread( wxCommandEvent& event )
 int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,\r
                  vlc_value_t old_val, vlc_value_t new_val, void *param )\r
 {\r
+#ifndef BASIC_SKINS\r
     Dialogs *p_dialogs = (Dialogs *)param;\r
 \r
-#ifndef BASIC_SKINS\r
     p_dialogs->ShowPopup();\r
 #endif // BASIC_SKINS\r
 \r
index 9f84548556901487ed6f4b5c4ee51dae08deee67..a33b39df5b7847831152358758ecf5bd463ebb8b 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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
 
index 8c8a636b5a89c22b7899cfa4e55039eb2bc8b5c5..1a959c952967be4bc8c2dfce902aaadb5484ee1e 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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 );
 
index 0f84147677f0b6564cf8d5dc6d235cffaf9cab3b..be5618068a1279f94c16ba1dd79cabbddb3ba2a3 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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<Anchor *>::const_iterator anc;
     list<Anchor *>::const_iterator hang;
index 58060d22512a37d70a5d32e5379a4c63508a3367..1bacb6d1c39a1c7db0c76a0321375ae265d8049c 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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;
     }
 
index 66ea09c5dde007b2ae23dc3732efa1ccbb1786d9..3274427a07de203079a7753546fa83bdcd91923c 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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;
     }
 
index 1675a624a0e09f516be61188e50a67004b263208..34035b5585b45fc68ad6a504584132a4f6a644da 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
 #ifndef VLC_SKIN_PROC
 #define VLC_SKIN_PROC
 
+#include "skin_common.h"
+
 //--- GENERAL ---------------------------------------------------------------
 #include <string>
 using namespace std;
 
-//---------------------------------------------------------------------------
-struct intf_thread_t;
-
 //---------------------------------------------------------------------------
 class VlcProc
 {
index c4b775fa4a4e818a237a71fc47dae2b7cdb6c4c1..950e3cf36854226b1c32d495d5359c8bd38e3bad 100644 (file)
@@ -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 <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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 );
     }
index 79d3f554470f4f8a575ca84543777385b0125c36..6fc658256f90ca073a178be5decc37738a7b3dbf 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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;
index a4263ad8abe357bc228d4f3c950a69a61c094cb9..603aebacee33992ea23b562807cea5454b3ac82e 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -29,6 +29,8 @@
 //--- X11 -----------------------------------------------------------------
 #include <X11/Xlib.h>
 
+#include "../src/skin_common.h"
+
 //---------------------------------------------------------------------------
 
 typedef long ldata_t[5];
index 087dcd69cc4d3c05fbcfe62da802a2b0f4e2787e..51007b09efeb10ca5b209d72c2f83ec572582ce3 100644 (file)
@@ -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     <asmax@videolan.org>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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
     {
index d5270c24833d7d14105ea3c49f26481e356c24c7..bcb77838d32d16a950a54f61ea07526721edb8cd 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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
index dac92bd496a38953e4dbc27abb8cb370b9687145..0bc1bc1df55471fd278c2276bdf8187ec93a245b 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -44,6 +44,8 @@ class X11Font : SkinFont
         Display *display;
         Font font;
         XFontStruct *FontInfo;
+        int Ascent;
+        int Descent;
         bool Underline;
 
         // Assign font to Device Context
index 5477014177795c5618616b90428aa6b3001e6d17..9eb0a2c339e33f4ac8167043b1c6180905af5ddb 100644 (file)
@@ -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     <asmax@videolan.org>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -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;
index 616d2ae2e54562063e693f8af13410cb97424f30..e5be46220cf79e5fa53f1e793f235289d07b4195 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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 )
index 0365e33c5b432eef9c687b4f6753ddb1ef1df5bc..ede0429dff1fb922c6e2fcbf07817d1e9c402e0b 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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()
index a391f501effe841a06e795ccbdb0c520d5a03f3c..02a11622b9312c605d0540df94dbd73ba5ce5052 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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 );
 
index 892f39e35e570b473d4c658b062bd1047d0f0e4a..ef1765c0731493de258f370d7605e94a066a9c58 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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:
index 9c51f9935e1e66653e10b4f8fdfaf4f5bada35ae..9bafaa806b042339e359df1bc7e45d4cd12beb52 100644 (file)
@@ -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     <asmax@videolan.org>
  *
@@ -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;
index 49b19baa27a9a8a2a8e2fe95337e635634ac8298..af0e2b1df70d838f3c2f004c5e955c058104ed00 100644 (file)
@@ -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 <gbazin@netcourrier.com>
  *
@@ -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;