]> git.sesse.net Git - vlc/blobdiff - plugins/mga/intf_mga.c
Removed flooding debug info :)
[vlc] / plugins / mga / intf_mga.c
index 895f98b3507e91b1440eae041ed89f89382cf719..1c6172e4fa962f66c5cbd2734b4aa374bd15e18a 100644 (file)
@@ -2,6 +2,7 @@
  * intf_mga.c: MGA interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
+ * $Id: intf_mga.c,v 1.7 2001/01/15 06:18:23 sam Exp $
  *
  * Authors:
  *
@@ -28,8 +29,6 @@
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdlib.h>                                                /* free() */
 #include <string.h>                                            /* strerror() */
-#include <sys/types.h>                        /* on BSD, uio.h needs types.h */
-#include <sys/uio.h>                                          /* for input.h */
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -41,7 +40,9 @@
 #include "mtime.h"
 #include "plugins.h"
 
-#include "input.h"
+#include "stream_control.h"
+#include "input_ext-intf.h"
+
 #include "video.h"
 #include "video_output.h"
 
@@ -90,9 +91,9 @@ static void X11DisableScreenSaver       ( intf_thread_t *p_intf );
 static void X11TogglePointer            ( intf_thread_t *p_intf );
 
 /*****************************************************************************
- * intf_SysCreate: initialize and create window
+ * intf_MGACreate: initialize and create window
  *****************************************************************************/
-int intf_SysCreate( intf_thread_t *p_intf )
+int intf_MGACreate( intf_thread_t *p_intf )
 {
     char       *psz_display;
 
@@ -100,7 +101,7 @@ int intf_SysCreate( intf_thread_t *p_intf )
     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )
     {
-        intf_ErrMsg("error: %s\n", strerror(ENOMEM));
+        intf_ErrMsg("error: %s", strerror(ENOMEM));
         return( 1 );
     }
 
@@ -109,7 +110,7 @@ int intf_SysCreate( intf_thread_t *p_intf )
     p_intf->p_sys->p_display = XOpenDisplay( psz_display );
     if( !p_intf->p_sys->p_display )                                 /* error */
     {
-        intf_ErrMsg("error: can't open display %s\n", psz_display );
+        intf_ErrMsg("error: can't open display %s", psz_display );
         free( p_intf->p_sys );
         return( 1 );
     }
@@ -119,7 +120,7 @@ int intf_SysCreate( intf_thread_t *p_intf )
      * but also command buttons, subtitles and other indicators */
     if( X11CreateWindow( p_intf ) )
     {
-        intf_ErrMsg("error: can't create interface window\n" );
+        intf_ErrMsg("error: can't create interface window" );
         XCloseDisplay( p_intf->p_sys->p_display );
         free( p_intf->p_sys );
         return( 1 );
@@ -133,7 +134,7 @@ int intf_SysCreate( intf_thread_t *p_intf )
                                             p_intf->p_sys->i_height, NULL, 0, NULL );
         if( p_intf->p_vout == NULL )                                /* error */
         {
-            intf_ErrMsg("error: can't create video output thread\n" );
+            intf_ErrMsg("error: can't create video output thread" );
             X11DestroyWindow( p_intf );
             XCloseDisplay( p_intf->p_sys->p_display );
             free( p_intf->p_sys );
@@ -142,7 +143,11 @@ int intf_SysCreate( intf_thread_t *p_intf )
     }
 
     p_intf->p_sys->b_mouse = 1;
+    
+    /* bind keys */
+    intf_AssignNormalKeys( p_intf );
 
+    
     /* Disable screen saver and return */
     p_intf->p_sys->i_ss_count = 1;
     X11DisableScreenSaver( p_intf );
@@ -150,9 +155,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
 }
 
 /*****************************************************************************
- * intf_SysDestroy: destroy interface window
+ * intf_MGADestroy: destroy interface window
  *****************************************************************************/
