5 import java.util.Map;
\r
8 import javajs.awt.Font;
\r
9 import javajs.util.P3;
\r
11 public interface GenericPlatform extends FontManager {
\r
13 public final static int CURSOR_DEFAULT = 0;
\r
14 public final static int CURSOR_CROSSHAIR = 1;
\r
15 public final static int CURSOR_WAIT = 3;
\r
16 public final static int CURSOR_ZOOM = 8;
\r
17 public final static int CURSOR_HAND = 12;
\r
18 public final static int CURSOR_MOVE = 13;
\r
20 void setViewer(PlatformViewer vwr, Object display);
\r
24 boolean isHeadless();
\r
26 void convertPointFromScreen(Object display, P3 ptTemp);
\r
28 void getFullScreenDimensions(Object display, int[] widthHeight);
\r
30 boolean hasFocus(Object display);
\r
32 String prompt(String label, String data, String[] list, boolean asButtons);
\r
34 void repaint(Object display);
\r
36 void requestFocusInWindow(Object display);
\r
38 void setCursor(int i, Object display);
\r
40 void setTransparentCursor(Object display);
\r
44 GenericMouseInterface getMouseManager(double privateKey, Object display);
\r
46 ///// core Image handling
\r
48 Object allocateRgbImage(int windowWidth, int windowHeight, int[] pBuffer,
\r
49 int windowSize, boolean backgroundTransparent, boolean isImageWrite);
\r
51 void disposeGraphics(Object graphicForText);
\r
53 void drawImage(Object g, Object img, int x, int y, int width, int height);
\r
55 int[] drawImageToBuffer(Object gObj, Object imageOffscreen,
\r
56 Object image, int width, int height, int bgcolor);
\r
58 void flushImage(Object imagePixelBuffer);
\r
60 Object getStaticGraphics(Object image, boolean backgroundTransparent);
\r
62 Object getGraphics(Object image);
\r
64 int getImageWidth(Object image);
\r
66 int getImageHeight(Object image);
\r
68 Object newBufferedImage(Object image, int i, int height);
\r
70 Object newOffScreenImage(int w, int h);
\r
73 void renderScreenImage(Object g, Object currentSize);
\r
75 int[] getTextPixels(String text, Font font3d, Object gObj,
\r
76 Object image, int mapWidth, int height,
\r
79 ///// Image creation for export (optional for any platform)
\r
82 * can be ignored (return null) if platform cannot save images
\r
85 * @return null only if this platform cannot save images
\r
87 Object createImage(Object ret);
\r
99 int[] grabPixels(Object image, int width, int height,
\r
100 int[] pixels, int startRow, int nRows);
\r
103 * can be ignored (return false) if platform cannot save images
\r
105 * @param boolIsEcho
\r
107 * @return false only if this platform cannot save images
\r
108 * @throws InterruptedException
\r
110 boolean waitForDisplay(Object boolIsEcho, Object image) throws InterruptedException;
\r
112 GenericMenuInterface getMenuPopup(String menuStructure, char type);
\r
114 Object getJsObjectInfo(Object[] jsObject, String method, Object[] args);
\r
116 boolean isSingleThreaded();
\r
118 void notifyEndOfRendering();
\r
120 String getDateFormat(String isoType);
\r
122 GenericFileInterface newFile(String name);
\r
124 Object getBufferedFileInputStream(String name);
\r
129 * @param outputBytes
\r
132 * @return may be javajs.util.SB or byte[] or java.io.InputStream
\r
134 Object getURLContents(URL url, byte[] outputBytes, String post, boolean asString);
\r
136 String getLocalUrl(String fileName);
\r
138 GenericImageDialog getImageDialog(String title,
\r
139 Map<String, GenericImageDialog> imageMap);
\r