Commit 50b952d9 authored by Jean-Paul Saman's avatar Jean-Paul Saman

mozilla: introduce new property text

The text "Waiting for video..." is no longer shown be default. One has to add it to the browser plugin properties before it is shown on the plugin area.
parent 8d26f8c3
......@@ -115,6 +115,7 @@ Insert VideoLAN.VLCPlugin.2
width="640"
height="480"
toolbar="true"
text="Waiting for video"
name="vlc">
</EMBED>
</OBJECT>
......
......@@ -45,6 +45,7 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
b_stream(0),
b_autoplay(1),
b_toolbar(0),
psz_text(NULL),
psz_target(NULL),
playlist_index(-1),
libvlc_instance(NULL),
......@@ -144,6 +145,10 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
{
psz_target = argv[i];
}
else if( !strcmp( argn[i], "text" ) )
{
psz_text = strdup( argv[i] );
}
else if( !strcmp( argn[i], "autoplay")
|| !strcmp( argn[i], "autostart") )
{
......@@ -266,6 +271,7 @@ VlcPlugin::~VlcPlugin()
{
free(psz_baseURL);
free(psz_target);
free(psz_text);
if( libvlc_media_player )
libvlc_media_player_release( libvlc_media_player );
if( libvlc_media_list )
......
......@@ -141,6 +141,7 @@ public:
int b_stream;
int b_autoplay;
int b_toolbar;
char * psz_text;
char * psz_target;
void playlist_play(libvlc_exception_t *ex)
......
......@@ -47,8 +47,6 @@
/* Enable/disable debugging printf's for X11 resizing */
#undef X11_RESIZE_DEBUG
#define WINDOW_TEXT "Waiting for video"
/*****************************************************************************
* Unix-only declarations
******************************************************************************/
......@@ -243,7 +241,8 @@ int16 NPP_HandleEvent( NPP instance, void * event )
ForeColor(whiteColor);
MoveTo( (npwindow.width-80)/ 2 , npwindow.height / 2 );
DrawText( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) );
if( p_plugin->psz_text )
DrawText( p_plugin->psz_text, 0, strlen(p_plugin->psz_text) );
}
}
return true;
......@@ -746,8 +745,9 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa
FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
SetTextColor(hdc, RGB(255, 255, 255));
SetBkColor(hdc, RGB(0, 0, 0));
DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect,
DT_CENTER|DT_VCENTER|DT_SINGLELINE);
if( p_plugin->psz_text )
DrawText( hdc, p_plugin->psz_text, strlen(p_plugin->psz_text), &rect,
DT_CENTER|DT_VCENTER|DT_SINGLELINE);
EndPaint( p_hwnd, &paintstruct );
return 0L;
......@@ -790,9 +790,10 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
gcv.foreground = WhitePixel( p_display, 0 );
XChangeGC( p_display, gc, GCForeground, &gcv );
XDrawString( p_display, video, gc,
window.width / 2 - 40, (window.height - i_control_height) / 2,
WINDOW_TEXT, strlen(WINDOW_TEXT) );
if( p_plugin->psz_text )
XDrawString( p_display, video, gc,
window.width / 2 - 40, (window.height - i_control_height) / 2,
p_plugin->psz_text, strlen(p_plugin->psz_text) );
XFreeGC( p_display, gc );
p_plugin->redrawToolbar();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment