* 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>
//---------------------------------------------------------------------------
ControlButton::~ControlButton()
{
+ if( ClickAction )
+ {
+ delete ClickAction;
+ }
+ if( MouseOverAction )
+ {
+ delete MouseOverAction;
+ }
+ if( MouseOutAction )
+ {
+ delete MouseOutAction;
+ }
}
//---------------------------------------------------------------------------
void ControlButton::Init()
* 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>
//---------------------------------------------------------------------------
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()
* 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>
//---------------------------------------------------------------------------
ControlImage::~ControlImage()
{
+ if( MouseDownAction )
+ {
+ delete MouseDownAction;
+ }
}
//---------------------------------------------------------------------------
void ControlImage::Init()
* 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>
//---------------------------------------------------------------------------
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 );
* 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
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
* 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>
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
* 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>
// 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 );
* 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>
//---------------------------------------------------------------------------
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;
* 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>
}
if( tar_extract_all( t, (char *)rootdir.c_str() ) != 0 )
- {
+ { tar_close( t );
return false;
}
* 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>
p_intf = _p_intf;
}
//---------------------------------------------------------------------------
+VlcProc::~VlcProc()
+{
+}
+//---------------------------------------------------------------------------
bool VlcProc::EventProc( Event *evt )
{
switch( evt->GetMessage() )
return true;
case VLC_OPEN:
+#ifndef BASIC_SKINS
p_intf->p_sys->p_dialogs->ShowOpen( true );
InterfaceRefresh();
+#endif
return true;
case VLC_LOAD_SKIN:
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:
{
if( p_intf->p_sys->p_new_theme_file == NULL )
{
+#ifndef BASIC_SKINS
p_intf->p_sys->p_dialogs->ShowOpenSkin();
+#endif
}
else
{
if( !p_intf->p_sys->p_playlist->i_size )
{
+#ifndef BASIC_SKINS
p_intf->p_sys->p_dialogs->ShowOpen( true );
InterfaceRefresh();
+#endif
return;
}
* 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
{
* 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>
//---------------------------------------------------------------------------
SkinWindow::~SkinWindow()
{
+ if( Image )
+ {
+ delete Image;
+ }
// Destroy the controls
for( unsigned int i = 0; i < ControlList.size(); i++ )
delete ControlList[i];
}
}
+#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 )
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 );
}
* 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>
*
// 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;
//---------------------------------------------------------------------------
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;
* 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>
*
//--- X11 -----------------------------------------------------------------
#include <X11/Xlib.h>
+#include "../src/skin_common.h"
+
//---------------------------------------------------------------------------
typedef long ldata_t[5];
* 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>
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,
if( win == NULL )
{
- return NULL;
+ return None;
}
else
{
* 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>
*
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 )
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,
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
* 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>
*
Display *display;
Font font;
XFontStruct *FontInfo;
+ int Ascent;
+ int Descent;
bool Underline;
// Assign font to Device Context
* 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>
//---------------------------------------------------------------------------
bool X11Region::Hit( int x, int y )
{
- int i;
+ unsigned int i;
x -= RefPoint.x;
y -= RefPoint.y;
* 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>
*
{
if( !proc->EventProc( evt ) )
{
+ delete (OSEvent *)evt;
return 1; // Exit VLC !
}
}
timerManager->Destroy();
delete refreshTimer;
-
+ delete proc;
}
//---------------------------------------------------------------------------
bool IsVLCEvent( unsigned int msg )
* 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>
*
//---------------------------------------------------------------------------
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()
* 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>
*
// Main timer loop
-void *X11TimerManager::Thread( void *p_timer )
+void X11TimerManager::Thread( void *p_timer )
{
vlc_thread_ready( (vlc_object_t*) p_timer );
* 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>
*
X11TimerManager( intf_thread_t *p_intf );
~X11TimerManager();
- static void *Thread( void *p_timer );
+ static void Thread( void *p_timer );
void WaitNextTimer();
public:
* 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>
*
//---------------------------------------------------------------------------
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 )
{
// Mask for transparency
Region region = XCreateRegion();
- region = XCreateRegion();
for( int line = 0; line < Height; line++ )
{
int start = 0, end = 0;
start = end + 1;
}
}
+ XDestroyImage( image );
XShapeCombineRegion( display, Wnd, ShapeBounding, 0, 0, region,
ShapeSet );
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;
* 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>
*
combo->SetValue( wxU(p_parser->psz_longname) );
}
}
+ vlc_list_release( p_list );
combo->SetToolTip( wxU(p_item->psz_longtext) );
config_data->control.combobox = combo;