X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Futil.hpp;h=95407721b6329b136e9ed7def7e336de0f524422;hb=ceb1049ca57b0fd0ce41e9eca631557ffa46993a;hp=812a13053e32f25a86858ae7748d2972be8efe9e;hpb=5b1cf5616ef878e237d8fb7975b4839650c6d840;p=apps%2Fagl-service-windowmanager.git diff --git a/src/util.hpp b/src/util.hpp index 812a130..9540772 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2017 TOYOTA MOTOR CORPORATION + * Copyright (c) 2018 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +20,7 @@ #include #include +#include #include #include @@ -36,7 +38,7 @@ #define HMI_SEQ_INFO(seq_num, args,...) _HMI_SEQ_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__, __LINE__, seq_num, args, ##__VA_ARGS__) #define HMI_SEQ_DEBUG(seq_num, args,...) _HMI_SEQ_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__, __LINE__, seq_num, args, ##__VA_ARGS__) -#define DUMP(args, ...) _DUMP(LOG_LEVEL_DEBUG, args, ##__VA_ARGS__) +#define DUMP(args, ...) _DUMP(LOG_LEVEL_INFO, args, ##__VA_ARGS__) enum LOG_LEVEL{ LOG_LEVEL_NONE = 0, @@ -52,24 +54,15 @@ void _HMI_LOG(enum LOG_LEVEL level, const char* file, const char* func, const in void _HMI_SEQ_LOG(enum LOG_LEVEL level, const char* file, const char* func, const int line, unsigned seq_num, const char* log, ...); void _DUMP(enum LOG_LEVEL level, const char *log, ...); -/** - * @struct unique_fd - */ -struct unique_fd +struct rect { - int fd{-1}; - unique_fd() = default; - explicit unique_fd(int f) : fd{f} {} - operator int() const { return fd; } - ~unique_fd(); - unique_fd(unique_fd const &) = delete; - unique_fd &operator=(unique_fd const &) = delete; - unique_fd(unique_fd &&o) : fd(o.fd) { o.fd = -1; } - unique_fd &operator=(unique_fd &&o) - { - std::swap(this->fd, o.fd); - return *this; - } + int32_t w, h; + int32_t x, y; +}; + +struct size +{ + uint32_t w, h; }; class rectangle @@ -126,4 +119,18 @@ class rectangle long _bottom; }; -#endif // !WM_UTIL_HPP +// Configuration file path helper +std::string get_file_path(const char *file_name, const char *root_path = NULL); + +typedef struct ChangeAreaReq { + std::string appname; + std::unordered_map area_req; + bool save; + std::unordered_map update_app2area; + ChangeAreaReq() = default; + ~ChangeAreaReq() = default; + ChangeAreaReq(const ChangeAreaReq& val) = default; + void dump(); +} ChangeAreaReq; + +#endif // WM_UTIL_HPP