1 /*****************************************************************************
2 * vlcshell.cpp: a VLC plugin for Mozilla
3 *****************************************************************************
4 * Copyright (C) 2002-2009 the VideoLAN team
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 * Jean-Paul Saman <jpsaman@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
35 #ifdef HAVE_MOZILLA_CONFIG_H
36 # include <mozilla-config.h>
39 /* This is from mozilla java, do we really need it? */
44 #include "vlcplugin.h"
47 /* Enable/disable debugging printf's for X11 resizing */
48 #undef X11_RESIZE_DEBUG
50 #define WINDOW_TEXT "Waiting for video"
52 /*****************************************************************************
53 * Unix-only declarations
54 ******************************************************************************/
57 static void Redraw( Widget w, XtPointer closure, XEvent *event );
58 static void ControlHandler( Widget w, XtPointer closure, XEvent *event );
59 static void Resize( Widget w, XtPointer closure, XEvent *event );
63 /*****************************************************************************
64 * MacOS-only declarations
65 ******************************************************************************/
69 /*****************************************************************************
70 * Windows-only declarations
71 *****************************************************************************/
74 static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar );
78 /******************************************************************************
80 *****************************************************************************/
81 char * NPP_GetMIMEDescription( void )
83 static char mimetype[] = PLUGIN_MIMETYPES;
87 NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
89 static char psz_name[] = PLUGIN_NAME;
90 static char psz_desc[1000];
92 /* plugin class variables */
95 case NPPVpluginNameString:
96 *((char **)value) = psz_name;
97 return NPERR_NO_ERROR;
99 case NPPVpluginDescriptionString:
100 snprintf( psz_desc, sizeof(psz_desc), PLUGIN_DESCRIPTION,
101 libvlc_get_version() );
102 *((char **)value) = psz_desc;
103 return NPERR_NO_ERROR;
106 /* move on to instance variables ... */
110 if( instance == NULL )
112 return NPERR_INVALID_INSTANCE_ERROR;
115 /* plugin instance variables */
117 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
118 if( NULL == p_plugin )
120 // plugin has not been initialized yet !
121 return NPERR_INVALID_INSTANCE_ERROR;
126 case NPPVpluginScriptableNPObject:
128 /* retrieve plugin root class */
129 NPClass *scriptClass = p_plugin->getScriptClass();
132 /* create an instance and return it */
133 *(NPObject**)value = NPN_CreateObject(instance, scriptClass);
134 return NPERR_NO_ERROR;
142 return NPERR_GENERIC_ERROR;
146 * there is some confusion in gecko headers regarding definition of this API
147 * NPPVariable is wrongly defined as NPNVariable, which sounds incorrect.
150 NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value )
152 return NPERR_GENERIC_ERROR;
155 /******************************************************************************
157 *****************************************************************************/
159 int16 NPP_HandleEvent( NPP instance, void * event )
161 static UInt32 lastMouseUp = 0;
162 libvlc_exception_t ex;
163 libvlc_exception_init(&ex);
165 if( instance == NULL )
170 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
171 if( p_plugin == NULL )
176 EventRecord *myEvent = (EventRecord*)event;
178 switch( myEvent->what )
184 if( (myEvent->when - lastMouseUp) < GetDblTime() )
187 p_plugin->toggle_fullscreen(&ex);
188 libvlc_exception_clear(&ex);
193 lastMouseUp = myEvent->when;
201 const NPWindow& npwindow = p_plugin->getWindow();
202 if( npwindow.window )
206 if( p_plugin->playlist_isplaying(&ex) )
208 hasVout = p_plugin->player_has_vout(NULL);
212 libvlc_rectangle_t area;
215 area.right = npwindow.width;
216 area.bottom = npwindow.height;
217 libvlc_video_redraw_rectangle(p_plugin->getMD(&ex), &area, NULL);
219 #warning disabled code
223 libvlc_exception_clear(&ex);
227 /* draw the beautiful "No Picture" */
229 ForeColor(blackColor);
232 /* seems that firefox forgets to set the following
233 * on occasion (reload) */
234 SetOrigin(((NP_Port *)npwindow.window)->portx,
235 ((NP_Port *)npwindow.window)->porty);
240 rect.right = npwindow.width;
241 rect.bottom = npwindow.height;
244 ForeColor(whiteColor);
245 MoveTo( (npwindow.width-80)/ 2 , npwindow.height / 2 );
246 DrawText( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) );
253 case NPEventType_GetFocusEvent:
254 case NPEventType_LoseFocusEvent:
256 case NPEventType_AdjustCursorEvent:
258 case NPEventType_MenuCommandEvent:
260 case NPEventType_ClippingChangedEvent:
262 case NPEventType_ScrollingBeginsEvent:
264 case NPEventType_ScrollingEndsEvent:
271 #endif /* XP_MACOSX */
273 /******************************************************************************
274 * General Plug-in Calls
275 *****************************************************************************/
276 NPError NPP_Initialize( void )
278 return NPERR_NO_ERROR;
281 jref NPP_GetJavaClass( void )
286 void NPP_Shutdown( void )
291 NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
292 char* argn[], char* argv[], NPSavedData* saved )
296 if( instance == NULL )
298 return NPERR_INVALID_INSTANCE_ERROR;
301 VlcPlugin * p_plugin = new VlcPlugin( instance, mode );
302 if( NULL == p_plugin )
304 return NPERR_OUT_OF_MEMORY_ERROR;
307 status = p_plugin->init(argc, argn, argv);
308 if( NPERR_NO_ERROR == status )
310 instance->pdata = reinterpret_cast<void*>(p_plugin);
312 NPN_SetValue(instance, NPPVpluginWindowBool, (void *)false);
313 NPN_SetValue(instance, NPPVpluginTransparentBool, (void *)false);
323 NPError NPP_Destroy( NPP instance, NPSavedData** save )
325 if( NULL == instance )
326 return NPERR_INVALID_INSTANCE_ERROR;
328 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
329 if( NULL == p_plugin )
330 return NPERR_NO_ERROR;
332 instance->pdata = NULL;
335 HWND win = (HWND)p_plugin->getWindow().window;
336 WNDPROC winproc = p_plugin->getWindowProc();
340 SetWindowLong( win, GWL_WNDPROC, (LONG)winproc );
344 libvlc_exception_t ex;
345 libvlc_exception_init(&ex);
346 int val = p_plugin->playlist_isplaying(&ex);
347 libvlc_exception_clear(&ex);
350 p_plugin->playlist_stop(&ex);
351 libvlc_exception_clear(&ex);
356 return NPERR_NO_ERROR;
359 NPError NPP_SetWindow( NPP instance, NPWindow* window )
361 #if defined(XP_UNIX) && !defined(__APPLE__)
363 unsigned int i_control_height = 0, i_control_width = 0;
368 return NPERR_INVALID_INSTANCE_ERROR;
371 /* NPP_SetWindow may be called before NPP_New (Opera) */
372 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
373 if( NULL == p_plugin )
375 /* we should probably show a splash screen here */
376 return NPERR_NO_ERROR;
379 #if defined(XP_UNIX) && !defined(__APPLE__)
380 control = p_plugin->getControlWindow();
383 libvlc_exception_t ex;
384 libvlc_exception_init(&ex);
386 libvlc_instance_t *p_vlc = p_plugin->getVLC();
390 * Before setting window to point to the
391 * new window, you may wish to compare the new window
392 * info to the previous window (if any) to note window
396 /* retrieve current window */
397 NPWindow& curwin = p_plugin->getWindow();
400 if( window && window->window )
402 /* check if plugin has a new parent window */
403 CGrafPtr drawable = (((NP_Port*) (window->window))->port);
405 /* as MacOS X video output is windowless, set viewport */
406 libvlc_rectangle_t view, clip;
409 ** browser sets port origin to top-left location of plugin
410 ** relative to GrafPort window origin is set relative to document,
411 ** which of little use for drawing
413 view.top = ((NP_Port*) (window->window))->porty;
414 view.left = ((NP_Port*) (window->window))->portx;
415 view.bottom = window->height+view.top;
416 view.right = window->width+view.left;
418 /* clipRect coordinates are also relative to GrafPort */
419 clip.top = window->clipRect.top;
420 clip.left = window->clipRect.left;
421 clip.bottom = window->clipRect.bottom;
422 clip.right = window->clipRect.right;
424 libvlc_video_set_viewport(p_vlc, p_plugin->getMD(&ex), &view, &clip, &ex);
425 libvlc_exception_clear(&ex);
427 #warning disabled code
429 /* remember new window */
430 p_plugin->setWindow(*window);
432 else if( curwin.window )
434 /* change/set parent */
435 curwin.window = NULL;
437 #endif /* XP_MACOSX */
440 if( window && window->window )
442 /* check if plugin has a new parent window */
443 HWND drawable = (HWND) (window->window);
444 if( !curwin.window || drawable != curwin.window )
446 /* reset previous window settings */
447 HWND oldwin = (HWND)p_plugin->getWindow().window;
448 WNDPROC oldproc = p_plugin->getWindowProc();
452 SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
454 /* attach our plugin object */
455 SetWindowLongPtr((HWND)drawable, GWLP_USERDATA,
456 reinterpret_cast<LONG_PTR>(p_plugin));
458 /* install our WNDPROC */
459 p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
460 GWL_WNDPROC, (LONG)Manage ) );
462 /* change window style to our liking */
463 LONG style = GetWindowLong((HWND)drawable, GWL_STYLE);
464 style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
465 SetWindowLong((HWND)drawable, GWL_STYLE, style);
467 /* remember new window */
468 p_plugin->setWindow(*window);
471 InvalidateRect( (HWND)drawable, NULL, TRUE );
472 UpdateWindow( (HWND)drawable );
475 else if( curwin.window )
478 HWND oldwin = (HWND)curwin.window;
479 SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
480 p_plugin->setWindowProc(NULL);
482 curwin.window = NULL;
487 /* default to hidden toolbar, shown at the end of this method if asked *
488 * developers note : getToolbarSize need to wait the end of this method
490 i_control_height = 0;
491 i_control_width = window->width;
493 if( window && window->window )
495 Window parent = (Window) window->window;
496 if( !curwin.window || (parent != (Window)curwin.window) )
498 Display *p_display = ( (NPSetWindowCallbackStruct *)
499 window->ws_info )->display;
501 XResizeWindow( p_display, parent, window->width, window->height );
503 int i_blackColor = BlackPixel(p_display, DefaultScreen(p_display));
506 Window video = XCreateSimpleWindow( p_display, parent, 0, 0,
507 window->width, window->height - i_control_height,
508 0, i_blackColor, i_blackColor );
509 Window controls = (Window) NULL;
510 controls = XCreateSimpleWindow( p_display, parent,
511 0, window->height - i_control_height-1,
512 window->width, i_control_height-1,
513 0, i_blackColor, i_blackColor );
515 XMapWindow( p_display, parent );
516 XMapWindow( p_display, video );
517 if( controls ) { XMapWindow( p_display, controls ); }
522 Widget w = XtWindowToWidget( p_display, parent );
524 XtAddEventHandler( w, ExposureMask, FALSE,
525 (XtEventHandler)Redraw, p_plugin );
526 XtAddEventHandler( w, StructureNotifyMask, FALSE,
527 (XtEventHandler)Resize, p_plugin );
528 XtAddEventHandler( w, ButtonReleaseMask, FALSE,
529 (XtEventHandler)ControlHandler, p_plugin );
531 /* remember window */
532 p_plugin->setWindow( *window );
533 p_plugin->setVideoWindow( video );
537 p_plugin->setControlWindow( controls );
540 Redraw( w, (XtPointer)p_plugin, NULL );
542 /* now display toolbar if asked through parameters */
543 if( p_plugin->b_toolbar )
545 p_plugin->showToolbar();
549 else if( curwin.window )
551 curwin.window = NULL;
555 if( !p_plugin->b_stream )
557 if( p_plugin->psz_target )
559 if( p_plugin->playlist_add( p_plugin->psz_target, NULL ) != -1 )
561 if( p_plugin->b_autoplay )
563 p_plugin->playlist_play(NULL);
566 p_plugin->b_stream = true;
569 return NPERR_NO_ERROR;
572 NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
573 NPBool seekable, uint16 *stype )
575 if( NULL == instance )
577 return NPERR_INVALID_INSTANCE_ERROR;
580 VlcPlugin *p_plugin = reinterpret_cast<VlcPlugin *>(instance->pdata);
581 if( NULL == p_plugin )
583 return NPERR_INVALID_INSTANCE_ERROR;
587 ** Firefox/Mozilla may decide to open a stream from the URL specified
588 ** in the SRC parameter of the EMBED tag and pass it to us
590 ** since VLC will open the SRC URL as well, we're not interested in
591 ** that stream. Otherwise, we'll take it and queue it up in the playlist
593 if( !p_plugin->psz_target || strcmp(stream->url, p_plugin->psz_target) )
595 /* TODO: use pipes !!!! */
596 *stype = NP_ASFILEONLY;
597 return NPERR_NO_ERROR;
599 return NPERR_GENERIC_ERROR;
602 int32 NPP_WriteReady( NPP instance, NPStream *stream )
608 int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
609 int32 len, void *buffer )
615 NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason )
617 if( instance == NULL )
619 return NPERR_INVALID_INSTANCE_ERROR;
621 return NPERR_NO_ERROR;
624 void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
626 if( instance == NULL )
631 VlcPlugin *p_plugin = reinterpret_cast<VlcPlugin *>(instance->pdata);
632 if( NULL == p_plugin )
637 if( p_plugin->playlist_add( stream->url, NULL ) != -1 )
639 if( p_plugin->b_autoplay )
641 p_plugin->playlist_play(NULL);
646 void NPP_URLNotify( NPP instance, const char* url,
647 NPReason reason, void* notifyData )
649 /***** Insert NPP_URLNotify code here *****\
650 PluginInstance* p_plugin;
651 if (instance != NULL)
652 p_plugin = (PluginInstance*) instance->pdata;
653 \*********************************************/
656 void NPP_Print( NPP instance, NPPrint* printInfo )
658 if( printInfo == NULL )
663 if( instance != NULL )
665 /***** Insert NPP_Print code here *****\
666 PluginInstance* p_plugin = (PluginInstance*) instance->pdata;
667 \**************************************/
669 if( printInfo->mode == NP_FULL )
673 * If your plugin would like to take over
674 * printing completely when it is in full-screen mode,
675 * set printInfo->pluginPrinted to TRUE and print your
676 * plugin as you see fit. If your plugin wants Netscape
677 * to handle printing in this case, set
678 * printInfo->pluginPrinted to FALSE (the default) and
679 * do nothing. If you do want to handle printing
680 * yourself, printOne is true if the print button
681 * (as opposed to the print menu) was clicked.
682 * On the Macintosh, platformPrint is a THPrint; on
683 * Windows, platformPrint is a structure
684 * (defined in npapi.h) containing the printer name, port,
688 /***** Insert NPP_Print code here *****\
689 void* platformPrint =
690 printInfo->print.fullPrint.platformPrint;
692 printInfo->print.fullPrint.printOne;
693 \**************************************/
696 printInfo->print.fullPrint.pluginPrinted = FALSE;
700 /* If not fullscreen, we must be embedded */
703 * If your plugin is embedded, or is full-screen
704 * but you returned false in pluginPrinted above, NPP_Print
705 * will be called with mode == NP_EMBED. The NPWindow
706 * in the printInfo gives the location and dimensions of
707 * the embedded plugin on the printed page. On the
708 * Macintosh, platformPrint is the printer port; on
709 * Windows, platformPrint is the handle to the printing
713 /***** Insert NPP_Print code here *****\
714 NPWindow* printWindow =
715 &(printInfo->print.embedPrint.window);
716 void* platformPrint =
717 printInfo->print.embedPrint.platformPrint;
718 \**************************************/
723 /******************************************************************************
724 * Windows-only methods
725 *****************************************************************************/
727 static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar )
729 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(GetWindowLongPtr(p_hwnd, GWLP_USERDATA));
738 PAINTSTRUCT paintstruct;
742 hdc = BeginPaint( p_hwnd, &paintstruct );
744 GetClientRect( p_hwnd, &rect );
746 FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
747 SetTextColor(hdc, RGB(255, 255, 255));
748 SetBkColor(hdc, RGB(0, 0, 0));
749 DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect,
750 DT_CENTER|DT_VCENTER|DT_SINGLELINE);
752 EndPaint( p_hwnd, &paintstruct );
756 /* delegate to default handler */
757 return CallWindowProc( p_plugin->getWindowProc(), p_hwnd,
763 /******************************************************************************
765 *****************************************************************************/
767 static void Redraw( Widget w, XtPointer closure, XEvent *event )
769 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
770 Window control = p_plugin->getControlWindow();
771 const NPWindow& window = p_plugin->getWindow();
774 unsigned int i_control_height, i_control_width;
776 if( p_plugin->b_toolbar )
777 p_plugin->getToolbarSize( &i_control_width, &i_control_height );
779 i_control_height = i_control_width = 0;
781 Window video = p_plugin->getVideoWindow();
782 Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display;
784 gcv.foreground = BlackPixel( p_display, 0 );
785 gc = XCreateGC( p_display, video, GCForeground, &gcv );
787 XFillRectangle( p_display, video, gc,
788 0, 0, window.width, window.height - i_control_height);
790 gcv.foreground = WhitePixel( p_display, 0 );
791 XChangeGC( p_display, gc, GCForeground, &gcv );
793 XDrawString( p_display, video, gc,
794 window.width / 2 - 40, (window.height - i_control_height) / 2,
795 WINDOW_TEXT, strlen(WINDOW_TEXT) );
796 XFreeGC( p_display, gc );
798 p_plugin->redrawToolbar();
801 static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
803 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
804 const NPWindow& window = p_plugin->getWindow();
806 int i_height = window.height;
807 int i_width = window.width;
808 int i_xPos = event->xbutton.x;
809 int i_yPos = event->xbutton.y;
811 if( p_plugin && p_plugin->b_toolbar )
814 libvlc_exception_t ex;
816 libvlc_exception_init( &ex );
817 libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
818 libvlc_exception_clear( &ex );
820 i_playing = p_plugin->playlist_isplaying( &ex );
821 libvlc_exception_clear( &ex );
823 vlc_toolbar_clicked_t clicked;
824 clicked = p_plugin->getToolbarButtonClicked( i_xPos, i_yPos );
831 p_plugin->playlist_pause( &ex );
833 p_plugin->playlist_play( &ex );
835 libvlc_exception_clear( &ex );
841 p_plugin->playlist_stop(&ex);
842 libvlc_exception_clear( &ex );
846 case clicked_Fullscreen:
848 p_plugin->set_fullscreen( 1, &ex );
849 libvlc_exception_clear( &ex );
856 libvlc_audio_toggle_mute( p_plugin->getVLC(), &ex );
857 libvlc_exception_clear( &ex );
861 case clicked_timeline:
863 /* if a movie is loaded */
867 f_length = libvlc_media_player_get_length( p_md, &ex ) / 100;
868 libvlc_exception_clear( &ex );
870 f_length = (float)f_length *
871 ( ((float)i_xPos-4.0 ) / ( ((float)i_width-8.0)/100) );
873 libvlc_media_player_set_time( p_md, f_length, &ex );
874 libvlc_exception_clear( &ex );
881 /* Not implemented yet*/
885 default: /* button_Unknown */
889 Redraw( w, closure, event );
892 static void Resize ( Widget w, XtPointer closure, XEvent *event )
894 VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
895 Window control = p_plugin->getControlWindow();
896 const NPWindow& window = p_plugin->getWindow();
897 Window drawable = p_plugin->getVideoWindow();
898 Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display;
901 Window root_return, parent_return, * children_return;
903 unsigned int i_nchildren;
904 unsigned int i_control_height, i_control_width;
906 if( p_plugin->b_toolbar )
908 p_plugin->getToolbarSize( &i_control_width, &i_control_height );
912 i_control_height = i_control_width = 0;
915 #ifdef X11_RESIZE_DEBUG
916 XWindowAttributes attr;
918 if( event && event->type == ConfigureNotify )
920 fprintf( stderr, "vlcshell::Resize() ConfigureNotify %d x %d, "
921 "send_event ? %s\n", event->xconfigure.width,
922 event->xconfigure.height,
923 event->xconfigure.send_event ? "TRUE" : "FALSE" );
925 #endif /* X11_RESIZE_DEBUG */
927 if( ! p_plugin->setSize(window.width, (window.height - i_control_height)) )
929 /* size already set */
933 i_ret = XResizeWindow( p_display, drawable,
934 window.width, (window.height - i_control_height) );
936 #ifdef X11_RESIZE_DEBUG
938 "vlcshell::Resize() XResizeWindow(owner) returned %d\n", i_ret );
940 XGetWindowAttributes ( p_display, drawable, &attr );
942 /* X is asynchronous, so the current size reported here is not
943 necessarily the requested size as the Resize request may not
944 yet have been handled by the plugin host */
945 fprintf( stderr, "vlcshell::Resize() current (owner) size %d x %d\n",
946 attr.width, attr.height );
947 #endif /* X11_RESIZE_DEBUG */
949 XQueryTree( p_display, drawable,
950 &root_return, &parent_return, &children_return,
953 if( i_nchildren > 0 )
955 /* XXX: Make assumptions related to the window parenting structure in
956 vlc/modules/video_output/x11/xcommon.c */
957 base_window = children_return[i_nchildren - 1];
959 #ifdef X11_RESIZE_DEBUG
960 fprintf( stderr, "vlcshell::Resize() got %d children\n", i_nchildren );
961 fprintf( stderr, "vlcshell::Resize() got base_window %p\n",
963 #endif /* X11_RESIZE_DEBUG */
965 i_ret = XResizeWindow( p_display, base_window,
966 window.width, ( window.height - i_control_height ) );
968 #ifdef X11_RESIZE_DEBUG
970 "vlcshell::Resize() XResizeWindow(base) returned %d\n",
973 XGetWindowAttributes( p_display, base_window, &attr );
975 fprintf( stderr, "vlcshell::Resize() new size %d x %d\n",
976 attr.width, attr.height );
977 #endif /* X11_RESIZE_DEBUG */