void KeyframeEffect::pauseAnimationForTestingOnCompositor(double pauseTime)
{
    ASSERT(hasActiveAnimationsOnCompositor());
    if (!m_target || !m_target->layoutObject())
        return;
    ASSERT(animation());
    for (const auto& compositorAnimationId : m_compositorAnimationIds)
        CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*m_target, *animation(), compositorAnimationId, pauseTime);
}
Exemple #2
0
/**
 * \brief Get the animation associated with the current content.
 * \pre The content type is "content_animation".
 */
bf::animation bf::any_animation::get_current_animation() const
{
  switch( m_content_type )
    {
    case content_animation: return m_animation;
    case content_file: return m_animation_file.get_animation();
    default:
      { CLAW_FAIL("Invalid content type."); return animation(); }
    }
} // any_animation::get_current_animation()
Exemple #3
0
SysBtn::SysBtn(QWidget *parent, const style::sysButton &st, const QString &text) : Button(parent)
, _st(st)
, a_color(_st.color->c)
, _a_color(animation(this, &SysBtn::step_color))
, _text(text) {
	int32 w = _st.size.width() + (_text.isEmpty() ? 0 : ((_st.size.width() - _st.icon.width()) / 2 + st::titleTextButton.font->width(_text)));
	resize(w, _st.size.height());
	setCursor(style::cur_default);
	connect(this, SIGNAL(stateChanged(int, ButtonStateChangeSource)), this, SLOT(onStateChange(int, ButtonStateChangeSource)));
}
void Player::draw(sf::RenderTarget& target)
{
    aimer_->set_position(animation().center_relative());

    bool facing_left = direction_ == Left;
    animation().fliph(facing_left);

    float actual_rotation = aim_angle_;
    if (facing_left)
    {
        actual_rotation *= -1;
    }

    aimer_->fliph(facing_left);
    aimer_->set_rotation(actual_rotation);

    animation().draw(target);
    aimer_->draw(target);
}
Exemple #5
0
    void hard_reset() {
        ids[ 0 ] = "";
        names[ "" ] = 0;
        animations.push_back( animation() );

        playlist = {0};
        selected = 0; // same than .reset();

        factor = {1};
    }
Exemple #6
0
bool GraphicsLayer::addAnimation(PassOwnPtr<WebCompositorAnimation> popAnimation)
{
    OwnPtr<WebCompositorAnimation> animation(popAnimation);
    ASSERT(animation);
    platformLayer()->setAnimationDelegate(this);

    // Remove any existing animations with the same animation id and target property.
    platformLayer()->removeAnimation(animation->id(), animation->targetProperty());
    return platformLayer()->addAnimation(animation.leakPtr());
}
Exemple #7
0
IntroWidget::IntroWidget(Window *window) : TWidget(window)
, _langChangeTo(0)
, _a_stage(animation(this, &IntroWidget::step_stage))
, _cacheHideIndex(0)
, _cacheShowIndex(0)
, _a_show(animation(this, &IntroWidget::step_show))
, steps(new IntroSteps(this))
, phone(0)
, code(0)
, signup(0)
, pwdcheck(0)
, current(0)
, moving(0)
, _callTimeout(60)
, _registered(false)
, _hasRecovery(false)
, _codeByTelegram(false)
, _back(this, st::setClose)
, _backFrom(0)
, _backTo(0) {
	setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight));

	connect(&_back, SIGNAL(clicked()), this, SLOT(onIntroBack()));
	_back.hide();

	countryForReg = psCurrentCountry();

	MTP::send(MTPhelp_GetNearestDc(), rpcDone(gotNearestDC));
	signalEmitOn = this;

	stages[0] = steps;
	memset(stages + 1, 0, sizeof(QWidget*) * 3);
	_back.raise();

	connect(window, SIGNAL(resized(const QSize&)), this, SLOT(onParentResize(const QSize&)));

	show();
	setFocus();

	cSetPasswordRecovered(false);

	_back.move(st::setClosePos.x(), st::setClosePos.y());
}
void KeyframeEffect::clearEffects()
{
    ASSERT(animation());
    ASSERT(m_sampledEffect);

    m_sampledEffect->clear();
    m_sampledEffect = nullptr;
    restartAnimationOnCompositor();
    m_target->setNeedsAnimationStyleRecalc();
    invalidate();
}
    //____________________________________________________________________________
    ClientGroupItemDataList::ClientGroupItemDataList( Client* parent ):
        QObject( parent ),
        QList<ClientGroupItemData>(),
        _client( *parent ),
        _dirty( false ),
        animationsEnabled_( true ),
        _animation( new Animation( 150, this ) ),
        animationType_( AnimationNone ),
        progress_(0),
        draggedItem_( NoItem ),
        targetItem_( NoItem )
    {

        // setup animation
        animation().data()->setStartValue( 0 );
        animation().data()->setEndValue( 1.0 );
        animation().data()->setTargetObject( this );
        animation().data()->setPropertyName( "progress" );

    }
