src/window.h in reflexion-0.1.22 vs src/window.h in reflexion-0.1.23
- old
+ new
@@ -2,27 +2,34 @@
#pragma once
#ifndef __REFLEX_SRC_WINDOW_H__
#define __REFLEX_SRC_WINDOW_H__
+#include <vector>
#include <map>
#include <xot/time.h>
#include <rays/point.h>
#include <rays/painter.h>
#include <reflex/window.h>
#include <reflex/view.h>
+#include "pointer.h"
namespace Reflex
{
+ enum {CAPTURE_ALL = INT_MAX};
+
+
struct Window::Data
{
- typedef std::map<View::Ref, bool> CapturingViews;
+ typedef std::vector<Pointer::ID> CaptureTargetIDList;
+ typedef std::map<View::Ref, CaptureTargetIDList> CaptureMap;
+
int hide_count = 1;
bool redraw = true;
Painter painter;
@@ -31,11 +38,11 @@
Point prev_position, prev_size;
double prev_time_update, prev_time_draw, prev_fps = 0;
- CapturingViews capturing_views;
+ CaptureMap captures;
Data ()
{
prev_time_update = prev_time_draw = Xot::time();
}
@@ -82,10 +89,22 @@
bool Window_is_resizable (const Window& window);
void Window_set_focus (Window* window, View* view);
- void Window_call_draw_event (Window* window, DrawEvent* event);
+ void Window_register_capture (
+ Window* window, View* view, Pointer::ID target = CAPTURE_ALL);
+
+ void Window_unregister_capture (
+ Window* window, View* view, Pointer::ID target = CAPTURE_ALL);
+
+ void Window_call_draw_event (Window* window, DrawEvent* event);
+
+ void Window_call_key_event (Window* window, KeyEvent* event);
+
+ void Window_call_pointer_event (Window* window, PointerEvent* event);
+
+ void Window_call_wheel_event (Window* window, WheelEvent* event);
float Window_get_pixel_density (const Window& window);
typedef View* (*Window_CreateRootViewFun) ();