From: Woochanlee Date: Wed, 30 Jun 2021 10:57:36 +0000 (+0900) Subject: libaurum: Re-arrange headers X-Git-Tag: submit/tizen/20210706.064323~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F260659%2F2;p=platform%2Fcore%2Fuifw%2Faurum.git libaurum: Re-arrange headers Divide interface, Combine Accessble, Move header to proper location etc... Change-Id: I6c27896543ceca46cf61c57a746f2060e16ac4b5 --- diff --git a/libaurum/inc/Accessibility/Accessible.h b/libaurum/inc/Accessibility/Accessible.h new file mode 100644 index 0000000..3292ad8 --- /dev/null +++ b/libaurum/inc/Accessibility/Accessible.h @@ -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_ */ diff --git a/libaurum/inc/Accessibility/AccessibleWatcher.h b/libaurum/inc/Accessibility/AccessibleWatcher.h index e695057..d9869cd 100644 --- a/libaurum/inc/Accessibility/AccessibleWatcher.h +++ b/libaurum/inc/Accessibility/AccessibleWatcher.h @@ -1,6 +1,5 @@ #pragma once - #include "AccessibleApplication.h" #include "AccessibleWindow.h" #include "AccessibleNode.h" diff --git a/libaurum/inc/Aurum.h b/libaurum/inc/Aurum.h index 2f46351..76e7405 100644 --- a/libaurum/inc/Aurum.h +++ b/libaurum/inc/Aurum.h @@ -16,13 +16,7 @@ #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 index fd97087..0000000 --- a/libaurum/inc/IDevice.h +++ /dev/null @@ -1,141 +0,0 @@ -#pragma once -#include "config.h" - -#include - -/** - * @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 index 97d7c1b..0000000 --- a/libaurum/inc/ISearchable.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once -#include "config.h" - -#include "UiSelector.h" - -#include -#include - -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 selector) const = 0; - - /** - * @brief TBD - * @since_tizen 5.5 - */ - virtual std::shared_ptr findObject( - const std::shared_ptr selector) const = 0; - - /** - * @brief TBD - * @since_tizen 5.5 - */ - virtual std::vector> findObjects( - const std::shared_ptr 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 index 0000000..fd97087 --- /dev/null +++ b/libaurum/inc/Interface/IDevice.h @@ -0,0 +1,141 @@ +#pragma once +#include "config.h" + +#include + +/** + * @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 index 0000000..97d7c1b --- /dev/null +++ b/libaurum/inc/Interface/ISearchable.h @@ -0,0 +1,42 @@ +#pragma once +#include "config.h" + +#include "UiSelector.h" + +#include +#include + +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 selector) const = 0; + + /** + * @brief TBD + * @since_tizen 5.5 + */ + virtual std::shared_ptr findObject( + const std::shared_ptr selector) const = 0; + + /** + * @brief TBD + * @since_tizen 5.5 + */ + virtual std::vector> findObjects( + const std::shared_ptr 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 index 0000000..0dda2f6 --- /dev/null +++ b/libaurum/inc/Misc/bitmask.h @@ -0,0 +1,72 @@ +#pragma once +#include + +template +struct enable_bitmask_operators{ + static const bool enable=false; +}; + +#define enableEnumClassBitfield(E) template<> \ + struct enable_bitmask_operators{ \ + static const bool enable=true; \ + } + +template +typename std::enable_if_t::enable,E> +operator|(E lhs,E rhs){ + typedef typename std::underlying_type_t underlying; + return static_cast( + static_cast(lhs) | static_cast(rhs)); +} + +template +typename std::enable_if_t::enable,E> +operator&(E lhs,E rhs){ + typedef typename std::underlying_type_t underlying; + return static_cast( + static_cast(lhs) & static_cast(rhs)); +} + +template +typename std::enable_if_t::enable,E> +operator^(E lhs,E rhs){ + typedef typename std::underlying_type_t underlying; + return static_cast( + static_cast(lhs) ^ static_cast(rhs)); +} + +template +typename std::enable_if_t::enable,E> +operator~(E lhs){ + typedef typename std::underlying_type_t underlying; + return static_cast( + ~static_cast(lhs)); +} + +template +typename std::enable_if_t::enable,E&> +operator|=(E& lhs,E rhs){ + typedef typename std::underlying_type_t underlying; + lhs=static_cast( + static_cast(lhs) | static_cast(rhs)); + return lhs; +} + +template +typename std::enable_if_t::enable,E&> +operator&=(E& lhs,E rhs){ + typedef typename std::underlying_type_t underlying; + lhs=static_cast( + static_cast(lhs) & static_cast(rhs)); + return lhs; +} + +template +typename std::enable_if_t::enable,E&> +operator^=(E& lhs,E rhs){ + typedef typename std::underlying_type_t underlying; + lhs=static_cast( + static_cast(lhs) ^ static_cast(rhs)); + return lhs; +} + diff --git a/libaurum/inc/bitmask.h b/libaurum/inc/bitmask.h deleted file mode 100644 index 0dda2f6..0000000 --- a/libaurum/inc/bitmask.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once -#include - -template -struct enable_bitmask_operators{ - static const bool enable=false; -}; - -#define enableEnumClassBitfield(E) template<> \ - struct enable_bitmask_operators{ \ - static const bool enable=true; \ - } - -template -typename std::enable_if_t::enable,E> -operator|(E lhs,E rhs){ - typedef typename std::underlying_type_t underlying; - return static_cast( - static_cast(lhs) | static_cast(rhs)); -} - -template -typename std::enable_if_t::enable,E> -operator&(E lhs,E rhs){ - typedef typename std::underlying_type_t underlying; - return static_cast( - static_cast(lhs) & static_cast(rhs)); -} - -template -typename std::enable_if_t::enable,E> -operator^(E lhs,E rhs){ - typedef typename std::underlying_type_t underlying; - return static_cast( - static_cast(lhs) ^ static_cast(rhs)); -} - -template -typename std::enable_if_t::enable,E> -operator~(E lhs){ - typedef typename std::underlying_type_t underlying; - return static_cast( - ~static_cast(lhs)); -} - -template -typename std::enable_if_t::enable,E&> -operator|=(E& lhs,E rhs){ - typedef typename std::underlying_type_t underlying; - lhs=static_cast( - static_cast(lhs) | static_cast(rhs)); - return lhs; -} - -template -typename std::enable_if_t::enable,E&> -operator&=(E& lhs,E rhs){ - typedef typename std::underlying_type_t underlying; - lhs=static_cast( - static_cast(lhs) & static_cast(rhs)); - return lhs; -} - -template -typename std::enable_if_t::enable,E&> -operator^=(E& lhs,E rhs){ - typedef typename std::underlying_type_t underlying; - lhs=static_cast( - static_cast(lhs) ^ static_cast(rhs)); - return lhs; -} - diff --git a/libaurum/meson.build b/libaurum/meson.build index 257e6f4..24d3c3b 100644 --- a/libaurum/meson.build +++ b/libaurum/meson.build @@ -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, ) - diff --git a/libaurum/src/A11yEvent.cc b/libaurum/src/A11yEvent.cc index 996fb33..d4d0bed 100644 --- a/libaurum/src/A11yEvent.cc +++ b/libaurum/src/A11yEvent.cc @@ -1,6 +1,5 @@ -#include "A11yEvent.h" - #include "Aurum.h" + #include A11yEventInfo::A11yEventInfo() : A11yEventInfo(A11yEvent::EVENT_NONE, nullptr, nullptr) {}