Пример #1
0
RheiaFramePluginManager::RheiaFramePluginManager(RheiaManagedFrame* parent):
	m_parent(parent)
{
	m_parent->PushEventHandler(this);

	RheiaFrameEventsManager::Get(m_parent)->RegisterEventMethod(RheiaEVT_FRAME_CLOSING,
		new RheiaEventFunctor<RheiaFramePluginManager>(this, RheiaFrameEventHandler(RheiaFramePluginManager::OnCloseParent)));
}
Пример #2
0
RheiaEnvironementManager::RheiaEnvironementManager():
        wxEvtHandler()
{
    m_envars = RheiaManager::Get()->GetConfigurationManager( wxT("environement_manger") )->ReadStringStringMap( wxT("/variables") );
    m_libpaths = RheiaManager::Get()->GetConfigurationManager( wxT("environement_manger") )->ReadArrayString( wxT("/libs") );

    RheiaStringStringMap::iterator it = m_envars.begin();

    for ( ; it != m_envars.end() ; ++it )
        wxSetEnv( it->first , it->second );

    for ( unsigned int i = 0; i < m_libpaths.GetCount() ; ++i )
    {
        wxString env;
#if defined( WIN32 )
        wxGetEnv( wxT("PATH") , &env );
        env += wxT(";") + m_libpaths[i];
        wxSetEnv( wxT("PATH") , env );
#elif defined( LINUX )
        wxGetEnv( wxT("LD_LIBRARY_PATH") , &env );
        env += m_libpaths[i] + wxT(":");
        wxSetEnv( wxT("LD_LIBRARY_PATH") , env );
#elif defined( MACOSX )
        wxGetEnv( wxT("DYLD_LIBRARY_PATH") , &env );
        env += m_libpaths[i] + wxT(":");
        wxSetEnv( wxT("DYLD_LIBRARY_PATH") , env );
#endif
    }

    RheiaEventsManager* pm = RheiaEventsManager::Get();
    pm->RegisterEventMethod(RheiaEVT_FRAME_CLOSING, new RheiaEventFunctor<RheiaEnvironementManager>(this, RheiaFrameEventHandler(RheiaEnvironementManager::OnCloseFrame)));
}
Пример #3
0
void RheiaLoggerManager::InitializeEnvironment()
{
//    /*************************************************************************
//    * Create the log window
//    *************************************************************************/
//#if wxHAS_TEXT_WINDOW_STREAM
//    LogWindow = new wxTextCtrl( Book, wxID_ANY, _("This is the log window\n"), wxDefaultPosition,
//                                wxDefaultSize, wxNO_BORDER | wxTE_RICH | wxTE_READONLY | wxTE_MULTILINE );
//    redirector = new wxStreamToTextRedirector( LogWindow );
//#else
//    LogWindow = new wxStreamedTextCtrl( Book, wxID_ANY, _("This is the log window\n"), wxDefaultPosition,
//                                        wxDefaultSize, wxNO_BORDER | wxTE_RICH | wxTE_READONLY | wxTE_MULTILINE );
//    redirector = new wxStreamToTextRedirector( (wxStreamedTextCtrl*) LogWindow , std::cout );
//#endif
//    std::cout << "Standard cout stream redirected to the log window..." << std::endl;
//
//    // Set user profile book configuration
//    RheiaConfigurationManager *icfg = RheiaManager::Get()->GetConfigurationManager(_T("log_manager"));
//
//    /* Now sets the log font size */
//    int FontSize = (int) icfg->ReadInt(_T("/aspect/log_font_size"), 8);
//    wxTextCtrl *iText = LogWindow;
//    wxFont font = iText->GetFont();
//    font.SetPointSize( FontSize );
//    iText->SetFont( font );
//
//    for(size_t i = 0; i < max_logs; ++i)
//    {
//        slot[i].index = i;
//        slot[i].log = &g_null_log;
//    }
//
//    SetLog(new RheiaTextCtrlLogger, app_log);
//    SetLog(new RheiaStdoutLogger, stdout_log);
//    SetLog(new RheiaTextCtrlLogger, debug_log);
//    slot[app_log].title = _T("Rheia");
//    slot[debug_log].title = _T("Rheia Debug");
//    slot[stdout_log].title = _T("stdout");
//
//    wxString path = RheiaStandardPaths::DataDirectoryGlobal() + _T("/images/edit_16x16.png");
//    defaultBitmap = RheiaLoadBitmap(path, wxBITMAP_TYPE_PNG);
//
//    wxRegisterId(baseID + num_pages);
//    for(int i = 0; i < num_pages; ++i)
//    {
//        page[i] = Page();
//    }
//
//    wxWindow* log;
//
//    for(size_t i = app_log; i < ::max_logs; ++i)
//    {
//        if((log = Slot(i).GetLogger()->CreateControl(Book)))
//            AddLogger(Slot(i).GetLogger(), log, Slot(i).title, Slot(i).icon);
//    }
//
//    /*************************************************************************
//    * Add the log window to the page
//    *************************************************************************/
//    Book->AddPage( LogWindow , _("Logs") , false , defaultBitmap );

    /***
    *   Global loggers shall now be registered
    *   Create standard RheiaLoggers name Rheia Log, Rheia Debug Log
    */
    RheiaLogger* log = RheiaLoggerFactory::Get()->BuildLogger( wxT("TimeTextLogger") , wxT("Rheia Log") );

    if( log != NULL )
    {
        AddLogger(log,wxT("Rheia Log"));
        log->Log( wxT("Rheia Log initialized ...") , RheiaLogging::success );
        log->Log( wxT("You will find here all standard Rheia Logging Info ...") , RheiaLogging::info );
        SetActiveLogger( wxT("Rheia Log") );
    }

//#if defined( RHEIA_DEBUG ) || defined( _DEBUG )
    RheiaLogger* debuglog = RheiaLoggerFactory::Get()->BuildLogger( wxT("TimeTextLogger") , wxT("Rheia Debug Log") );

    if( debuglog != NULL )
    {
        AddLogger(debuglog,wxT("Rheia Debug Log"));
        debuglog->Log( wxT("Rheia Debug Log initialized ...") , RheiaLogging::success );
    }
//#endif
    if( m_parent )
	{
        m_parent->PushEventHandler( this );
		RheiaFrameEventsManager::Get(m_parent)->RegisterEventMethod(RheiaEVT_FRAME_CLOSING,
			new RheiaEventFunctor<RheiaLoggerManager>(this, RheiaFrameEventHandler(RheiaLoggerManager::OnCloseFrame)));
	}
}