This commit is contained in:
GitHub Merge Button 2012-06-02 18:40:32 -07:00
commit 9018fa643e
1 changed files with 47 additions and 42 deletions

View File

@ -173,7 +173,7 @@ void displayImage(Image image, SimpleWindow win = null) {
auto p = win.draw; auto p = win.draw;
p.drawImage(Point(0, 0), image); p.drawImage(Point(0, 0), image);
} }
return win.eventLoop(0, win.eventLoop(0,
(int) { (int) {
win.close(); win.close();
} ); } );
@ -725,8 +725,8 @@ version(Windows) {
case WM_MBUTTONUP: case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK: case WM_MBUTTONDBLCLK:
mouse.type = 0; mouse.type = 0;
mouse.x = GET_X_LPARAM(lParam); mouse.x = LOWORD(lParam);
mouse.y = GET_Y_LPARAM(lParam); mouse.y = HIWORD(lParam);
mouse.buttonFlags = wParam; mouse.buttonFlags = wParam;
if(handleMouseEvent) if(handleMouseEvent)
@ -1409,18 +1409,23 @@ enum ColorMapNotification:int
struct _XPrivate {} struct _XPrivate {}
struct _XrmHashBucketRec {} struct _XrmHashBucketRec {}
typedef void* XPointer;
typedef void* XExtData; alias void* XPointer;
alias void* XExtData;
alias uint XID; alias uint XID;
typedef XID Window;
typedef XID Drawable; alias XID Window;
typedef XID Pixmap; alias XID Drawable;
alias XID Pixmap;
alias uint Atom; alias uint Atom;
alias bool Bool; alias bool Bool;
alias Display XDisplay; alias Display XDisplay;
typedef int ByteOrder;
typedef uint Time; alias int ByteOrder;
typedef void ScreenFormat; alias uint Time;
alias void ScreenFormat;
struct XImage { struct XImage {
int width, height; /* size of image */ int width, height; /* size of image */
@ -1479,8 +1484,8 @@ struct XKeyEvent
uint keycode; /* detail */ uint keycode; /* detail */
Bool same_screen; /* same screen flag */ Bool same_screen; /* same screen flag */
} }
typedef XKeyEvent XKeyPressedEvent; alias XKeyEvent XKeyPressedEvent;
typedef XKeyEvent XKeyReleasedEvent; alias XKeyEvent XKeyReleasedEvent;
struct XButtonEvent struct XButtonEvent
{ {
@ -1498,8 +1503,8 @@ struct XButtonEvent
uint button; /* detail */ uint button; /* detail */
Bool same_screen; /* same screen flag */ Bool same_screen; /* same screen flag */
} }
typedef XButtonEvent XButtonPressedEvent; alias XButtonEvent XButtonPressedEvent;
typedef XButtonEvent XButtonReleasedEvent; alias XButtonEvent XButtonReleasedEvent;
struct XMotionEvent{ struct XMotionEvent{
int type; /* of event */ int type; /* of event */
@ -1516,7 +1521,7 @@ struct XMotionEvent{
byte is_hint; /* detail */ byte is_hint; /* detail */
Bool same_screen; /* same screen flag */ Bool same_screen; /* same screen flag */
} }
typedef XMotionEvent XPointerMovedEvent; alias XMotionEvent XPointerMovedEvent;
struct XCrossingEvent{ struct XCrossingEvent{
int type; /* of event */ int type; /* of event */
@ -1539,8 +1544,8 @@ struct XCrossingEvent{
Bool focus; /* Boolean focus */ Bool focus; /* Boolean focus */
KeyOrButtonMask state; /* key or button mask */ KeyOrButtonMask state; /* key or button mask */
} }
typedef XCrossingEvent XEnterWindowEvent; alias XCrossingEvent XEnterWindowEvent;
typedef XCrossingEvent XLeaveWindowEvent; alias XCrossingEvent XLeaveWindowEvent;
struct XFocusChangeEvent{ struct XFocusChangeEvent{
int type; /* FocusIn or FocusOut */ int type; /* FocusIn or FocusOut */
@ -1557,8 +1562,8 @@ struct XFocusChangeEvent{
* NotifyPointerRoot, NotifyDetailNone * NotifyPointerRoot, NotifyDetailNone
*/ */
} }
typedef XFocusChangeEvent XFocusInEvent; alias XFocusChangeEvent XFocusInEvent;
typedef XFocusChangeEvent XFocusOutEvent; alias XFocusChangeEvent XFocusOutEvent;
Window XCreateSimpleWindow( Window XCreateSimpleWindow(
Display* /* display */, Display* /* display */,
Window /* parent */, Window /* parent */,
@ -1590,7 +1595,7 @@ Atom XInternAtom(
Bool /* only_if_exists */ Bool /* only_if_exists */
); );
typedef int Status; alias int Status;
enum EventMask:int enum EventMask:int
@ -2104,10 +2109,10 @@ struct Depth
Visual *visuals; /* list of visuals possible at this depth */ Visual *visuals; /* list of visuals possible at this depth */
} }
typedef void* GC; alias void* GC;
alias int VisualID; alias int VisualID;
typedef XID Colormap; alias XID Colormap;
typedef XID KeySym; alias XID KeySym;
alias uint KeyCode; alias uint KeyCode;
struct Screen{ struct Screen{