当前位置: 首页>>代码示例>>C++>>正文


C++ ElementDocument::RemoveReference方法代码示例

本文整理汇总了C++中rocket::core::ElementDocument::RemoveReference方法的典型用法代码示例。如果您正苦于以下问题:C++ ElementDocument::RemoveReference方法的具体用法?C++ ElementDocument::RemoveReference怎么用?C++ ElementDocument::RemoveReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rocket::core::ElementDocument的用法示例。


在下文中一共展示了ElementDocument::RemoveReference方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LevelFileDataSource

void Phobos::Game::Gui::LevelSelector::Open()
{
	m_fCloseRequested = false;

	m_upDataSource.reset( PH_NEW LevelFileDataSource(m_lstLevelPaths));
	m_upDataGridController.reset(PH_NEW(DataGridController));

	m_spGuiContext = Engine::Gui::Manager::GetInstance().CreateContext("LevelSelector");

	Rocket::Core::ElementDocument* cursor = m_spGuiContext->LoadMouseCursor("resources/gui/LevelSelector/cursor.rml");
	if (cursor)
		cursor->RemoveReference();

	Rocket::Core::ElementDocument* document = m_spGuiContext->LoadDocument("resources/gui/LevelSelector/main.rml");
	if (document)
	{
		document->SetTitle(Rocket::Core::String("Select Level"));
		document->Show();		

		document->RemoveReference();

		Rocket::Controls::ElementDataGrid *dataGrid = dynamic_cast<Rocket::Controls::ElementDataGrid*>(document->GetElementById("datagrid"));				

		int numRows = dataGrid->GetNumRows();

		dataGrid->AddEventListener("rowadd", m_upDataGridController.get());
		dataGrid->AddEventListener("keydown", m_upDataGridController.get());

		document->GetElementById("loadForm")->AddEventListener("submit", &clLevelSelectorEventListener_gl);
		document->GetElementById("quitForm")->AddEventListener("submit", &clLevelSelectorEventListener_gl);
	}
}
开发者ID:CronosTs,项目名称:phobos3d,代码行数:32,代码来源:LevelSelector.cpp

示例2: file

Rocket::Core::ElementDocument*
UIContext::load_document_file( const std::string& filename )
{
  Rocket::Core::ElementDocument* doc = nullptr;

  NOM_ASSERT( this->context_ != nullptr );
  if( this->context_ != nullptr )
  {
    doc = this->context_->LoadDocument( filename.c_str() );

    if( doc ) {
      doc->RemoveReference();
    }
    else { // doc == nullptr
      NOM_LOG_ERR(  NOM_LOG_CATEGORY_APPLICATION,
                    "Could not load document from file:", filename );
    }
  }
  else {
    NOM_LOG_ERR(  NOM_LOG_CATEGORY_APPLICATION,
                  "Could not load document from file (invalid context):",
                  filename );
  }

  return doc;
}
开发者ID:i8degrees,项目名称:nomlib,代码行数:26,代码来源:UIContext.cpp

示例3: LoadWindow

// Loads a window and binds the event handler for it.
bool EventManager::LoadWindow(const Rocket::Core::String& window_name)
{
    // Set the event handler for the new screen, if one has been registered.
    EventHandler* old_event_handler = event_handler;
    EventHandlerMap::iterator iterator = event_handlers.find(window_name);
    if (iterator != event_handlers.end())
        event_handler = (*iterator).second;
    else
        event_handler = NULL;

    // Attempt to load the referenced RML document.

    char path[1024];
    GetMmoResourcePath(path, 1024, (window_name + ".rml").CString());

    Rocket::Core::ElementDocument* document = gContext->LoadDocument(path);
    if (document == NULL)
    {
        event_handler = old_event_handler;
        return false;
    }

    // Set the element's title on the title; IDd 'title' in the RML.
    Rocket::Core::Element* title = document->GetElementById("title");
    if (title != NULL)
        title->SetInnerRML(document->GetTitle());

    document->Focus();
    document->Show();

    // Remove the caller's reference.
    document->RemoveReference();

    return true;
}
开发者ID:ktj007,项目名称:mmo,代码行数:36,代码来源:EventManager.cpp

示例4:

Rocket::Core::ElementDocument* UIContext::load_mouse_cursor_file( const std::string& filename )
{
  Rocket::Core::ElementDocument* cursor = nullptr;

  if( this->context_ )
  {
    cursor = this->context_->LoadMouseCursor( filename.c_str() );

    if( cursor )
    {
      cursor->RemoveReference();
      cursor->Show();
    }
    else // cursor == nullptr
    {
      NOM_LOG_ERR( NOM_LOG_CATEGORY_APPLICATION, "Could not load mouse cursor from file:", filename );
    }
  }
  else
  {
    NOM_LOG_CRIT( NOM_LOG_CATEGORY_APPLICATION, "Could not load mouse cursor: invalid context with file:", filename );
  }

  return cursor;
}
开发者ID:i8degrees,项目名称:nomlib,代码行数:25,代码来源:UIContext.cpp

示例5: Start

