Ken Thomases : winemac: Implement CreateDesktopWindow().
Alexandre Julliard
julliard at winehq.org
Tue Jan 8 13:58:43 CST 2013
Module: wine
Branch: master
Commit: bbb8c60c7effcf1a1bab3256bf7b718dc082e0f3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bbb8c60c7effcf1a1bab3256bf7b718dc082e0f3
Author: Ken Thomases <ken at codeweavers.com>
Date: Mon Jan 7 14:43:21 2013 -0600
winemac: Implement CreateDesktopWindow().
---
dlls/winemac.drv/Makefile.in | 3 +-
dlls/winemac.drv/gdi.c | 2 +-
dlls/winemac.drv/macdrv.h | 9 ++++-
dlls/winemac.drv/window.c | 73 +++++++++++++++++++++++++++++++++++++
dlls/winemac.drv/winemac.drv.spec | 1 +
5 files changed, 85 insertions(+), 3 deletions(-)
diff --git a/dlls/winemac.drv/Makefile.in b/dlls/winemac.drv/Makefile.in
index 08a5440..2082b37 100644
--- a/dlls/winemac.drv/Makefile.in
+++ b/dlls/winemac.drv/Makefile.in
@@ -5,7 +5,8 @@ EXTRALIBS = -framework AppKit
C_SRCS = \
display.c \
gdi.c \
- macdrv_main.c
+ macdrv_main.c \
+ window.c
OBJC_SRCS = \
cocoa_display.m
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c
index 176b588..333cb0c 100644
--- a/dlls/winemac.drv/gdi.c
+++ b/dlls/winemac.drv/gdi.c
@@ -99,7 +99,7 @@ static DWORD get_dpi(void)
*
* Returns the rectangle encompassing all the screens.
*/
-static CGRect macdrv_get_desktop_rect(void)
+CGRect macdrv_get_desktop_rect(void)
{
CGRect ret;
CGDirectDisplayID displayIDs[32];
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h
index 6b52ff1..2382809 100644
--- a/dlls/winemac.drv/macdrv.h
+++ b/dlls/winemac.drv/macdrv.h
@@ -3,7 +3,7 @@
*
* Copyright 1996 Alexandre Julliard
* Copyright 1999 Patrik Stridvall
- * Copyright 2011, 2012 Ken Thomases for CodeWeavers Inc.
+ * Copyright 2011, 2012, 2013 Ken Thomases for CodeWeavers Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -63,4 +63,11 @@ static inline const char *wine_dbgstr_cgrect(CGRect cgrect)
}
+/**************************************************************************
+ * Mac GDI driver
+ */
+
+extern CGRect macdrv_get_desktop_rect(void) DECLSPEC_HIDDEN;
+
+
#endif /* __WINE_MACDRV_H */
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c
new file mode 100644
index 0000000..a374742
--- /dev/null
+++ b/dlls/winemac.drv/window.c
@@ -0,0 +1,73 @@
+/*
+ * MACDRV windowing driver
+ *
+ * Copyright 1993, 1994, 1995, 1996, 2001 Alexandre Julliard
+ * Copyright 1993 David Metcalfe
+ * Copyright 1995, 1996 Alex Korobka
+ * Copyright 2011, 2012, 2013 Ken Thomases for CodeWeavers Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+
+#include "macdrv.h"
+#include "winuser.h"
+#include "wine/server.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(macdrv);
+
+
+/**********************************************************************
+ * CreateDesktopWindow (MACDRV.@)
+ */
+BOOL CDECL macdrv_CreateDesktopWindow(HWND hwnd)
+{
+ unsigned int width, height;
+
+ TRACE("%p\n", hwnd);
+
+ /* retrieve the real size of the desktop */
+ SERVER_START_REQ(get_window_rectangles)
+ {
+ req->handle = wine_server_user_handle(hwnd);
+ req->relative = COORDS_CLIENT;
+ wine_server_call(req);
+ width = reply->window.right;
+ height = reply->window.bottom;
+ }
+ SERVER_END_REQ;
+
+ if (!width && !height) /* not initialized yet */
+ {
+ CGRect rect = macdrv_get_desktop_rect();
+
+ SERVER_START_REQ(set_window_pos)
+ {
+ req->handle = wine_server_user_handle(hwnd);
+ req->previous = 0;
+ req->swp_flags = SWP_NOZORDER;
+ req->window.left = CGRectGetMinX(rect);
+ req->window.top = CGRectGetMinY(rect);
+ req->window.right = CGRectGetMaxX(rect);
+ req->window.bottom = CGRectGetMaxY(rect);
+ req->client = req->window;
+ wine_server_call(req);
+ }
+ SERVER_END_REQ;
+ }
+
+ return TRUE;
+}
diff --git a/dlls/winemac.drv/winemac.drv.spec b/dlls/winemac.drv/winemac.drv.spec
index 03fa490..7bea2e8c 100644
--- a/dlls/winemac.drv/winemac.drv.spec
+++ b/dlls/winemac.drv/winemac.drv.spec
@@ -4,5 +4,6 @@
# USER driver
+@ cdecl CreateDesktopWindow(long) macdrv_CreateDesktopWindow
@ cdecl EnumDisplayMonitors(long ptr ptr long) macdrv_EnumDisplayMonitors
@ cdecl GetMonitorInfo(long ptr) macdrv_GetMonitorInfo
More information about the wine-cvs
mailing list