Commit 51c1011e authored by Jean-Paul Saman's avatar Jean-Paul Saman

mozilla: introduce new property text

Make it possible to override the default text.
parent bc756e06
......@@ -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),
......@@ -145,6 +146,10 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
{
psz_target = argv[i];
}
else if( !strcmp( argn[i], "text" ) )
{
psz_text = argv[i];
}
else if( !strcmp( argn[i], "autoplay")
|| !strcmp( argn[i], "autostart") )
{
......
......@@ -145,6 +145,7 @@ public:
int b_stream;
int b_autoplay;
int b_toolbar;
char * psz_text;
char * psz_target;
void playlist_play(libvlc_exception_t *ex)
......
......@@ -240,7 +240,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( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) );
}
}
return true;
......@@ -747,8 +748,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, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect,
DT_CENTER|DT_VCENTER|DT_SINGLELINE);
EndPaint( p_hwnd, &paintstruct );
return 0L;
......@@ -791,9 +793,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,
WINDOW_TEXT, strlen(WINDOW_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