void HelloWorld::Start()
{
    helloScene_ = new Scene(context_);
    CreateObjects();
    CreateText();
    SubscribeToEvents();
    
    
    //Rocket stuff
    Rocket::Core::SetRenderInterface(&rocketRenderer);
    Rocket::Core::SetSystemInterface(&rocketSystemInterface);
    
    Rocket::Core::Initialise();
    int w = GetSubsystem<Graphics>()->GetWidth();
    int h = GetSubsystem<Graphics>()->GetHeight();
    rocketContext = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(w, h));
    if(rocketContext == NULL)
    {
        Rocket::Core::Shutdown();
        throw "Dead in the water";
    }
    
    Rocket::Core::FontDatabase::LoadFontFace("Data/Fonts/Delicious-Bold.otf");
    Rocket::Core::FontDatabase::LoadFontFace("Data/Fonts/Delicious-BoldItalic.otf");
    Rocket::Core::FontDatabase::LoadFontFace("Data/Fonts/Delicious-Italic.otf");
    Rocket::Core::FontDatabase::LoadFontFace("Data/Fonts/Delicious-Roman.otf");
    
    Rocket::Core::ElementDocument *Document = rocketContext->LoadDocument("Data/UI/rocketDemo.html");
    
    if(Document)
    {
        Document->Show();
        Document->RemoveReference();
    };
}
开发者ID:Bewolf2,项目名称:urho3d-librocket,代码行数:35,代码来源:RocketTest.cpp

示例6:

Rocket::Core::ElementDocument *RocketModule::loadDocument( const char *filename, bool show )
{
	Rocket::Core::ElementDocument *document;

	// YES I really had to make a function for this!
	document = context->LoadDocument( filename );

	if( show && document )
	{
		// load documents with autofocus disabled
		document->Show( Rocket::Core::ElementDocument::NONE );
		document->Focus();

		// reference counting may bog on us if we cache documents!
		document->RemoveReference();

		// optional element specific eventlisteners here

		// only for UI documents! FIXME: we are already doing this in NavigationStack
		Rocket::Core::EventListener *listener = UI_GetMainListener();
		document->AddEventListener( "keydown", listener );
		document->AddEventListener( "change", listener );
	}

	return document;
}
开发者ID:ewirch,项目名称:qfusion,代码行数:26,代码来源:ui_rocketmodule.cpp

示例7: loadCursor

