libaurum: Re-arrange headers 59/260659/2
authorWoochanlee <wc0917.lee@samsung.com>
Wed, 30 Jun 2021 10:57:36 +0000 (19:57 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Wed, 30 Jun 2021 11:10:45 +0000 (11:10 +0000)
Divide interface, Combine Accessble, Move header to proper location etc...

Change-Id: I6c27896543ceca46cf61c57a746f2060e16ac4b5

libaurum/inc/Accessibility/Accessible.h [new file with mode: 0644]
libaurum/inc/Accessibility/AccessibleWatcher.h
libaurum/inc/Aurum.h
libaurum/inc/IDevice.h [deleted file]
libaurum/inc/ISearchable.h [deleted file]
libaurum/inc/Interface/IDevice.h [new file with mode: 0644]
libaurum/inc/Interface/ISearchable.h [new file with mode: 0644]
libaurum/inc/Misc/bitmask.h [new file with mode: 0644]
libaurum/inc/bitmask.h [deleted file]
libaurum/meson.build
libaurum/src/A11yEvent.cc

diff --git a/libaurum/inc/Accessibility/Accessible.h b/libaurum/inc/Accessibility/Accessible.h
new file mode 100644 (file)
index 0000000..3292ad8
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _ACCESSIBLE_H_
+#define _ACCESSIBLE_H_
+
+#include "AccessibleNode.h"
+#include "AccessibleUtils.h"
+#include "AccessibleWatcher.h"
+#include "AccessibleApplication.h"
+#include "AccessibleWindow.h"
+#include "IEventConsumer.h"
+#include "IEventSource.h"
+
+#endif /* _ACCESSIBLE_H_ */
index e695057289fdcfdb9a9cd5ad0cafae5a550572cb..d9869cdb4c755cb2aadf868c16b5f41ee41067ef 100644 (file)
@@ -1,6 +1,5 @@
 #pragma once
 
-
 #include "AccessibleApplication.h"
 #include "AccessibleWindow.h"
 #include "AccessibleNode.h"
index 2f46351ca283c60ea8a95c1a7cce93e74be44afa..76e7405473bb32e8cd37bfff7e41b587370ba98c 100644 (file)
 #include "Waiter.h"
 #include "ISearchable.h"
 #include "IDevice.h"
-#include "AccessibleNode.h"
-#include "AccessibleUtils.h"
-#include "AccessibleWatcher.h"
-#include "AccessibleApplication.h"
-#include "AccessibleWindow.h"
-#include "IEventConsumer.h"
-#include "IEventSource.h"
+#include "Accessible.h"
 #include "Point2D.h"
 #include "Rect.h"
 #include "PartialMatch.h"
diff --git a/libaurum/inc/IDevice.h b/libaurum/inc/IDevice.h
deleted file mode 100644 (file)
index fd97087..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#pragma once
-#include "config.h"
-
-#include <string>
-
-/**
- * @brief TimeRequestType enum class
- * @since_tizen 5.5
- */
-enum class TimeRequestType {
-    WALLCLOCK,
-    MONOTONIC,
-};
-
-/**
- * @brief KeyRequestType enum class
- * @since_tizen 5.5
- */
-enum class KeyRequestType {
-    STROKE,
-    LONG_STROKE,
-    PRESS,
-    RELEASE,
-};
-
-/**
- * @brief IDevice interface
- * @since_tizen 5.5
- */
-class IDevice {
-public:
-    /**
-     * @brief TBD virtual dtor
-     * @since_tizen 5.5
-     */
-    virtual ~IDevice() {}
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool click(const int x, const int y) = 0;
-
-    /**
-     * @brief TBD click method
-     * @since_tizen 5.5
-     */
-    virtual bool click(const int x, const int y, const unsigned int intv) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool drag(const int sx, const int sy, const int ex, const int ey,
-                      const int steps, const int durationMs) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual int touchDown(const int x, const int y) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool touchMove(const int x, const int y, const int seq) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool touchUp(const int x, const int y, const int seq) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-
-    virtual bool wheelUp(int amount, const int durationMs) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool wheelDown(int amount, const int durationMs) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressBack(KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressHome(KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressMenu(KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressVolUp(KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressVolDown(KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressPower(KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool pressKeyCode(std::string keycode, KeyRequestType type) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool takeScreenshot(std::string path, float scale, int quality) = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual long long getSystemTime(TimeRequestType type) = 0;
-};
\ No newline at end of file
diff --git a/libaurum/inc/ISearchable.h b/libaurum/inc/ISearchable.h
deleted file mode 100644 (file)
index 97d7c1b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#pragma once
-#include "config.h"
-
-#include "UiSelector.h"
-
-#include <memory>
-#include <vector>
-
-class UiObject;
-/**
- * @brief ISearchable interface
- * @since_tizen 5.5
- */
-class ISearchable {
-public:
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual ~ISearchable() {}
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual bool hasObject(const std::shared_ptr<UiSelector> selector) const = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual std::shared_ptr<UiObject> findObject(
-        const std::shared_ptr<UiSelector> selector) const = 0;
-
-    /**
-     * @brief TBD
-     * @since_tizen 5.5
-     */
-    virtual std::vector<std::shared_ptr<UiObject>> findObjects(
-        const std::shared_ptr<UiSelector> selector) const = 0;
-};
\ No newline at end of file
diff --git a/libaurum/inc/Interface/IDevice.h b/libaurum/inc/Interface/IDevice.h
new file mode 100644 (file)
index 0000000..fd97087
--- /dev/null
@@ -0,0 +1,141 @@
+#pragma once
+#include "config.h"
+
+#include <string>
+
+/**
+ * @brief TimeRequestType enum class
+ * @since_tizen 5.5
+ */
+enum class TimeRequestType {
+    WALLCLOCK,
+    MONOTONIC,
+};
+
+/**
+ * @brief KeyRequestType enum class
+ * @since_tizen 5.5
+ */
+enum class KeyRequestType {
+    STROKE,
+    LONG_STROKE,
+    PRESS,
+    RELEASE,
+};
+
+/**
+ * @brief IDevice interface
+ * @since_tizen 5.5
+ */
+class IDevice {
+public:
+    /**
+     * @brief TBD virtual dtor
+     * @since_tizen 5.5
+     */
+    virtual ~IDevice() {}
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool click(const int x, const int y) = 0;
+
+    /**
+     * @brief TBD click method
+     * @since_tizen 5.5
+     */
+    virtual bool click(const int x, const int y, const unsigned int intv) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool drag(const int sx, const int sy, const int ex, const int ey,
+                      const int steps, const int durationMs) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual int touchDown(const int x, const int y) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool touchMove(const int x, const int y, const int seq) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool touchUp(const int x, const int y, const int seq) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+
+    virtual bool wheelUp(int amount, const int durationMs) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool wheelDown(int amount, const int durationMs) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressBack(KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressHome(KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressMenu(KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressVolUp(KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressVolDown(KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressPower(KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool pressKeyCode(std::string keycode, KeyRequestType type) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool takeScreenshot(std::string path, float scale, int quality) = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual long long getSystemTime(TimeRequestType type) = 0;
+};
\ No newline at end of file
diff --git a/libaurum/inc/Interface/ISearchable.h b/libaurum/inc/Interface/ISearchable.h
new file mode 100644 (file)
index 0000000..97d7c1b
--- /dev/null
@@ -0,0 +1,42 @@
+#pragma once
+#include "config.h"
+
+#include "UiSelector.h"
+
+#include <memory>
+#include <vector>
+
+class UiObject;
+/**
+ * @brief ISearchable interface
+ * @since_tizen 5.5
+ */
+class ISearchable {
+public:
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual ~ISearchable() {}
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual bool hasObject(const std::shared_ptr<UiSelector> selector) const = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual std::shared_ptr<UiObject> findObject(
+        const std::shared_ptr<UiSelector> selector) const = 0;
+
+    /**
+     * @brief TBD
+     * @since_tizen 5.5
+     */
+    virtual std::vector<std::shared_ptr<UiObject>> findObjects(
+        const std::shared_ptr<UiSelector> selector) const = 0;
+};
\ No newline at end of file
diff --git a/libaurum/inc/Misc/bitmask.h b/libaurum/inc/Misc/bitmask.h
new file mode 100644 (file)
index 0000000..0dda2f6
--- /dev/null
@@ -0,0 +1,72 @@
+#pragma once
+#include <type_traits>
+
+template<typename E>
+struct enable_bitmask_operators{
+    static const bool enable=false;
+};
+
+#define enableEnumClassBitfield(E) template<> \
+        struct enable_bitmask_operators<E>{   \
+            static const bool enable=true;    \
+        }
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
+operator|(E lhs,E rhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    return static_cast<E>(
+        static_cast<underlying>(lhs) | static_cast<underlying>(rhs));
+}
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
+operator&(E lhs,E rhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    return static_cast<E>(
+        static_cast<underlying>(lhs) & static_cast<underlying>(rhs));
+}
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
+operator^(E lhs,E rhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    return static_cast<E>(
+        static_cast<underlying>(lhs) ^ static_cast<underlying>(rhs));
+}
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
+operator~(E lhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    return static_cast<E>(
+        ~static_cast<underlying>(lhs));
+}
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E&>
+operator|=(E& lhs,E rhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    lhs=static_cast<E>(
+        static_cast<underlying>(lhs) | static_cast<underlying>(rhs));
+    return lhs;
+}
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E&>
+operator&=(E& lhs,E rhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    lhs=static_cast<E>(
+        static_cast<underlying>(lhs) & static_cast<underlying>(rhs));
+    return lhs;
+}
+
+template<typename E>
+typename std::enable_if_t<enable_bitmask_operators<E>::enable,E&>
+operator^=(E& lhs,E rhs){
+    typedef typename std::underlying_type_t<E> underlying;
+    lhs=static_cast<E>(
+        static_cast<underlying>(lhs) ^ static_cast<underlying>(rhs));
+    return lhs;
+}
+
diff --git a/libaurum/inc/bitmask.h b/libaurum/inc/bitmask.h
deleted file mode 100644 (file)
index 0dda2f6..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#pragma once
-#include <type_traits>
-
-template<typename E>
-struct enable_bitmask_operators{
-    static const bool enable=false;
-};
-
-#define enableEnumClassBitfield(E) template<> \
-        struct enable_bitmask_operators<E>{   \
-            static const bool enable=true;    \
-        }
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
-operator|(E lhs,E rhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    return static_cast<E>(
-        static_cast<underlying>(lhs) | static_cast<underlying>(rhs));
-}
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
-operator&(E lhs,E rhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    return static_cast<E>(
-        static_cast<underlying>(lhs) & static_cast<underlying>(rhs));
-}
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
-operator^(E lhs,E rhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    return static_cast<E>(
-        static_cast<underlying>(lhs) ^ static_cast<underlying>(rhs));
-}
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E>
-operator~(E lhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    return static_cast<E>(
-        ~static_cast<underlying>(lhs));
-}
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E&>
-operator|=(E& lhs,E rhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    lhs=static_cast<E>(
-        static_cast<underlying>(lhs) | static_cast<underlying>(rhs));
-    return lhs;
-}
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E&>
-operator&=(E& lhs,E rhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    lhs=static_cast<E>(
-        static_cast<underlying>(lhs) & static_cast<underlying>(rhs));
-    return lhs;
-}
-
-template<typename E>
-typename std::enable_if_t<enable_bitmask_operators<E>::enable,E&>
-operator^=(E& lhs,E rhs){
-    typedef typename std::underlying_type_t<E> underlying;
-    lhs=static_cast<E>(
-        static_cast<underlying>(lhs) ^ static_cast<underlying>(rhs));
-    return lhs;
-}
-
index 257e6f4bf7611f87f2f743cda33fd1a7638b9a16..24d3c3b614b31a318f9aaa5e80f79ade61b50bbd 100644 (file)
@@ -7,18 +7,12 @@ libaurum_install_inc = [
   './inc/Sel.h',
   './inc/Until.h',
   './inc/Waiter.h',
-  './inc/ISearchable.h',
-  './inc/IDevice.h',
+  './inc/Interface/ISearchable.h',
+  './inc/Interface/IDevice.h',
   './inc/A11yEvent.h',
-  './inc/bitmask.h',
-  './inc/Accessibility/AccessibleNode.h',
-  './inc/Accessibility/AccessibleUtils.h',
-  './inc/Accessibility/AccessibleWatcher.h',
-  './inc/Accessibility/AccessibleApplication.h',
-  './inc/Accessibility/AccessibleWindow.h',
-  './inc/Accessibility/IEventConsumer.h',
-  './inc/Accessibility/IEventSource.h',
+  './inc/Accessibility/Accessible.h',
   './inc/Runnable/Runnable.h',
+  './inc/Misc/bitmask.h',
   './inc/Misc/Point2D.h',
   './inc/Misc/Rect.h',
   './inc/Aurum.h',
@@ -30,7 +24,8 @@ libaurum_inc = [
   include_directories('./inc/Impl'),
   include_directories('./inc/Impl/Accessibility'),
   include_directories('./inc/Misc'),
-  include_directories('./inc/Runnable/'),
+  include_directories('./inc/Runnable'),
+  include_directories('./inc/Interface'),
   root_inc,
   loguru_inc,
 ]
@@ -77,4 +72,3 @@ libaurum =  declare_dependency(link_with: libaurum_lib,
 
 install_headers(libaurum_install_inc,
 )
-
index 996fb33b5a6d0bb7a14dba4cc062bafc2c62f681..d4d0bed668b4235b0ae073e9287495d1a87aeb21 100644 (file)
@@ -1,6 +1,5 @@
-#include "A11yEvent.h"
-
 #include "Aurum.h"
+
 #include <unordered_map>
 
 A11yEventInfo::A11yEventInfo() : A11yEventInfo(A11yEvent::EVENT_NONE, nullptr, nullptr) {}