2 * MACDRV windowing driver
4 * Copyright 1996 Alexandre Julliard
5 * Copyright 1999 Patrik Stridvall
6 * Copyright 2011, 2012 Ken Thomases for CodeWeavers Inc.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #ifndef __WINE_MACDRV_H
24 #define __WINE_MACDRV_H
26 #ifndef __WINE_CONFIG_H
27 # error You must include config.h to use this header
30 #include "macdrv_cocoa.h"
34 #include "wine/debug.h"
35 #include "wine/gdi_driver.h"
38 static inline CGRect cgrect_from_rect(RECT rect)
40 if (rect.left >= rect.right || rect.top >= rect.bottom)
42 return CGRectMake(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
45 static inline RECT rect_from_cgrect(CGRect cgrect)
47 static const RECT empty;
49 if (!CGRectIsNull(cgrect))
51 RECT rect = { CGRectGetMinX(cgrect), CGRectGetMinY(cgrect),
52 CGRectGetMaxX(cgrect), CGRectGetMaxY(cgrect) };
59 static inline const char *wine_dbgstr_cgrect(CGRect cgrect)
61 return wine_dbg_sprintf("(%g,%g)-(%g,%g)", CGRectGetMinX(cgrect), CGRectGetMinY(cgrect),
62 CGRectGetMaxX(cgrect), CGRectGetMaxY(cgrect));
66 #endif /* __WINE_MACDRV_H */