Ejemplo n.º 1
0
Page::~Page()
{
    m_mainFrame->setView(0);
    setGroupName(String());
    allPages->remove(this);
    
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
        frame->pageDestroyed();

    m_editorClient->pageDestroyed();
#if ENABLE(INSPECTOR)
    m_inspectorController->inspectedPageDestroyed();
#endif

    m_backForwardList->close();

#ifndef NDEBUG
    pageCounter.decrement();

    // Cancel keepAlive timers, to ensure we release all Frames before exiting.
    // It's safe to do this because we prohibit closing a Page while JavaScript
    // is executing.
    Frame::cancelAllKeepAlive();
#endif
}
Ejemplo n.º 2
0
Page::~Page()
{
    m_mainFrame->setView(0);
    setGroupName(String());
    allPages->remove(this);
    
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
        frame->pageDestroyed();
    m_editorClient->pageDestroyed();
    if (m_parentInspectorController)
        m_parentInspectorController->pageDestroyed();
    m_inspectorController->inspectedPageDestroyed();

    m_backForwardList->close();

#ifndef NDEBUG
    --PageCounter::count;

    // Cancel keepAlive timers, to ensure we release all Frames before exiting.
    // It's safe to do this because we prohibit closing a Page while JavaScript
    // is executing.
    Frame::cancelAllKeepAlive();
#endif

    // Added by Paul Pedriana, 1/2009. Memory leak fix.
    if(allPages->isEmpty())
    {
        delete allPages;
        allPages = 0;
    }
}
Ejemplo n.º 3
0
Page::~Page()
{
    m_mainFrame->setView(0);
    setGroupName(String());
    allPages->remove(this);
    
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
        frame->pageDestroyed();

    if (m_scrollableAreaSet) {
        ScrollableAreaSet::const_iterator end = m_scrollableAreaSet->end(); 
        for (ScrollableAreaSet::const_iterator it = m_scrollableAreaSet->begin(); it != end; ++it)
            (*it)->disconnectFromPage();
    }

    m_editorClient->pageDestroyed();

    InspectorInstrumentation::inspectedPageDestroyed(this);

    backForward()->close();

#ifndef NDEBUG
    pageCounter.decrement();

    // Cancel keepAlive timers, to ensure we release all Frames before exiting.
    // It's safe to do this because we prohibit closing a Page while JavaScript
    // is executing.
    Frame::cancelAllKeepAlive();
#endif
}
Ejemplo n.º 4
0
Page::~Page()
{
    m_mainFrame->setView(0);
    setGroupName(String());
    allPages->remove(this);
    
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
        frame->willDetachPage();
        frame->detachFromPage();
    }

    m_editorClient->pageDestroyed();
    if (m_alternativeTextClient)
        m_alternativeTextClient->pageDestroyed();

#if ENABLE(INSPECTOR)
    m_inspectorController->inspectedPageDestroyed();
#endif

    if (m_scrollingCoordinator)
        m_scrollingCoordinator->pageDestroyed();

    backForward()->close();

#ifndef NDEBUG
    pageCounter.decrement();
