bool LH_LgLcdCallbackThread::render( int conn )
{
    // Close open contexts no longer in use
    if( !bw_bm.hdr.Format && bw_cxt.device != LGLCD_INVALID_DEVICE )
    {
        lgLcdClose(bw_cxt.device);
        bw_cxt.device = LGLCD_INVALID_DEVICE;
    }
    if( !qvga_bm.hdr.Format && qvga_cxt.device != LGLCD_INVALID_DEVICE )
    {
        lgLcdClose(qvga_cxt.device);
        qvga_cxt.device = LGLCD_INVALID_DEVICE;
    }

    // Open context that are available and needed
    if( bw_bm.hdr.Format && bw_cxt.device == LGLCD_INVALID_DEVICE )
    {
        Q_ASSERT( bw_cxt.onSoftbuttonsChanged.softbuttonsChangedContext == this );
        bw_cxt.connection = conn;
        if( LCD_ERR( lgLcdOpenByType(&bw_cxt) ) )
            lgLcdSetAsLCDForegroundApp(bw_cxt.device,LGLCD_LCD_FOREGROUND_APP_YES);
    }
    if( qvga_bm.hdr.Format && qvga_cxt.device == LGLCD_INVALID_DEVICE )
    {
        Q_ASSERT( qvga_cxt.onSoftbuttonsChanged.softbuttonsChangedContext == this );
        qvga_cxt.connection = conn;
        if( LCD_ERR( lgLcdOpenByType(&qvga_cxt) ) )
            lgLcdSetAsLCDForegroundApp(qvga_cxt.device,LGLCD_LCD_FOREGROUND_APP_YES);
    }

    // Push bits to open devices that has images
    if( bw_cxt.device != LGLCD_INVALID_DEVICE && bw_bm.hdr.Format )
    {
        if( lgLcdUpdateBitmap( bw_cxt.device, &bw_bm.hdr, LGLCD_PRIORITY_NORMAL ) != ERROR_SUCCESS )
        {
            lgLcdClose(bw_cxt.device);
            bw_cxt.device = LGLCD_INVALID_DEVICE;
        }
    }

    if( qvga_cxt.device != LGLCD_INVALID_DEVICE && qvga_bm.hdr.Format )
    {
        if( lgLcdUpdateBitmap( qvga_cxt.device, &qvga_bm.hdr, LGLCD_PRIORITY_NORMAL ) != ERROR_SUCCESS )
        {
            lgLcdClose(qvga_cxt.device);
            qvga_cxt.device = LGLCD_INVALID_DEVICE;
        }
    }

    return true;
}
//************************************************************************
// Activates the applet on the LCD
//************************************************************************
void CLCDConnectionLogitech::SetAsForeground(bool bSetAsForeground)
{
	// TODO: Activate when 1.02 is out
	m_bSetAsForeground = bSetAsForeground;
	if (LGLCD_INVALID_DEVICE != m_hDevice)
		lgLcdSetAsLCDForegroundApp(m_hDevice, bSetAsForeground);
}
Example #3
0
void lcd_priority (int priority)
{
	if (!inited)
		return;
	if (old_pri == priority)
		return;
	if (lgLcdSetAsLCDForegroundApp (device, priority ? LGLCD_LCD_FOREGROUND_APP_YES : LGLCD_LCD_FOREGROUND_APP_NO) == ERROR_SUCCESS)
		old_pri = priority;
}
Example #4
0
void CLCDOutput::SetAsForeground(BOOL bSetAsForeground)
{
    /*DWORD dwSet = */bSetAsForeground ? LGLCD_LCD_FOREGROUND_APP_YES : LGLCD_LCD_FOREGROUND_APP_NO;
    m_bSetAsForeground = bSetAsForeground;
    if (LGLCD_INVALID_DEVICE != m_hDevice)
    {
        lgLcdSetAsLCDForegroundApp(m_hDevice, bSetAsForeground);
    }
}
Example #5
0
HRESULT CLCDOutput::SetAsForeground(BOOL bSetAsForeground)
{
    m_bSetAsForeground = bSetAsForeground;
    if (LGLCD_INVALID_DEVICE != m_hDevice)
    {
        DWORD dwRes = lgLcdSetAsLCDForegroundApp(m_hDevice, bSetAsForeground);
        if(ERROR_SUCCESS != dwRes)
        {
            return MAKE_HRESULT(SEVERITY_ERROR, 0, dwRes);
        }
    }
    return E_FAIL;
}