diff options
| author | Mike Wey | 2011-12-30 18:39:25 +0100 |
|---|---|---|
| committer | Mike Wey | 2011-12-30 18:39:25 +0100 |
| commit | 23a4423c025c42fc5131e090afe0df11112443df (patch) | |
| tree | 77b0ddff2a4adb43f0ef2f3b3ae7d602506bfb1e /dmagick/Image.d | |
| parent | c227153d3ff409a94bce49542da85ab0706daa09 (diff) | |
Add the windows display functionality.
Diffstat (limited to 'dmagick/Image.d')
| -rw-r--r-- | dmagick/Image.d | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/dmagick/Image.d b/dmagick/Image.d index a556fa0..6f1a8e4 100644 --- a/dmagick/Image.d +++ b/dmagick/Image.d @@ -25,6 +25,8 @@ import dmagick.ImageView; import dmagick.Options; import dmagick.Utils; +version(Windows) import dmagick.internal.Windows; + //Import all translated c headers. import dmagick.c.MagickCore; @@ -1180,37 +1182,8 @@ class Image { version(Windows) { - WNDCLASS wndclass; - HINSTANCE hInstance = cast(HINSTANCE) GetModuleHandle(null); - HWND hwnd; - MSG msg; - - wndclass.style = CS_HREDRAW | CS_VREDRAW; - wndclass.lpfnWndProc = &WndProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = 0; - wndclass.hInstance = hInstance; - wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); - wndclass.hbrBackground = null; - wndclass.lpszMenuName = "DMagick"w; - wndclass.lpszClassName = "DMagick"w; - - if (!RegisterClass(&wndclass)) - throw new DMagickException("This program requires Windows NT!"); - - hwnd = CreateWindow(cn, toStringz(title), WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, CW_USEDEFAULT, width, height, - null, null, hInstance, null); - - ShowWindow(hwnd, SW_SHOWNORMAL); - UpdateWindow(hwnd); - - while (GetMessage(&msg, NULL, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } + Window win = new Window(this); + win.display(); } else { |
