2012-12-21 02:02:07 +01:00
|
|
|
/*
|
|
|
|
* MACDRV windowing driver
|
|
|
|
*
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
|
|
|
* Copyright 1999 Patrik Stridvall
|
2013-01-07 21:43:21 +01:00
|
|
|
* Copyright 2011, 2012, 2013 Ken Thomases for CodeWeavers Inc.
|
2012-12-21 02:02:07 +01:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_MACDRV_H
|
|
|
|
#define __WINE_MACDRV_H
|
|
|
|
|
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
|
|
|
|
2012-12-21 02:02:28 +01:00
|
|
|
#include "macdrv_cocoa.h"
|
2012-12-21 02:02:07 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "wine/gdi_driver.h"
|
|
|
|
|
|
|
|
|
2012-12-21 02:02:28 +01:00
|
|
|
static inline CGRect cgrect_from_rect(RECT rect)
|
|
|
|
{
|
|
|
|
if (rect.left >= rect.right || rect.top >= rect.bottom)
|
|
|
|
return CGRectNull;
|
|
|
|
return CGRectMake(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline RECT rect_from_cgrect(CGRect cgrect)
|
|
|
|
{
|
|
|
|
static const RECT empty;
|
|
|
|
|
|
|
|
if (!CGRectIsNull(cgrect))
|
|
|
|
{
|
|
|
|
RECT rect = { CGRectGetMinX(cgrect), CGRectGetMinY(cgrect),
|
|
|
|
CGRectGetMaxX(cgrect), CGRectGetMaxY(cgrect) };
|
|
|
|
return rect;
|
|
|
|
}
|
|
|
|
|
|
|
|
return empty;
|
|
|
|
}
|
|
|
|
|
2012-12-21 02:02:07 +01:00
|
|
|
static inline const char *wine_dbgstr_cgrect(CGRect cgrect)
|
|
|
|
{
|
|
|
|
return wine_dbg_sprintf("(%g,%g)-(%g,%g)", CGRectGetMinX(cgrect), CGRectGetMinY(cgrect),
|
|
|
|
CGRectGetMaxX(cgrect), CGRectGetMaxY(cgrect));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-01-07 21:43:21 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Mac GDI driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern CGRect macdrv_get_desktop_rect(void) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
|
2013-01-07 21:44:44 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Mac USER driver
|
|
|
|
*/
|
|
|
|
|
2013-01-15 03:23:58 +01:00
|
|
|
/* Mac driver private messages, must be in the range 0x80001000..0x80001fff */
|
|
|
|
enum macdrv_window_messages
|
|
|
|
{
|
|
|
|
WM_MACDRV_SET_WIN_REGION = 0x80001000,
|
|
|
|
};
|
|
|
|
|
2013-01-07 21:44:44 +01:00
|
|
|
/* macdrv private window data */
|
|
|
|
struct macdrv_win_data
|
|
|
|
{
|
|
|
|
HWND hwnd; /* hwnd that this private data belongs to */
|
|
|
|
macdrv_window cocoa_window;
|
|
|
|
RECT window_rect; /* USER window rectangle relative to parent */
|
|
|
|
RECT whole_rect; /* Mac window rectangle for the whole window relative to parent */
|
|
|
|
RECT client_rect; /* client area relative to parent */
|
2013-01-15 03:24:02 +01:00
|
|
|
COLORREF color_key; /* color key for layered window; CLR_INVALID is not color keyed */
|
2013-01-07 21:44:44 +01:00
|
|
|
BOOL on_screen : 1; /* is window ordered in? */
|
2013-01-15 03:23:58 +01:00
|
|
|
BOOL shaped : 1; /* is window using a custom region shape? */
|
2013-01-15 03:24:02 +01:00
|
|
|
BOOL layered : 1; /* is window layered and with valid attributes? */
|
|
|
|
BOOL per_pixel_alpha : 1; /* is window using per-pixel alpha? */
|
2013-01-15 03:23:55 +01:00
|
|
|
struct window_surface *surface;
|
2013-01-07 21:44:44 +01:00
|
|
|
};
|
|
|
|
|
2013-01-15 03:23:55 +01:00
|
|
|
extern RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp) DECLSPEC_HIDDEN;
|
2013-01-15 03:24:02 +01:00
|
|
|
extern struct window_surface *create_surface(macdrv_window window, const RECT *rect, BOOL use_alpha) DECLSPEC_HIDDEN;
|
2013-01-15 03:23:55 +01:00
|
|
|
extern void set_window_surface(macdrv_window window, struct window_surface *window_surface) DECLSPEC_HIDDEN;
|
2013-01-15 03:24:02 +01:00
|
|
|
extern void set_surface_use_alpha(struct window_surface *window_surface, BOOL use_alpha) DECLSPEC_HIDDEN;
|
2013-01-07 21:44:44 +01:00
|
|
|
|
2012-12-21 02:02:07 +01:00
|
|
|
#endif /* __WINE_MACDRV_H */
|