summaryrefslogtreecommitdiffstats
path: root/grpc-proxy
diff options
context:
space:
mode:
Diffstat (limited to 'grpc-proxy')
-rw-r--r--grpc-proxy/agl_shell.proto8
-rw-r--r--grpc-proxy/grpc-async-cb.cpp12
-rw-r--r--grpc-proxy/grpc-async-cb.h4
-rw-r--r--grpc-proxy/shell.cpp9
-rw-r--r--grpc-proxy/shell.h1
5 files changed, 34 insertions, 0 deletions
diff --git a/grpc-proxy/agl_shell.proto b/grpc-proxy/agl_shell.proto
index 8e81750..f8a57d2 100644
--- a/grpc-proxy/agl_shell.proto
+++ b/grpc-proxy/agl_shell.proto
@@ -10,6 +10,7 @@ service AglShellManagerService {
rpc SetAppFloat(FloatRequest) returns (FloatResponse) {}
rpc AppStatusState(AppStateRequest) returns (stream AppStateResponse) {}
rpc GetOutputs(OutputRequest) returns (ListOutputResponse) {}
+ rpc SetAppNormal(NormalRequest) returns (NormalResponse) {}
}
message ActivateRequest {
@@ -62,3 +63,10 @@ message OutputResponse {
message ListOutputResponse {
repeated OutputResponse outputs = 1;
};
+
+message NormalRequest {
+ string app_id = 1;
+};
+
+message NormalResponse {
+};
diff --git a/grpc-proxy/grpc-async-cb.cpp b/grpc-proxy/grpc-async-cb.cpp
index 3754b3c..f7c114a 100644
--- a/grpc-proxy/grpc-async-cb.cpp
+++ b/grpc-proxy/grpc-async-cb.cpp
@@ -123,6 +123,18 @@ GrpcServiceImpl::SetAppFloat(grpc::CallbackServerContext *context,
}
grpc::ServerUnaryReactor *
+GrpcServiceImpl::SetAppNormal(grpc::CallbackServerContext *context,
+ const ::agl_shell_ipc::NormalRequest* request,
+ ::agl_shell_ipc::NormalResponse* /* response */)
+{
+ m_aglShell->SetAppNormal(request->app_id());
+
+ grpc::ServerUnaryReactor* reactor = context->DefaultReactor();
+ reactor->Finish(grpc::Status::OK);
+ return reactor;
+}
+
+grpc::ServerUnaryReactor *
GrpcServiceImpl::SetAppSplit(grpc::CallbackServerContext *context,
const ::agl_shell_ipc::SplitRequest* request,
::agl_shell_ipc::SplitResponse* /*response*/)
diff --git a/grpc-proxy/grpc-async-cb.h b/grpc-proxy/grpc-async-cb.h
index e6a19a6..214ce12 100644
--- a/grpc-proxy/grpc-async-cb.h
+++ b/grpc-proxy/grpc-async-cb.h
@@ -84,6 +84,10 @@ public:
const ::agl_shell_ipc::OutputRequest* /* request */,
::agl_shell_ipc::ListOutputResponse* response) override;
+ grpc::ServerUnaryReactor *SetAppNormal(grpc::CallbackServerContext *context,
+ const ::agl_shell_ipc::NormalRequest* request,
+ ::agl_shell_ipc::NormalResponse* /*response*/) override;
+
grpc::ServerWriteReactor< ::agl_shell_ipc::AppStateResponse>* AppStatusState(
::grpc::CallbackServerContext* /*context*/,
const ::agl_shell_ipc::AppStateRequest* /*request*/) override;
diff --git a/grpc-proxy/shell.cpp b/grpc-proxy/shell.cpp
index 83032b1..eb2e08b 100644
--- a/grpc-proxy/shell.cpp
+++ b/grpc-proxy/shell.cpp
@@ -77,6 +77,15 @@ Shell::SetAppFloat(const std::string &app_id, int32_t x_pos, int32_t y_pos)
}
void
+Shell::SetAppNormal(const std::string &app_id)
+{
+ struct agl_shell *shell = this->m_shell.get();
+
+ agl_shell_set_app_normal(shell, app_id.c_str());
+ wl_display_flush(m_shell_data->wl_display);
+}
+
+void
Shell::SetAppSplit(const std::string &app_id, uint32_t orientation)
{
(void) app_id;
diff --git a/grpc-proxy/shell.h b/grpc-proxy/shell.h
index 4059e0b..143599a 100644
--- a/grpc-proxy/shell.h
+++ b/grpc-proxy/shell.h
@@ -43,4 +43,5 @@ public:
void SetAppSplit(const std::string &app_id, uint32_t orientation);
void SetAppFloat(const std::string &app_id,
int32_t x_pos, int32_t y_pos);
+ void SetAppNormal(const std::string &app_id);
};