#endif

}
Ejemplo n.º 5
0
//check that all groups set names & set names
int GroupCustomization::CheckGroupNames(int GameMode)
{
	int count;
	int ret=0;
	
	if(!ret)
		return ret;

	switch (GameMode)
	{
		case GAMERS_3:
			count = 3;break;
		case GROUP_2:
			count =2;break;
		case GROUP_3:	
			count = 3;break;
			break;
		case GROUP_4:	
			count = 4;break;
			break;
	}
	//check group names
	for(int i=0;i<count;i++)
	{
		if(strlen(((CurrentGroupLayer*)layers.getObjectAtIndex(i))->getTextField())==0) return i+1;
	}
	//setGroupName
	for(int i=0;i<count;i++) setGroupName(i,((CurrentGroupLayer*)layers.getObjectAtIndex(i))->getTextField());
	return ret;
}
void ChangeVisibilityEditorWidget::updateData(Action * action)
{
    mCurrentAction = qobject_cast<ChangeVisibility*>(action);
    if (! mCurrentAction)
        return;

    mFadeEditorWidget->updateData(mCurrentAction->fadeAction());
    mSlideEditorWidget->updateData(mCurrentAction->slideAction());

    setGroupName(mCurrentAction->name());
    mObjectsWidget->clear();

    mObjects = findObjects(! mCurrentAction->toShow());

    mObjectsWidget->blockSignals(true);

    for (int i=0; i < mObjects.size(); i++)
        mObjectsWidget->addItem(mObjects[i]->objectName());
    mObjectsWidget->blockSignals(false);

    mObjectsWidget->setCurrentIndex(0);
    if (! mCurrentAction->sceneObject() && mObjects.size()) {
        mCurrentAction->setSceneObject(mObjects[0]);
        //if (lastChangeVisibilityActionForObject(mObjects[0]) == mCurrentAction)
        //    mObjects[0]->setAvailable(! mObjects[0]->isAvailable());
    }

}
Ejemplo n.º 7
0
GroupSettings::GroupSettings(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::GroupSettings)
{
    ui->setupUi(this);
    connect(ui->groupName, SIGNAL(editingFinished()), SLOT(setGroupName()));
    freeGroup();
}
Ejemplo n.º 8
0
//check that all groups set names & set names
int GroupCustomization::CheckGroupNames(int GameMode)
{
	int count;
	int ret=0;
	switch (GameMode)
	{
		case GAMERS_3:
			count = 3;break;
		case GROUP_2:
			count =2;break;
		case GROUP_3:	
			count = 3;break;
			break;
		case GROUP_4:	
			count = 4;break;
			break;
	}
	//check group names
	/*
	for(int i=0;i<count;i++)
	{
		if(strlen(((CurrentGroupLayer*)layers.getObjectAtIndex(i))->getTextField())==0) return i+1;
	}
	*/
	//setGroupName
	for(int i=0;i<count;i++) 
		if(strlen(((CurrentGroupLayer*)layers.getObjectAtIndex(i))->getTextField())==0)
		{
			setGroupName(i,((CCTextFieldTTF*)((CCLayer*)((CurrentGroupLayer*)layers.getObjectAtIndex(i))->getChildByTag(ID_CONTROLLAYER))->getChildByTag(ID_TEXTFIELD))->getPlaceHolder());
		}
		else
		{
			setGroupName(i,((CurrentGroupLayer*)layers.getObjectAtIndex(i))->getTextField());
		}
	return ret;
}
Ejemplo n.º 9
0
   /*
      _SDB_KRCB implement
   */
   _SDB_KRCB::_SDB_KRCB ()
   :_mainEDU( &_eduMgr, EDU_TYPE_MAIN )
   {
      ossMemset( _hostName, 0, sizeof( _hostName ) ) ;
      ossMemset( _groupName, 0, sizeof( _groupName ) ) ;

      _exitCode = SDB_OK ;
      _businessOK = TRUE ;
      _restart = FALSE ;
      _isRestore = FALSE ;

      _flowControl = FALSE ;

      _dbMode = 0 ;

      for ( INT32 i = 0 ; i < SDB_CB_MAX ; ++i )
      {
         _arrayCBs[ i ] = NULL ;
         _arrayCBs[ i ] = NULL ;
      }
      _init             = FALSE ;
      _isActive         = FALSE ;

      /* <-- internal status, can't be modified by config file --> */
      _dbStatus = SDB_DB_NORMAL ;
      /* <-- external status, can be changed by modifying config file --> */

      // standalone role by default, user may overwrite this setting
      _role = SDB_ROLE_STANDALONE ;

      setGroupName ( "" );
      // monitor switch initialization, no latch needed
      // for better performance these monitor swtich should be turned off
      // here, turn it on for testing

#if defined ( SDB_ENGINE )
      _monCfgCB.timestampON = TRUE ;
      _monDBCB.recordActivateTimestamp () ;
#endif // SDB_ENGINE

      // register config handler to option mgr
      _optioncb.setConfigHandler( this ) ;
   }
