/***************************************************************
	 * Função responsavel por inicializar a classe corretamente
	 * carregando todas as surfaces e setando o titulo corretamente
	 *
	 **************************************************************/
	void MenuScreen::Init() 
	{
		int x = MENU_BUTTON_X;
		int y = MENU_BUTTON_Y;
		int vSpace = MENU_BUTTON_VERTICAL_SPACE;
		background = LoadImage(MENU_BACKGROUND);
		music = new Music();
		music->Load(PATH_MENU_MUSIC);
 		startBT   = new CSButton(MENU_BUTTON, x, y);
		scoreBT   = new CSButton(MENU_BUTTON, x, y + vSpace);                      // vSpace * 1 
		optionsBT = new CSButton(MENU_BUTTON, x, y + (vSpace << 1));               // vSpace * 2
		creditsBT = new CSButton(MENU_BUTTON, x, y + ((vSpace << 1) + vSpace));    // vSpace * 3
		SDL_Font *font = new SDL_Font(MENU_FONT, MENU_BUTTON_FONT_SIZE);
		startBT->SetFont(font);
		scoreBT->SetFont(font);
		optionsBT->SetFont(font);
		creditsBT->SetFont(font);
		startBT->SetText(MENU_START_LABEL);
		scoreBT->SetText(MENU_SCORE_LABEL);
		optionsBT->SetText(MENU_OPTIONS_LABEL);
		creditsBT->SetText(MENU_CREDITS_LABEL);
		AddListener(startBT);
		AddListener(scoreBT);
		AddListener(optionsBT);
		AddListener(creditsBT);
		music->Play(MIX_PLAY_FOREVER);
	}
