Esempio n. 1
0
bool ScrollView::initWithContainer(ScrollViewDelegate* pDele, int nCount, const Size& oSize)
{
    _pageCount = nCount;
    _cellSize = oSize;
    _pageEnabled = true;
    _delegate = NULL;
    _bounceable = true;
    _clippingToBounds = true;
    
    setDelegate(pDele);
    
    Layer* pContainer= Layer::create();
    pContainer->setAnchorPoint(Vec2::ZERO);
    pContainer->setPosition(Vec2::ZERO);
    
    for (int i=0 ; i<nCount ; ++i)
    {
        Node* pNode = Node::create();
        pDele->scrollViewInitPage(pNode, i);
        pNode->setPosition(Vec2(i*oSize.width, 0));
        pNode->setTag(i);
        pContainer->addChild(pNode);
    }
    
    setContainer(pContainer);
    setContentSize(Size(oSize.width*nCount, oSize.height));
    
    setTouchEnabled(true);
    
    return true;
}
bool CCCGameScrollView::createContainer(CCNewScrollViewDelegate* pDele, int nCount,const cocos2d::CCSize & oSize )
{
	m_nPageCount=nCount;
	m_CellSize=oSize;
	setDelegate(pDele);
    
	CCLayer* pContainer=CCLayer::create();
	pContainer->setAnchorPoint(CCPointZero);
	pContainer->setPosition(CCPointZero);
    
	CCSize winSize=CCDirector::sharedDirector()->getVisibleSize();
    
	for (int i=0;i<nCount;++i)
	{
		CCNode* pNode=CCNode::create();
		pDele->scrollViewInitPage(pNode,i);
		pNode->setPosition(ccp(winSize.width/2+i*oSize.width,winSize.height/2));
		pNode->setTag(i);
		pContainer->addChild(pNode);
	}
    
	setContainer(pContainer);
	setContentSize(CCSizeMake(oSize.width*nCount,oSize.height));
    
	return true;
}
Esempio n. 3
0
void PushBallScene::touchEvent(Ref *obj , Widget::TouchEventType type)
{
    Button *btn = dynamic_cast<Button *>(obj);
    switch (type)
    {
        case ui::Widget::TouchEventType::ENDED:
        {
            switch (btn->getTag()) {
                case 200:
                {
                    auto coin = ToolSprite::create("cocos_studio/studio_ui/choose_flavor/coin.png");
                    coin->setPosition(ui_coin->getPosition());
                    this->addToUILayer(coin);
                    coin->setDelegate(this);
                    coin->setTag(COINTAG);
//                    coin->setIsMove(false);
                    
                   Vec2 pos =  this->m_pContentLayer->getChildByTag(MACCOVER)->convertToWorldSpace(slitPushPos[m_iMacNum]);
                    
                    auto parabola = ParabolaTo::create(5.0, coin->getPosition(), pos);
                    
                    coin->runAction(Sequence::create(parabola,nullptr));
                    
                }
                    break;
            }
        }
    }
}
Esempio n. 4
0
UBGraphicsVideoItem::UBGraphicsVideoItem(const QUrl& pVideoFileUrl, QGraphicsItem *parent):
        UBGraphicsMediaItem(pVideoFileUrl,parent)
        , mShouldMove(false)
{
    update();

    mMediaObject = new Phonon::MediaObject(this);
    mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...

    Phonon::createPath(mMediaObject, mVideoWidget);

    mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
    Phonon::createPath(mMediaObject, mAudioOutput);

    /*
     * The VideoVidget should recover the size from the original movie, but this is not always true expecially on
     * windows and linux os. I don't know why?
     * In this case the wiget size is equal to QSize(1,1).
     */

    if(mVideoWidget->sizeHint() == QSize(1,1)){
      mVideoWidget->resize(320,240);
    }

    setWidget(mVideoWidget);

    UBGraphicsVideoItemDelegate* delegate = new UBGraphicsVideoItemDelegate(this, mMediaObject);
    delegate->init();
    setDelegate(delegate);

    mDelegate->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);

    connect(mDelegate, SIGNAL(showOnDisplayChanged(bool)), this, SLOT(showOnDisplayChanged(bool)));
    connect(mMediaObject, SIGNAL(hasVideoChanged(bool)), this, SLOT(hasVideoChanged(bool)));
}
Esempio n. 5
0
UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) :
    QGraphicsTextItem(parent)
    , UBGraphicsItem()
    , mMultiClickState(0)
    , mLastMousePressTime(QTime::currentTime())
{
    setDelegate(new UBGraphicsTextItemDelegate(this, 0));

    // TODO claudio remove this because in contrast with the fact the frame should be created on demand.
    Delegate()->createControls();
    Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
    Delegate()->setUBFlag(GF_FLIPPABLE_ALL_AXIS, false);
    Delegate()->setUBFlag(GF_REVOLVABLE, true);

    mTypeTextHereLabel = tr("<Type Text Here>");

    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);
    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly


    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);

    setTextInteractionFlags(Qt::TextEditorInteraction);

    setUuid(QUuid::createUuid());

    connect(document(), SIGNAL(contentsChanged()), Delegate(), SLOT(contentsChanged()));
    connect(document(), SIGNAL(undoCommandAdded()), this, SLOT(undoCommandAdded()));

    connect(document()->documentLayout(), SIGNAL(documentSizeChanged(const QSizeF &)),
            this, SLOT(documentSizeChanged(const QSizeF &)));

}
Esempio n. 6
0
void Scheduler::startSurface(
    SurfaceId surfaceId,
    const std::string &moduleName,
    const folly::dynamic &initialProps,
    const LayoutConstraints &layoutConstraints,
    const LayoutContext &layoutContext) {
  std::lock_guard<std::mutex> lock(mutex_);

  auto shadowTree =
      std::make_unique<ShadowTree>(surfaceId, layoutConstraints, layoutContext);
  shadowTree->setDelegate(this);
  shadowTreeRegistry_.emplace(surfaceId, std::move(shadowTree));

#ifndef ANDROID

  // TODO: Is this an ok place to do this?
  auto serializedCommands = initialProps.find("serializedCommands");
  if (serializedCommands != initialProps.items().end()) {
    auto tree = TemplateRenderer::buildShadowTree(serializedCommands->second.asString(), surfaceId, folly::dynamic::object(), *componentDescriptorRegistry_);

    uiManagerDidFinishTransactionWithoutLock(surfaceId, std::make_shared<SharedShadowNodeList>(SharedShadowNodeList {tree}));
    // TODO: hydrate rather than replace
    uiManager_->startSurface(surfaceId, moduleName, initialProps);
  } else {
    uiManager_->startSurface(surfaceId, moduleName, initialProps);
  }
#endif
}
bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if (!glview) {
        glview = GLViewImpl::create("SocketClient");
        director->setOpenGLView(glview);
    }
    
    // Tell cocos our design resolution and our resolution policy
    director->getOpenGLView()->setDesignResolutionSize(1024, 768, ResolutionPolicy::FIXED_HEIGHT);
    
    // Get the actual screen size
    Size frameSize = glview->getFrameSize();
    
    // turn on display FPS
    //director->setDisplayStats(true);
    
    // set FPS. the default value is 1.0/60 if you don't call this
    director->setAnimationInterval(1.0 / 60);
    
    register_all_packages();
    
    Director::getInstance()->runWithScene(SceneSample::scene());
    
    auto socketThread = SocketThread::GetInstance();
    socketThread->start();
    socketThread->setDelegate(this);
    
    return true;
}
Esempio n. 8
0
bool Server::connectServer()
{
    if (m_serverDelegate == 0) setDelegate(m_host, m_type);
    bool connected(isConnected());
    if (!connected) connected = m_serverDelegate->connectServer();
    if (connected) startTimer();
    return connected;
}
QVariantPrototype::QVariantPrototype(JSC::ExecState* exec, WTF::PassRefPtr<JSC::Structure> structure,
                                     JSC::Structure* prototypeFunctionStructure)
    : QScriptObject(structure)
{
    setDelegate(new QVariantDelegate(QVariant()));

    putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, variantProtoFuncToString), JSC::DontEnum);
    putDirectFunction(exec, new (exec) JSC::NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, variantProtoFuncValueOf), JSC::DontEnum);
}
Esempio n. 10
0
bool PlyReader::parseWithDelegate(std::shared_ptr<PlyReaderDelegate> delegate)
{
	bool result = setDelegate(delegate);
	if (result)
	{
		parseFile();
	}
	return result;
}
Esempio n. 11
0
void KComboBox::setLineEdit( QLineEdit *edit )
{
    if ( !editable() && edit &&
         !qstrcmp( edit->className(), "QLineEdit" ) )
    {
        // uic generates code that creates a read-only KComboBox and then
        // calls combo->setEditable( true ), which causes QComboBox to set up
        // a dumb QLineEdit instead of our nice KLineEdit.
        // As some KComboBox features rely on the KLineEdit, we reject
        // this order here.
        delete edit;
        edit = new KLineEdit( this, "combo edit" );
    }

    QComboBox::setLineEdit( edit );
    d->klineEdit = dynamic_cast<KLineEdit*>( edit );
    setDelegate( d->klineEdit );

    // Connect the returnPressed signal for both Q[K]LineEdits'
    if (edit)
        connect( edit, SIGNAL( returnPressed() ), SIGNAL( returnPressed() ));

    if ( d->klineEdit )
    {
        // someone calling KComboBox::setEditable( false ) destroys our
        // lineedit without us noticing. And KCompletionBase::delegate would
        // be a dangling pointer then, so prevent that. Note: only do this
        // when it is a KLineEdit!
        connect( edit, SIGNAL( destroyed() ), SLOT( lineEditDeleted() ));

        connect( d->klineEdit, SIGNAL( returnPressed( const QString& )),
                 SIGNAL( returnPressed( const QString& ) ));

        connect( d->klineEdit, SIGNAL( completion( const QString& )),
                 SIGNAL( completion( const QString& )) );

        connect( d->klineEdit, SIGNAL( substringCompletion( const QString& )),
                 SIGNAL( substringCompletion( const QString& )) );

        connect( d->klineEdit,
                 SIGNAL( textRotation( KCompletionBase::KeyBindingType )),
                 SIGNAL( textRotation( KCompletionBase::KeyBindingType )) );

        connect( d->klineEdit,
                 SIGNAL( completionModeChanged( KGlobalSettings::Completion )),
                 SIGNAL( completionModeChanged( KGlobalSettings::Completion)));

        connect( d->klineEdit,
                 SIGNAL( aboutToShowContextMenu( QPopupMenu * )),
                 SIGNAL( aboutToShowContextMenu( QPopupMenu * )) );

        connect( d->klineEdit,
                 SIGNAL( completionBoxActivated( const QString& )),
                 SIGNAL( activated( const QString& )) );
    }
Esempio n. 12
0
ILTelemetry::ILTelemetry() : ILObject() {
	_i = new ILTelemetryImpl;
	_i->delegate = NULL;
	_i->on = false;
	
	setDelegate(new ILTelemetryStdoutLogger());
	
	char* isOn = getenv("ILTelemetryIsOn");
	if (isOn && strcmp(isOn, "YES") == 0)
		setOn(true);
}
Esempio n. 13
0
UBGraphicsAudioItem::UBGraphicsAudioItem(const QUrl& pAudioFileUrl, QGraphicsItem *parent):
        UBGraphicsMediaItem(pAudioFileUrl,parent)
{
    update();

    mAudioOutput = new Phonon::AudioOutput ( Phonon::MusicCategory, this );
    mMediaObject = new Phonon::MediaObject ( this );
    mMediaObject->setTickInterval ( 1000 );
    Phonon::createPath ( mMediaObject, mAudioOutput );

    mMediaObject->clearQueue();
    mSource = Phonon::MediaSource(pAudioFileUrl);
    mMediaObject->setCurrentSource (mSource );

    connect (mMediaObject,SIGNAL ( tick ( qint64 ) ), this, SLOT ( tick ( qint64 ) ) );
    connect(mMediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(onStateChanged(Phonon::State,Phonon::State)));

    mAudioWidget = new QWidget();

    mSeekSlider = new Phonon::SeekSlider ( mAudioWidget );
    mSeekSlider->setMediaObject ( mMediaObject );

    QPalette palette;
    palette.setBrush ( QPalette::Light, Qt::darkGray );

    mTimeLcd = new QLCDNumber;
    mTimeLcd->setPalette ( palette );
    mTimeLcd->display ( "00:00" );

    QHBoxLayout *seekerLayout = new QHBoxLayout;
    seekerLayout->addWidget ( mSeekSlider );
    seekerLayout->addWidget ( mTimeLcd );

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout ( seekerLayout );

    mAudioWidget->setLayout ( mainLayout );
    setWidget ( mAudioWidget );

    UBGraphicsAudioItemDelegate* delegate = new UBGraphicsAudioItemDelegate ( this, mMediaObject );
    delegate->init();
    setDelegate ( delegate );

    mDelegate->frame()->setOperationMode ( UBGraphicsDelegateFrame::Resizing );

    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly

}
Esempio n. 14
0
//평수
void EstimateUserInfo::setSizeInputBox()
{
    auto editbox = EditBox::create(Size(300, 30), ui::Scale9Sprite::create());
    editbox->setPosition(ratioPosition(50, 52.5f));
    editbox->setPlaceHolder("공사할 공간의 면적(평수)");
    editbox->setMaxLength(100);
    editbox->setPlaceholderFontColor(Color3B::GRAY);
    editbox->setFontColor(Color3B::BLACK);
    editbox->setPlaceholderFontSize(10);
    editbox->setReturnType(EditBox::KeyboardReturnType::DONE);
    editbox->setInputMode(EditBox::InputMode::NUMERIC);

    this->addChild(editbox);
    editbox->setDelegate(this);
    
}
Esempio n. 15
0
UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent)
    : QGraphicsPixmapItem(parent)
{
    setDelegate(new UBGraphicsItemDelegate(this, 0, true, false, true, true));
    Delegate()->init();
    Delegate()->setFlippable(true);
    Delegate()->setRotatable(true);

    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);
    setTransformationMode(Qt::SmoothTransformation);

    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);

    setUuid(QUuid::createUuid()); //more logical solution is in creating uuid for element in element's constructor
}
Esempio n. 16
0
QbsKJob::QbsKJob(const QbsKJob::CreateQbsJobFunction &function, const QString &buildDir, QObject *parent)
    : KDevelop::OutputJob(parent)
    , m_createQbsJobFunction(function)
    , m_job(nullptr)
{
    KDevelop::OutputModel* model = new KDevelop::OutputModel( QUrl::fromLocalFile(buildDir) );
    model->setFilteringStrategy( KDevelop::OutputModel::CompilerFilter );
    setModel(model);
    setCapabilities(Killable);

    setStandardToolView(KDevelop::IOutputView::BuildView);
    setBehaviours(KDevelop::IOutputView::AllowUserClose | KDevelop::IOutputView::AutoScroll );

    setObjectName(buildDir);
    setDelegate(new KDevelop::OutputDelegate);
    setKillJobOnOutputClose(true);
}
Esempio n. 17
0
//주소
void EstimateUserInfo::setAddressInputBox()
{
    
    auto editbox = EditBox::create(Size(300, 30), ui::Scale9Sprite::create());
//    "images/UIButtons/UI_TopMenuBG-hd.png"
    editbox->setPosition(ratioPosition(50, 63));
    editbox->setPlaceHolder("상세주소입력");                        //처음 보여주는 문자열
    editbox->setMaxLength(100);                                //최대로 입력받을수 잇는 문자의 길이
    editbox->setPlaceholderFontColor(Color3B::GRAY);        //문자열 색변경
    editbox->setFontColor(Color3B::BLACK);                    //입력한 문자열 색변경

    //키보드 오른쪽하단 enter키를 search로 변경
    editbox->setReturnType(EditBox::KeyboardReturnType::DONE);
    this->addChild(editbox);
    editbox->setDelegate(this);
    
}
UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent)
    :QGraphicsItemGroup(parent), UBGraphicsItem()
{
    setDelegate(new UBGraphicsItemDelegate(this, 0, true, true, false));
    Delegate()->init();
    Delegate()->setFlippable(true);
    Delegate()->setRotatable(true);
    Delegate()->setCanTrigAnAction(true);

    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);

    setUuid(QUuid::createUuid());
    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setFlag(QGraphicsItem::ItemIsMovable, true);

}
Esempio n. 19
0
void UI::initEditBox(){
    auto visibleSize=Director::getInstance()->getVisibleSize();
    auto eb=EditBox::create(cocos2d::Size(800,200) ,"editBG.png");
    eb->setPlaceHolder("请输入内容");
    eb->setPlaceholderFont("font/Marker Felt.ttf", 40);
    eb->setPlaceholderFontColor(Color3B::YELLOW);
    eb->setFont("font/Marker Felt.ttf", 20);
    eb->setColor(Color3B::BLACK);
    //eb->setInputFlag(cocos2d::ui::EditBox::InputFlag::PASSWORD);
    eb->setInputMode(cocos2d::ui::EditBox::InputMode::ANY);
    eb->setReturnType(cocos2d::ui::EditBox::KeyboardReturnType::DONE);
    //设置代理
    eb->setDelegate(this);
    eb->setMaxLength(20);
    eb->setPosition(visibleSize/2);
    addChild(eb);
    
}
UBGraphicsGroupContainerItem::UBGraphicsGroupContainerItem(QGraphicsItem *parent)
    : QGraphicsItem(parent)
    , mCurrentItem(NULL)
{
    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);

   	setDelegate(new UBGraphicsGroupContainerItemDelegate(this, 0));
    Delegate()->init();

    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setFlag(QGraphicsItem::ItemIsMovable, true);

    UBGraphicsGroupContainerItem::setAcceptHoverEvents(true);

    setUuid(QUuid::createUuid());

    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
}
Esempio n. 21
0
void UBGraphicsSvgItem::init()
{
    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);

    setDelegate(new UBGraphicsItemDelegate(this, 0, true, true, false, true));
    Delegate()->init();
    Delegate()->setFlippable(true);
    Delegate()->setRotatable(true);


    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);

    setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    setMaximumCacheSize(boundingRect().size().toSize() * UB_MAX_ZOOM);

    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly

    setUuid(QUuid::createUuid());
}
Esempio n. 22
0
void HelloWorld::testEditBox()
{
    auto sp = Scale9Sprite::create("textField.png");
    //设置大小
    sp->setPreferredSize(Size(255, 40));
    sp->setAnchorPoint(Point(0.5, 0.5));
    
    
    auto editBox=EditBox::create(Size(255, 40), sp);
    editBox->setPlaceHolder("请输入内容");
    editBox->setFontColor(Color3B(255, 0, 255));
    editBox->setPosition(Point(240, 60));
    editBox->setInputMode(EditBox::InputMode::ANY);
    editBox->setMaxLength(10);
    editBox->setReturnType(EditBox::KeyboardReturnType::DONE);
    editBox->setDelegate(this);
    editBox->setInputFlag(EditBox::InputFlag::PASSWORD);
    this->addChild(editBox);
}
UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent)
    :QGraphicsItemGroup(parent), UBGraphicsItem()
{
    setDelegate(new UBGraphicsItemDelegate(this, 0, GF_COMMON
                                           | GF_RESPECT_RATIO
                                           | GF_REVOLVABLE
                                           | GF_FLIPPABLE_ALL_AXIS));

    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);

    setUuid(QUuid::createUuid());
    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setFlag(QGraphicsItem::ItemIsMovable, true);

    mDebugText = NULL;
    debugTextEnabled = false; // set to true to get a graphical display of strokes' Z-levels
}
bool DungeonLayer::init() {
  if (!Layer::init()) {
    return false;
  }
  
  this->setName(DUNGEON_LAYER_NAME);
  
  auto characterSprite = CharacterDiceSprite::create();
  characterSprite->setDelegate(this);
  
  auto character = Game::getInstance()->getPlayer()->getCharacter();
  character->setSprite(characterSprite);
  character->resetLife();
  
  this->reset();
  this->_setupEventHandlers();
  
  return true;
}
Esempio n. 25
0
UBGraphicsCurtainItem::UBGraphicsCurtainItem(QGraphicsItem* parent)
    : QGraphicsRectItem(parent)
{
    UBGraphicsCurtainItemDelegate* delegate = new UBGraphicsCurtainItemDelegate(this, 0);
    delegate->init();
    setDelegate(delegate);

    setFlag(QGraphicsItem::ItemIsMovable, true);
    setFlag(QGraphicsItem::ItemIsSelectable, true);

#if QT_VERSION >= 0x040600 // needs Qt 4.6.0 or better
    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
#endif

    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Tool);
    setPen(Qt::NoPen);
    this->setAcceptHoverEvents(true);

    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::Curtain)); //Necessary to set if we want z value to be assigned correctly
}
Esempio n. 26
0
void Scheduler::startSurface(
    SurfaceId surfaceId,
    const std::string &moduleName,
    const folly::dynamic &initialProps,
    const LayoutConstraints &layoutConstraints,
    const LayoutContext &layoutContext) const {
  std::lock_guard<std::mutex> lock(mutex_);

  auto shadowTree =
      std::make_unique<ShadowTree>(surfaceId, layoutConstraints, layoutContext);
  shadowTree->setDelegate(this);
  shadowTreeRegistry_.emplace(surfaceId, std::move(shadowTree));

#ifndef ANDROID
  runtimeExecutor_([=](jsi::Runtime &runtime) {
    uiManagerBinding_->startSurface(
        runtime, surfaceId, moduleName, initialProps);
  });
#endif
}
Esempio n. 27
0
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Layer::init() )
    {
        return false;
    }
    auto director = Director::getInstance();
    _winSize = director->getWinSize();
 
    _ground = GroundLayer::create();
    this->addChild(_ground, 0);
    
    auto interface = InterfaceLayer::create();
    interface->setDelegate(_ground);
    
    this->addChild(interface, 1);

    return true;
}
Esempio n. 28
0
//요청사항
void EstimateUserInfo::setRequestInputBox()
{
    auto editbox = EditBox::create(Size(300, 30), ui::Scale9Sprite::create());
    editbox->setPosition(ratioPosition(50, 42));
    editbox->setPlaceHolder("세부 요청사항을 작성해주세요.");                            editbox->setMaxLength(100);
    editbox->setPlaceholderFontColor(Color3B::GRAY);
    editbox->setFontColor(Color3B::BLACK);
    editbox->setReturnType(EditBox::KeyboardReturnType::DONE);
    editbox->setPlaceholderFontSize(20);
    editbox->setTag(TAG_REQUEST_BOX);
    editbox->setDelegate(this);
    this->addChild(editbox);
    
    _lbRequest = setLabelSystemTTFUnAdd("", 20, ratioPosition(50, 44));
    _lbRequest->setAnchorPoint(Vec2(0.5f, 1.0f));
    _lbRequest->setAlignment(TextHAlignment::LEFT, TextVAlignment::TOP);
    _lbRequest->setDimensions(300, 100);
    _lbRequest->setColor(Color3B::BLACK);
    addChild(_lbRequest);
    
}
Esempio n. 29
0
CustomBuildJob::CustomBuildJob( CustomBuildSystem* plugin, KDevelop::ProjectBaseItem* item, CustomBuildSystemTool::ActionType t )
    : OutputJob( plugin ), type( t ), killed( false ), enabled( false )
{
    setCapabilities( Killable );
    QString subgrpname;
    QString title;
    switch( type ) {
        case CustomBuildSystemTool::Build:
            title = i18n( "Building:" );
            subgrpname = QString( "%1Build" ).arg( ConfigConstants::toolGroupPrefix );
            break;
        case CustomBuildSystemTool::Clean:
            title = i18n( "Cleaning:" );
            subgrpname = QString( "%1Clean" ).arg( ConfigConstants::toolGroupPrefix );
            break;
        case CustomBuildSystemTool::Install:
            title = i18n( "Installing:" );
            subgrpname = QString( "%1Install" ).arg( ConfigConstants::toolGroupPrefix );
            break;
        case CustomBuildSystemTool::Configure:
            title = i18n( "Configuring:" );
            subgrpname = QString( "%1Configure" ).arg( ConfigConstants::toolGroupPrefix );
            break;
        case CustomBuildSystemTool::Prune:
            title = i18n( "Pruning:" );
            subgrpname = QString( "%1Prune" ).arg( ConfigConstants::toolGroupPrefix );
            break;
        case CustomBuildSystemTool::Undefined:
            return;
    }
    setTitle( QString("%1 %2").arg( cmd ).arg( item->text() ) );
    setObjectName( QString("%1 %2").arg( cmd ).arg( item->text() ) );
    builddir = plugin->buildDirectory( item ).toLocalFile();
    KConfigGroup grp = plugin->configuration( item->project() ).group( subgrpname );
    enabled = grp.readEntry( ConfigConstants::toolEnabled, false );
    cmd = grp.readEntry( ConfigConstants::toolExecutable, KUrl() ).toLocalFile();
    environment = grp.readEntry( ConfigConstants::toolEnvironment, "" );
    arguments = grp.readEntry( ConfigConstants::toolArguments, "" );
    setDelegate( new KDevelop::OutputDelegate );
}
Esempio n. 30
0
void VideoPreview::clear()
{
	_callWnd = NULL;
	_viewStarted = true;
	if (!_currentFilePreview.empty())
	{
		QueueManager::LockFileQueueShared l_fileQueue;
		auto qi = QueueManager::FileQueue::find_target(_currentFilePreview);
		if (qi)
		{
			qi->setDelegate(nullptr);
		}
	}
	// Stop/Remove Items
	SocketProcessorSIter i = _socketProcessors.begin();
	while (i != _socketProcessors.end())
	{
		if ((*i)->IsInProcess()) // [2] https://www.box.net/shared/6sfnyx7a7wg6ig9a8uly
		{
			(*i)->setServerIsDie();
			(*i)->join();
			int resCount = 10;
			while ((*i)->IsInProcess())
			{
				// TODO: Cruth?
				if (--resCount < 0)
					break;
				::Sleep(10);
			}
		}
		VideoPreviewSocketProcessor* item = *i;
		i = _socketProcessors.erase(i);
		delete item;
	}
	
	_socketProcessors.clear();
	_ask2Download.clear();
}