<commit_before>/************************************************************************
*
* Flood Project  (2008-201x)
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/

#include "WxPlatform.h"

FLD_NAMESPACE_BEGIN

//-----------------------------------//

WxPlatform::WxPlatform()
    : windowManager(this)
{
}

//-----------------------------------//

void WxPlatform::init()
{
    wxApp::SetInstance(new WxApp());

    if (!wxEntryStart(0, 0))
        return;

    wxTheApp->OnInit();

    wxImage::AddHandler( new wxPNGHandler() );
}

//-----------------------------------//

WxPlatform::~WxPlatform()
{
    wxTheApp->OnExit();
    wxEntryCleanup();
}

//-----------------------------------//

void WxPlatform::update()
{
    wxTheApp->OnRun();
}

//-----------------------------------//

WindowManager* WxPlatform::getWindowManager()
{
    return &windowManager;
}
<commit_msg>WxPlaftform now sets active event loop.<commit_after>/************************************************************************
*
* Flood Project  (2008-201x)
* Licensed under the simplified BSD license. All rights reserved.
*
************************************************************************/

#include "WxPlatform.h"
#include "wx/app.h"
#include "wx/evtloop.h"
#include "wx/apptrait.h"

FLD_NAMESPACE_BEGIN

//-----------------------------------//

WxPlatform::WxPlatform()
    : windowManager(this)
{
}

//-----------------------------------//

void WxPlatform::init()
{
    wxApp::SetInstance(new WxApp());

    if (!wxEntryStart(0, 0))
        return;

    wxTheApp->OnInit();

    wxEventLoopBase::SetActive(wxTheApp->GetTraits()->CreateEventLoop());

    wxImage::AddHandler( new wxPNGHandler() );
}

//-----------------------------------//

WxPlatform::~WxPlatform()
{
    wxTheApp->OnExit();
    wxEntryCleanup();
}

//-----------------------------------//

void WxPlatform::update()
{
    wxTheApp->OnRun();
}

//-----------------------------------//

WindowManager* WxPlatform::getWindowManager()
{
    return &windowManager;
}

{'fraction_non_alphanumeric': 0.4221698113207547, 'fraction_numerical': 0.008490566037735849, 'mean_word_length': 2.1237113402061856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2479177', 'n_tokens_mistral': 606, 'n_tokens_neox': 567, 'n_words': 92}