]> git.sesse.net Git - vlc/blob - mozilla/vlcshell.cpp
5fb274361331693f58b738a7fb1174523c5c8ed0
[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             if( needsDisplay )
180             {
181                 const NPWindow *npwindow = p_plugin->getWindow();
182                 
183                 /* draw the beautiful "No Picture" */
184
185                 ForeColor(blackColor);
186                 PenMode( patCopy );
187
188                 Rect rect;
189                 rect.left = 0;
190                 rect.top = 0;
191                 rect.right = npwindow->width;
192                 rect.bottom = npwindow->height;
193                 PaintRect( &rect );
194
195                 ForeColor(whiteColor);
196                 MoveTo( (npwindow->width-80)/ 2  , npwindow->height / 2 );
197                 DrawText( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) );
198             }
199             return true;
200         }
201         case activateEvt:
202             return false;
203         case NPEventType_GetFocusEvent:
204         case NPEventType_LoseFocusEvent:
205             return true;
206         case NPEventType_AdjustCursorEvent:
207             return false;
208         case NPEventType_MenuCommandEvent:
209             return false;
210         case NPEventType_ClippingChangedEvent:
211             return false;
212         case NPEventType_ScrollingBeginsEvent:
213         case NPEventType_ScrollingEndsEvent:
214             return true;
215         default:
216             ;
217     }
218     return false;
219 }
220 #endif /* XP_MACOSX */
221
222 /******************************************************************************
223  * General Plug-in Calls
224  *****************************************************************************/
225 NPError NPP_Initialize( void )
226 {
227     return NPERR_NO_ERROR;
228 }
229
230 jref NPP_GetJavaClass( void )
231 {
232     return NULL;
233 }
234
235 void NPP_Shutdown( void )
236 {
237     ;
238 }
239
240 NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
241                  char* argn[], char* argv[], NPSavedData* saved )
242 {
243     NPError status;
244
245     if( instance == NULL )
246     {
247         return NPERR_INVALID_INSTANCE_ERROR;
248     }
249
250     VlcPlugin * p_plugin = new VlcPlugin( instance, mode );
251     if( NULL == p_plugin )
252     {
253         return NPERR_OUT_OF_MEMORY_ERROR;
254     }
255
256     status = p_plugin->init(argc, argn, argv);
257     if( NPERR_NO_ERROR == status ) {
258         instance->pdata = reinterpret_cast<void*>(p_plugin);
259     }
260     else {
261         delete p_plugin;
262     }
263     return status;
264 }
265
266 NPError NPP_Destroy( NPP instance, NPSavedData** save )
267 {
268     if( instance == NULL )
269     {
270         return NPERR_INVALID_INSTANCE_ERROR;
271     }
272
273     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
274
275     if( p_plugin )
276         delete p_plugin;
277
278     instance->pdata = NULL;
279
280     return NPERR_NO_ERROR;
281 }
282
283 NPError NPP_SetWindow( NPP instance, NPWindow* window )
284 {
285     if( ! instance )
286     {
287         return NPERR_INVALID_INSTANCE_ERROR;
288     }
289
290     /* NPP_SetWindow may be called before NPP_New (Opera) */
291     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
292     if( ! p_plugin )
293     {
294         /* we should probably show a splash screen here */
295         return NPERR_NO_ERROR;
296     }
297
298     libvlc_instance_t *p_vlc = p_plugin->getVLC();
299
300     /*
301      * PLUGIN DEVELOPERS:
302      *  Before setting window to point to the
303      *  new window, you may wish to compare the new window
304      *  info to the previous window (if any) to note window
305      *  size changes, etc.
306      */
307
308     const NPWindow *curwin = p_plugin->getWindow();
309
310 #ifdef XP_MACOSX
311     if( window && window->window )
312     {
313         /* check if plugin has a new parent window */
314         CGrafPtr drawable = (((NP_Port*) (window->window))->port);
315         if( !curwin->window || drawable != (((NP_Port*) (curwin->window))->port) )
316         {
317             /* set/change parent window */
318             libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
319         }
320
321         /* as MacOS X video output is windowless, set viewport */
322         libvlc_rectangle_t view, clip;
323
324         /*
325         ** browser sets port origin to top-left location of plugin relative to GrafPort
326         ** window origin is set relative to document, which of little use for drawing
327         */
328         view.top     = ((NP_Port*) (window->window))->porty;
329         view.left    = ((NP_Port*) (window->window))->portx;
330         view.bottom  = window->height+view.top;
331         view.right   = window->width+view.left;
332
333         /* clipRect coordinates are also relative to GrafPort */
334         clip.top     = window->clipRect.top;
335         clip.left    = window->clipRect.left;
336         clip.bottom  = window->clipRect.bottom;
337         clip.right   = window->clipRect.right;
338
339         libvlc_video_set_viewport(p_vlc, &view, &clip, NULL);
340
341         /* remember window details */
342         p_plugin->setWindow(window);
343     }
344 #endif /* XP_MACOSX */
345
346 #ifdef XP_WIN
347     if( window && window->window )
348     {
349         /* check if plugin has a new parent window */
350         HWND drawable = (HWND) (window->window);
351         if( !curwin->window || drawable != curwin->window )
352         {
353             /* reset previous window settings */
354             HWND oldwin = (HWND)p_plugin->getWindow()->window;
355             WNDPROC oldproc = p_plugin->getWindowProc();
356             if( oldproc )
357             {
358                 /* reset WNDPROC */
359                 SetWindowLong( oldwin, GWL_WNDPROC, (LONG)oldproc );
360             }
361             /* install our WNDPROC */
362             p_plugin->setWindowProc( (WNDPROC)SetWindowLong( drawable,
363                                                            GWL_WNDPROC, (LONG)Manage ) );
364
365             /* attach our plugin object */
366             SetWindowLongPtr((HWND)drawable, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(p_plugin));
367
368             /* change window style to our liking */
369             LONG style = GetWindowLong((HWND)drawable, GWL_STYLE);
370             style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
371             SetWindowLong((HWND)drawable, GWL_STYLE, style);
372
373             /* change/set parent */
374             libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, NULL);
375         }
376
377         /* remember window details */
378         p_plugin->setWindow(window);
379
380         /* Redraw window */
381         InvalidateRect( (HWND)drawable, NULL, TRUE );
382         UpdateWindow( (HWND)drawable );
383     }
384     else
385     {
386         /* reset WNDPROC */
387         HWND oldwin = (HWND)curwin->window;
388         SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
389         p_plugin->setWindowProc(NULL);
390         /* change/set parent */
391         libvlc_video_set_parent(p_vlc, 0, NULL);
392     }
393 #endif /* XP_WIN */
394
395 #ifdef XP_UNIX
396     if( window && window->window )
397     {
398         Window  drawable   = (Window) window->window;
399         if( !curwin->window || drawable != (Window)curwin->window )
400         {
401             Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
402
403             XResizeWindow( p_display, drawable, window->width, window->height );
404             Widget w = XtWindowToWidget( p_display, drawable );
405
406             XtAddEventHandler( w, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin );
407             XtAddEventHandler( w, StructureNotifyMask, FALSE, (XtEventHandler)Resize, p_plugin );
408
409             /* remember window */
410             p_plugin->setWindow(window);
411
412             Redraw( w, (XtPointer)p_plugin, NULL );
413         }
414     }
415 #endif /* XP_UNIX */
416
417     if( !p_plugin->b_stream )
418     {
419         if( p_plugin->psz_target )
420         {
421             if( VLC_SUCCESS == libvlc_playlist_add( p_vlc, p_plugin->psz_target, NULL, NULL ) )
422             {
423                 if( p_plugin->b_autoplay )
424                 {
425                     libvlc_playlist_play(p_vlc, 0, 0, NULL, NULL);
426                 }
427                 p_plugin->b_stream = VLC_TRUE;
428             }
429         }
430     }
431     return NPERR_NO_ERROR;
432 }
433
434 NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
435                        NPBool seekable, uint16 *stype )
436 {
437     if( instance == NULL )
438     {
439         return NPERR_INVALID_INSTANCE_ERROR;
440     }
441
442 #if 0
443     VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
444 #endif
445
446     /* fprintf(stderr, "NPP_NewStream - FILE mode !!\n"); */
447
448     /* We want a *filename* ! */
449     *stype = NP_ASFILE;
450
451 #if 0
452     if( !p_plugin->b_stream )
453     {
454         p_plugin->psz_target = strdup( stream->url );
455         p_plugin->b_stream = VLC_TRUE;
456     }
457 #endif
458
459     return NPERR_NO_ERROR;
460 }
461
462 int32 STREAMBUFSIZE = 0X0FFFFFFF; /* If we are reading from a file in NPAsFile
463                    * mode so we can take any size stream in our
464                    * write call (since we ignore it) */
465
466 #define SARASS_SIZE (1024*1024)
467
468 int32 NPP_WriteReady( NPP instance, NPStream *stream )
469 {
470     VlcPlugin* p_plugin;
471
472     /* fprintf(stderr, "NPP_WriteReady\n"); */
473
474     if (instance != NULL)
475     {
476         p_plugin = reinterpret_cast<VlcPlugin*>(instance->pdata);
477         /* Muahahahahahahaha */
478         return STREAMBUFSIZE;
479         /*return SARASS_SIZE;*/
480     }
481
482     /* Number of bytes ready to accept in NPP_Write() */
483     return STREAMBUFSIZE;
484     /*return 0;*/
485 }
486
487
488 int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
489                  int32 len, void *buffer )
490 {
491     /* fprintf(stderr, "NPP_Write %i\n", (int)len); */
492
493     if( instance != NULL )
494     {
495         /*VlcPlugin* p_plugin = (VlcPlugin*) instance->pdata;*/
496     }
497
498     return len;         /* The number of bytes accepted */
499 }
500
501
502 NPError NPP_DestroyStream( NPP instance, NPStream *stream, NPError reason )
503 {
504     if( instance == NULL )
505     {
506         return NPERR_INVALID_INSTANCE_ERROR;
507     }
508
509     return NPERR_NO_ERROR;
510 }
511
512
513 void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
514 {
515     if( instance == NULL )
516     {
517         return;
518     }
519
520     /* fprintf(stderr, "NPP_StreamAsFile %s\n", fname); */
521
522 #if 0
523     VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
524
525     VLC_AddTarget( p_plugin->i_vlc, fname, 0, 0,
526                    PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
527 #endif /* USE_LIBVLC */
528 }
529
530
531 void NPP_URLNotify( NPP instance, const char* url,
532                     NPReason reason, void* notifyData )
533 {
534     /***** Insert NPP_URLNotify code here *****\
535     PluginInstance* p_plugin;
536     if (instance != NULL)
537         p_plugin = (PluginInstance*) instance->pdata;
538     \*********************************************/
539 }
540
541
542 void NPP_Print( NPP instance, NPPrint* printInfo )
543 {
544     if( printInfo == NULL )
545     {
546         return;
547     }
548
549     if( instance != NULL )
550     {
551         /***** Insert NPP_Print code here *****\
552         PluginInstance* p_plugin = (PluginInstance*) instance->pdata;
553         \**************************************/
554
555         if( printInfo->mode == NP_FULL )
556         {
557             /*
558              * PLUGIN DEVELOPERS:
559              *  If your plugin would like to take over
560              *  printing completely when it is in full-screen mode,
561              *  set printInfo->pluginPrinted to TRUE and print your
562              *  plugin as you see fit.  If your plugin wants Netscape
563              *  to handle printing in this case, set
564              *  printInfo->pluginPrinted to FALSE (the default) and
565              *  do nothing.  If you do want to handle printing
566              *  yourself, printOne is true if the print button
567              *  (as opposed to the print menu) was clicked.
568              *  On the Macintosh, platformPrint is a THPrint; on
569              *  Windows, platformPrint is a structure
570              *  (defined in npapi.h) containing the printer name, port,
571              *  etc.
572              */
573
574             /***** Insert NPP_Print code here *****\
575             void* platformPrint =
576                 printInfo->print.fullPrint.platformPrint;
577             NPBool printOne =
578                 printInfo->print.fullPrint.printOne;
579             \**************************************/
580
581             /* Do the default*/
582             printInfo->print.fullPrint.pluginPrinted = FALSE;
583         }
584         else
585         {
586             /* If not fullscreen, we must be embedded */
587             /*
588              * PLUGIN DEVELOPERS:
589              *  If your plugin is embedded, or is full-screen
590              *  but you returned false in pluginPrinted above, NPP_Print
591              *  will be called with mode == NP_EMBED.  The NPWindow
592              *  in the printInfo gives the location and dimensions of
593              *  the embedded plugin on the printed page.  On the
594              *  Macintosh, platformPrint is the printer port; on
595              *  Windows, platformPrint is the handle to the printing
596              *  device context.
597              */
598
599             /***** Insert NPP_Print code here *****\
600             NPWindow* printWindow =
601                 &(printInfo->print.embedPrint.window);
602             void* platformPrint =
603                 printInfo->print.embedPrint.platformPrint;
604             \**************************************/
605         }
606     }
607 }
608
609 /******************************************************************************
610  * Windows-only methods
611  *****************************************************************************/
612 #if XP_WIN
613 static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar )
614 {
615     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(GetWindowLongPtr(p_hwnd, GWLP_USERDATA));
616
617     switch( i_msg )
618     {
619         case WM_ERASEBKGND:
620             return 1L;
621
622         case WM_PAINT:
623         {
624             PAINTSTRUCT paintstruct;
625             HDC hdc;
626             RECT rect;
627
628             hdc = BeginPaint( p_hwnd, &paintstruct );
629
630             GetClientRect( p_hwnd, &rect );
631
632             FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
633             SetTextColor(hdc, RGB(255, 255, 255));
634             SetBkColor(hdc, RGB(0, 0, 0));
635             TextOut( hdc, (rect.right-rect.left)/ 2 - 40,
636                           (rect.bottom-rect.top)/ 2,
637                      WINDOW_TEXT, strlen(WINDOW_TEXT) );
638
639             EndPaint( p_hwnd, &paintstruct );
640             return 0L;
641         }
642         default:
643             /* delegate to default handler */
644             return p_plugin->getWindowProc()( p_hwnd, i_msg, wpar, lpar );
645     }
646 }
647 #endif /* XP_WIN */
648
649 /******************************************************************************
650  * UNIX-only methods
651  *****************************************************************************/
652 #ifdef XP_UNIX
653 static void Redraw( Widget w, XtPointer closure, XEvent *event )
654 {
655     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
656     const NPWindow *window = p_plugin->getWindow();
657     GC gc;
658     XGCValues gcv;
659
660     Window  drawable   = (Window) window->window;
661     Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
662
663     gcv.foreground = BlackPixel( p_display, 0 );
664     gc = XCreateGC( p_display, drawable, GCForeground, &gcv );
665
666     XFillRectangle( p_display, drawable, gc,
667                     0, 0, window->width, window->height );
668
669     gcv.foreground = WhitePixel( p_display, 0 );
670     XChangeGC( p_display, gc, GCForeground, &gcv );
671
672     XDrawString( p_display, drawable, gc,
673                  window->width / 2 - 40, window->height / 2,
674                  WINDOW_TEXT, strlen(WINDOW_TEXT) );
675
676     XFreeGC( p_display, gc );
677 }
678
679 static void Resize ( Widget w, XtPointer closure, XEvent *event )
680 {
681     VlcPlugin* p_plugin = reinterpret_cast<VlcPlugin*>(closure);
682     const NPWindow *window = p_plugin->getWindow();
683     Window  drawable   = (Window) window->window;
684     Display *p_display = ((NPSetWindowCallbackStruct *)window->ws_info)->display;
685
686     int i_ret;
687     Window root_return, parent_return, * children_return;
688     Window base_window;
689     unsigned int i_nchildren;
690
691 #ifdef X11_RESIZE_DEBUG
692     XWindowAttributes attr;
693
694     if( event && event->type == ConfigureNotify )
695     {
696         fprintf( stderr, "vlcshell::Resize() ConfigureNotify %d x %d, "
697                  "send_event ? %s\n", event->xconfigure.width,
698                  event->xconfigure.height,
699                  event->xconfigure.send_event ? "TRUE" : "FALSE" );
700     }
701 #endif /* X11_RESIZE_DEBUG */
702
703     if( ! p_plugin->setSize(window->width, window->height) )
704     {
705         /* size already set */
706         return;
707     }
708
709
710     i_ret = XResizeWindow( p_display, drawable, window->width, window->height );
711
712 #ifdef X11_RESIZE_DEBUG
713     fprintf( stderr,
714              "vlcshell::Resize() XResizeWindow(owner) returned %d\n", i_ret );
715
716     XGetWindowAttributes ( p_display, drawable, &attr );
717
718     /* X is asynchronous, so the current size reported here is not
719        necessarily the requested size as the Resize request may not
720        yet have been handled by the plugin host */
721     fprintf( stderr, "vlcshell::Resize() current (owner) size %d x %d\n",
722              attr.width, attr.height );
723 #endif /* X11_RESIZE_DEBUG */
724
725     XQueryTree( p_display, drawable,
726                 &root_return, &parent_return, &children_return,
727                 &i_nchildren );
728
729     if( i_nchildren > 0 )
730     {
731         /* XXX: Make assumptions related to the window parenting structure in
732            vlc/modules/video_output/x11/xcommon.c */
733         base_window = children_return[i_nchildren - 1];
734
735 #ifdef X11_RESIZE_DEBUG
736         fprintf( stderr, "vlcshell::Resize() got %d children\n", i_nchildren );
737         fprintf( stderr, "vlcshell::Resize() got base_window %p\n",
738                  base_window );
739 #endif /* X11_RESIZE_DEBUG */
740
741         i_ret = XResizeWindow( p_display, base_window,
742                 window->width, window->height );
743
744 #ifdef X11_RESIZE_DEBUG
745         fprintf( stderr,
746                  "vlcshell::Resize() XResizeWindow(base) returned %d\n",
747                  i_ret );
748
749         XGetWindowAttributes( p_display, base_window, &attr );
750
751         fprintf( stderr, "vlcshell::Resize() new size %d x %d\n",
752                  attr.width, attr.height );
753 #endif /* X11_RESIZE_DEBUG */
754     }
755 }
756
757 #endif /* XP_UNIX */
758