usb_ecm: Use the current configuration instead of a fixed one.
[haiku.git] / src / servers / app / ClickTarget.h
blobead8ee9f6843647ea9ebebcb993ce5c1fca7d89c
1 /*
2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef CLICK_TARGET_H
6 #define CLICK_TARGET_H
9 #include <TokenSpace.h>
12 /*! \brief Identifies a mouse click target in the app server.
14 Used to discriminate between different targets in order to filter
15 multi-clicks. A click on a different target resets the click count.
17 struct ClickTarget {
18 public:
19 enum Type {
20 TYPE_INVALID,
21 TYPE_WINDOW_CONTENTS,
22 TYPE_WINDOW_DECORATOR
25 public:
26 ClickTarget()
28 fType(TYPE_INVALID),
29 fWindow(B_NULL_TOKEN),
30 fWindowElement(0)
34 ClickTarget(Type type, int32 window, int32 windowElement)
36 fType(type),
37 fWindow(window),
38 fWindowElement(windowElement)
42 bool IsValid() const
44 return fType != TYPE_INVALID;
47 Type GetType() const
49 return fType;
52 int32 WindowToken() const
54 return fWindow;
57 int32 WindowElement() const
59 return fWindowElement;
62 bool operator==(const ClickTarget& other) const
64 return fType == other.fType && fWindow == other.fWindow
65 && fWindowElement == other.fWindowElement;
68 bool operator!=(const ClickTarget& other) const
70 return !(*this == other);
73 private:
74 Type fType;
75 int32 fWindow;
76 int32 fWindowElement;
80 #endif // CLICK_TARGET_H