Exemplo n.º 2
0
//============================================================================
//		NPreferences::NPreferences : Constructor.
//----------------------------------------------------------------------------
NPreferences::NPreferences(void)
{


	// Initialise ourselves
	AddListener(this);
}
void CFlowTrackEventNode::ProcessEvent( EFlowEvent event, SActivationInfo * pActInfo )
{
	if (event == eFE_Initialize && false == gEnv->IsEditor())
	{
		AddListener(pActInfo);
	}
}
Exemplo n.º 4
0
IResultSet* CCursor::Open()
{
    CResultSet *ri = new CResultSet(m_conn, GetCursorCmd()->Open());
    ri->AddListener(this);
    AddListener(ri);
    return ri;
}
Exemplo n.º 5
0
void
nsSplitterFrameInner::MouseUp(nsPresContext* aPresContext, nsGUIEvent* aEvent)
{
  if (mDragging && mOuter) {
    AdjustChildren(aPresContext);
    AddListener(aPresContext);
    nsIPresShell::SetCapturingContent(nullptr, 0); // XXXndeakin is this needed?
    mDragging = false;
    State newState = GetState(); 
    // if the state is dragging then make it Open.
    if (newState == Dragging)
      mOuter->mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::state, EmptyString(), true);

    mPressed = false;

    // if we dragged then fire a command event.
    if (mDidDrag) {
      nsCOMPtr<nsIDOMXULElement> element = do_QueryInterface(mOuter->GetContent());
      element->DoCommand();
    }

    //printf("MouseUp\n");
  }

  delete[] mChildInfosBefore;
  delete[] mChildInfosAfter;
  mChildInfosBefore = nullptr;
  mChildInfosAfter = nullptr;
  mChildInfosBeforeCount = 0;
  mChildInfosAfterCount = 0;
}
void CFlowTrackEventNode::Serialize( SActivationInfo * pActInfo, TSerialize ser)
{
	if (ser.IsReading() && false == gEnv->IsEditor())
	{
		AddListener(pActInfo);
	}
}
Exemplo n.º 7
0
//=============================================================================
//		NBroadcaster::CloneBroadcaster : Clone a broadcaster.
//-----------------------------------------------------------------------------
void NBroadcaster::CloneBroadcaster(const NBroadcaster &theBroadcaster)
{	NListenerMapConstIterator	theIter;



	// Validate our state
	NN_ASSERT(mBroadcasts.empty());



	// Clone the broadcaster
	//
	// An explicit clone is necessary to ensure the pointers between listener and
	// broadcaster are correctly established (the default copy constructor would
	// copy the pointers in this object, but wouldn't update the other).
	//
	// Cloning a broadcaster that's currently broadcasting will clone the listeners
	// so that future broadcasts go to the same place - however we don't clone the
	// list of active broadcasts, since we're not ourselves broadcasting.
	mIsBroadcasting = theBroadcaster.mIsBroadcasting;
	mBroadcasts.clear();

	for (theIter = theBroadcaster.mListeners.begin(); theIter != theBroadcaster.mListeners.end(); theIter++)
		AddListener(theIter->first);
}
Exemplo n.º 8
0
IBulkInsert* CConnection::CreateBulkInsert(const string& table_name)
{
//    if( m_getUsed )
//        throw CDbapiException("CConnection::CreateBulkInsert(): Get...() methods used");

    CDBAPIBulkInsert *bcp = new CDBAPIBulkInsert(table_name, GetAuxConn());
    AddListener(bcp);
    bcp->AddListener(this);
    return bcp;
}
Exemplo n.º 9
0
IStatement* CConnection::CreateStatement()
{
//    if( m_getUsed )
//        throw CDbapiException("CConnection::CreateStatement(): Get...() methods used");

    CStatement *stmt = new CStatement(GetAuxConn());
    AddListener(stmt);
    stmt->AddListener(this);
    return stmt;
}
Exemplo n.º 10
0
void KrConsole::AddCommand( const gedString& command, IKrWidgetListener* handler )
{
	AddListener( handler );

	Command c;
	c.command = command;
	c.handler = handler;

	commandList.PushFront( c );
}
Exemplo n.º 11
0
NS_IMETHODIMP
nsSliderFrame::SetInitialChildList(nsIAtom*        aListName,
                                   nsFrameList&    aChildList)
{
  nsresult r = nsBoxFrame::SetInitialChildList(aListName, aChildList);

  AddListener();

  return r;
}
Exemplo n.º 12
0
const IResultSetMetaData* CResultSet::GetMetaData(EOwnership ownership)
{
    CResultSetMetaData *md = new CResultSetMetaData(m_rs);
    if( ownership == eNoOwnership )
    {
        md->AddListener(this);
        AddListener(md);
    }
    return md;
}
Exemplo n.º 13
0
status_t
NotificationManager::AddListener(const char* serviceName,
	uint32 eventMask, NotificationListener& listener)
{
	char buffer[96];
	KMessage specifier;
	specifier.SetTo(buffer, sizeof(buffer), 0);
	specifier.AddInt32(kEventMaskString, eventMask);

	return AddListener(serviceName, &specifier, listener);
}
Exemplo n.º 14
0
PixelInfoPanel::PixelInfoPanel( wxWindow* parent ) :
    wxPanel( parent, wxID_ANY),
    Broadcaster( "PixelInfoPanel"),
    Listener( "PixelInfoPanel" )
{
  wxBoxSizer* sizer = new wxBoxSizer( wxHORIZONTAL );

  m_listCtrlCursor = new PixelInfoListCtrl( this, _("Cursor") );
  m_listCtrlMouse = new PixelInfoListCtrl( this, _("Mouse") );

  sizer->Add( m_listCtrlCursor, 1, wxEXPAND );
  sizer->AddSpacer( 3 );
  sizer->Add( m_listCtrlMouse, 1, wxEXPAND );

  this->SetSizer( sizer );
  this->Layout();

  AddListener( m_listCtrlCursor );
  AddListener( m_listCtrlMouse );
}
Exemplo n.º 15
0
ICallableStatement*
CConnection::PrepareCall(const string& proc)
{
//    if( m_getUsed )
//        throw CDbapiException("CConnection::CreateCallableStatement(): Get...() methods used");

    CCallableStatement *cstmt = new CCallableStatement(proc, GetAuxConn());
    AddListener(cstmt);
    cstmt->AddListener(this);
    return cstmt;
}
Exemplo n.º 16
0
NS_IMETHODIMP
nsSliderFrame::InsertFrames(nsIAtom*        aListName,
                            nsIFrame*       aPrevFrame,
                            nsFrameList&    aFrameList)
{
  PRBool wasEmpty = mFrames.IsEmpty();
  nsresult rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList);
  if (wasEmpty)
    AddListener();

  return rv;
}
Exemplo n.º 17
0
ICursor* CConnection::CreateCursor(const string& name,
                                   const string& sql,
                                   int batchSize)
{
 //   if( m_getUsed )
 //       throw CDbapiException("CConnection::CreateCursor(): Get...() methods used");

    CCursor *cur = new CCursor(name, sql, batchSize, GetAuxConn());
    AddListener(cur);
    cur->AddListener(this);
    return cur;
}
Exemplo n.º 18
0
// New part
IStatement* CConnection::GetStatement()
{
    CHECK_NCBI_DBAPI(m_connection == 0, "No connection established");

    CHECK_NCBI_DBAPI(
        m_connUsed,
        "CConnection::GetStatement(): Connection taken, cannot use this method"
        );
    CStatement *stmt = new CStatement(this);
    AddListener(stmt);
    stmt->AddListener(this);
    return stmt;
}
Exemplo n.º 19
0
void EventManager::_UnlockListeners() {
    mListenersLocked = false;

    while(mListenerRemoveQueue.size() > 0) {
        RemoveListener(mListenerRemoveQueue.back());
        mListenerRemoveQueue.pop_back();
    }

    while(mListenerAddQueue.size() > 0) {
        AddListener(mListenerAddQueue.back());
        mListenerAddQueue.pop_back();
    }
}
Exemplo n.º 20
0
NS_IMETHODIMP
nsSliderFrame::AppendFrames(nsIAtom*        aListName,
                            nsFrameList&    aFrameList)
{
  // if we have no children and on was added then make sure we add the
  // listener
  PRBool wasEmpty = mFrames.IsEmpty();
  nsresult rv = nsBoxFrame::AppendFrames(aListName, aFrameList);
  if (wasEmpty)
    AddListener();

  return rv;
}
Exemplo n.º 21
0
const IResultSetMetaData* CResultSet::GetMetaData(EOwnership ownership)
{
    if (ownership == eTakeOwnership) {
        return new CResultSetMetaData(m_rs);
    }

    if (m_metaData == NULL) {
        m_metaData = new CResultSetMetaData(m_rs);
        m_metaData->AddListener(this);
        AddListener(m_metaData);
    }
    return m_metaData;
}
Exemplo n.º 22
0
OP_STATUS OpSpeedDialView::InitSpeedDial(OpWidget* container)
{
	RETURN_IF_ERROR(Init());
	RETURN_IF_ERROR(AddListener(this));
	container->AddChild(this);

#ifdef ACCESSIBILITY_EXTENSION_SUPPORT
	AccessibilityPrunesMe(ACCESSIBILITY_PRUNE_WHEN_INVISIBLE);
#endif //ACCESSIBILITY_EXTENSION_SUPPORT

	SetTabStop(TRUE);

	return OpStatus::OK;
}
Exemplo n.º 23
0
BaseScreen::BaseScreen	(const ControlRect & newRect, ApplicationManager * pAppMng, int32 screenID) 
	:	GUIControlContainer	(NULL, newRect)
{
	SetID(screenID);
	pManager = pAppMng;
	AddListener(EEI_WINDOW_SET_MAIN, this);
	AddListener(EEI_WINDOW_LOST_MAIN, this);
	AddListener(EEI_WINDOW_DID_ACTIVATE, this);
	AddListener(EEI_WINDOW_WILL_DEACTIVATE, this);
	AddListener(EEI_SOFT1_PRESSED, this);
	AddListener(EEI_SOFT2_PRESSED, this);
	AddListener(EEI_CLR_PRESSED, this);
}
NS_IMETHODIMP nsSystemAlertsService::ShowAlert(nsIAlertNotification* aAlert,
                                               nsIObserver* aAlertListener)
{
  NS_ENSURE_ARG(aAlert);

  nsAutoString alertName;
  nsresult rv = aAlert->GetName(alertName);
  NS_ENSURE_SUCCESS(rv, rv);

  RefPtr<nsAlertsIconListener> alertListener =
    new nsAlertsIconListener(this, alertName);
  if (!alertListener)
    return NS_ERROR_OUT_OF_MEMORY;

  AddListener(alertName, alertListener);
  return alertListener->InitAlertAsync(aAlert, aAlertListener);
}
Exemplo n.º 25
0
void CStatement::CacheResultSet(CDB_Result *rs)
{
    if( m_irs != 0 ) {
        _TRACE("CStatement::CacheResultSet(): Invalidating cached CResultSet " << (void*)m_irs);
        m_irs->Invalidate();
    }

    if( rs != 0 ) {
        m_irs = new CResultSet(m_conn, rs);
        m_irs->AddListener(this);
        AddListener(m_irs);
        _TRACE("CStatement::CacheResultSet(): Created new CResultSet " << (void*)m_irs
            << " with CDB_Result " << (void*)rs);
    } else {
        m_irs = 0;
    }
}
Exemplo n.º 26
0
IBulkInsert* CConnection::GetBulkInsert(const string& table_name)
{
//    if( m_connUsed )
//        throw CDbapiException("CConnection::GetBulkInsert(): Connection taken, cannot use this method");
/*
    if( m_bulkInsert != 0 ) {
        delete m_bulkInsert;
    }
    m_bulkInsert = new CDBAPIBulkInsert(table_name, nof_cols, this);
    AddListener(m_bulkInsert);
    m_bulkInsert->AddListener(this);
    return m_bulkInsert;
*/
    CDBAPIBulkInsert *bulkInsert = new CDBAPIBulkInsert(table_name, this);
    AddListener(bulkInsert);
    bulkInsert->AddListener(this);
    return bulkInsert;
}
Exemplo n.º 27
0
ICursor* CConnection::GetCursor(const string& name,
                                const string& sql,
                                int batchSize)
{
//    if( m_connUsed )
//        throw CDbapiException("CConnection::GetCursor(): Connection taken, cannot use this method");
/*
    if( m_cursor != 0 ) {
        delete m_cursor;
    }
    m_cursor = new CCursor(name, sql, batchSize, this);
    AddListener(m_cursor);
    m_cursor->AddListener(this);
    return m_cursor;
*/
    CCursor *cursor = new CCursor(name, sql, batchSize, this);
    AddListener(cursor);
    cursor->AddListener(this);
    return cursor;
}
Exemplo n.º 28
0
bool SFEngine::Start(int protocolId)
{
	bool bResult = false;
	_EngineConfig* pInfo = m_Config.GetConfigureInfo();
	LOG(INFO) << "Engine Starting... IP : " << (char*)StringConversion::ToASCII(pInfo->serverIP).c_str() << " Port : " << pInfo->serverPort;

	if (protocolId >= 0)
	{
		IPacketProtocol* pProtocol = m_pPacketProtocolManager->GetPacketProtocol(protocolId);

		if (pProtocol == NULL)
		{
			LOG(ERROR) << "Engine Start Fail. PacketProtocol None";
			return false;
		}

		int listenerId = -1;
		
		if (pInfo->serverPort != 0)
		{
			listenerId = AddListener((char*)StringConversion::ToASCII(pInfo->serverIP).c_str(), pInfo->serverPort, protocolId);

			if (listenerId <= 0)
			{
				LOG(ERROR) << "Engine Start Fail. m_pNetworkEngine->AddListener fail";
				return false;
			}
		}
	}

	bResult = m_pNetworkEngine->Start((char*)StringConversion::ToASCII(pInfo->serverIP).c_str(), pInfo->serverPort);

	if (bResult == false)
	{
		LOG(ERROR) << "Engine Start Fail!!";
		return false;
	}
	LOG(INFO) << "Engine Start!!";

	return true;
}
Exemplo n.º 29
0
ICallableStatement*
CConnection::GetCallableStatement(const string& proc)
{
    CHECK_NCBI_DBAPI(
        m_connUsed,
        "CConnection::GetCallableStatement(): Connection taken, cannot use this method"
        );
/*
    if( m_cstmt != 0 ) {
        //m_cstmt->PurgeResults();
        delete m_cstmt;
    }
    m_cstmt = new CCallableStatement(proc, this);
    AddListener(m_cstmt);
    m_cstmt->AddListener(this);
    return m_cstmt;
*/
    CCallableStatement *cstmt = new CCallableStatement(proc, this);
    AddListener(cstmt);
    cstmt->AddListener(this);
    return cstmt;
}
	SafeAreaResizer( ScreenLayoutManager* pLayoutMan )
	: m_layoutMan(pLayoutMan)
	{
		SAFE_HARDWARE_MOUSE_FUNC(AddListener(this));
		g_pGameActions->FilterNoMouse()->Enable(true);
	}