void
DblqhProxy::execEXEC_SR_2(Signal* signal, GlobalSignalNumber gsn)
{
  ndbrequire(signal->getLength() == Ss_EXEC_SR_2::Sig::SignalLength);

  const Ss_EXEC_SR_2::Sig* sig =
    (const Ss_EXEC_SR_2::Sig*)signal->getDataPtr();
  Uint32 ssId = getSsId(sig);

  bool found = false;
  Ss_EXEC_SR_2& ss = ssFindSeize<Ss_EXEC_SR_2>(ssId, &found);
  if (!found) {
    jam();
    setMask(ss);
  }

  ndbrequire(sig->nodeId == getOwnNodeId());
  if (ss.m_sigcount == 0) {
    jam();
    ss.m_gsn = gsn;
    ss.m_sig = *sig;
  } else {
    jam();
    ndbrequire(ss.m_gsn == gsn);
    ndbrequire(memcmp(&ss.m_sig, sig, sizeof(*sig)) == 0);
  }
  ss.m_sigcount++;

  // reversed roles
  recvCONF(signal, ss);
}
Example #2
0
QtCurveSizeGrip::QtCurveSizeGrip(QtCurveClient* client):
    QWidget(0),
    client_(client)
{
    setAttribute(Qt::WA_NoSystemBackground );
    setAutoFillBackground(false);

    // cursor
    setCursor(Qt::SizeFDiagCursor);

    // size
    setFixedSize(QSize(GRIP_SIZE, GRIP_SIZE));

    // mask
    QPolygon p;
    p << QPoint(0, GRIP_SIZE)
      << QPoint(GRIP_SIZE, 0)
      << QPoint(GRIP_SIZE, GRIP_SIZE)
      << QPoint(0, GRIP_SIZE);

    setMask(QRegion(p));

    // embed
    embed();
    updatePosition();

    // event filter
    client->widget()->installEventFilter(this);

    // show
    show();
}
Example #3
0
void PopupMessage::dissolveMask()
{
    if( m_stage == 1 )
    {
        //repaint( false );
        QPainter maskPainter(&m_mask);

        m_mask.fill(Qt::black);

        maskPainter.setBrush(Qt::white);
        maskPainter.setPen(Qt::white);
        maskPainter.drawRect( m_mask.rect() );

        m_dissolveSize += m_dissolveDelta;

        if( m_dissolveSize > 0 )
        {
            //maskPainter.setCompositionMode( Qt::EraseROP );
			//FIXME: QRubberBand

            int x, y, s;
            const int size = 16;

            for (y = 0; y < height() + size; y += size)
            {
                x = width();
                s = m_dissolveSize * x / 128;

                for ( ; x > size; x -= size, s -= 2 )
                {
                    if (s < 0)
                        break;

                    maskPainter.drawEllipse(x - s / 2, y - s / 2, s, s);
                }
            }
        }
        else if( m_dissolveSize < 0 )
        {
            m_dissolveDelta = 1;
            killTimer( m_timerId );

            if( m_timeout )
            {
                m_timerId = startTimer( 40 );
                m_stage = 2;
            }
        }

        setMask(m_mask);
    }
    else if ( m_stage == 2 )
    {
        countDown();
    }
    else
    {
        deleteLater();
    }
}
Example #4
0
void ToolButtonTip::updateMask( void )
{
	// as this widget has not a rectangular shape AND is a top
	// level widget (which doesn't allow painting only particular
	// regions), we have to set a mask for it
	QBitmap b( size() );
	b.clear();

	QPainter p( &b );
	p.setBrush( Qt::color1 );
	p.setPen( Qt::color1 );
	p.drawRoundRect( 0, 0, width() - 1, height() - 1,
					ROUNDED / width(), ROUNDED / height() );

	if( m_toolButton )
	{
		QPoint pt = m_toolButton->mapToGlobal( QPoint( 0, 0 ) );
		const int dx = pt.x()-x();
		if( dx < 10 && dx >= 0 )
		{
			p.fillRect( dx, 0, 10, 10, Qt::color1 );
		}
	}

	setMask( b );
}
Example #5
0
/*
 * Initialize the disk driver.
 * Read the partition table.
 */
