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();
}
void AppList::removeClient(const string &appid){
return req_list.empty();
}
-struct WMTrigger AppList::getRequest(unsigned request_seq){
+struct WMTrigger AppList::getRequest(unsigned req_num){
for(auto& x : req_list){
- if (request_seq == x.seq_num)
+ if (req_num == x.seq_num)
{
return x.trigger;
}
}
}
-const vector<struct WMAction>& AppList::getActions(unsigned request_seq){
+const vector<struct WMAction>& AppList::getActions(unsigned req_num){
for (auto &x : req_list)
{
- if (request_seq == x.seq_num)
+ if (req_num == x.seq_num)
{
return x.sync_draw_req;
}
}
}
-bool AppList::setAction(unsigned request_seq, const string &appid, const string &role, const string &area){
+bool AppList::setAction(unsigned req_num, const struct WMAction &action){
+ bool result = false;
+ for (auto &x : req_list)
+ {
+ if (req_num != x.seq_num)
+ {
+ continue;
+ }
+ x.sync_draw_req.push_back(action);
+ result = true;
+ break;
+ }
+
+ return result;
+}
+
+bool AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, bool visible){
bool result = false;
for (auto& x : req_list)
{
- if (request_seq != x.seq_num)
+ if (req_num != x.seq_num)
{
continue;
}
- WMAction action{appid, role, area, false};
+ WMAction action{appid, role, area, visible, false};
x.sync_draw_req.push_back(action);
result = true;
return result;
}
-bool AppList::setEndDrawFinished(unsigned request_seq, const string &appid, const string &role){
+bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const string &role){
bool result = false;
for (auto& x : req_list)
{
- if (request_seq < x.seq_num)
+ if (req_num < x.seq_num)
{
break;
}
- if (request_seq == x.seq_num)
+ if (req_num == x.seq_num)
{
for(auto& y : x.sync_draw_req){
if (y.appid == appid && y.role == role)
* @param unsigned sequence_num
* @return true if all action is set.
*/
-bool AppList::endDrawFullfilled(unsigned request_seq){
+bool AppList::endDrawFullfilled(unsigned req_num){
bool result = false;
for (const auto& x : req_list)
{
- if(request_seq < x.seq_num){
+ if(req_num < x.seq_num){
break;
}
- if(request_seq == x.seq_num){
+ if(req_num == x.seq_num){
result = true;
for(const auto& y : x.sync_draw_req){
result &= y.end_draw_finished;