Add SetAppScale example support
[src/window-management-client-grpc.git] / src / main.cpp
index 727bd27..6ab9530 100644 (file)
@@ -46,6 +46,8 @@ enum mode {
        FULLSCREEN = 2,
        FULLSCREEN_QT = 3,      //  rather than use rpc, use Qt API
        ON_OTHER_OUTPUTS = 4,
+       SET_FLOAT_POS   = 5,
+       SCALE   = 6,
 };
 
 static QWindow *
@@ -81,10 +83,16 @@ int main(int argc, char *argv[])
                        mmode = ON_OTHER_OUTPUTS;
                else if (strcmp(argv[1], "full_qt") == 0)
                        mmode = FULLSCREEN_QT;
+               else if (strcmp(argv[1], "position") == 0)
+                       mmode = SET_FLOAT_POS;
+               else if (strcmp(argv[1], "scale") == 0)
+                       mmode = SCALE;
                else
                        assert(!"Invalid mode");
 
-               if (mmode != FLOAT && mmode != FULLSCREEN && mmode != ON_OTHER_OUTPUTS) {
+               if (mmode != FLOAT && mmode != FULLSCREEN && 
+                   mmode != ON_OTHER_OUTPUTS && mmode != SET_FLOAT_POS &&
+                   mmode != SCALE) {
                        fprintf(stderr, "Will not use rpc\n");
                        goto skip;
                }
@@ -118,6 +126,20 @@ int main(int argc, char *argv[])
                        client->SetAppOnOutput(myname.toStdString(),
                                               std::string(output_name));
                        break;
+               case SET_FLOAT_POS:
+                       // this assumes the window is already running and
+                       // floating; uses the same application so this needs
+                       // to be first started as float.
+                       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;
                default:
                        break;
                }