comparison Applications/Generic/GuiAdapter.h @ 1029:0f100d0b9caf

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 04 Oct 2019 21:58:30 +0200
parents ac88989817e3
children 4383382db01d 2d8ab34c8c91
comparison
equal deleted inserted replaced
1028:6d5382fa45e1 1029:0f100d0b9caf
75 }; 75 };
76 76
77 77
78 enum GuiAdapterHidEventType 78 enum GuiAdapterHidEventType
79 { 79 {
80 GUIADAPTER_EVENT_MOUSEDOWN = 1973, 80 GUIADAPTER_EVENT_MOUSEDOWN = 1973,
81 GUIADAPTER_EVENT_MOUSEMOVE = 1974, 81 GUIADAPTER_EVENT_MOUSEMOVE = 1974,
82 GUIADAPTER_EVENT_MOUSEUP = 1975, 82 GUIADAPTER_EVENT_MOUSEDBLCLICK = 1975,
83 GUIADAPTER_EVENT_WHEEL = 1976, 83 GUIADAPTER_EVENT_MOUSEUP = 1976,
84 GUIADAPTER_EVENT_KEYDOWN = 1977, 84 GUIADAPTER_EVENT_WHEEL = 1977,
85 GUIADAPTER_EVENT_KEYUP = 1978, 85 GUIADAPTER_EVENT_KEYDOWN = 1978,
86 GUIADAPTER_EVENT_KEYUP = 1979,
86 }; 87 };
87 88
88 const unsigned int GUIADAPTER_DELTA_PIXEL = 2973; 89 const unsigned int GUIADAPTER_DELTA_PIXEL = 2973;
89 const unsigned int GUIADAPTER_DELTA_LINE = 2974; 90 const unsigned int GUIADAPTER_DELTA_LINE = 2974;
90 const unsigned int GUIADAPTER_DELTA_PAGE = 2975; 91 const unsigned int GUIADAPTER_DELTA_PAGE = 2975;
251 SDL: 252 SDL:
252 see https://wiki.libsdl.org/SDL_CaptureMouse 253 see https://wiki.libsdl.org/SDL_CaptureMouse
253 254
254 */ 255 */
255 256
256 void SetMouseDownCallback(std::string canvasId, void* userData, bool capture, OnMouseEventFunc func); 257 void SetMouseDownCallback (std::string canvasId, void* userData, bool capture, OnMouseEventFunc func);
257 void SetMouseMoveCallback(std::string canvasId, void* userData, bool capture, OnMouseEventFunc func); 258 void SetMouseDblClickCallback (std::string canvasId, void* userData, bool capture, OnMouseEventFunc func);
258 void SetMouseUpCallback (std::string canvasId, void* userData, bool capture, OnMouseEventFunc func); 259 void SetMouseMoveCallback (std::string canvasId, void* userData, bool capture, OnMouseEventFunc func);
259 void SetWheelCallback (std::string canvasId, void* userData, bool capture, OnMouseWheelFunc func); 260 void SetMouseUpCallback (std::string canvasId, void* userData, bool capture, OnMouseEventFunc func);
260 void SetKeyDownCallback (std::string canvasId, void* userData, bool capture, OnKeyDownFunc func); 261 void SetWheelCallback (std::string canvasId, void* userData, bool capture, OnMouseWheelFunc func);
261 void SetKeyUpCallback (std::string canvasId, void* userData, bool capture, OnKeyUpFunc func); 262 void SetKeyDownCallback (std::string canvasId, void* userData, bool capture, OnKeyDownFunc func);
263 void SetKeyUpCallback (std::string canvasId, void* userData, bool capture, OnKeyUpFunc func);
262 264
263 // if you pass "#window", under SDL, then any Window resize will trigger the callback 265 // if you pass "#window", under SDL, then any Window resize will trigger the callback
264 void SetResizeCallback (std::string canvasId, void* userData, bool capture, OnWindowResizeFunc func); 266 void SetResizeCallback (std::string canvasId, void* userData, bool capture, OnWindowResizeFunc func);
265 267
266 void RequestAnimationFrame(OnAnimationFrameFunc func, void* userData); 268 void RequestAnimationFrame(OnAnimationFrameFunc func, void* userData);
328 Func func; 330 Func func;
329 void* userData; 331 void* userData;
330 }; 332 };
331 std::vector<EventHandlerData<OnWindowResizeFunc> > resizeHandlers_; 333 std::vector<EventHandlerData<OnWindowResizeFunc> > resizeHandlers_;
332 std::vector<EventHandlerData<OnMouseEventFunc > > mouseDownHandlers_; 334 std::vector<EventHandlerData<OnMouseEventFunc > > mouseDownHandlers_;
335 std::vector<EventHandlerData<OnMouseEventFunc > > mouseDblCickHandlers_;
333 std::vector<EventHandlerData<OnMouseEventFunc > > mouseMoveHandlers_; 336 std::vector<EventHandlerData<OnMouseEventFunc > > mouseMoveHandlers_;
334 std::vector<EventHandlerData<OnMouseEventFunc > > mouseUpHandlers_; 337 std::vector<EventHandlerData<OnMouseEventFunc > > mouseUpHandlers_;
335 std::vector<EventHandlerData<OnMouseWheelFunc > > mouseWheelHandlers_; 338 std::vector<EventHandlerData<OnMouseWheelFunc > > mouseWheelHandlers_;
336 std::vector<EventHandlerData<OnKeyDownFunc > > keyDownHandlers_; 339 std::vector<EventHandlerData<OnKeyDownFunc > > keyDownHandlers_;
337 std::vector<EventHandlerData<OnKeyUpFunc > > keyUpHandlers_; 340 std::vector<EventHandlerData<OnKeyUpFunc > > keyUpHandlers_;