static void ideInitialize(void) {
  unsigned int totalSectors;

  /* determine disk size */
  waitDiskReady();
  totalSectors = *DISK_CAP;
  if (totalSectors == 0) {
    panic("IDE disk not found");
  }
  /* read partition table */
  readPartitionTable();
  if (debugIdeDisk) {
    printf("IDE disk has %d (0x%X) sectors\n",
           totalSectors, totalSectors);
    showPartitionTable();
  }
  /* disk queue is empty */
  ideTab.b_actf = NULL;
  ideTab.b_actl = NULL;
  /* no disk operation in progress, no errors */
  ideTab.b_active = 0;
  ideTab.b_errcnt = 0;
  /* set ISR and enable interrupts */
  setISR(DISK_IRQ, ideISR);
  setMask(getMask() | (1 << DISK_IRQ));
  /* the disk is now initialized */
  ideInitialized = TRUE;
}
void MaskingSample::setup() 
{
    ci::app::getWindow()->getSignalKeyUp().connect(std::bind(&MaskingSample::keyUp, this, std::placeholders::_1));
	
	//	Load the mask texture
	ci::gl::TextureRef maskTexture = ci::gl::Texture::create(ci::loadImage(ci::app::loadAsset("circle_mask_blurred.jpg")));
	
	//	Create the mask shape
	//mMask = Shape::create(maskTexture);
    mMask = Shape::createRect(100, 100);
    mMask->setAlignment(Alignment::CENTER_CENTER);
    mMask->setPosition(ci::app::getWindowWidth()/2, ci::app::getWindowHeight()/2);
    ci::app::timeline().apply(&mMask->getRotationAnim(), 0.0f, ci::toRadians(360.0f), 1.0f).loop();
    ci::app::timeline().apply(&mMask->getScaleAnim(), ci::vec2(1.0f, 1.0f), ci::vec2(4.0f, 4.0f), 1.0f).loop().pingPong();
    
	//	Load the image texture
	ci::gl::TextureRef texture = ci::gl::Texture::create(ci::loadImage(ci::app::loadAsset("cat.jpg")));
	
	//	Create the image shape
	mImage = Image::create(texture);
	addChild(mImage);
	
	//	Set the image mask
	setMask(mMask);
	
	//	Connect mouse event
	getSignal(MouseEvent::MOVE).connect(std::bind(&MaskingSample::onMouseMove, this, std::placeholders::_1));
}
void
DblqhProxy::execSTART_RECREQ(Signal* signal)
{
  if (refToMain(signal->getSendersBlockRef()) == DBLQH) {
    jam();
    execSTART_RECREQ_2(signal);
    return;
  }

  const StartRecReq* req = (const StartRecReq*)signal->getDataPtr();
  Ss_START_RECREQ& ss = ssSeize<Ss_START_RECREQ>();
  ss.m_req = *req;

  // seize records for sub-ops
  Uint32 i;
  for (i = 0; i < ss.m_req2cnt; i++) {
    Ss_START_RECREQ_2::Req tmp;
    tmp.proxyBlockNo = ss.m_req2[i].m_blockNo;
    Uint32 ssId2 = getSsId(&tmp);
    Ss_START_RECREQ_2& ss2 = ssSeize<Ss_START_RECREQ_2>(ssId2);
    ss.m_req2[i].m_ssId = ssId2;

    // set wait-for bitmask in SsParallel
    setMask(ss2);
  }

  ndbrequire(signal->getLength() == StartRecReq::SignalLength);
  sendREQ(signal, ss);
}
Example #8
0
void CCBar::resizeEvent(QResizeEvent *e)
{
	m_border = QPainterPath();
	m_border.moveTo(m_offset, 0);
	m_border.cubicTo(
			m_offset, 0,
	0, m_mask.height()/2,
	m_offset, m_mask.height()
			);
	
	m_border.lineTo(m_mask.width()-m_offset,  m_mask.height());
	
	m_border.cubicTo(
			m_mask.width()-m_offset,  m_mask.height(),
	m_mask.width(), m_mask.height()/2,
	m_mask.width()-m_offset, 0
			);
	m_border.lineTo(m_offset, 0);
	
	QPainter p(&m_mask);
	p.setPen(QPen(Qt::black,1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
	p.setBrush(Qt::red);
	p.drawPath(m_border);
	
	setMask(m_mask.mask());
}
RColorDialog::RColorDialog(QWidget *parent) :
    QDialog(parent)
{

    setFixedSize(220,300);
    QGridLayout *l = new QGridLayout;
    l->setSpacing(3);
    QList<QColor> colorlist;
    colorlist << "#1D48BB" << "#06829E" << "#006600" << "#990000" << "#800080" << "#FFAA00" << "#A6A6A6"<<"#505050" <<"#000000";
    for (int i = 0; i < 3; i++)
        for (int j = 0; j < 3; j++)
        {
            RPushButton *bt = new RPushButton;
            bt->setFixedSize(60,60);

            connect(bt, SIGNAL(clicked()),SLOT(setColor()));
            l->addWidget(bt, i, j);
        }
    RPushButton *closebt = new RPushButton;

    closebt->setFixedSize(60,60);

    connect(closebt,SIGNAL(clicked()),SLOT(close()));
    l->addWidget(closebt,3,2);
    setLayout(l);


    setMask(geometry());


}
Example #10
0
TicketPopup::TicketPopup(QWidget *parent, QString text, QPixmap pixmap, int timeToClose)
{
  setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint);
  setWindowModality(Qt::ApplicationModal);
  setObjectName("main");

  gridLayout = new QGridLayout(this);
  imagelabel = new QLabel(this);
  imagelabel->setPixmap(pixmap);
  imagelabel->setAlignment(Qt::AlignCenter);
  gridLayout->addWidget(imagelabel, 0, 0);
  editText = new QTextEdit(this);
  editText->setHtml(text);
  editText->setReadOnly(true);
  gridLayout->addWidget(editText, 1, 0);
  gridLayout->setMargin(17);

  timer = new QTimer(this);
  timer->setInterval(timeToClose);
  connect(timer, SIGNAL(timeout()), this, SLOT(closeIt()));
  

  QString path = KStandardDirs::locate("appdata", "images/");
  QString filen = path + "/imgPrint.png";
  QPixmap pix(filen);
  setMask(pix.mask());
  QString st;
  st = QString("main { background-image: url(%1);}").arg(filen);
  setStyleSheet(st);
}
Example #11
0
CursorWindow::CursorWindow(const QImage &img, QPoint hot, QWidget* sk)
	:QWidget(0),
	m_view(0), skin(sk),
	hotspot(hot)
{
    setWindowFlags( Qt::FramelessWindowHint );
    mouseRecipient = 0;
    setMouseTracking(true);
#ifndef QT_NO_CURSOR
    setCursor(Qt::BlankCursor);
#endif
    QPixmap p;
    p = QPixmap::fromImage(img);
    if (!p.mask()) {
	if ( img.hasAlphaChannel() ) {
	    QBitmap bm;
	    bm = QPixmap::fromImage(img.createAlphaMask());
	    p.setMask( bm );
	} else {
	    QBitmap bm;
	    bm = QPixmap::fromImage(img.createHeuristicMask());
	    p.setMask( bm );
	}
    }
    QPalette palette;
    palette.setBrush(backgroundRole(), QBrush(p));
    setPalette(palette);
    setFixedSize( p.size() );
    if ( !p.mask().isNull() )
	setMask( p.mask() );
}
Example #12
0
RongHe::RongHe(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::RongHe)
{
    ui->setupUi(this);
    //脡猫脰脙脭虏陆脟麓掳脤氓
    setWindowFlags(Qt::FramelessWindowHint);
    QPixmap mask(":/Images/images/ui_fix_min3.png");//录脫脭脴脩脷脗毛脥录脧帽
    setMask(QBitmap(mask.mask())); //脡猫脰脙麓掳脤氓碌脛脩脷脗毛脥录脧帽,驴脵鲁媒脥录脧帽碌脛掳脳脡芦脟酶脫貌脢碌脧脰虏禄鹿忙脭貌麓掳脤氓
    QPalette p;//脡猫脰脙碌梅脡芦掳氓
    p.setBrush(QPalette::Window, QBrush(mask));//陆芦碌梅脡芦掳氓碌脛禄颅脣垄脡猫脰脙脦陋脩脷脗毛脦禄脥录,脭脷虏禄鹿忙脭貌麓掳脤氓脡脧脧脭脢戮鲁枚脩脷脗毛脦禄脥录
    setPalette(p);
    //QPainter painter(this);
    //painter.drawPixmap(0,0,width(),height(),QPixmap(":/Images/images/ui_fix.png"));

    ui->pushButton->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_fix_work_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_fix_work_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_fix_work_press.png);}");
    ui->pushButton_5->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_windwork_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_windwork_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_windwork_press.png);}");
