Commit 270c4994 authored by Gildas Bazin's avatar Gildas Bazin

* modules/gui/wxwindows/*: added skeleton for popup contextual menu.
* modules/access/dvdplay/access.c, modules/audio_filter/resampler/linear.c: a couple of warning
fixes.
parent 0e7efe76
......@@ -2,7 +2,7 @@
* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: access.c,v 1.7 2002/12/06 16:34:04 sam Exp $
* $Id: access.c,v 1.8 2002/12/13 01:50:32 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -301,7 +301,7 @@ static int dvdplay_SetArea( input_thread_t * p_input, input_area_t * p_area )
* Chapter selection
*/
if( p_area->i_part != dvdplay_chapter_cur( p_dvd->vmg ) )
if( (int)p_area->i_part != dvdplay_chapter_cur( p_dvd->vmg ) )
{
if( ( p_area->i_part > 0 ) &&
( p_area->i_part <= p_area->i_part_nb ))
......
......@@ -2,7 +2,7 @@
* linear.c : linear interpolation resampler
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: linear.c,v 1.6 2002/11/20 16:43:32 sam Exp $
* $Id: linear.c,v 1.7 2002/12/13 01:50:31 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
......@@ -47,7 +47,7 @@ struct aout_filter_sys_t
{
int32_t *p_prev_sample; /* this filter introduces a 1 sample delay */
int i_remainder; /* remainder of previous sample */
unsigned int i_remainder; /* remainder of previous sample */
audio_date_t end_date;
};
......
......@@ -2,7 +2,8 @@ SOURCES_wxwindows = \
modules/gui/wxwindows/wxwindows.cpp \
modules/gui/wxwindows/wxwindows.h \
modules/gui/wxwindows/interface.cpp \
modules/gui/wxwindows/playlist.cpp \
modules/gui/wxwindows/playlist.cpp \
modules/gui/wxwindows/popup.cpp \
modules/gui/wxwindows/timer.cpp \
$(NULL)
......
/*****************************************************************************
* popup.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: popup.cpp,v 1.1 2002/12/13 01:50:32 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <errno.h> /* ENOMEM */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#ifdef WIN32 /* mingw32 hack */
#undef Yield
#undef CreateDialog
#endif
/* Let vlc take care of the i18n stuff */
#define WXINTL_NO_GETTEXT_MACRO
#include <wx/wxprec.h>
#include <wx/wx.h>
#include <wx/listctrl.h>
#include <vlc/intf.h>
#include "wxwindows.h"
/*****************************************************************************
* Event Table.
*****************************************************************************/
/* IDs for the controls and the menu commands */
enum
{
/* menu items */
Close_Event = 1,
MenuEntry_Event,
MenuDummy_Event
};
BEGIN_EVENT_TABLE(PopupMenu, wxMenu)
/* Menu events */
EVT_MENU(Close_Event, PopupMenu::OnClose)
EVT_MENU(MenuEntry_Event, PopupMenu::OnEntrySelected)
END_EVENT_TABLE()
/*****************************************************************************
* Constructor.
*****************************************************************************/
PopupMenu::PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface ):
wxMenu( "VideoLan" )
{
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
Append(MenuEntry_Event, "Dummy1");
Append(MenuEntry_Event, "Dummy2");
Append(MenuDummy_Event, "&Dummy sub menu",
CreateDummyMenu(), "Dummy sub menu help");
Append(MenuEntry_Event, "Dummy3", "", TRUE);
AppendSeparator();
Append( Close_Event, _("&Close") );
wxPoint mousepos = wxGetMousePosition();
p_main_interface->PopupMenu( this, mousepos.x, mousepos.y );
}
PopupMenu::~PopupMenu()
{
}
/*****************************************************************************
* Private methods.
*****************************************************************************/
void PopupMenu::OnClose( wxCommandEvent& WXUNUSED(event) )
{
p_intf->b_die = VLC_TRUE;
}
void PopupMenu::OnEntrySelected( wxCommandEvent& WXUNUSED(event) )
{
}
wxMenu *PopupMenu::CreateDummyMenu()
{
wxMenu *menu = new wxMenu;
menu->Append(MenuEntry_Event, "Sub Dummy1");
menu->AppendSeparator();
menu->Append(MenuEntry_Event, "Sub Dummy2", "", TRUE);
return menu;
}
......@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.5 2002/11/23 16:17:12 gbazin Exp $
* $Id: timer.cpp,v 1.6 2002/12/13 01:50:32 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -104,6 +104,7 @@ void Timer::Notify()
/* If the "display popup" flag has changed */
if( p_intf->b_menu_change )
{
new PopupMenu( p_intf, p_main_interface );
p_intf->b_menu_change = 0;
}
......
......@@ -2,7 +2,7 @@
* wxwindows.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: wxwindows.cpp,v 1.7 2002/12/08 19:56:04 gbazin Exp $
* $Id: wxwindows.cpp,v 1.8 2002/12/13 01:50:32 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -118,7 +118,7 @@ static int Open( vlc_object_t *p_this )
p_intf->p_sys->b_slider_free = 1;
p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0;
p_intf->p_sys->i_part = -1;
p_intf->p_sys->i_part = 0;
return VLC_SUCCESS;
}
......
......@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.4 2002/12/08 19:56:04 gbazin Exp $
* $Id: wxwindows.h,v 1.5 2002/12/13 01:50:32 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -71,7 +71,7 @@ struct intf_sys_t
int i_playing; /* playlist selected item */
/* The window labels for DVD mode */
int i_part; /* current chapter */
unsigned int i_part; /* current chapter */
};
/*****************************************************************************
......@@ -180,3 +180,24 @@ private:
intf_thread_t *p_intf;
};
#endif
/* Popup contextual menu */
class PopupMenu: public wxMenu
{
public:
/* Constructor */
PopupMenu( intf_thread_t *p_intf, Interface *p_main_interface );
virtual ~PopupMenu();
private:
/* Event handlers (these functions should _not_ be virtual) */
void OnClose( wxCommandEvent& event );
void OnEntrySelected( wxCommandEvent& event );
wxMenu *PopupMenu::CreateDummyMenu();
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
Interface *p_main_interface;
};
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