Esempio n. 1
0
void IconObj::Field(int index, char **string, int *width, boolean *visible, 
		    boolean *active)
{
   XmString s;
   Dimension wid;
   unsigned char alignment;
   Boolean draw_field;
   Boolean selected;
   Boolean _active;

   GuiIconGetField(_w, index, &s, &wid, &alignment, &draw_field, &selected, 
		   &_active);
   if (width)
      *width = (int)wid;
   if (string)
      *string = StringExtract(s);
   if (visible)
      *visible = draw_field ? true : false;
   if (active)
      *active = _active ? true : false;
}
Esempio n. 2
0
//Bonjour, vous avez un nouveau message !
void Network::slotReadyRead()
{
    int size = m_sslSocket->bytesAvailable();
    m_data.append(m_sslSocket->readAll());

    if(!m_blockSize)
    {
        if(!m_data.contains(':'))
            return;

        int pos = m_data.indexOf(":");
        m_blockSize = atoi(m_data.left(pos));
        m_data = m_data.mid(pos+1);
        size -= pos+1;
    }

    if(size < m_blockSize)
        return;

    //A ce stade nous avons le message en entier
    Core::Instance().messageHandler(StringExtract(m_data.data()));
    m_data.clear();
    m_blockSize = 0;
}