//    ui->pushButton_8->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_wavework_normal.png);}"
//                                   "QPushButton:hover{border-image: url(:/Images/images/pb_wavework_hover.png);}"
//                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_wavework_press.png);}");
    //显示结果样式

    ui->pushButton_8->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_datatrans_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_datatrans_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_datatrans_press.png);}");
    ui->pushButton_9->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_fix_result_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_fix_result_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_fix_result_press.png);}");
    ui->pushButton_10->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_datamix_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_datamix_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_datamix_press.png);}");
    ui->pushButton_6->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_mainui_return_normal2.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_mainui_return_hover2.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_mainui_return_press2.png);}");
    /*source button
    ui->pushButton_bf->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_play_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_play_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_play_press.png);}");
    ui->pushButton_zt->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_pause_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_pause_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_pause_press.png);}");
    ui->pushButton_jias->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_foreward_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_foreward_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_foreward_press.png);}");
    ui->pushButton_jians->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_back_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_back_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_back_press.png);}");
    */

	timer = new QTimer;
    speed = 500;
    label = NULL;
    iterator = NULL;
    connect(timer,SIGNAL(timeout()),this,SLOT(nextPicture()));
}
Example #13
0
ShapeWidget::ShapeWidget(QWidget *parent)
	: QWidget(parent,Qt::FramelessWindowHint)
{
    QPixmap pix;
    pix.load(":/images/tux.png",0,Qt::AvoidDither|Qt::ThresholdDither|Qt::ThresholdAlphaDither);
    resize(pix.size());
    setMask(pix.mask());
}
Example #14
0
 void resizeEvent( QResizeEvent* r )
 {
   QSize s = r->size();
   QRegion reg( 0, 0, s.width(), s.height() );
   QRegion reg2( 2, 2, s.width() - 4, s.height() - 4 );
   QRegion reg3 = reg.subtracted( reg2 );
   setMask( reg3 );
 }