// Load the mouse cursor and release the caller's reference:
// NOTE: be sure to use it before initRocket( .. ) function
void RocketModule::loadCursor( int contextId, const String& rmlCursor )
{
	Rocket::Core::ElementDocument* cursor = contextForId( contextId )->LoadMouseCursor( rmlCursor );

	if( cursor )
		cursor->RemoveReference();
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:9,代码来源:ui_rocketmodule.cpp

示例8: unloadGUI

void GuiDemo::unloadGUI()
{
	if (m_document) 
	{
		m_document->RemoveReference();
		m_document = 0;
	}

	// Shutdown Lua  before we shut down Rocket.
	Rocket::Core::Lua::Interpreter::Shutdown();
}
开发者ID:Ali-il,项目名称:gamekit,代码行数:11,代码来源:main.cpp

示例9: LoadDocumentFromMemory

// The "LoadDocument" function bound into Python context objects instead of the C++ function.
python::object ContextInterface::LoadDocumentFromMemory(Context* self, const char* stream)
{
    Rocket::Core::ElementDocument* document = self->LoadDocumentFromMemory(stream);
    if (document == NULL)
        return python::object();

    // Remove the C++ caller reference and return the python::object
    python::object py_document = Rocket::Core::Python::Utilities::MakeObject(document);
    document->RemoveReference();

    return py_document;
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:13,代码来源:ContextInterface.cpp

示例10: CreateDocument

// The "CreateDocument" function bound into Python context objects instead of the C++ function.
python::object ContextInterface::CreateDocument(Context* self, const char* tag)
{
    Rocket::Core::ElementDocument* document = self->CreateDocument(tag);
    if (document == NULL)
        return python::object();

    // Remove the C++ caller reference and add a Python one to replace it.
    python::object py_document = Rocket::Core::Python::Utilities::MakeObject(document);
    document->RemoveReference();

    return py_document;
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:13,代码来源:ContextInterface.cpp

示例11: createScene

void RocketApplication::createScene()
{
	Ogre::ResourceGroupManager::getSingleton().createResourceGroup("Rocket");
	Ogre::ResourceGroupManager::getSingleton().addResourceLocation(rocket_path.Replace("\\", "/").CString(), "FileSystem", "Rocket");

	// Rocket initialisation.
	ogre_renderer = new RenderInterfaceOgre3D(mWindow->getWidth(), mWindow->getHeight());
	Rocket::Core::SetRenderInterface(ogre_renderer);

	ogre_system = new SystemInterfaceOgre3D();
	Rocket::Core::SetSystemInterface(ogre_system);

	Rocket::Core::Initialise();
	Rocket::Controls::Initialise();

	// Load the fonts from the path to the sample directory.
	Rocket::Core::FontDatabase::LoadFontFace(sample_path + "../../assets/Delicious-Roman.otf");
	Rocket::Core::FontDatabase::LoadFontFace(sample_path + "../../assets/Delicious-Bold.otf");
	Rocket::Core::FontDatabase::LoadFontFace(sample_path + "../../assets/Delicious-Italic.otf");
	Rocket::Core::FontDatabase::LoadFontFace(sample_path + "../../assets/Delicious-BoldItalic.otf");

	context = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(mWindow->getWidth(), mWindow->getHeight()));
	Rocket::Debugger::Initialise(context);

	// Load the mouse cursor and release the caller's reference.
	Rocket::Core::ElementDocument* cursor = context->LoadMouseCursor(sample_path + "../../assets/cursor.rml");
	if (cursor)
		cursor->RemoveReference();

	Rocket::Core::ElementDocument* document = context->LoadDocument(sample_path + "../../assets/demo.rml");
	if (document)
	{
		document->Show();
		document->RemoveReference();
	}

	// Add the application as a listener to Ogre's render queue so we can render during the overlay.
	mSceneMgr->addRenderQueueListener(this);
}
开发者ID:AlexKordic,项目名称:libRocket,代码行数:39,代码来源:RocketApplication.cpp

示例12: streamAdapter

bool
CFormBackendImp::LoadLayout( GUCEF::CORE::CIOAccess& layoutStorage )
{GUCEF_TRACE;
    
    CRocketStreamAdapter streamAdapter( layoutStorage );

    // Load and show the document.
    Rocket::Core::ElementDocument* document = m_context->GetRocketContext()->LoadDocument( &streamAdapter );
    if ( NULL != document )
    {
        document->Show();
        document->RemoveReference();
        return true;
    }
    return false;
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:16,代码来源:guidriverRocket_CFormBackendImp.cpp

示例13: Rocket_LoadDocument

void Rocket_LoadDocument(const char* path) {
    Rocket::Core::ElementDocument* document = menuContext->LoadDocument(path);
    Rocket::Core::ElementDocument* other;

    if (document) {
        document->RemoveReference();
        menuContext->PullDocumentToFront(
                document); // Ensure any duplicates will be found first.

        // Close any other documents which may have the same ID
        other = menuContext->GetDocument(document->GetId());
        if (other && other != document) {
            other->Close();
        }
    }
}
开发者ID:Kangz,项目名称:Unvanquished,代码行数:16,代码来源:rocket_documents.cpp

示例14: uninitRocket

void GuiDemo::uninitRocket()
{
	if (m_document) m_document->RemoveReference();
	m_document = 0;

	// Shutdown Rocket.
	if (m_rkContext) m_rkContext->RemoveReference();
	m_rkContext = 0;
	Rocket::Core::Shutdown();

	delete m_rkOgreSystem; m_rkOgreSystem = 0;
	delete m_rkOgreRenderer; m_rkOgreRenderer = 0;
	delete m_rkFileInterface; m_rkFileInterface = 0;

	delete m_rkEventListener; m_rkEventListener = 0;
	delete m_rkRenderListener; m_rkRenderListener = 0;
}
开发者ID:dryadf68116,项目名称:vuforia-gamekit-integration,代码行数:17,代码来源:main.cpp

示例15: initRocket

void GuiDemo::initRocket()
{
	GK_ASSERT(m_scene && !m_rkContext);

	gkWindow* window = m_scene->getDisplayWindow();
	// Rocket initialisation.
	m_rkOgreRenderer = new RenderInterfaceOgre3D(window->getWidth(), window->getHeight());
	Rocket::Core::SetRenderInterface(m_rkOgreRenderer);

	m_rkOgreSystem = new SystemInterfaceOgre3D();
	Rocket::Core::SetSystemInterface(m_rkOgreSystem);

	Rocket::Core::Initialise();
	Rocket::Controls::Initialise();


	installRocketFonts();

	m_rkContext = Rocket::Core::CreateContext("main", Rocket::Core::Vector2i(window->getWidth(), window->getHeight()));
	Rocket::Debugger::Initialise(m_rkContext);

	m_rkFileInterface = new FileInterfaceOgre3D();
	Rocket::Core::SetFileInterface(m_rkFileInterface);


	// Load the mouse cursor and release the caller's reference.
	Rocket::Core::ElementDocument* cursor = m_rkContext->LoadMouseCursor(ROCKET_CURSOR_PAGE);
	if (cursor)
		cursor->RemoveReference();

	m_document = m_rkContext->LoadDocument(ROCKET_DEMO_PAGE);
	if (m_document)
	{
		Rocket::Core::Element* button = m_document->GetElementById(DEMO_PAGE_BUTTON_ID);
		if (button)
			button->AddEventListener("click", this);
		m_document->Show();		
	}

	m_rkEventListener  = new RocketEventListener(window, m_rkContext);
	m_rkRenderListener = new RocketRenderListener(window->getRenderWindow(), m_scene->getManager(), m_rkContext);
}
开发者ID:dryadf68116,项目名称:vuforia-gamekit-integration,代码行数:42,代码来源:main.cpp


注:本文中的rocket::core::ElementDocument::RemoveReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。