]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/playlist.hpp
playlist.cpp, playlist.hpp: fix segfault when destroying playlist drop target (and...
[vlc] / modules / gui / wxwidgets / dialogs / playlist.hpp
index 4f3129cb4025376fedef2d1ad98e0d3ab09391c6..0c5461b67951f72470ca0fbf0ca39ad18451b878 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 1999-2005 the VideoLAN team
  * $Id$
  *
- * Authors: Clément Stenac <zorglub@videolan.org>
+ * Authors: Clément Stenac <zorglub@videolan.org>
  *
  * 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
@@ -27,6 +27,7 @@
 #include "wxwidgets.hpp"
 
 #include <wx/treectrl.h>
+#include <wx/dnd.h>
 
 #define MODE_NONE 0
 #define MODE_GROUP 1
@@ -58,6 +59,8 @@ public:
     bool b_need_update;
     int  i_items_to_append;
 
+    int GetCurrentView( ){ return i_current_view; };
+
 private:
     void RemoveItem( int );
     void DeleteTreeItem( wxTreeItemId );
@@ -115,6 +118,10 @@ private:
     void OnKeyDown( wxTreeEvent& event );
     void OnNewGroup( wxCommandEvent& event );
 
+    void OnDragItemBegin( wxTreeEvent& event );
+    void OnDragItemEnd( wxTreeEvent& event );
+    wxTreeItemId draged_tree_item;
+
     /* Popup  */
     wxMenu *item_popup;
     wxMenu *node_popup;
@@ -128,7 +135,10 @@ private:
     void OnPopupDel( wxCommandEvent& event );
     void OnPopupEna( wxCommandEvent& event );
     void OnPopupInfo( wxCommandEvent& event );
+    void OnPopupAddNode( wxCommandEvent& event );
+protected:
     void Rebuild( vlc_bool_t );
+private:
 
     void Preparse();
 
@@ -147,9 +157,10 @@ private:
     wxTreeItemId saved_tree_item;
     int i_saved_id;
 
+protected:
     playlist_t *p_playlist;
 
-
+private:
     /* Custom events */
     void OnPlaylistEvent( wxCommandEvent& event );
 
@@ -162,14 +173,29 @@ private:
 
     int i_update_counter;
 
+    vlc_bool_t b_changed_view;
+    char **pp_sds;
+
+protected:
     intf_thread_t *p_intf;
     wxTreeCtrl *treectrl;
     int i_current_view;
-    vlc_bool_t b_changed_view;
-    char **pp_sds;
 
+friend class PlaylistFileDropTarget;
+};
 
+#if wxUSE_DRAG_AND_DROP
+/* Playlist file drop target */
+class PlaylistFileDropTarget: public wxFileDropTarget
+{
+public:
+    PlaylistFileDropTarget( Playlist * );
+    virtual bool OnDropFiles( wxCoord x, wxCoord y,
+                              const wxArrayString& filenames );
+private:
+    Playlist *p;
 };
+#endif
 
 } // end of wxvlc namespace