]> git.sesse.net Git - vlc/blob - mozilla/vlcshell.cpp
Reenable dvdcss which was disabled accidently in [16806]. Fix the dvdnav patch to...
[vlc] / mozilla / vlcshell.cpp
1 /*****************************************************************************
2  * vlcshell.cpp: a VLC plugin for Mozilla
3  *****************************************************************************
4  * Copyright (C) 2002-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include "config.h"
28
29 #include <stdio.h>
30 #include <string.h>
31 #include <stdlib.h>
32
33 /* Mozilla stuff */
34 #ifdef HAVE_MOZILLA_CONFIG_H
35 #   include <mozilla-config.h>
36 #endif
37
38 /* This is from mozilla java, do we really need it? */
39 #if 0
40 #include <jri.h>
41 #endif
42
43 #include "vlcplugin.h"
44
45 /* Enable/disable debugging printf's for X11 resizing */
46 #undef X11_RESIZE_DEBUG
47
48 #define WINDOW_TEXT "(no video)"
49
50 /*****************************************************************************
51  * Unix-only declarations
52 ******************************************************************************/
53 #ifdef XP_UNIX
54
55 static void Redraw( Widget w, XtPointer closure, XEvent *event );
56 static void Resize( Widget w, XtPointer closure, XEvent *event );
57
58 #endif
59
60 /*****************************************************************************
61  * MacOS-only declarations
62 ******************************************************************************/
63 #ifdef XP_MACOSX
64 #endif
65
66 /*****************************************************************************
67  * Windows-only declarations
68  *****************************************************************************/
69 #ifdef XP_WIN
70
71 static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar );
72
73 #endif
74
75 /******************************************************************************
76  * UNIX-only API calls
77  *****************************************************************************/
78 char * NPP_GetMIMEDescription( void )
79 {
80     return PLUGIN_MIMETYPES;
81 }
82
83 NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
84 {
85
86     static char psz_desc[1000];
87
88     /* plugin class variables */
89     switch( variable )
90     {
91         case NPPVpluginNameString:
92             *((char **)value) = PLUGIN_NAME;
93             return NPERR_NO_ERROR;
94
95         case NPPVpluginDescriptionString:
96             snprintf( psz_desc, sizeof(psz_desc)-1, PLUGIN_DESCRIPTION, VLC_Version() );
97             psz_desc[sizeof(psz_desc)-1] = 0;
98             *((char **)value) = psz_desc;
99             return NPERR_NO_ERROR;
100
101         default:
102             /* move on to instance variables ... */
103             break;
104     }
105
106     if( instance == NULL )
107     {
108         return NPERR_INVALID_INSTANCE_ERROR;
109     }
110
111     /* plugin instance variables */
112
113     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
114     if( NULL == p_plugin )
115     {
116         // plugin has not been initialized yet !
117         return NPERR_INVALID_INSTANCE_ERROR;
118     }
119
120     switch( variable )
121     {
122         case NPPVpluginScriptableNPObject:
123             /* create an instance and return it */
124             *(NPObject**)value = NPN_CreateObject(instance, p_plugin->getScriptClass());
125             if( NULL == *(NPObject**)value )
126             {
127                 return NPERR_OUT_OF_MEMORY_ERROR;
128             }
129             break;
130
131         default:
132             return NPERR_GENERIC_ERROR;
133     }
134     return NPERR_NO_ERROR;
135 }
136
137 /******************************************************************************
138  * Mac-only API calls
139  *****************************************************************************/
140 #ifdef XP_MACOSX
141 int16 NPP_HandleEvent( NPP instance, void * event )
142 {
143     if( instance == NULL )
144     {
145         return false;
146     }
147
148     VlcPlugin *p_plugin = (VlcPlugin*)instance->pdata;
149     EventRecord *myEvent = (EventRecord*)event;
150
151     switch( myEvent->what )
152     {
153         case nullEvent:
154             break;
155         case mouseDown:
156         case mouseUp:
157             return true;
158         case keyUp:
159         case keyDown:
160         case autoKey:
161             return true;
162         case updateEvt:
163         {
164             int needsDisplay = TRUE;
165             libvlc_instance_t *p_vlc = p_plugin->getVLC();
166
167             if( p_vlc )
168             {
169                 if( libvlc_playlist_isplaying(p_vlc, NULL) )
170                 {
171                     libvlc_input_t *p_input = libvlc_playlist_get_input(p_vlc, NULL);
172                     if( p_input )
173                     {
174                         needsDisplay = ! libvlc_input_has_vout(p_input, NULL);
175                         libvlc_input_free(p_input);
176                     }
177                 }
178             }
179
180             const NPWindow *npwindow = p_plugin->getWindow();
181                 
182             if( needsDisplay && npwindow->window )
183             {
184                 /* draw the beautiful "No Picture" */
185
186                 ForeColor(blackColor);
187                 PenMode( patCopy );
188
189                 /* seems that firefox forgets to set the following on occasion (reload) */
190                 SetOrigin(((NP_Port *)npwindow->window)->portx, ((NP_Port *)npwindow->window)->porty);
191
192                 Rect rect;
193                 rect.left = 0;
194                 rect.top = 0;
195                 rect.right = npwindow->width;
196                 rect.bottom = npwindow->height;
197                 PaintRect( &rect );
198
199                 ForeColor(whiteColor);
200                 MoveTo( (npwindow->width-80)/ 2  , npwindow->height / 2 );
201                 DrawText( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) );
202             }
203             return true;
204         }
205         case activateEvt:
206             return false;
207         case NPEventType_GetFocusEvent:
208         case NPEventType_LoseFocusEvent:
209             return true;
210         case NPEventType_AdjustCursorEvent:
211             return false;
212         case NPEventType_MenuCommandEvent:
213             return false;
214         case NPEventType_ClippingChangedEvent:
215             return false;
216         case NPEventType_ScrollingBeginsEvent:
217         case NPEventType_ScrollingEndsEvent:
218             return true;
219         default:
220             ;
221     }
222     return false;
223 }
224 #endif /* XP_MACOSX */
225
226 /******************************************************************************
227  * General Plug-in Calls
228  *****************************************************************************/
229 NPError NPP_Initialize( void )
230 {
231     return NPERR_NO_ERROR;
232 }
233
234 jref NPP_GetJavaClass( void )
235 {
236     return NULL;
237 }
238
239 void NPP_Shutdown( void )
240 {
241     ;
242 }
243
244 NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
245                  char* argn[], char* argv[], NPSavedData* saved )
246 {
247     NPError status;
248
249     if( instance == NULL )
250     {
251         return NPERR_INVALID_INSTANCE_ERROR;
252     }
253
254     VlcPlugin * p_plugin = new VlcPlugin( instance, mode );
255     if( NULL == p_plugin )
256     {
257         return NPERR_OUT_OF_MEMORY_ERROR;
258     }
259
260     status = p_plugin->init(argc, argn, argv);
261     if( NPERR_NO_ERROR == status ) {
262         instance->pdata = reinterpret_cast<void*>(p_plugin);
263     }
264     else {
265         delete p_plugin;
266     }
267     return status;
268 }
269
270 NPError NPP_Destroy( NPP instance, NPSavedData** save )
271 {
272     if( instance == NULL )
273     {
274         return NPERR_INVALID_INSTANCE_ERROR;
275     }
276
277     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
278
279 #if XP_WIN
280     HWND win = (HWND)p_plugin->getWindow()->window;
281     WNDPROC winproc = p_plugin->getWindowProc();
282     if( winproc )
283     {
284         /* reset WNDPROC */
285         SetWindowLong( win, GWL_WNDPROC, (LONG)winproc );
286     }
287 #endif
288
289     if( p_plugin )
290         delete p_plugin;
291
292     instance->pdata = NULL;
293
294     return NPERR_NO_ERROR;
295 }
296
297 NPError NPP_SetWindow( NPP instance, NPWindow* window )
298 {
299     if( ! instance )
300     {
301         return NPERR_INVALID_INSTANCE_ERROR;
302     }
303
304     /* NPP_SetWindow may be called before NPP_New (Opera) */
305     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
306     if( ! p_plugin )
307     {
308         /* we should probably show a splash screen here */
309         return NPERR_NO_ERROR;
310     }
311
312     libvlc_instance_t *p_vlc = p_plugin->getVLC();
313
314     /*
315      * PLUGIN DEVELOPERS:
316      *  Before setting window to point to the
317      *  new window, you may wish to compare the new window
318      *  info to the previous window (if any) to note window
319      *  size changes, etc.
320      */
321
322     const NPWindow *curwin = p_plugin->getWindow();
323
324 #ifdef XP_MACOSX
325     if( window && window->window )
326     {
327         /* check if plugin has a new parent window */
328         CGrafPtr drawable = (((NP_Port*) (window->window))->port);
329         if( !curwin->window || drawable != (((NP_Port*) (curwin->window))->port) )
330         {
331             /* set/change parent window */
332             libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
333         }
334
335         /* as MacOS X video output is windowless, set viewport */
336         libvlc_rectangle_t view, clip;
337
338         /*
339         ** browser sets port origin to top-left location of plugin relative to GrafPort
340         ** window origin is set relative to document, which of little use for drawing
341         */
342         view.top     = ((NP_Port*) (window->window))->porty;
343         view.left    = ((NP_Port*) (window->window))->portx;
344         view.bottom  = window->height+view.top;
345         view.right   = window->width+view.left;
346         /* clipRect coordinates are also relative to GrafPort */
347         clip.top     = window->clipRect.top;
348         clip.left    = window->clipRect.left;
349         clip.bottom  = window->clipRect.bottom;
350         clip.right   = window->clipRect.right;
351
352         libvlc_video_set_viewport(p_vlc, &view, &clip, NULL);
353
354         /* remember window details */
355         p_plugin->setWindow(window);
356     }
357 #endif /* XP_MACOSX */
358
359 #ifdef XP_WIN
360     if( window && window->window )
361     {
362         /* check if plugin has a new parent window */
363         HWND drawable = (HWND) (window->window);
364         if( !curwin->window || drawable != curwin->window )
365         {
366             /* reset previous window settings */
367             HWND oldwin = (HWND)p_plugin->getWindow()->window;
368             WNDPROC oldproc = p_plugin->getWindowProc();
369             if( oldproc )
370             {
371                 /* reset WNDPROC */
372                 SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
373             }
374             /* attach our plugin object */
375             SetWindowLongPtr((HWND)drawable, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(p_plugin));
376
377             /* install our WNDPROC */
378             p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
379                                                            GWL_WNDPROC, (LONG)Manage ) );
380
381             /* change window style to our liking */
382             LONG style = GetWindowLong((HWND)drawable, GWL_STYLE);
383             style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
384             SetWindowLong((HWND)drawable, GWL_STYLE, style);
385
386             /* change/set parent */
387             libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
388         }
389
390         /* remember window details */
391         p_plugin->setWindow(window);
392
393         /* Redraw window */
394         InvalidateRect( (HWND)drawable, NULL, TRUE );
395         UpdateWindow( (HWND)drawable );
396     }
397     else
398     {
399         /* reset WNDPROC */
400         HWND oldwin = (HWND)curwin->window;
401         SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
402         p_plugin->setWindowProc(NULL);
403         /* change/set parent */
404         libvlc_video_set_parent(p_vlc, 0, NULL);
405     }
406 #endif /* XP_WIN */
407
408 #ifdef XP_UNIX
409     if( window && window->window )
410     {
411         Window  drawable   = (Window) window->window;
412         if( !curwin->window || drawable != (Window)curwin->window )
413         {
414             Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
415
416             XResizeWindow( p_display, drawable, window->width, window->height );
417             Widget w = XtWindowToWidget( p_display, drawable );
418
419             XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin );
420             XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin );
421
422             /* set/change parent window */
423             libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
424
425             /* remember window */
426             p_plugin->setWindow(window);
427
428             Redraw( w, (XtPointer)p_plugin, NULL );
429         }
430     }
431 #endif /* XP_UNIX */
432
433     if( !p_plugin->b_stream )
434     {
435         if( p_plugin->psz_target )
436         {
437             if( VLC_SUCCESS == libvlc_playlist_add( p_vlc, p_plugin->psz_target, NULL, NULL ) )
438             {
439                 if( p_plugin->b_autoplay )
440                 {
441                     libvlc_playlist_play(p_vlc, 0, 0, NULL, NULL);
442                 }
443                 p_plugin->b_stream = VLC_TRUE;
444             }
445         }
446     }
447     return NPERR_NO_ERROR;
448 }
449
450 NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
451                        NPBool seekable, uint16 *stype )
452 {
453     if( NULL == instance  )
454     {
455         return NPERR_INVALID_INSTANCE_ERROR;
456     }
457
458     VlcPlugin *p_plugin = reinterpret_cast<VlcPlugin *>(instance->pdata);
459
460    /*
461    ** Firefox/Mozilla may decide to open a stream from the URL specified
462    ** in the SRC parameter of the EMBED tag and pass it to us
463    **
464    ** since VLC will open the SRC URL as well, we're not interested in
465    ** that stream. Otherwise, we'll take it and queue it up in the playlist
466    */
467     if( !p_plugin->psz_target || strcmp(stream->url, p_plugin->psz_target) )
468     {
469         /* TODO: use pipes !!!! */
470         *stype = NP_ASFILEONLY;
471         return NPERR_NO_ERROR;
472     }
473     return NPERR_GENERIC_ERROR;
474 }
475
476 int32 NPP_WriteReady( NPP instance, NPStream *stream )
477 {
478     /* TODO */
479     return 8*1024;
480 }
481
482
483 int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
484                  int32 len, void *buffer )
485 {
486     /* TODO */
487     return len;
488 }
489
490
491 NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason )
492 {
493     if( instance == NULL )
494     {
495         return NPERR_INVALID_INSTANCE_ERROR;
496     }
497     return NPERR_NO_ERROR;
498 }
499
500
501 void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
502 {
503     if( instance == NULL )
504     {
505         return;
506     }
507
508     VlcPlugin *p_plugin = reinterpret_cast<VlcPlugin *>(instance->pdata);
509
510     if( VLC_SUCCESS == libvlc_playlist_add( p_plugin->getVLC(), fname, stream->url, NULL ) )
511     {
512         if( p_plugin->b_autoplay )
513         {
514             libvlc_playlist_play( p_plugin->getVLC(), 0, 0, NULL, NULL);
515         }
516     }
517 }
518
519
520 void NPP_URLNotify( NPP instance, const char* url,
521                     NPReason reason, void* notifyData )
522 {
523     /***** Insert NPP_URLNotify code here *****\
524     PluginInstance* p_plugin;
525     if (instance != NULL)
526         p_plugin = (PluginInstance*) instance->pdata;
527     \*********************************************/
528 }
529
530
531 void NPP_Print( NPP instance, NPPrint* printInfo )
532 {
533     if( printInfo == NULL )
534     {
535         return;
536     }
537
538     if( instance != NULL )
539     {
540         /***** Insert NPP_Print code here *****\
541         PluginInstance* p_plugin = (PluginInstance*) instance->pdata;
542         \**************************************/
543
544         if( printInfo->mode == NP_FULL )
545         {
546             /*
547              * PLUGIN DEVELOPERS:
548              *  If your plugin would like to take over
549              *  printing completely when it is in full-screen mode,
550              *  set printInfo->pluginPrinted to TRUE and print your
551              *  plugin as you see fit.  If your plugin wants Netscape
552              *  to handle printing in this case, set
553              *  printInfo->pluginPrinted to FALSE (the default) and
554              *  do nothing.  If you do want to handle printing
555              *  yourself, printOne is true if the print button
556              *  (as opposed to the print menu) was clicked.
557              *  On the Macintosh, platformPrint is a THPrint; on
558              *  Windows, platformPrint is a structure
559              *  (defined in npapi.h) containing the printer name, port,
560              *  etc.
561              */
562
563             /***** Insert NPP_Print code here *****\
564             void* platformPrint =
565                 printInfo->print.fullPrint.platformPrint;
566             NPBool printOne =
567                 printInfo->print.fullPrint.printOne;
568             \**************************************/
569
570             /* Do the default*/
571             printInfo->print.fullPrint.pluginPrinted = FALSE;
572         }
573         else
574         {
575             /* If not fullscreen, we must be embedded */
576             /*
577              * PLUGIN DEVELOPERS:
578              *  If your plugin is embedded, or is full-screen
579              *  but you returned false in pluginPrinted above, NPP_Print
580              *  will be called with mode == NP_EMBED.  The NPWindow
581              *  in the printInfo gives the location and dimensions of
582              *  the embedded plugin on the printed page.  On the
583              *  Macintosh, platformPrint is the printer port; on
584              *  Windows, platformPrint is the handle to the printing
585              *  device context.
586              */
587
588             /***** Insert NPP_Print code here *****\
589             NPWindow* printWindow =
590                 &(printInfo->print.embedPrint.window);
591             void* platformPrint =
592                 printInfo->print.embedPrint.platformPrint;
593             \**************************************/
594         }
595     }
596 }
597
598 /******************************************************************************
599  * Windows-only methods
600  *****************************************************************************/
601 #if XP_WIN
602 static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar )
603 {
604     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(GetWindowLongPtr(p_hwnd, GWLP_USERDATA));
605
606     switch( i_msg )
607     {
608         case WM_ERASEBKGND:
609             return 1L;
610
611         case WM_PAINT:
612         {
613             PAINTSTRUCT paintstruct;
614             HDC hdc;
615             RECT rect;
616
617             hdc = BeginPaint( p_hwnd, &paintstruct );
618
619             GetClientRect( p_hwnd, &rect );
620
621             FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
622             SetTextColor(hdc, RGB(255, 255, 255));
623             SetBkColor(hdc, RGB(0, 0, 0));
624             DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE); 
625
626             EndPaint( p_hwnd, &paintstruct );
627             return 0L;
628         }
629         default:
630             /* delegate to default handler */
631             return p_plugin->getWindowProc()( p_hwnd, i_msg, wpar, lpar );
632     }
633 }
634 #endif /* XP_WIN */
635
636 /******************************************************************************
637  * UNIX-only methods
638  *****************************************************************************/
639 #ifdef XP_UNIX
640 static void Redraw( Widget w, XtPointer closure, XEvent *event )
641 {
642     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
643     const NPWindow *window = p_plugin->getWindow();
644     GC gc;
645     XGCValues gcv;
646
647     Window  drawable   = (Window) window->window;
648     Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
649
650     gcv.foreground = BlackPixel( p_display, 0 );
651     gc = XCreateGC( p_display, drawable, GCForeground, &gcv );
652
653     XFillRectangle( p_display, drawable, gc,
654                     0, 0, window->width, window->height );
655
656     gcv.foreground = WhitePixel( p_display, 0 );
657     XChangeGC( p_display, gc, GCForeground, &gcv );
658
659     XDrawString( p_display, drawable, gc,
660                  window->width / 2 - 40, window->height / 2,
661                  WINDOW_TEXT, strlen(WINDOW_TEXT) );
662
663     XFreeGC( p_display, gc );
664 }
665
666 static void Resize ( Widget w, XtPointer closure, XEvent *event )
667 {
668     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
669     const NPWindow *window = p_plugin->getWindow();
670     Window  drawable   = (Window) window->window;
671     Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
672
673     int i_ret;
674     Window root_return, parent_return, * children_return;
675     Window base_window;
676     unsigned int i_nchildren;
677
678 #ifdef X11_RESIZE_DEBUG
679     XWindowAttributes attr;
680
681     if( event && event->type == ConfigureNotify )
682     {
683         fprintf( stderr, "vlcshell::Resize() ConfigureNotify %d x %d, "
684                  "send_event ? %s\n", event->xconfigure.width,
685                  event->xconfigure.height,
686                  event->xconfigure.send_event ? "TRUE" : "FALSE" );
687     }
688 #endif /* X11_RESIZE_DEBUG */
689
690     if( ! p_plugin->setSize(window->width, window->height) )
691     {
692         /* size already set */
693         return;
694     }
695
696
697     i_ret = XResizeWindow( p_display, drawable, window->width, window->height );
698
699 #ifdef X11_RESIZE_DEBUG
700     fprintf( stderr,
701              "vlcshell::Resize() XResizeWindow(owner) returned %d\n", i_ret );
702
703     XGetWindowAttributes ( p_display, drawable, &attr );
704
705     /* X is asynchronous, so the current size reported here is not
706        necessarily the requested size as the Resize request may not
707        yet have been handled by the plugin host */
708     fprintf( stderr, "vlcshell::Resize() current (owner) size %d x %d\n",
709              attr.width, attr.height );
710 #endif /* X11_RESIZE_DEBUG */
711
712     XQueryTree( p_display, drawable,
713                 &root_return, &parent_return, &children_return,
714                 &i_nchildren );
715
716     if( i_nchildren > 0 )
717     {
718         /* XXX: Make assumptions related to the window parenting structure in
719            vlc/modules/video_output/x11/xcommon.c */
720         base_window = children_return[i_nchildren - 1];
721
722 #ifdef X11_RESIZE_DEBUG
723         fprintf( stderr, "vlcshell::Resize() got %d children\n", i_nchildren );
724         fprintf( stderr, "vlcshell::Resize() got base_window %p\n",
725                  base_window );
726 #endif /* X11_RESIZE_DEBUG */
727
728         i_ret = XResizeWindow( p_display, base_window,
729                 window->width, window->height );
730
731 #ifdef X11_RESIZE_DEBUG
732         fprintf( stderr,
733                  "vlcshell::Resize() XResizeWindow(base) returned %d\n",
734                  i_ret );
735
736         XGetWindowAttributes( p_display, base_window, &attr );
737
738         fprintf( stderr, "vlcshell::Resize() new size %d x %d\n",
739                  attr.width, attr.height );
740 #endif /* X11_RESIZE_DEBUG */
741     }
742 }
743
744 #endif /* XP_UNIX */
745