Beispiel #1
0
////////////////////////////////////////////////////////////////////////////////
//FBVLC_Win class
////////////////////////////////////////////////////////////////////////////////
FBVLC_Win::FBVLC_Win()
    : m_use_native_scaling( false ), m_hBgBrush( NULL ), m_frame_buf( 0 )
{
    vlc_player_options& o = get_options();

    COLORREF bg_color = HtmlColor2RGB( o.get_bg_color(), RGB( 0, 0, 0 ) );
    m_hBgBrush = CreateSolidBrush( bg_color );
}
Beispiel #2
0
void FBVLC_Mac::updateBgComponents()
{
    uint8_t r = 0, g = 0, b = 0;
    HtmlColor2RGB(get_options().get_bg_color(), &r, &g, &b);
    m_bgComponents[0] = r / 255.f;
    m_bgComponents[1] = g / 255.f;
    m_bgComponents[2] = b / 255.f;
    m_bgComponents[3] = 1.f;
}
inline COLORREF HtmlColor2RGB(const std::string& HtmlColor,
                              COLORREF DefColor)
{
    uint8_t r, g, b; r = g = b = 0;

    if(!HtmlColor2RGB(HtmlColor, &r, &g, &b))
        return DefColor;

    return RGB(r, g, b);
}
Beispiel #4
0
void VLCHolderWnd::PreRegisterWindowClass( WNDCLASS* wc )
{
    if( !_hBgBrush ) {
        //if bg color string can't be parsed, then black color will be used
        _hBgBrush =
            CreateSolidBrush( HtmlColor2RGB( PO()->get_bg_color(),
                                             RGB( 0, 0, 0 ) ) );
    }

    wc->hbrBackground = _hBgBrush;
    wc->lpszClassName = TEXT("Web Plugin VLC Window Holder Class");
}
Beispiel #5
0
void FBVLC_Win::on_option_change( vlc_player_option_e option )
{
    Chimera::on_option_change( option );

    vlc_player_options& o = get_options();

    switch( option ) {
        case po_bg_color: {
            if( isWindowless() ) {
                HBRUSH hTmpBrush = m_hBgBrush;
                COLORREF bg_color = HtmlColor2RGB( o.get_bg_color(), RGB( 0, 0, 0 ) );
                m_hBgBrush = CreateSolidBrush( bg_color );
                DeleteObject( hTmpBrush );

                if( GetWindow() )
                    GetWindow()->InvalidateWindow();
            }
            break;
        }
        default:
            break;
    }
}