Пример #1
0
void TextField::doDraw(const CurrentTransform&, float sx, float sy, float ex, float ey)
{
    G_UNUSED(sx);
    G_UNUSED(sy);
    G_UNUSED(ex);
    G_UNUSED(ey);
    if (scaleChanged()) createGraphics();
	for (std::vector<GraphicsBase>::iterator it=graphicsBase_.begin();it!=graphicsBase_.end();it++)
		(*it).draw(shader_);
}
Пример #2
0
QList<QVideoFrame::PixelFormat> VideoFrameSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const
{
	G_UNUSED(handleType);
	// Return the formats you will support
	return QList<QVideoFrame::PixelFormat>()
			<< QVideoFrame::Format_ARGB32
			<< QVideoFrame::Format_RGB32
		;
}
Пример #3
0
static void
sc_dumb_player_set_property (GObject *object, guint property_id,
                              const GValue *value, GParamSpec *pspec)
{
	ScDumbPlayer* self = SC_DUMB_PLAYER (object);
	G_UNUSED (self);

	switch (property_id) {
		default:
			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
	}
}
Пример #4
0
static void
sc_rack_model_set_property (GObject *object, guint property_id,
                              const GValue *value, GParamSpec *pspec)
{
	ScRackModel* self = SC_RACK_MODEL (object);
	G_UNUSED (self);

	switch (property_id) {
		default:
			G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
	}
}
Пример #5
0
VideoFrameSurface::VideoFrameSurface(TextureData *tex,int w,int h, int o) {
	G_UNUSED(o);
	gtex=tex;
	cw=w;
	ch=h;
	shader = gtexture_get_engine()->createShaderProgram(VShaderCode,
			FShaderCode, ShaderProgram::Flag_FromCode, camUniforms,
			camAttributes);
	indices.resize(4);
	vertices.resize(4);
	texcoords.resize(4);

	indices[0] = 0;
	indices[1] = 1;
	indices[2] = 3;
	indices[3] = 2;
	indices.Update();
/*
	switch (o)
	{
	case 0: //Portrait
		texcoords[3] = Point2f(0, 1);
		texcoords[0] = Point2f(0, 0);
		texcoords[1] = Point2f(1, 0);
		texcoords[2] = Point2f(1, 1);
		break;
	case 90: //Landscape left
		texcoords[0] = Point2f(0, 1);
		texcoords[1] = Point2f(0, 0);
		texcoords[2] = Point2f(1, 0);
		texcoords[3] = Point2f(1, 1);
		break;
	case 180: //Portrait upside down
		texcoords[1] = Point2f(0, 1);
		texcoords[2] = Point2f(0, 0);
		texcoords[3] = Point2f(1, 0);
		texcoords[0] = Point2f(1, 1);
		break;
	case 270: //Landscape right
		texcoords[2] = Point2f(0, 1);
		texcoords[3] = Point2f(0, 0);
		texcoords[0] = Point2f(1, 0);
		texcoords[1] = Point2f(1, 1);
		break;
	}*/
	texcoords[0] = Point2f(0, 0);
	texcoords[1] = Point2f(1, 0);
	texcoords[2] = Point2f(1, 1);
	texcoords[3] = Point2f(0, 1);
	texcoords.Update();

#ifdef Q_OS_MACX
	vertices[0] = Point2f(0, 0);
	vertices[1] = Point2f(gtex->width, 0);
	vertices[2] = Point2f(gtex->width, gtex->height);
	vertices[3] = Point2f(0, gtex->height);
#else
	vertices[0] = Point2f(0, gtex->height);
	vertices[1] = Point2f(gtex->width, gtex->height);
	vertices[2] = Point2f(gtex->width, 0);
	vertices[3] = Point2f(0, 0);
#endif
	vertices.Update();

	rdrTgt = gtexture_get_engine()->createRenderTarget(gtexture_getInternalTexture(gtex->gid));
	camtex = gtexture_get_engine()->createTexture(ShaderTexture::FMT_RGBA,
			ShaderTexture::PK_UBYTE,w,h,NULL,
			ShaderTexture::WRAP_CLAMP,ShaderTexture::FILT_LINEAR);
}
Пример #6
0
void GBitmapArray::doDraw(const CurrentTransform&, float sx, float sy, float ex, float ey)
{
    G_UNUSED(sx); G_UNUSED(sy); G_UNUSED(ex); G_UNUSED(ey);
}
Пример #7
0
void GLDMaskBox::showEvent(QShowEvent * event)
{
    G_UNUSED(event);

    if (!m_oTipBoxParam.m_wgtOwner)
    {
        return;
    }

    if (m_oTipBoxParam.m_nMaxWidth > 0)
    {
        this->setMaximumWidth(m_oTipBoxParam.m_nMaxWidth);
    }

    QIcon icon(m_oTipBoxParam.m_strIconClose);

    if (m_oTipBoxParam.m_bIsOverTimeShow)
    {
        m_btnClose->setIcon(icon);
        m_btnClose->setEnabled(true);
    }
    else
    {
        m_btnClose->setEnabled(false);
    }

    //m_btnClose->setIcon(icon);

    m_labelTextTitle->setFont(m_oTipBoxParam.m_fontTitle);
    m_labelTextTitle->setText(m_oTipBoxParam.m_strTitle);

    m_labelTextBody->setFont(m_oTipBoxParam.m_fontBody);
    m_labelTextBody->setText(m_oTipBoxParam.m_strBody);

    //为了设置行高,采用HTML,html换行为 <br/>
    m_oTipBoxParam.m_strBody.replace("\n", "<br/>");
    m_labelTextBody->setText(QString("<p style=\"line-height:%1px\">%2</p>")
        .arg(m_oTipBoxParam.m_nRowHeight).arg(m_oTipBoxParam.m_strBody));

    // 设置根据内容调整气泡提示的大小
    //this->layout()->setSizeConstraint(QLayout::SetFixedSize);
    m_labelTextBody->adjustSize();

    QPixmap pxpIco;
    pxpIco.load(m_oTipBoxParam.m_strIcon);

    if (!m_oTipBoxParam.m_sizeIcon.isEmpty())
    {
        pxpIco = pxpIco.scaled(m_oTipBoxParam.m_sizeIcon.width(), m_oTipBoxParam.m_sizeIcon.height(), Qt::KeepAspectRatio);
    }

    m_labelIco->setPixmap(pxpIco);

    m_animFadeOut->setDuration(m_oTipBoxParam.m_nTimeFadeOut);

    QWidget* wgt = m_oTipBoxParam.m_wgtOwner;
    while (wgt)
    {
        qDebug() << wgt->objectName();
        wgt->installEventFilter(this);
        wgt = wgt->parentWidget();
    }

    if (m_timerClose)
    {
        //m_timerClose->start(m_oTipBoxParam.m_nTimeRemain);
    }
}