#include "platform_window.h"

#include "geometry/geometry.h"

void platform_window::on_resize(int width, int height) {
	const Eigen::Vector2i size(width, height);
	on_resize_delegate.broadcast(size);
}

void platform_window::on_move(const int x, const int y) {
	on_move_delegate.broadcast(Eigen::Vector2i(x, y));
}

void platform_window::handle_mouse_move(const Eigen::Vector2f& in_window_pos) {
	on_mouse_move_delegate.broadcast(in_window_pos);
}

void platform_window::handle_mouse_button_down(const Eigen::Vector2f& in_window_pos, mouse_button in_button) {
	on_mouse_button_down_delegate.broadcast(in_window_pos, in_button);
}

void platform_window::handle_mouse_button_up(const Eigen::Vector2f& in_window_pos, mouse_button in_button) {
	on_mouse_button_up_delegate.broadcast(in_window_pos, in_button);
}

void platform_window::handle_mouse_dbl_click(const Eigen::Vector2f& pos, mouse_button button) {
	on_mouse_button_dbl_delegate.broadcast(pos, button);
}

void platform_window::handle_mouse_wheel(const Eigen::Vector2f& pos, wheel_event delta) {
	on_mouse_wheel_delegate.broadcast(pos, delta);
}

void platform_window::handle_mouse_leave() {
	on_mouse_leave_delegate.broadcast();
}