CoaSettingsWidgetChangeDebug::CoaSettingsWidgetChangeDebug(QWidget * const parent , Qt::WFlags f )
: CoaSettingsWidget (parent, f)
,actionModel(0)
{
   BEGIN;

   //Create the central form
   Q_INIT_RESOURCE(tools);
   CoaFormFactory factory(this);
   factory.formBuild(":/tools/settings/coachangedebug.ui");
   setIcon(":/tools/settings/icons/debug.png");

   initMainButtons();
   initDefaultModeButtons();

   loadModel();
   assert(actionModel);

   initTableView();
   setShortName( tr("Debug") );
   setGroupName( shortName() );

}
Ejemplo n.º 11
0
Page::~Page()
{
    m_mainFrame->setView(0);
    setGroupName(String());
    allPages->remove(this);
    
    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
        frame->pageDestroyed();

    if (m_scrollableAreaSet) {
        ScrollableAreaSet::const_iterator end = m_scrollableAreaSet->end(); 
        for (ScrollableAreaSet::const_iterator it = m_scrollableAreaSet->begin(); it != end; ++it)
            (*it)->disconnectFromPage();
    }

    m_editorClient->pageDestroyed();

#if ENABLE(INSPECTOR)
    m_inspectorController->inspectedPageDestroyed();
#endif

#if ENABLE(MEDIA_STREAM)
    if (m_userMediaClient)
        m_userMediaClient->pageDestroyed();
#endif

#if ENABLE(THREADED_SCROLLING)
    if (m_scrollingCoordinator)
        m_scrollingCoordinator->pageDestroyed();
#endif

    backForward()->close();

#ifndef NDEBUG
    pageCounter.decrement();
#endif
}
Ejemplo n.º 12
0
GroupCustomization::GroupCustomization(int GameMode)
{
	//set game mode
	m_GameMode = GameMode;

	//init colors
	for(int i=0;i<4;i++)
	{
		setGroupName(i,NULL);
	}
	
	//set center of the screen
	CCSize size = CCDirector::sharedDirector()->getWinSize();
	x = size.width/2;
    y = size.height/2;

	//add background sprite
	CCSprite* background = CCSprite::spriteWithFile(MainMenu_background);
	addChild(background,0);
	background->setPosition(ccp(x,y));
    
    //add leather
	CCSprite* lth = CCSprite::spriteWithFile(GroupCustomization_lead_choise_colors);
    addChild(lth,0);
    lth->setAnchorPoint(ccp(0.5,1));
	lth->setPosition(ccp(x,y*2));

	KeyboardNotificationLayer* knlGroups[4];

	knlGroups[0] = new CurrentGroupLayer(ID_RED,1);
	knlGroups[1] = new CurrentGroupLayer(ID_GREEN,2);
	layers.addObject(knlGroups[0]);
	layers.addObject(knlGroups[1]);
	knlGroups[0]->release();
	knlGroups[1]->release();
	switch (GameMode)
	{
		case GAMERS_3:
			knlGroups[2] = new CurrentGroupLayer(ID_BLUE,3);
			layers.addObject(knlGroups[2]);
			knlGroups[2]->release();
			break;
		case GROUP_3:	
			knlGroups[2] = new CurrentGroupLayer(ID_BLUE,3);
			layers.addObject(knlGroups[2]);
			knlGroups[2]->release();
			break;
		case GROUP_4:
			knlGroups[2] = new CurrentGroupLayer(ID_BLUE,3);
			knlGroups[3] = new CurrentGroupLayer(ID_YELLOW,4);
			layers.addObject(knlGroups[2]);
			layers.addObject(knlGroups[3]);
			knlGroups[2]->release();
			knlGroups[3]->release();
			break;
	}

	pScrollLayer = CCScrollLayer::layerWithLayers(&layers,500);
	addChild(pScrollLayer);
	pScrollLayer->setPosition(ccp(0,0));

	setPageIndicator(pScrollLayer->currentScreen,pScrollLayer->totalScreens);
	//scale and opacity elements on disable layer
	((CurrentGroupLayer*)layers.getObjectAtIndex(0))->setContentAccess(1);

	CCMenuItem* itm_back = CCMenuItemImage::itemFromNormalImage(GroupCustomization_back,GroupCustomization_back_selected,this,menu_selector(GroupCustomization::itm_backCallback));
	itm_back->setPosition(ccp(-(x*2/2.2),-(y*2/2.22)));

	CCMenuItem* itm_start = CCMenuItemImage::itemFromNormalImage(GroupCustomization_start,GroupCustomization_start_selected,this,menu_selector(GroupCustomization::itm_startCallback));
	itm_start->setPosition(ccp(+(x*2/2.27),-(y*2/2.27)));

	CCMenu* mn_GroupCustomization = CCMenu::menuWithItems(itm_back,itm_start,NULL);
	addChild(mn_GroupCustomization,1);
	mn_GroupCustomization->setPosition(ccp(x,y));
}
Ejemplo n.º 13
0
GroupCustomization::GroupCustomization(int GameMode)
{
	//set game mode
	m_GameMode = GameMode;

	//init colors
	for(int i=0;i<4;i++)
	{
		setGroupName(i,NULL);
	}
	
	//set center of the screen
	CCSize size = CCDirector::sharedDirector()->getWinSize();
	x = size.width/2;
    y = size.height/2;

	CCSprite* background = CCSprite::spriteWithFile("GroupCustomization/background.png");
	addChild(background,0);
	background->setPosition(ccp(x,y));

	KeyboardNotificationLayer* knlGroups[4];

	switch (GameMode)
	{
		case GAMERS_3:
			knlGroups[0] = new CurrentGroupLayer(ID_RED);
			knlGroups[1] = new CurrentGroupLayer(ID_GREEN);
			knlGroups[2] = new CurrentGroupLayer(ID_BLUE);
			layers.addObject(knlGroups[0]);
			layers.addObject(knlGroups[1]);
			layers.addObject(knlGroups[2]);
			knlGroups[0]->release();
			knlGroups[1]->release();
			knlGroups[2]->release();
			break;
		case GROUP_2:
			knlGroups[0] = new CurrentGroupLayer(ID_RED);
			knlGroups[1] = new CurrentGroupLayer(ID_GREEN);
			layers.addObject(knlGroups[0]);
			layers.addObject(knlGroups[1]);
			knlGroups[0]->release();
			knlGroups[1]->release();
			break;
		case GROUP_3:	
			knlGroups[0] = new CurrentGroupLayer(ID_RED);
			knlGroups[1] = new CurrentGroupLayer(ID_GREEN);
			knlGroups[2] = new CurrentGroupLayer(ID_BLUE);
			layers.addObject(knlGroups[0]);
			layers.addObject(knlGroups[1]);
			layers.addObject(knlGroups[2]);
			knlGroups[0]->release();
			knlGroups[1]->release();
			knlGroups[2]->release();
			break;
		case GROUP_4:
			knlGroups[0] = new CurrentGroupLayer(ID_RED);
			knlGroups[1] = new CurrentGroupLayer(ID_GREEN);
			knlGroups[2] = new CurrentGroupLayer(ID_BLUE);
			knlGroups[3] = new CurrentGroupLayer(ID_YELLOW);
			layers.addObject(knlGroups[0]);
			layers.addObject(knlGroups[1]);
			layers.addObject(knlGroups[2]);
			layers.addObject(knlGroups[3]);
			knlGroups[0]->release();
			knlGroups[1]->release();
			knlGroups[2]->release();
			knlGroups[3]->release();
			break;
	}
	pScrollLayer = CCScrollLayer::layerWithLayers(&layers,0);
	addChild(pScrollLayer);
	pScrollLayer->setPosition(ccp(0,0));

	setPageIndicator(pScrollLayer->currentScreen,pScrollLayer->totalScreens);

	CCMenuItem* itm_back = CCMenuItemImage::itemFromNormalImage("GroupCustomization/back_normal.png","GroupCustomization/back_selected.png",this,menu_selector(GroupCustomization::itm_backCallback));
	itm_back->setAnchorPoint(ccp(0,0));
	itm_back->setPosition(ccp(10,10));

	CCMenuItem* itm_start = CCMenuItemImage::itemFromNormalImage("GroupCustomization/start_normal.png","GroupCustomization/start_normal.png",this,menu_selector(GroupCustomization::itm_startCallback));
	itm_start->setAnchorPoint(ccp(0,0));
	itm_start->setPosition(ccp(size.width-195,10));

	CCMenu* mn_GroupCustomization = CCMenu::menuWithItems(itm_back,itm_start,NULL);
	addChild(mn_GroupCustomization,1);
	mn_GroupCustomization->setPosition(ccp(0,0));
}
Ejemplo n.º 14
0
 BulletElement::BulletElement(const Matrix4d& T_elem_to_link, Shape shape, 
                               const vector<double>& params,
                               const string& group_name,
                               bool use_margins)
   : T_elem_to_link(T_elem_to_link),shape(shape)
 {
   setGroupName(group_name);
   //DEBUG
   //std::cout << "BulletElement::BulletElement: START" << std::endl;
   //END_DEBUG
   btCollisionShape* bt_shape;
   double small_margin = 1e-9;
   switch (shape) {
     case BOX:
       {
       //DEBUG
       //std::cout << "BulletElement::BulletElement: Create BOX ..." << std::endl;
       //END_DEBUG
       btBoxShape bt_box( btVector3(params[0]/2,params[1]/2,params[2]/2) );
       /* Strange things happen to the collision-normals when we use the
        * convex interface to the btBoxShape. Instead, we'll explicitly create
        * a btConvexHullShape.
        */
       bt_shape = new btConvexHullShape();
       if (use_margins)
         bt_shape->setMargin(0.05);
       else
         bt_shape->setMargin(small_margin);
       for (int i=0; i<8; ++i){
         btVector3 vtx;
         bt_box.getVertex(i,vtx);
         dynamic_cast<btConvexHullShape*>(bt_shape)->addPoint(vtx);
       }
       //DEBUG
       //std::cout << "BulletElement::BulletElement: Created BOX" << std::endl;
       //END_DEBUG
       }
       break;
     case SPHERE:
       if (true || params[0] != 0) {
         //DEBUG
         //std::cout << "BulletElement::BulletElement: Create SPHERE ..." << std::endl;
         //END_DEBUG
         bt_shape = new btSphereShape(params[0]) ;
         //DEBUG
         //std::cout << "BulletElement::BulletElement: Created SPHERE" << std::endl;
         //END_DEBUG
       } else {
         //DEBUG
         //std::cout << "BulletElement::BulletElement: THROW" << std::endl;
         //END_DEBUG
         throw zeroRadiusSphereException();
       }
       break;
     case CYLINDER:
       //DEBUG
       //std::cout << "BulletElement::BulletElement: Create CYLINDER ..." << std::endl;
       //END_DEBUG
       bt_shape = new btCylinderShapeZ( btVector3(params[0],params[0],params[1]/2) );
       //DEBUG
       //std::cout << "BulletElement::BulletElement: Created CYLINDER ..." << std::endl;
       //END_DEBUG
       break;
     case MESH:
       //DEBUG
       //std::cout << "BulletElement::BulletElement: Create MESH ..." << std::endl;
       //END_DEBUG
       //bt_shape = new btConvexHullShape( (btScalar*) params.data(), 
                                         //params.size()/3,
                                         //(int) 3*sizeof(double) );
       bt_shape = new btConvexHullShape();
       if (use_margins)
         bt_shape->setMargin(0.05);
       else
         bt_shape->setMargin(small_margin);
       for (int i=0; i<params.size(); i+=3){
         //DEBUG
         //std::cout << "BulletElement::BulletElement: Adding point " << i/3 + 1 << std::endl;
         //END_DEBUG
         dynamic_cast<btConvexHullShape*>(bt_shape)->addPoint(btVector3(params[i],params[i+1],params[i+2]));
       }
       //DEBUG
       //std::cout << "BulletElement::BulletElement: Created MESH ..." << std::endl;
       //END_DEBUG
       break;
     case CAPSULE:
       bt_shape = new btConvexHullShape();
       dynamic_cast<btConvexHullShape*>(bt_shape)->addPoint(btVector3(0,0,-params[1]/2));
       dynamic_cast<btConvexHullShape*>(bt_shape)->addPoint(btVector3(0,0,params[1]/2));
       bt_shape->setMargin(params[0]);
       break;
     default:
       cerr << "Warning: Collision element has an unknown type " << shape << endl;
       //DEBUG
       //std::cout << "BulletElement::BulletElement: THROW" << std::endl;
       //END_DEBUG
       throw unknownShapeException(shape);
       break;
   }
   //DEBUG
   //cout << "BulletElement::BulletElement: Creating btCollisionObject" << endl;
   //END_DEBUG
   bt_obj = make_shared<btCollisionObject>();
   //DEBUG
   //cout << "BulletElement::BulletElement: Setting bt_shape for bt_ob" << endl;
   //END_DEBUG
   bt_obj->setCollisionShape(bt_shape);
   //DEBUG
   //cout << "BulletElement::BulletElement: Setting world transform for bt_ob" << endl;
   //END_DEBUG
   setWorldTransform(Matrix4d::Identity());
   //DEBUG
   //cout << "BulletElement::BulletElement: END" << std::endl;
   //END_DEBUG
 }