BackgroundRow::BackgroundRow(QWidget *parent) : TWidget(parent)
, _chooseFromGallery(this, lang(lng_settings_bg_from_gallery), st::defaultBoxLinkButton)
, _chooseFromFile(this, lang(lng_settings_bg_from_file), st::defaultBoxLinkButton)
, _radial(animation(this, &BackgroundRow::step_radial)) {
	Window::chatBackground()->initIfEmpty();

	updateImage();

	connect(_chooseFromGallery, SIGNAL(clicked()), this, SIGNAL(chooseFromGallery()));
	connect(_chooseFromFile, SIGNAL(clicked()), this, SIGNAL(chooseFromFile()));
}
void Qgs3DAnimationWidget::onRemoveKeyframe()
{
  int index = cboKeyframe->currentIndex();
  if ( index <= 0 )
    return;

  cboKeyframe->setCurrentIndex( 0 );
  cboKeyframe->removeItem( index );

  initializeController( animation() );
}
Exemple #12
0
void handleMouseKeypress(int key, int state, int x, int y)
{
    switch (key) {
		case GLUT_LEFT_BUTTON:
            if (state == 0 && pause==FALSE){
                if (gun0.bullet_number > 0) {
					gun0.bullet_number--;
					pistola.pushAnimation(animation(locRot(0,0,0,10,0,-10),100,std::chrono::system_clock::now()));
					pistola.pushAnimation(animation(locRot(0,0,0,-10,0,10),100,std::chrono::system_clock::now()+std::chrono::milliseconds(100)));
                    collisionCurse();
                }
				else 
				{
					sound.setBuffer(sound_youreempty);
					sound.play();
				}
            }
            break;
    }
}
Exemple #13
0
WWidget *WtHome::examples()
{
  WContainerWidget *result = new WContainerWidget();

  WText *intro = new WText(tr("home.examples"));
  intro->setInternalPathEncoding(true);
  result->addWidget(intro);

  examplesMenu_ = new WTabWidget(result);

  WAnimation animation(WAnimation::SlideInFromRight, WAnimation::EaseIn);
  examplesMenu_->contentsStack()->setTransitionAnimation(animation, true);

  /*
   * The following code is functionally equivalent to:
   *
   *   examplesMenu_->addTab(helloWorldExample(), "Hello world");
   *
   * However, we optimize here for memory consumption (it is a homepage
   * after all, and we hope to be slashdotted some day)
   *
   * Therefore, we wrap all the static content (including the tree
   * widgets), into WViewWidgets with static models. In this way the
   * widgets are not actually stored in memory on the server.
   */

  // The call ->setPathComponent() is to use "/examples/" instead of
  // "/examples/hello_world" as internal path
  examplesMenu_->addTab(wrapView(&WtHome::helloWorldExample),
			tr("hello-world"))->setPathComponent("");
  examplesMenu_->addTab(wrapView(&WtHome::chartExample),
  			tr("charts"));
  examplesMenu_->addTab(wrapView(&WtHome::homepageExample),
			tr("wt-homepage"));
  examplesMenu_->addTab(wrapView(&WtHome::treeviewExample),
			tr("treeview"));
  examplesMenu_->addTab(wrapView(&WtHome::gitExample),
			tr("git"));
  examplesMenu_->addTab(wrapView(&WtHome::chatExample),
			tr("chat"));
  examplesMenu_->addTab(wrapView(&WtHome::composerExample),
			tr("mail-composer"));
  examplesMenu_->addTab(wrapView(&WtHome::hangmanExample),
			tr("hangman"));
  examplesMenu_->addTab(wrapView(&WtHome::widgetGalleryExample),
			tr("widget-gallery"));

  // Enable internal paths for the example menu
  examplesMenu_->setInternalPathEnabled("/examples");
  examplesMenu_->currentChanged().connect(this, &Home::googleAnalyticsLogger);

  return result;
}
void CCounter::setDigit(int digit,bool bAnimate)
{
    if(_digit != digit){
        _digit = digit;
		CCNode* presenter = _presenters->getChildByTag(digit);
		CCPoint dest = presenter->getPosition();
		if(bAnimate)
			animation(digit);
		else
			_moveTo(digit,ccp(0, -dest.y));
    }
}
    //_____________________________________________________________________
    void SliderData::updateSlider( QStyle::SubControl hoverControl )
    {

        if( hoverControl == QStyle::SC_SliderHandle )
        {

            if( !sliderHovered() ) {
                setSliderHovered( true );
                if( enabled() )
                {
                    animation().data()->setDirection( Animation::Forward );
                    if( !animation().data()->isRunning() ) animation().data()->start();
                } else setDirty();
            }

        } else {

            if( sliderHovered() )
            {
                setSliderHovered( false );
                if( enabled() )
                {
                    animation().data()->setDirection( Animation::Backward );
                    if( !animation().data()->isRunning() ) animation().data()->start();
                } else setDirty();
            }

        }
    }