Example #15
0
	MessageBubble(QWidget* parent) : QWidget(parent, Qt::Popup | Qt::Window) {
		QPolygon poly;
		for (int i = 0;  i < 5; i++) {
			poly << points[i];
		}
		QRegion reg(poly);
		setMask(reg);
	}
Example #16
0
void RotationDialog::resizeEvent(QResizeEvent *)
{
    QPainterPath p;
    p.addRoundedRect(rect(), 20, 20);
    QRegion maskedRegion(p.toFillPolygon().toPolygon());
    setMask(maskedRegion);
    updatePath();
}
Example #17
0
void bfin_interrupt_enable(bfin_isr_t *isr, bool enable) {
  rtems_interrupt_level isrLevel;

  rtems_interrupt_disable(isrLevel);
  isr->mask = enable ? (1 << isr->source) : 0;
  setMask(isr->vector);
  rtems_interrupt_enable(isrLevel);
}
Example #18
0
SingleSampler::SingleSampler()
{
	MakeRefByID(FOREVER, 0, CreateParameterBlock(pbDesc, PBLOCK_LENGTH, CURRENT_VERSION));
	DbgAssert(pParamBlk);
	pParamBlk->SetValue(PB_QUALITY, 0, 0 );	
	n = 1;
	setMask( mask, ALL_ONES );
}
Example #19
0
void MainWindow::updateDecoration()
{
    m_device = QPixmap(":/device-640x480.png", "png");
    QBitmap bitmap = m_device.createHeuristicMask();
    setFixedSize(m_device.size());
    setMask(bitmap);
    update();
}
Example #20
0
int main()
{
    int n;
    char group[3];
    std::vector<uint16_t> cards;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s", &group);
        uint16_t card = 0;
        card = setMask(card, getMask(group[0]));
        card = setMask(card, getMask(group[1]));
        cards.push_back(card);
    }
    printf("%d\n", solve_442a(cards));
    return 0;
}
Example #21
0
    ///
    // FirmwareProgressSensor constructor - uses system target
    //
    FirmwareProgressSensor::FirmwareProgressSensor( )
        :SensorBase(TARGETING::SENSOR_NAME_FW_BOOT_PROGRESS, NULL)
    {
        // message buffer created and initialized in base object.

        // assert the system firmware progress offset.
        iv_msg->iv_assertion_mask = setMask( SYSTEM_FIRMWARE_PROGRESS );
    };
Example #22
0
void
LauncherContextualMenu::updateMask()
{
    QPixmap pixmap(size());
    render(&pixmap, QPoint(), QRegion(),
           QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask);
    setMask(pixmap.createMaskFromColor("red"));
}
Example #23
0
void FakeToolTip::resizeEvent(QResizeEvent *)
{
    QStyleHintReturnMask frameMask;
    QStyleOption option;
    option.init(this);
    if (style()->styleHint(QStyle::SH_ToolTip_Mask, &option, this, &frameMask))
        setMask(frameMask.region);
}
Example #24
0
int removeTower(gnode * grid,tower* t){
//	gnode * node=&grid[t->position];
//	node->tower=0;
	t->health=-1;
	t->last_attack=t->owner;
	setMask(t,TOWER_HEALTH);
	return 0;
}
Example #25
0
/*!\reimp
 */
