]> git.sesse.net Git - vlc/blobdiff - plugins/beos/intf_beos.cpp
* Ported Glide and MGA plugins to the new module API. MGA never worked,
[vlc] / plugins / beos / intf_beos.cpp
index de4852e7fefbbada26b22e120cab8f5bb84e5118..1ff3d8b466e5d03441f578d11df6fb11c47952bd 100644 (file)
@@ -2,7 +2,7 @@
  * intf_beos.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: intf_beos.cpp,v 1.8 2001/02/18 03:32:02 polux Exp $
+ * $Id: intf_beos.cpp,v 1.10 2001/02/20 07:49:12 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -22,6 +22,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#define MODULE_NAME beos
+#include "modules_inner.h"
+
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
 
 #include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
+
 #include <kernel/OS.h>
+#include <storage/Path.h>
 #include <View.h>
 #include <Application.h>
 #include <Message.h>
+#include <NodeInfo.h>
 #include <Locker.h>
 #include <DirectWindow.h>
+
 #include <malloc.h>
 #include <string.h>
 
@@ -48,6 +55,7 @@ extern "C"
 #include "modules.h"
 
 #include "intf_msg.h"
+#include "intf_plst.h"
 #include "interface.h"
 
 #include "main.h"
@@ -68,10 +76,10 @@ typedef struct intf_sys_s
  * InterfaceWindow
  *****************************************************************************/
  
-InterfaceWindow::InterfaceWindow( BRect frame, const char *name , intf_thread_t  *p_intf )
-    : BWindow(frame, name, B_TITLED_WINDOW, B_NOT_RESIZABLE|B_NOT_ZOOMABLE)
+InterfaceWindow::InterfaceWindow( BRect frame, const char *name , intf_thread_t  *p_interface )
+    : BWindow(frame, name, B_TITLED_WINDOW, B_NOT_ZOOMABLE)
 {
-    p_interface = p_intf;
+    p_intf = p_interface;
     SetName( "interface" );
     
     BView * p_view;
@@ -98,9 +106,24 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
     {
     case B_KEY_DOWN:
         p_message->FindString( "bytes", (const char **)&psz_key );
-        p_interface->p_sys->i_key = psz_key[0];
+        p_intf->p_sys->i_key = psz_key[0];
         break;
         
+    case B_SIMPLE_DATA:
+        {
+            entry_ref ref;
+            if( p_message->FindRef( "refs", &ref ) == B_OK )
+            {
+                BPath path( &ref );
+                char * psz_name = strdup(path.Path());
+                intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'",
+                              psz_name );
+                intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_name );
+            }
+
+        }
+        break;
+
     default:
         BWindow::MessageReceived( p_message );
         break;
@@ -113,10 +136,11 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
 
 bool InterfaceWindow::QuitRequested()
 {
+    p_intf->b_die = 1;
+
     return( false );
 }
 
-
 extern "C"
 {
 
@@ -132,7 +156,7 @@ static void intf_Run       ( intf_thread_t *p_intf );
  * Functions exported as capabilities. They are declared as static so that
  * we don't pollute the namespace too much.
  *****************************************************************************/
-void intf_getfunctions( function_list_t * p_function_list )
+void _M( intf_getfunctions )( function_list_t * p_function_list )
 {
     p_function_list->pf_probe = intf_Probe;
     p_function_list->functions.intf.pf_open  = intf_Open;