Code Review
/
apps
/
agl-service-windowmanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Change function according to 1476fb
[apps/agl-service-windowmanager.git]
/
src
/
applist.cpp
diff --git
a/src/applist.cpp
b/src/applist.cpp
index
66289ea
..
d0082dd
100644
(file)
--- a/
src/applist.cpp
+++ b/
src/applist.cpp
@@
-53,7
+53,7
@@
void AppList::removeClient(const string &appid)
this->app2client.erase(appid);
}
this->app2client.erase(appid);
}
-bool AppList::contains(const string &appid)
+bool AppList::contains(const string &appid)
const
{
auto result = this->app2client.find(appid);
return (this->app2client.end() != result) ? true : false;
{
auto result = this->app2client.find(appid);
return (this->app2client.end() != result) ? true : false;
@@
-83,25
+83,25
@@
shared_ptr<WMClient> AppList::lookUpClient(const string &appid)
return this->app2client.at(appid);
}
return this->app2client.at(appid);
}
-int AppList::countClient()
+int AppList::countClient()
const
{
return this->app2client.size();
}
{
return this->app2client.size();
}
-unsigned AppList::current
SequenceNumber()
+unsigned AppList::current
RequestNumber() const
{
return this->current_req;
}
// Is this function necessary ?
{
return this->current_req;
}
// Is this function necessary ?
-unsigned AppList::get
SequenceNumber(const string &appid)
+unsigned AppList::get
RequestNumber(const string &appid) const
{
for (const auto &x : this->req_list)
{
// Since app will not request twice and more, comparing appid is enough?
if ((x.trigger.appid == appid))
{
{
for (const auto &x : this->req_list)
{
// Since app will not request twice and more, comparing appid is enough?
if ((x.trigger.appid == appid))
{
- return x.
s
eq_num;
+ return x.
r
eq_num;
}
}
return 0;
}
}
return 0;
@@
-111,55
+111,55
@@
unsigned AppList::addAllocateRequest(WMRequest req)
{
if (this->req_list.size() == 0)
{
{
if (this->req_list.size() == 0)
{
- req.
s
eq_num = current_req;
+ req.
r
eq_num = current_req;
}
else
{
}
else
{
- HMI_SEQ_DEBUG(this->current_req, "add: %d", this->req_list.back().
s
eq_num + 1);
- req.
seq_num = this->req_list.back().s
eq_num + 1;
+ HMI_SEQ_DEBUG(this->current_req, "add: %d", this->req_list.back().
r
eq_num + 1);
+ req.
req_num = this->req_list.back().r
eq_num + 1;
}
this->req_list.push_back(req);
}
this->req_list.push_back(req);
- return req.
s
eq_num; // return 1; if you test time_expire
+ return req.
r
eq_num; // return 1; if you test time_expire
}
}
-
bool AppList::requestFinished(
)
+
struct WMTrigger AppList::getRequest(unsigned req_num, bool *found
)
{
{
- return this->req_list.empty();
-}
-
-struct WMTrigger AppList::getRequest(unsigned req_num)
-{
- for (auto &x : this->req_list)
+ *found = false;
+ for (const auto &x : this->req_list)
{
{
- if (req_num == x.
s
eq_num)
+ if (req_num == x.
r
eq_num)
{
{
+ *found = true;
return x.trigger;
}
}
return x.trigger;
}
}
+ return WMTrigger{"", "", "", Task::TASK_INVALID};
}
}
-const vector<struct WMAction> &AppList::getActions(unsigned req_num)
+const vector<struct WMAction> &AppList::getActions(unsigned req_num
, bool* found
)
{
{
+ *found = false;
for (auto &x : this->req_list)
{
for (auto &x : this->req_list)
{
- if (req_num == x.
s
eq_num)
+ if (req_num == x.
r
eq_num)
{
{
+ *found = true;
return x.sync_draw_req;
}
}
}
return x.sync_draw_req;
}
}
}
-
bool
AppList::setAction(unsigned req_num, const struct WMAction &action)
+
WMError
AppList::setAction(unsigned req_num, const struct WMAction &action)
{
{
-
bool result = false
;
+
WMError result = WMError::FAIL
;
for (auto &x : this->req_list)
{
for (auto &x : this->req_list)
{
- if (req_num != x.
s
eq_num)
+ if (req_num != x.
r
eq_num)
{
continue;
}
x.sync_draw_req.push_back(action);
{
continue;
}
x.sync_draw_req.push_back(action);
- result =
true
;
+ result =
WMError::SUCCESS
;
break;
}
break;
}
@@
-173,12
+173,12
@@
bool AppList::setAction(unsigned req_num, const struct WMAction &action)
* otherwise (visible is false) app should be invisible. Then enddraw_finished param is set to true.
* This function doesn't support actions for focus yet.
*/
* otherwise (visible is false) app should be invisible. Then enddraw_finished param is set to true.
* This function doesn't support actions for focus yet.
*/
-
bool
AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, bool visible)
+
WMError
AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, bool visible)
{
{
-
bool result = false
;
+
WMError result = WMError::NOT_REGISTERED
;
for (auto &x : req_list)
{
for (auto &x : req_list)
{
- if (req_num != x.
s
eq_num)
+ if (req_num != x.
r
eq_num)
{
continue;
}
{
continue;
}
@@
-186,22
+186,27
@@
bool AppList::setAction(unsigned req_num, const string &appid, const string &rol
WMAction action{appid, role, area, visible, edraw_f};
x.sync_draw_req.push_back(action);
WMAction action{appid, role, area, visible, edraw_f};
x.sync_draw_req.push_back(action);
- result =
true
;
+ result =
WMError::SUCCESS
;
break;
}
return result;
}
break;
}
return result;
}
+/**
+ * This function checks
+ * * req_num is equal to current request number
+ * * appid and role are equeal to the appid and role stored in action list(sync_draw_req)
+ */
bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const string &role)
{
bool result = false;
for (auto &x : req_list)
{
bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const string &role)
{
bool result = false;
for (auto &x : req_list)
{
- if (req_num < x.
s
eq_num)
+ if (req_num < x.
r
eq_num)
{
break;
}
{
break;
}
- if (req_num == x.
s
eq_num)
+ if (req_num == x.
r
eq_num)
{
for (auto &y : x.sync_draw_req)
{
{
for (auto &y : x.sync_draw_req)
{
@@
-219,7
+224,7
@@
bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const st
/**
* @brief check all actions of the requested sequence is finished
/**
* @brief check all actions of the requested sequence is finished
- * @param unsigned
sequence_num
+ * @param unsigned
request_number
* @return true if all action is set.
*/
bool AppList::endDrawFullfilled(unsigned req_num)
* @return true if all action is set.
*/
bool AppList::endDrawFullfilled(unsigned req_num)
@@
-227,11
+232,11
@@
bool AppList::endDrawFullfilled(unsigned req_num)
bool result = false;
for (const auto &x : req_list)
{
bool result = false;
for (const auto &x : req_list)
{
- if (req_num < x.
s
eq_num)
+ if (req_num < x.
r
eq_num)
{
break;
}
{
break;
}
- if (req_num == x.
s
eq_num)
+ if (req_num == x.
r
eq_num)
{
result = true;
for (const auto &y : x.sync_draw_req)
{
result = true;
for (const auto &y : x.sync_draw_req)
@@
-247,11
+252,11
@@
bool AppList::endDrawFullfilled(unsigned req_num)
return result;
}
return result;
}
-void AppList::removeRequest(unsigned req_
seq
)
+void AppList::removeRequest(unsigned req_
num
)
{
this->req_list.erase(remove_if(this->req_list.begin(), this->req_list.end(),
{
this->req_list.erase(remove_if(this->req_list.begin(), this->req_list.end(),
- [req_
seq
](WMRequest x) {
- return x.
seq_num == req_seq
;
+ [req_
num
](WMRequest x) {
+ return x.
req_num == req_num
;
}));
}
}));
}
@@
-264,7
+269,7
@@
void AppList::next()
}
}
}
}
-bool AppList::haveRequest()
+bool AppList::haveRequest()
const
{
return !this->req_list.empty();
}
{
return !this->req_list.empty();
}
@@
-286,7
+291,7
@@
void AppList::reqDump()
DUMP("current request : %d", current_req);
for (const auto &x : req_list)
{
DUMP("current request : %d", current_req);
for (const auto &x : req_list)
{
- DUMP("requested with : %d", x.
s
eq_num);
+ DUMP("requested with : %d", x.
r
eq_num);
DUMP("Trigger : (APPID :%s, ROLE :%s, AREA :%s, TASK: %d)",
x.trigger.appid.c_str(),
x.trigger.role.c_str(),
DUMP("Trigger : (APPID :%s, ROLE :%s, AREA :%s, TASK: %d)",
x.trigger.appid.c_str(),
x.trigger.role.c_str(),