void QRadioButton::updateMask()
{
    QBitmap bm(width(),height());
    {
	bm.fill(color0);
	QPainter p( &bm, this );
	int x, y, w, h;
	GUIStyle gs = style();
	QFontMetrics fm = fontMetrics();
	QSize lsz = fm.size(ShowPrefix, text());
	QSize sz = style().exclusiveIndicatorSize();
	if ( gs == WindowsStyle )
	    sz.setWidth(sz.width()+1);
	y = 0;
	x = sz.width() + gutter;
	w = width() - x;
	h = height();

	QColorGroup cg(color1,color1, color1,color1,color1,color1,color1,color1, color0);

	style().drawItem( &p, x, y, w, h,
			  AlignLeft|AlignVCenter|ShowPrefix,
			  cg, TRUE,
			  pixmap(), text() );
	x = 0;
	y = (height() - lsz.height() + fm.height() - sz.height())/2;

	style().drawExclusiveIndicatorMask(&p, x, y, sz.width(), sz.height(), isOn() );

	if ( hasFocus() ) {
 	    y = 0;
 	    x = sz.width() + gutter;
 	    w = width() - x;
 	    h = height();
	    QRect br = style().itemRect( &p, x, y, w, h,
					 AlignLeft|AlignVCenter|ShowPrefix,
					 isEnabled(),
					 pixmap(), text() );
	    br.setLeft( br.left()-3 );
	    br.setRight( br.right()+2 );
	    br.setTop( br.top()-2 );
	    br.setBottom( br.bottom()+2);
	    br = br.intersect( QRect(0,0,width(),height()) );

	    if ( !text().isEmpty() )
		style().drawFocusRect( &p, br, cg );
	    else {
		br.setRight( br.left()-1 );
		br.setLeft( br.left()-16 );
		br.setTop( br.top() );
		br.setBottom( br.bottom() );
		style().drawFocusRect( &p, br, cg );
	    }

	}
    }
    setMask(bm);
}
Example #26
0
VertexWidget::VertexWidget(QWidget *shapeWidget, QWidget *parent)
    : QLabel(parent)
    , m_widget(shapeWidget)
    , m_pressed(false)
{
    QPixmap p(vertexPng);
    setPixmap(p);
    setMask(QBitmap(p));
}
Example #27
0
void ShapedClock::resizeEvent(QResizeEvent * /* event */)
{
    int side = qMin( width( ), height( ) );
    QRegion maskedRegion( width( ) / 2 - side / 2, height( ) / 2 - side / 2, side,
                         side, QRegion::Ellipse);
    //QPixmap pixmap( "D:\\ParkSolution\\Document\\Info.bmp" );
    //QBitmap bitmap( pixmap );
    setMask( maskedRegion );
}
Example #28
0
void TabPreview::resizeEvent(QResizeEvent* ev)
{
    QFrame::resizeEvent(ev);

    // Oxygen is setting rounded corners only for top-level tooltips
    if (mApp->styleName() == QLatin1String("oxygen")) {
        setMask(QzTools::roundedRect(rect(), 4));
    }
}
Example #29
0
static void *extend_heap(size_t words) //extend heap
{
	char *bp;
	size_t size;
	size = (words % 2) ? (words + 1)*WSIZE : words * WSIZE; 
#ifdef __DEBUG__
	fprintf(stderr, "Extending heap by %u...\n",size);
	printf("Heap size now : %u\n",mem_heapsize());
#endif
	if((long)(bp = mem_sbrk(size)) == -1) return NULL; //sbrk : gathering moar spaces
	set(getBlockHeader(bp), setMask(size, 0));
	set(getBlockFooter(bp), setMask(size, 0));
	set(getBlockHeader(getNextBlock(bp)), setMask(0, 1));
	push_back(size, bp); //empty block to the list
	void* result = coalesce(bp); //coalesces!
//	push_back(getSize(getBlockHeader(result)), result);
	return result;
}
Example #30
0
void EvSplitterHandle::resizeEvent(QResizeEvent *event)
{
    if (orientation() == Qt::Horizontal)
        setContentsMargins(2, 0, 2, 0);
    else
        setContentsMargins(0, 2, 0, 2);
    setMask(QRegion(contentsRect()));
    QSplitterHandle::resizeEvent(event);
}