]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*: added skeleton for popup contextual menu.
authorGildas Bazin <gbazin@videolan.org>
Fri, 13 Dec 2002 01:50:32 +0000 (01:50 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 13 Dec 2002 01:50:32 +0000 (01:50 +0000)
* modules/access/dvdplay/access.c, modules/audio_filter/resampler/linear.c: a couple of warning
fixes.

modules/access/dvdplay/access.c
modules/audio_filter/resampler/linear.c
modules/gui/wxwindows/Modules.am
modules/gui/wxwindows/popup.cpp [new file with mode: 0644]
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/wxwindows.cpp
modules/gui/wxwindows/wxwindows.h

index 3afedf4655d5a81e49875acdfb55caeacc898c2b..7638e19704994ac3525c40c795a609ff619b2b4f 100644 (file)
@@ -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: Stéphane 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 ))
index cc2005f93c59e6f08e5780c53f0f571a603416f3..7081836f99cd0e1d0837bf4f91dd32a8e49009b3 100644 (file)
@@ -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;
 };
index 3d0845de5dc5bd676cd9db47119acdff395ddf71..bb070aacf8e90253888275c5e08612f9e5487f02 100644 (file)
@@ -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)
 
diff --git a/modules/gui/wxwindows/popup.cpp b/modules/gui/wxwindows/popup.cpp
new file mode 100644 (file)
index 0000000..32fcb07
--- /dev/null
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * 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;
+}
index bb06a7c7a0c77cfdd44461d99f2d73ab67fba59a..bda95c99bffdc85b014cdcf3254ee6274d971ae9 100644 (file)
@@ -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;
     }
 
index fdf009bd1e775226879daaa70b10b5345aa12012..ed2d351fc7303a8550673cd8d5506ea6b1eaf1b2 100644 (file)
@@ -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;
 }
index 2c0d25590b99781feb95a89430f1999052198ab5..73d9ba8c507c97a873befbec58e29f7f359fd9b9 100644 (file)
@@ -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;
+};