-void intf_SysDestroy( intf_thread_t *p_intf )
+void intf_MGADestroy( intf_thread_t *p_intf )
 {
     /* Enable screen saver */
     X11EnableScreenSaver( p_intf );
@@ -179,9 +184,9 @@ void intf_SysDestroy( intf_thread_t *p_intf )
 
 
 /*****************************************************************************
- * intf_SysManage: event loop
+ * intf_MGAManage: event loop
  *****************************************************************************/
-void intf_SysManage( intf_thread_t *p_intf )
+void intf_MGAManage( intf_thread_t *p_intf )
 {
     /* Manage main window */
     X11ManageWindow( p_intf );
@@ -244,7 +249,7 @@ static int X11CreateWindow( intf_thread_t *p_intf )
                              &p_intf->p_sys->wm_delete_window, 1 ) )
     {
         /* WM_DELETE_WINDOW is not supported by window manager */
-        intf_Msg("error: missing or bad window manager - please exit program kindly.\n");
+        intf_Msg("intf error: missing or bad window manager - please exit program kindly.");
     }
 
     /* Creation of a graphic context that doesn't generate a GraphicsExpose event
@@ -349,7 +354,7 @@ static void X11ManageWindow( intf_thread_t *p_intf )
         /* DestroyNotify event: window has been destroyed */
         else if( xevent.type == DestroyNotify )
         {
-            intf_ErrMsg( "vout: window destroyed !\n");
+            intf_ErrMsg( "vout: window destroyed !");
         }
         /* Keyboard event */
         else if( xevent.type == KeyPress )
@@ -358,7 +363,7 @@ static void X11ManageWindow( intf_thread_t *p_intf )
             {
                 if( intf_ProcessKey( p_intf, i_key ) )
                 {
-                    intf_DbgMsg("unhandled key '%c' (%i)\n", (char) i_key, i_key );
+                    intf_DbgMsg("unhandled key '%c' (%i)", (char) i_key, i_key );
                 }
             }
         }
@@ -392,13 +397,13 @@ static void X11ManageWindow( intf_thread_t *p_intf )
                  && (xevent.xclient.data.l[0] == p_intf->p_sys->wm_delete_window ) )
         {
             /* FIXME: this never happens :( how to receive wm messages ?? */
-            intf_DbgMsg("ClientMessage received\n");
+            intf_DbgMsg("ClientMessage received");
         }
 #ifdef DEBUG
         /* Other event */
         else
         {
-            intf_DbgMsg("%p -> unhandled event type %d received\n", p_intf, xevent.type );
+            intf_DbgMsg("%p -> unhandled event type %d received", p_intf, xevent.type );
         }
 #endif
     }
@@ -411,7 +416,7 @@ static void X11ManageWindow( intf_thread_t *p_intf )
         if( b_resized )
         {
             /* If interface window has been resized, change vout size */
-            intf_DbgMsg("resizing output window\n");
+            intf_DbgMsg("resizing output window");
             vlc_mutex_lock( &p_intf->p_vout->change_lock );
             p_intf->p_vout->i_width =  p_intf->p_sys->i_width;
             p_intf->p_vout->i_height = p_intf->p_sys->i_height;
@@ -422,7 +427,7 @@ static void X11ManageWindow( intf_thread_t *p_intf )
                  (p_intf->p_vout->i_height != p_intf->p_sys->i_height) )
         {
            /* If video output size has changed, change interface window size */
-            intf_DbgMsg("resizing interface window\n");
+            intf_DbgMsg("resizing interface window");
             p_intf->p_sys->i_width =    p_intf->p_vout->i_width;
             p_intf->p_sys->i_height =   p_intf->p_vout->i_height;
             XResizeWindow( p_intf->p_sys->p_display, p_intf->p_sys->window,
@@ -444,7 +449,7 @@ void X11EnableScreenSaver( intf_thread_t *p_intf )
 {
     if( p_intf->p_sys->i_ss_count++ == 0 )
     {
-        intf_Msg("Enabling screen saver\n");
+        intf_DbgMsg("intf: enabling screen saver");
         XSetScreenSaver( p_intf->p_sys->p_display, p_intf->p_sys->i_ss_timeout,
                          p_intf->p_sys->i_ss_interval, p_intf->p_sys->i_ss_blanking,
                          p_intf->p_sys->i_ss_exposure );
@@ -466,7 +471,7 @@ void X11DisableScreenSaver( intf_thread_t *p_intf )
                          &p_intf->p_sys->i_ss_exposure );
 
         /* Disable screen saver */
-        intf_Msg("Disabling screen saver\n");
+        intf_DbgMsg("intf: disabling screen saver");
         XSetScreenSaver( p_intf->p_sys->p_display, 0,
                          p_intf->p_sys->i_ss_interval, p_intf->p_sys->i_ss_blanking,
                          p_intf->p_sys->i_ss_exposure );