Commit 0f0a0c68 authored by Gildas Bazin's avatar Gildas Bazin

* modules/*: got rid of empty module objects.
* modules/gui/wxwindows/preferences.cpp: fixed the config options display for submodules.
parent e3bc8828
......@@ -2,7 +2,7 @@
* dvd.c : DVD input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: dvd.c,v 1.7 2003/05/15 22:27:36 massiot Exp $
* $Id: dvd.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -96,9 +96,9 @@ vlc_module_begin();
#endif
add_shortcut( "dvdold" );
add_shortcut( "dvdsimple" );
add_submodule();
set_capability( "access", i );
set_callbacks( E_(DVDOpen), E_(DVDClose) );
set_capability( "access", i );
set_callbacks( E_(DVDOpen), E_(DVDClose) );
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(DVDInit), E_(DVDEnd) );
......
......@@ -7,7 +7,7 @@
*****************************************************************************
*
* Copyright (C) 2001 VideoLAN
* $Id: dvd.c,v 1.5 2003/03/30 18:14:35 gbazin Exp $
* $Id: dvd.c,v 1.6 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -50,10 +50,9 @@ void E_(CloseIntf) ( vlc_object_t * );
vlc_module_begin();
add_usage_hint( N_("[dvdplay:][device][@[title][,[chapter][,angle]]]") );
set_description( _("DVD input with menus support") );
add_submodule();
set_capability( "access", 120 );
set_callbacks( E_(OpenDVD), E_(CloseDVD) );
add_shortcut( "dvd" );
set_capability( "access", 120 );
set_callbacks( E_(OpenDVD), E_(CloseDVD) );
add_shortcut( "dvd" );
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(InitDVD), E_(EndDVD) );
......
......@@ -2,7 +2,7 @@
* dvdread.c : DvdRead input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: dvdread.c,v 1.6 2003/03/30 18:14:35 gbazin Exp $
* $Id: dvdread.c,v 1.7 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -43,9 +43,8 @@ void E_(EndDVD) ( vlc_object_t * );
*****************************************************************************/
vlc_module_begin();
set_description( _("DVD input (using libdvdread)") );
add_submodule();
set_capability( "access", 110 );
set_callbacks( E_(OpenDVD), E_(CloseDVD) );
set_capability( "access", 110 );
set_callbacks( E_(OpenDVD), E_(CloseDVD) );
add_submodule();
set_capability( "demux", 0 );
set_callbacks( E_(InitDVD), E_(EndDVD) );
......
......@@ -2,7 +2,7 @@
* slp.c: SLP access plugin
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: slp.c,v 1.11 2003/05/15 22:27:36 massiot Exp $
* $Id: slp.c,v 1.12 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Loc Minier <lool@videolan.org>
*
......@@ -84,9 +84,9 @@ vlc_module_begin();
NAMINGAUTHORITY_LONGTEXT, VLC_TRUE );
add_string( "slp-filter", "", NULL, FILTER_TEXT, FILTER_LONGTEXT, VLC_TRUE );
add_string( "slp-lang", "", NULL, LANG_TEXT, LANG_LONGTEXT, VLC_TRUE );
add_submodule();
set_capability( "access", 0 );
set_callbacks( Open, Close );
set_capability( "access", 0 );
set_callbacks( Open, Close );
add_submodule();
add_shortcut( "demux_slp" );
set_capability( "demux", 0 );
......
......@@ -2,7 +2,7 @@
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: BeOS.cpp,v 1.11 2003/06/03 12:06:29 titer Exp $
* $Id: BeOS.cpp,v 1.12 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -53,9 +53,9 @@ vlc_module_begin();
add_string( "beos-screenshotpath", "/boot/home/", NULL, "Screenshot Path", "", VLC_TRUE );
add_string_from_list( "beos-screenshotformat", "PNG", ppsz_screenshotformat, NULL, "Screenshot Format", "", VLC_TRUE );
set_description( _("BeOS standard API interface") );
add_submodule();
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
add_submodule();
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
......
......@@ -2,7 +2,7 @@
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.14 2003/06/06 02:48:19 hartman Exp $
* $Id: macosx.m,v 1.15 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......@@ -60,9 +60,8 @@ void E_(CloseVideo) ( vlc_object_t * );
vlc_module_begin();
set_description( _("MacOS X interface, sound and video") );
add_submodule();
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
add_submodule();
set_capability( "video output", 200 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
......
......@@ -42,9 +42,8 @@ void E_(CloseVideo) ( vlc_object_t * );
*****************************************************************************/
vlc_module_begin();
set_description( _("QNX RTOS video and audio output") );
add_submodule();
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_submodule();
set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) );
......
......@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.20 2003/06/16 21:55:58 gbazin Exp $
* $Id: preferences.cpp,v 1.21 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -66,6 +66,7 @@
/*****************************************************************************
* Classes declarations.
*****************************************************************************/
class ConfigTreeData;
class PrefsTreeCtrl : public wxTreeCtrl
{
public:
......@@ -81,6 +82,7 @@ public:
private:
/* Event handlers (these functions should _not_ be virtual) */
void OnSelectTreeItem( wxTreeEvent& event );
ConfigTreeData *FindModuleConfig( ConfigTreeData *config_data );
DECLARE_EVENT_TABLE()
......@@ -150,9 +152,11 @@ class ConfigTreeData : public wxTreeItemData
{
public:
ConfigTreeData() { panel = NULL; psz_section = NULL; }
ConfigTreeData() { b_submodule = 0; panel = NULL; psz_section = NULL; }
virtual ~ConfigTreeData() { if( panel ) delete panel; }
vlc_bool_t b_submodule;
PrefsPanel *panel;
wxBoxSizer *sizer;
int i_object_id;
......@@ -442,7 +446,10 @@ PrefsTreeCtrl::PrefsTreeCtrl( wxWindow *_p_parent, intf_thread_t *_p_intf,
/* Add the plugin to the tree */
ConfigTreeData *config_data = new ConfigTreeData;
config_data->i_object_id = p_module->i_object_id;
config_data->b_submodule = p_module->b_submodule;
config_data->i_object_id = p_module->b_submodule ?
((module_t *)p_module->p_parent)->i_object_id :
p_module->i_object_id;
AppendItem( capability_item, wxU(p_module->psz_object_name), -1, -1,
config_data );
}
......@@ -524,6 +531,14 @@ void PrefsTreeCtrl::CleanChanges()
long cookie, cookie2;
ConfigTreeData *config_data;
config_data = !GetSelection() ? NULL :
FindModuleConfig( (ConfigTreeData *)GetItemData( GetSelection() ) );
if( config_data )
{
config_data->panel->Hide();
p_sizer->Remove( config_data->panel );
}
/* Clean changes for the main module */
wxTreeItemId item = GetFirstChild( root_item, cookie );
for( size_t i_child_index = 0;
......@@ -533,20 +548,8 @@ void PrefsTreeCtrl::CleanChanges()
config_data = (ConfigTreeData *)GetItemData( item );
if( config_data && config_data->panel )
{
if( item == GetSelection() )
{
config_data->panel->Hide();
p_sizer->Remove( config_data->panel );
}
delete config_data->panel;
config_data->panel = NULL;
if( item == GetSelection() )
{
wxTreeEvent event;
OnSelectTreeItem( event );
}
}
item = GetNextChild( root_item, cookie );
......@@ -567,20 +570,50 @@ void PrefsTreeCtrl::CleanChanges()
if( config_data && config_data->panel )
{
if( item2 == GetSelection() )
{
config_data->panel->Hide();
p_sizer->Remove( config_data->panel );
}
delete config_data->panel;
config_data->panel = NULL;
}
if( item2 == GetSelection() )
{
wxTreeEvent event;
OnSelectTreeItem( event );
}
item2 = GetNextChild( item, cookie2 );
}
item = GetNextChild( plugins_item, cookie );
}
if( GetSelection() )
{
wxTreeEvent event;
OnSelectTreeItem( event );
}
}
ConfigTreeData *PrefsTreeCtrl::FindModuleConfig( ConfigTreeData *config_data )
{
/* We need this complexity because submodules don't have their own config
* options. They use the parent module ones. */
if( !config_data || !config_data->b_submodule )
{
return config_data;
}
long cookie, cookie2;
ConfigTreeData *config_new;
wxTreeItemId item = GetFirstChild( plugins_item, cookie );
for( size_t i_child_index = 0;
i_child_index < GetChildrenCount( plugins_item, FALSE );
i_child_index++ )
{
wxTreeItemId item2 = GetFirstChild( item, cookie2 );
for( size_t i_child_index = 0;
i_child_index < GetChildrenCount( item, FALSE );
i_child_index++ )
{
config_new = (ConfigTreeData *)GetItemData( item2 );
if( config_new && !config_new->b_submodule &&
config_new->i_object_id == config_data->i_object_id )
{
return config_new;
}
item2 = GetNextChild( item, cookie2 );
......@@ -588,13 +621,17 @@ void PrefsTreeCtrl::CleanChanges()
item = GetNextChild( plugins_item, cookie );
}
/* Found nothing */
return NULL;
}
void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event )
{
ConfigTreeData *config_data;
config_data = (ConfigTreeData *)GetItemData( event.GetOldItem() );
config_data = FindModuleConfig( (ConfigTreeData *)GetItemData(
event.GetOldItem() ) );
if( config_data && config_data->panel )
{
config_data->panel->Hide();
......@@ -602,7 +639,8 @@ void PrefsTreeCtrl::OnSelectTreeItem( wxTreeEvent& event )
}
/* Don't use event.GetItem() because we also send fake events */
config_data = (ConfigTreeData *)GetItemData( GetSelection() );
config_data = FindModuleConfig( (ConfigTreeData *)GetItemData(
GetSelection() ) );
if( config_data )
{
if( !config_data->panel )
......
......@@ -2,7 +2,7 @@
* dummy.c : dummy plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: dummy.c,v 1.7 2003/05/15 22:27:37 massiot Exp $
* $Id: dummy.c,v 1.8 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -50,15 +50,13 @@
#endif
vlc_module_begin();
set_description( _("dummy functions") );
set_description( _("dummy interface function") );
set_capability( "interface", 0 );
add_shortcut( "vlc" );
add_submodule();
set_description( _("dummy interface function") );
set_capability( "interface", 0 );
set_callbacks( E_(OpenIntf), NULL );
set_callbacks( E_(OpenIntf), NULL );
#ifdef WIN32
add_category_hint( N_("Interface"), NULL, VLC_FALSE );
add_bool( "dummy-quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_FALSE );
add_category_hint( N_("Interface"), NULL, VLC_FALSE );
add_bool( "dummy-quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_FALSE );
#endif
add_submodule();
set_description( _("dummy access function") );
......
......@@ -2,7 +2,7 @@
* sap.c : SAP interface module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.12 2003/06/16 15:39:11 zorglub Exp $
* $Id: sap.c,v 1.13 2003/06/17 16:09:16 gbazin Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
*
......@@ -62,6 +62,12 @@
# endif
#endif
#ifdef UNDER_CE
# define close(a) CloseHandle(a);
#elif defined( WIN32 )
# define close(a) closesocket(a);
#endif
#include "network.h"
#define MAX_LINE_LENGTH 256
......@@ -217,15 +223,7 @@ static void Run( intf_thread_t *p_intf )
}
/* Closing socket */
#ifdef UNDER_CE
CloseHandle( socket_desc.i_handle );
#elif defined( WIN32 )
closesocket( socket_desc.i_handle );
#else
close( socket_desc.i_handle );
#endif
}
/********************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment