1 // Aseprite UI Library
2 // Copyright (C) 2001-2013, 2015  David Capello
3 //
4 // This file is released under the terms of the MIT license.
5 // Read LICENSE.txt for more information.
6 
7 #ifndef UI_HIT_TEST_EVENT_H_INCLUDED
8 #define UI_HIT_TEST_EVENT_H_INCLUDED
9 #pragma once
10 
11 #include "ui/event.h"
12 
13 namespace ui {
14 
15   enum HitTest {
16     HitTestNowhere,
17     HitTestCaption,
18     HitTestClient,
19     HitTestBorderNW,
20     HitTestBorderN,
21     HitTestBorderNE,
22     HitTestBorderE,
23     HitTestBorderSE,
24     HitTestBorderS,
25     HitTestBorderSW,
26     HitTestBorderW,
27   };
28 
29   class HitTestEvent : public Event {
30   public:
HitTestEvent(Component * source,const gfx::Point & point,HitTest hit)31     HitTestEvent(Component* source, const gfx::Point& point, HitTest hit)
32       : Event(source)
33       , m_point(point)
34       , m_hit(hit) { }
35 
point()36     gfx::Point point() const { return m_point; }
37 
hit()38     HitTest hit() const { return m_hit; }
setHit(HitTest hit)39     void setHit(HitTest hit) { m_hit = hit; }
40 
41   private:
42     gfx::Point m_point;
43     HitTest m_hit;
44   };
45 
46 } // namespace ui
47 
48 #endif  // UI_HIT_TEST_EVENT_H_INCLUDED
49