<commit_before>
#include "dispatcher.h"

namespace sdl
{

////////////////////////////////////////

dispatcher::dispatcher( void )
{
}

////////////////////////////////////////

dispatcher::~dispatcher( void )
{
}

////////////////////////////////////////

int dispatcher::execute( void )
{
	_exit_code = 0;

	bool done = false;
	while ( !done )
	{
		SDL_Event event;
		if ( SDL_WaitEvent( &event ) == 0 )
			throw std::runtime_error( SDL_GetError() );

		switch ( event.type )
		{
			case SDL_QUIT:
				done = true;
				break;
		}
	}

	return _exit_code;
}

////////////////////////////////////////

void dispatcher::exit( int code )
{
	_exit_code = code;

	SDL_Event event;
	event.type = SDL_QUIT;
	if ( SDL_PushEvent( &event) == 0 )
		throw std::runtime_error( SDL_GetError() );
}

////////////////////////////////////////

void dispatcher::add_window( const std::shared_ptr<window> &w )
{
	_windows[w->id()] = w;
}

////////////////////////////////////////

}

<commit_msg>Handle window resizing events.<commit_after>
#include "dispatcher.h"

namespace sdl
{

////////////////////////////////////////

dispatcher::dispatcher( void )
{
}

////////////////////////////////////////

dispatcher::~dispatcher( void )
{
}

////////////////////////////////////////

int dispatcher::execute( void )
{
	_exit_code = 0;

	bool done = false;
	while ( !done )
	{
		SDL_Event event;
		if ( SDL_WaitEvent( &event ) == 0 )
			throw std::runtime_error( SDL_GetError() );

		switch ( event.type )
		{
			case SDL_QUIT:
				done = true;
				break;

			case SDL_WINDOWEVENT:
				switch ( event.window.event )
				{
					case SDL_WINDOWEVENT_RESIZED:
						_windows[event.window.windowID]->resized( event.window.data1, event.window.data2 );
						break;
				}
		}
	}

	return _exit_code;
}

////////////////////////////////////////

void dispatcher::exit( int code )
{
	_exit_code = code;

	SDL_Event event;
	event.type = SDL_QUIT;
	if ( SDL_PushEvent( &event) == 0 )
		throw std::runtime_error( SDL_GetError() );
}

////////////////////////////////////////

void dispatcher::add_window( const std::shared_ptr<window> &w )
{
	_windows[w->id()] = w;
}

////////////////////////////////////////

}


{'fraction_non_alphanumeric': 0.3292067858780376, 'fraction_numerical': 0.0036680421824850985, 'mean_word_length': 1.4965675057208239, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '940117', 'n_tokens_mistral': 779, 'n_tokens_neox': 688, 'n_words': 135}