Exemple #16
0
TitleWidget::TitleWidget(MainWindow *window) : TWidget(window)
, wnd(window)
, hideLevel(0)
, hider(0)
, _back(this, st::titleBackButton, lang(lng_menu_back))
, _cancel(this, lang(lng_cancel), st::titleTextButton)
, _settings(this, lang(lng_menu_settings), st::titleTextButton)
, _contacts(this, lang(lng_menu_contacts), st::titleTextButton)
, _about(this, lang(lng_menu_about), st::titleTextButton)
, _lock(this, window)
, _update(this, window, lang(lng_menu_update))
, _minimize(this, window)
, _maximize(this, window)
, _restore(this, window)
, _close(this, window)
, _a_update(animation(this, &TitleWidget::step_update))
, lastMaximized(!(window->windowState() & Qt::WindowMaximized))
{
	setGeometry(0, 0, wnd->width(), st::titleHeight);
	setAttribute(Qt::WA_OpaquePaintEvent);
	_lock.hide();
	_update.hide();
    _cancel.hide();
    _back.hide();
	if (
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
		Sandbox::updatingState() == Application::UpdatingReady ||
#endif
		cHasPasscode()
	) {
		showUpdateBtn();
	}
	stateChanged();

	connect(&_back, SIGNAL(clicked()), window, SLOT(hideSettings()));
	connect(&_cancel, SIGNAL(clicked()), this, SIGNAL(hiderClicked()));
	connect(&_settings, SIGNAL(clicked()), window, SLOT(showSettings()));
	connect(&_contacts, SIGNAL(clicked()), this, SLOT(onContacts()));
	connect(&_about, SIGNAL(clicked()), this, SLOT(onAbout()));
	connect(wnd->windowHandle(), SIGNAL(windowStateChanged(Qt::WindowState)), this, SLOT(stateChanged(Qt::WindowState)));

#ifndef TDESKTOP_DISABLE_AUTOUPDATE
	Sandbox::connect(SIGNAL(updateReady()), this, SLOT(showUpdateBtn()));
#endif

    if (cPlatform() != dbipWindows) {
        _minimize.hide();
        _maximize.hide();
        _restore.hide();
        _close.hide();
    }
}
bool KeyframeEffectReadOnly::isCandidateForAnimationOnCompositor(
    double animationPlaybackRate) const {
  // Do not put transforms on compositor if more than one of them are defined
  // in computed style because they need to be explicitly ordered
  if (!model() || !m_target ||
      (m_target->computedStyle() && m_target->computedStyle()->hasOffset()) ||
      hasMultipleTransformProperties())
    return false;

  return CompositorAnimations::isCandidateForAnimationOnCompositor(
      specifiedTiming(), *m_target, animation(), *model(),
      animationPlaybackRate);
}
void OjMechantSimple::process()
{

	_dy = (_dy < GRAVITE)? _dy+PGRAVITE : GRAVITE;

	animation();
	QList<QGraphicsItem*> listCollision = collidingItems();

	for(int i=0;i<listCollision.size();++i)
	{
		emit collision(dynamic_cast<ObjetJeu*>(this),dynamic_cast<ObjetJeu*>(listCollision.at(i)));
	}
}
void KeyframeEffectReadOnly::clearEffects() {
  DCHECK(animation());
  DCHECK(m_sampledEffect);

  m_sampledEffect->clear();
  m_sampledEffect = nullptr;
  restartAnimationOnCompositor();
  m_target->setNeedsAnimationStyleRecalc();
  if (RuntimeEnabledFeatures::webAnimationsSVGEnabled() &&
      m_target->isSVGElement())
    toSVGElement(*m_target).clearWebAnimatedAttributes();
  invalidate();
}
Exemple #20
0
IntroSignup::IntroSignup(IntroWidget *parent) : IntroStep(parent)
, a_errorAlpha(0)
, a_photoOver(0)
, _a_error(animation(this, &IntroSignup::step_error))
, _a_photo(animation(this, &IntroSignup::step_photo))
, next(this, lang(lng_intro_finish), st::btnIntroNext)
, first(this, st::inpIntroName, lang(lng_signup_firstname))
, last(this, st::inpIntroName, lang(lng_signup_lastname))
, sentRequest(0)
, _invertOrder(langFirstNameGoesSecond()) {
	setVisible(false);
	setGeometry(parent->innerRect());

	connect(&next, SIGNAL(clicked()), this, SLOT(onSubmitName()));
	connect(&checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));

	if (_invertOrder) {
		setTabOrder(&last, &first);
	}

	setMouseTracking(true);
}
int XFormView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = ArthurFrame::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 15)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 15;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< XFormType*>(_v) = type(); break;
        case 1: *reinterpret_cast< bool*>(_v) = animation(); break;
        case 2: *reinterpret_cast< qreal*>(_v) = shear(); break;
        case 3: *reinterpret_cast< qreal*>(_v) = rotation(); break;
        case 4: *reinterpret_cast< qreal*>(_v) = scale(); break;
        case 5: *reinterpret_cast< QString*>(_v) = text(); break;
        case 6: *reinterpret_cast< QPixmap*>(_v) = pixmap(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setType(*reinterpret_cast< XFormType*>(_v)); break;
        case 1: setAnimation(*reinterpret_cast< bool*>(_v)); break;
        case 2: setShear(*reinterpret_cast< qreal*>(_v)); break;
        case 3: setRotation(*reinterpret_cast< qreal*>(_v)); break;
        case 4: setScale(*reinterpret_cast< qreal*>(_v)); break;
        case 5: setText(*reinterpret_cast< QString*>(_v)); break;
        case 6: setPixmap(*reinterpret_cast< QPixmap*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
void KeyframeEffectReadOnly::applyEffects() {
  DCHECK(isInEffect());
  DCHECK(animation());
  if (!m_target || !m_model)
    return;

  if (hasIncompatibleStyle())
    animation()->cancelAnimationOnCompositor();

  double iteration = currentIteration();
  DCHECK_GE(iteration, 0);
  bool changed = false;
  if (m_sampledEffect) {
    changed = m_model->sample(clampTo<int>(iteration, 0), progress(),
                              iterationDuration(),
                              m_sampledEffect->mutableInterpolations());
  } else {
    Vector<RefPtr<Interpolation>> interpolations;
    m_model->sample(clampTo<int>(iteration, 0), progress(), iterationDuration(),
                    interpolations);
    if (!interpolations.isEmpty()) {
      SampledEffect* sampledEffect = SampledEffect::create(this);
      sampledEffect->mutableInterpolations().swap(interpolations);
      m_sampledEffect = sampledEffect;
      ensureAnimationStack(m_target).add(sampledEffect);
      changed = true;
    } else {
      return;
    }
  }

  if (changed) {
    m_target->setNeedsAnimationStyleRecalc();
    if (RuntimeEnabledFeatures::webAnimationsSVGEnabled() &&
        m_target->isSVGElement())
      toSVGElement(*m_target).setWebAnimationsPending();
  }
}
    //______________________________________________
    bool WidgetStateData::updateState( bool value )
    {
        if( !_initialized )
        {

            _state = value;
            _initialized = true;
            return false;

        } else if( _state == value ) {

            return false;

        } else {

            _state = value;
            animation().data()->setDirection( _state ? Animation::Forward : Animation::Backward );
            if( !animation().data()->isRunning() ) animation().data()->start();
            return true;

        }

    }
Exemple #24
0
void CAI_Stalker::renderable_Render	()
{
	inherited::renderable_Render		();

	if (!already_dead())
		CInventoryOwner::renderable_Render	();

#ifdef DEBUG
	if (g_Alive()) {
		if (psAI_Flags.test(aiAnimationStats))
			animation().add_animation_stats	();
	}
#endif // DEBUG
}
Exemple #25
0
FlatTextarea::FlatTextarea(QWidget *parent, const style::flatTextarea &st, const QString &pholder, const QString &v) : QTextEdit(parent)
, _oldtext(v)
, _phVisible(!v.length())
, a_phLeft(_phVisible ? 0 : st.phShift)
, a_phAlpha(_phVisible ? 1 : 0)
, a_phColor(st.phColor->c)
, _a_appearance(animation(this, &FlatTextarea::step_appearance))
, _st(st) {
	setAcceptRichText(false);
	resize(_st.width, _st.font->height);

	setFont(_st.font->f);
	setAlignment(_st.align);

	setPlaceholder(pholder);

	QPalette p(palette());
	p.setColor(QPalette::Text, _st.textColor->c);
	setPalette(p);

	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

	setFrameStyle(QFrame::NoFrame | QFrame::Plain);
	viewport()->setAutoFillBackground(false);

	setContentsMargins(0, 0, 0, 0);

	switch (cScale()) {
	case dbisOneAndQuarter: _fakeMargin = 1; break;
	case dbisOneAndHalf: _fakeMargin = 2; break;
	case dbisTwo: _fakeMargin = 4; break;
	}
	setStyleSheet(qsl("QTextEdit { margin: %1px; }").arg(_fakeMargin));

	viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
	_touchTimer.setSingleShot(true);
	connect(&_touchTimer, SIGNAL(timeout()), this, SLOT(onTouchTimer()));

	connect(document(), SIGNAL(contentsChange(int, int, int)), this, SLOT(onDocumentContentsChange(int, int, int)));
	connect(document(), SIGNAL(contentsChanged()), this, SLOT(onDocumentContentsChanged()));
	connect(this, SIGNAL(undoAvailable(bool)), this, SLOT(onUndoAvailable(bool)));
	connect(this, SIGNAL(redoAvailable(bool)), this, SLOT(onRedoAvailable(bool)));
	if (App::wnd()) connect(this, SIGNAL(selectionChanged()), App::wnd(), SLOT(updateGlobalMenu()));

	if (!v.isEmpty()) {
		setTextFast(v);
	}
}
Exemple #26
0
GameWidget::GameWidget(QWidget *parent)
: QGLWidget(QGLFormat(QGL::SampleBuffers), parent) // QWidget(parent) //
{
	moteur = new GameEngine();
	audio = SoundManager::getInstance();
	son_montagne = son_avalanche = son_mort = son_fish = son_victoire = 0;
	setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
	animation_en_cours=false;
	avalancheTombant=false;
	afficher_accueil=true;
	timer_animation = new QTimer(this);
	connect(timer_animation, SIGNAL(timeout()), this, SLOT(animation()));
	generateImage();
	setFocus();
}
Exemple #27
0
	statusmenu::statusmenu()
	{
		app.getimgcache()->setmode(ict_sys);
		nl::nx::view_file("UI");

		node source = nl::nx::nodes["UI"]["StatusBar2.img"]["mainBar"]["System"];

		sprites.push_back(sprite(animation(source["backgrnd"]["0"]), vector2d(0, 0)));
		backfill = texture(source["backgrnd"]["1"]);
		sprites.push_back(sprite(animation(source["backgrnd"]["2"]), vector2d(0, 150)));

		buttons[BT_CHANGECH] = button(source["BtChannel"], 8, 20);
		buttons[BT_KEYCONFIG] = button(source["BtKeySetting"], 8, 46);
		buttons[BT_JOYPAD] = button(source["BtJoyPad"], 8, 72);
		buttons[BT_OPTIONS] = button(source["BtSystemOption"], 8, 98);
		buttons[BT_GOPTIONS] = button(source["BtGameOption"], 8, 124);
		buttons[BT_QUITGAME] = button(source["BtGameQuit"], 8, 150);

		nl::nx::unview_file("UI");
		app.getimgcache()->unlock();
		position = vector2d(721, 366);
		dimensions = vector2d(79, 176);
		active = true;
	}
FlatCheckbox::FlatCheckbox(QWidget *parent, const QString &text, bool checked, const style::flatCheckbox &st) : Button(parent)
, _st(st)
, a_over(0, 0)
, _a_appearance(animation(this, &FlatCheckbox::step_appearance))
, _text(text)
, _opacity(1)
, _checked(checked) {
	connect(this, SIGNAL(clicked()), this, SLOT(onClicked()));
	connect(this, SIGNAL(stateChanged(int, ButtonStateChangeSource)), this, SLOT(onStateChange(int, ButtonStateChangeSource)));
	setCursor(_st.cursor);
	int32 w = _st.width, h = _st.height;
    if (w <= 0) w = _st.textLeft + _st.font->width(_text) + 2;
	if (h <= 0) h = qMax(_st.font->height, _st.imageRect.pxHeight());
	resize(QSize(w, h));
}
Exemple #29
0
void inPhieu(char *dir,char* trangThai){	// Chuong trinh in phieu nhay theo tung 500 ms
	FILE *fp;
	khachHang temp;
	fp = fopen(dir,"rb");
	fread(&temp,sizeof(temp),1,fp);
	fclose(fp);
	printf(" Ban Co Muon In Phieu? (Y/N)\n");
	if (yesNo() == 1){
		printf("\n ..Dang In.");
		animation();
		printf("\n ..Xong........\n\n\n");
		printInfo(temp,0,trangThai);
	}
	else return;	
}
//-------------------------------------------------------------
void Polaroidframe::draw(){
    
    drawShadow();
    drawFrames();
    drawBottomBanner();
    drawPic();
    ofPushMatrix();
    ofTranslate(pos);
    ofRotateZ(angle);
    ofSetColor(color);
    ofRect(frame);
    ofPopMatrix();
    animation();
    
}