aboutsummaryrefslogtreecommitdiffstats
path: root/src/applist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/applist.cpp')
-rw-r--r--src/applist.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/applist.cpp b/src/applist.cpp
index 8c13f5f..bdb64a9 100644
--- a/src/applist.cpp
+++ b/src/applist.cpp
@@ -20,7 +20,6 @@
using std::shared_ptr;
using std::string;
-using std::unique_ptr;
using std::vector;
namespace wm
@@ -28,8 +27,8 @@ namespace wm
AppList::AppList()
: req_list(0),
- client_list(0),
- current_seq(1)
+ app2client(0),
+ current_req(1)
{
}
@@ -38,32 +37,32 @@ AppList::~AppList() {}
void AppList::addClient(const string &appid, const string &role)
{
shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, role);
- client_list[appid] = client;
- client_dump();
+ this->app2client[appid] = client;
+ this->clientDump();
}
void AppList::addClient(const std::string &appid, unsigned layer, unsigned surface, const std::string &role)
{
shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, layer, surface, role);
- client_list[appid] = client;
- client_dump();
+ this->app2client[appid] = client;
+ this->clientDump();
}
void AppList::removeClient(const string &appid)
{
- client_list.erase(appid);
+ this->app2client.erase(appid);
}
bool AppList::contains(const string &appid)
{
- auto result = client_list.find(appid);
- return (client_list.end() != result) ? true : false;
+ auto result = this->app2client.find(appid);
+ return (this->app2client.end() != result) ? true : false;
}
void AppList::removeSurface(unsigned surface_id){
// This function may be very slow
bool ret = false;
- for (auto &x : client_list)
+ for (auto &x : this->app2client)
{
ret = x.second->removeSurfaceIfExist(surface_id);
if(ret){
@@ -81,23 +80,23 @@ void AppList::removeSurface(unsigned surface_id){
*/
shared_ptr<WMClient> AppList::lookUpClient(const string &appid)
{
- return client_list.at(appid);
+ return this->app2client.at(appid);
}
int AppList::countClient()
{
- return client_list.size();
+ return this->app2client.size();
}
unsigned AppList::currentSequenceNumber()
{
- return current_seq;
+ return this->current_req;
}
// Is this function necessary ?
unsigned AppList::getSequenceNumber(const string &appid)
{
- for (const auto &x : req_list)
+ for (const auto &x : this->req_list)
{
// Since app will not request twice and more, comparing appid is enough?
if ((x.trigger.appid == appid))
@@ -110,27 +109,27 @@ unsigned AppList::getSequenceNumber(const string &appid)
unsigned AppList::addAllocateRequest(WMRequest req)
{
- if (req_list.size() == 0)
+ if (this->req_list.size() == 0)
{
- req.seq_num = current_seq;
+ req.seq_num = current_req;
}
else
{
- HMI_SEQ_DEBUG(current_seq, "real: %d", req_list.back().seq_num + 1);
- req.seq_num = req_list.back().seq_num + 1;
+ HMI_SEQ_DEBUG(this->current_req, "add: %d", this->req_list.back().seq_num + 1);
+ req.seq_num = this->req_list.back().seq_num + 1;
}
- req_list.push_back(req);
+ this->req_list.push_back(req);
return req.seq_num; // return 1; if you test time_expire
}
bool AppList::requestFinished()
{
- return req_list.empty();
+ return this->req_list.empty();
}
struct WMTrigger AppList::getRequest(unsigned req_num)
{
- for (auto &x : req_list)
+ for (auto &x : this->req_list)
{
if (req_num == x.seq_num)
{
@@ -141,7 +140,7 @@ struct WMTrigger AppList::getRequest(unsigned req_num)
const vector<struct WMAction> &AppList::getActions(unsigned req_num)
{
- for (auto &x : req_list)
+ for (auto &x : this->req_list)
{
if (req_num == x.seq_num)
{
@@ -153,7 +152,7 @@ const vector<struct WMAction> &AppList::getActions(unsigned req_num)
bool AppList::setAction(unsigned req_num, const struct WMAction &action)
{
bool result = false;
- for (auto &x : req_list)
+ for (auto &x : this->req_list)
{
if (req_num != x.seq_num)
{
@@ -176,7 +175,8 @@ bool AppList::setAction(unsigned req_num, const string &appid, const string &rol
{
continue;
}
- WMAction action{appid, role, area, visible, false};
+ bool edraw_f = false;
+ WMAction action{appid, role, area, visible, edraw_f};
x.sync_draw_req.push_back(action);
result = true;
@@ -206,7 +206,7 @@ bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const st
}
}
}
- req_dump();
+ this->reqDump();
return result;
}
@@ -242,30 +242,30 @@ bool AppList::endDrawFullfilled(unsigned req_num)
void AppList::removeRequest(unsigned req_seq)
{
- req_list.erase(remove_if(req_list.begin(), req_list.end(),
- [req_seq](WMRequest x) {
- return x.seq_num == req_seq;
- }));
+ this->req_list.erase(remove_if(this->req_list.begin(), this->req_list.end(),
+ [req_seq](WMRequest x) {
+ return x.seq_num == req_seq;
+ }));
}
void AppList::next()
{
- ++this->current_seq;
- if (0 == this->current_seq)
+ ++this->current_req;
+ if (0 == this->current_req)
{
- this->current_seq = 1;
+ this->current_req = 1;
}
}
bool AppList::haveRequest()
{
- return !req_list.empty();
+ return !this->req_list.empty();
}
-void AppList::client_dump()
+void AppList::clientDump()
{
DUMP("======= client dump =====");
- for (const auto &x : client_list)
+ for (const auto &x : this->app2client)
{
const auto &y = x.second;
y->dumpInfo();
@@ -273,10 +273,10 @@ void AppList::client_dump()
DUMP("======= client dump end=====");
}
-void AppList::req_dump()
+void AppList::reqDump()
{
DUMP("======= req dump =====");
- DUMP("current request : %d", current_seq);
+ DUMP("current request : %d", current_req);
for (const auto &x : req_list)
{
DUMP("requested with : %d", x.seq_num);