X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.cpp;h=3db6372f67f5202589de44fc47d435eeeccad5b0;hb=cb7aa009ef9873967152e716fb01fecc30d401f7;hp=ed809fe6d03315d15e9fe14cd9e4ec34ff090f32;hpb=21772bfc2d482248e2df5438039a70d5231bc993;p=src%2Fwindow-management-client-grpc.git diff --git a/src/main.cpp b/src/main.cpp index ed809fe..3db6372 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,6 +47,8 @@ enum mode { FULLSCREEN_QT = 3, // rather than use rpc, use Qt API ON_OTHER_OUTPUTS = 4, SET_FLOAT_POS = 5, + SCALE = 6, + SPLIT = 7, }; static QWindow * @@ -84,10 +86,16 @@ int main(int argc, char *argv[]) mmode = FULLSCREEN_QT; else if (strcmp(argv[1], "position") == 0) mmode = SET_FLOAT_POS; + else if (strcmp(argv[1], "scale") == 0) + mmode = SCALE; + else if (strcmp(argv[1], "split") == 0) + mmode = SPLIT; else assert(!"Invalid mode"); - if (mmode != FLOAT && mmode != FULLSCREEN && mmode != ON_OTHER_OUTPUTS && mmode != SET_FLOAT_POS) { + if (mmode != FLOAT && mmode != FULLSCREEN && + mmode != ON_OTHER_OUTPUTS && mmode != SET_FLOAT_POS && + mmode != SCALE && mmode != SPLIT) { fprintf(stderr, "Will not use rpc\n"); goto skip; } @@ -95,6 +103,9 @@ int main(int argc, char *argv[]) if (mmode == ON_OTHER_OUTPUTS) output_name = argv[2]; + if (mmode == SPLIT) + output_name = argv[2]; + // start grpc connection GrpcClient *client = new GrpcClient(); @@ -128,6 +139,18 @@ int main(int argc, char *argv[]) client->SetAppPosition(myname.toStdString(), 550, 550); exit(EXIT_SUCCESS); break; + case SCALE: + // this assumes the window is already running and + // floating; uses the same application so this needs + // to be first started as float. + client->SetAppScale(myname.toStdString(), 200, 200); + exit(EXIT_SUCCESS); + break; + case SPLIT: + // put it on the bottom + client->SetAppSplit(myname.toStdString(), 4, 0, 0, + std::string(output_name)); + break; default: break; }