package net.jselby.escapists.game.events.functions;

import net.jselby.escapists.game.events.Action;
import net.jselby.escapists.game.events.Expression;
import net.jselby.escapists.game.events.FunctionCollection;

/**
 * Full-screen / windowed functions.
 */
public class Windows extends FunctionCollection {
    @Action(subId = 53, id = 81)
    public void SetWindowed() {
        System.out.println("STUB: SetWindowed()");
    }

    @Action(subId = 38, id = 93)
    public void SetWindowNormal() {
        System.out.println("STUB: SetWindowNormal()");
    }

    @Action(subId = 38, id = 83)
    public void SetWindowWidth(int width) {
        System.out.println("STUB: SetWindowWidth()");
    }

    @Action(subId = 38, id = 84)
    public void SetWindowHeight(int height) {
        System.out.println("STUB: SetWindowHeight()");
    }

    @Action(subId = 38, id = 97)
    public void SetWindowPosition(int x, int y) {
        System.out.println("STUB: SetWindowPosition()");
    }

    @Expression(subId = 38, id = 84)
    public double GetScreenWidth() {
        System.out.println("STUB: GetScreenWidth()");
        return 0;
    }

    @Expression(subId = 38, id = 85)
    public double GetScreenHeight() {
        System.out.println("STUB: GetScreenHeight()");
        return 0;
    }
}

@@ -46,16 +46,43 @@
 tions;%0A%0A
+import com.badlogic.gdx.*;%0A
 import n
@@ -390,24 +390,200 @@
 indowed() %7B%0A
+        if (Gdx.graphics.supportsDisplayModeChange()) %7B%0A            Gdx.graphics.setDisplayMode(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);%0A        %7D else %7B%0A    
         Syst
@@ -590,37 +590,49 @@
 em.out.println(%22
-STUB:
+Platform rejected
  SetWindowed()%22)
@@ -629,24 +629,34 @@
 ndowed()%22);%0A
+        %7D%0A
     %7D%0A%0A    @
@@ -854,24 +854,204 @@
 nt width) %7B%0A
+        if (Gdx.graphics.supportsDisplayModeChange()) %7B%0A            Gdx.graphics.setDisplayMode(width, Gdx.graphics.getHeight(), Gdx.graphics.isFullscreen());%0A        %7D else %7B%0A    
         Syst
@@ -1058,37 +1058,49 @@
 em.out.println(%22
-STUB:
+Platform rejected
  SetWindowWidth(
@@ -1100,24 +1100,34 @@
 wWidth()%22);%0A
+        %7D%0A
     %7D%0A%0A    @
@@ -1196,24 +1196,204 @@
 t height) %7B%0A
+        if (Gdx.graphics.supportsDisplayModeChange()) %7B%0A            Gdx.graphics.setDisplayMode(Gdx.graphics.getWidth(), height, Gdx.graphics.isFullscreen());%0A        %7D else %7B%0A    
         Syst
@@ -1400,37 +1400,49 @@
 em.out.println(%22
-STUB:
+Platform rejected
  SetWindowHeight
@@ -1443,24 +1443,34 @@
 Height()%22);%0A
+        %7D%0A
     %7D%0A%0A    @
@@ -1651,38 +1651,35 @@
  84)%0A    public 
-double
+int
  GetScreenWidth(
@@ -1694,70 +1694,38 @@
     
-System.out.println(%22STUB: GetScreenWidth()%22);%0A        return 0
+return Gdx.graphics.getWidth()
 ;%0A  
@@ -1781,14 +1781,11 @@
 lic 
-double
+int
  Get
@@ -1813,71 +1813,39 @@
     
-System.out.println(%22STUB: GetScreenHeight()%22);%0A        return 0
+return Gdx.graphics.getHeight()
 ;%0A  

Implement Window functions