simpledisplay
- void getClipboardText(SimpleWindow clipboardOwner, void delegate(in char[]) receiver);
- gets plain text from the clipboard
- void setClipboardText(SimpleWindow clipboardOwner, string text);
- copies some text to the clipboard
- void setPrimarySelection(SimpleWindow window, string text);
- Asserts ownership of PRIMARY and copies the text into a buffer that clients can request later
- enum Resizablity: int;
- When you create a SimpleWindow, you can see its resizability to be one of these via the constructor...
- fixedSize
- the window cannot be resized
- allowResizing
- the window can be resized. The buffer (if there is one) will automatically adjust size, but not stretch the contents. the windowResized delegate will be called so you can respond to the new size yourself.
- automaticallyScaleIfPossible
- if possible, your drawing buffer will remain the same size and simply be automatically scaled to the new window size. If this is impossible, it will not allow the user to resize the window at all. Note: window.width and window.height WILL be adjusted, which might throw you off if you draw based on them, so keep track of your expected width and height separately. That way, when it is scaled, things won't be thrown off.
- struct MouseEvent;
- Listen for this on your event listeners if you are interested in mouse
- struct Pen;
- This gives a few more options to drawing lines and such
- Color color;
- the foreground color
- int width;
- width of the line
- struct ScreenPainter;
- Most functions use the outlineColor instead of taking a color themselves.
- void drawEllipse(Point upperLeft, Point lowerRight);
- Arguments are the points of the bounding rectangle
- class Sprite;
- Sprites are optimized for fast drawing on the screen, but slow for direct pixel
access. They are best for drawing a relatively unchanging image repeatedly on the screen.
You create one by giving a window and an image. It optimizes for that window,
and copies the image into it to use as the initial picture. Creating a sprite
can be quite slow (especially over a network connection) so you should do it
as little as possible and just hold on to your sprite handles after making them.
Then you can use sprite.drawAt(painter, point); to draw it, which should be
a fast operation - much faster than drawing the Image itself every time.
FIXME:
you are supposed to be able to draw on these similarly to on windows.
- void flushGui();
- Flushes any pending gui buffers. Necessary if you are using with_eventloop with X - flush after you create your windows but before you call loop()
Page generated by Ddoc.