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 ) : ...@@ -45,6 +45,7 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
b_stream(0), b_stream(0),
b_autoplay(1), b_autoplay(1),
b_toolbar(0), b_toolbar(0),
psz_text(NULL),
psz_target(NULL), psz_target(NULL),
playlist_index(-1), playlist_index(-1),
libvlc_instance(NULL), libvlc_instance(NULL),
...@@ -145,6 +146,10 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[]) ...@@ -145,6 +146,10 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
{ {
psz_target = argv[i]; psz_target = argv[i];
} }
else if( !strcmp( argn[i], "text" ) )
{
psz_text = argv[i];
}
else if( !strcmp( argn[i], "autoplay") else if( !strcmp( argn[i], "autoplay")
|| !strcmp( argn[i], "autostart") ) || !strcmp( argn[i], "autostart") )
{ {
......
...@@ -145,6 +145,7 @@ public: ...@@ -145,6 +145,7 @@ public:
int b_stream; int b_stream;
int b_autoplay; int b_autoplay;
int b_toolbar; int b_toolbar;
char * psz_text;
char * psz_target; char * psz_target;
void playlist_play(libvlc_exception_t *ex) void playlist_play(libvlc_exception_t *ex)
......
...@@ -240,6 +240,7 @@ int16 NPP_HandleEvent( NPP instance, void * event ) ...@@ -240,6 +240,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
ForeColor(whiteColor); ForeColor(whiteColor);
MoveTo( (npwindow.width-80)/ 2 , npwindow.height / 2 ); MoveTo( (npwindow.width-80)/ 2 , npwindow.height / 2 );
if( p_plugin->psz_text )
DrawText( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) ); DrawText( WINDOW_TEXT , 0 , strlen(WINDOW_TEXT) );
} }
} }
...@@ -747,6 +748,7 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa ...@@ -747,6 +748,7 @@ static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpa
FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) ); FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
SetTextColor(hdc, RGB(255, 255, 255)); SetTextColor(hdc, RGB(255, 255, 255));
SetBkColor(hdc, RGB(0, 0, 0)); SetBkColor(hdc, RGB(0, 0, 0));
if( p_plugin->psz_text )
DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect, DrawText( hdc, WINDOW_TEXT, strlen(WINDOW_TEXT), &rect,
DT_CENTER|DT_VCENTER|DT_SINGLELINE); DT_CENTER|DT_VCENTER|DT_SINGLELINE);
...@@ -791,6 +793,7 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event ) ...@@ -791,6 +793,7 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
gcv.foreground = WhitePixel( p_display, 0 ); gcv.foreground = WhitePixel( p_display, 0 );
XChangeGC( p_display, gc, GCForeground, &gcv ); XChangeGC( p_display, gc, GCForeground, &gcv );
if( p_plugin->psz_text )
XDrawString( p_display, video, gc, XDrawString( p_display, video, gc,
window.width / 2 - 40, (window.height - i_control_height) / 2, window.width / 2 - 40, (window.height - i_control_height) / 2,
WINDOW_TEXT, strlen(WINDOW_TEXT) ); WINDOW_TEXT, strlen(WINDOW_TEXT) );
......
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