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"
|
|
|
|
|
|
|
|
|
2013-07-02 08:25:32 +02:00
|
|
|
extern BOOL skip_single_buffer_flushes DECLSPEC_HIDDEN;
|
2013-07-02 08:25:50 +02:00
|
|
|
extern BOOL allow_vsync DECLSPEC_HIDDEN;
|
2013-07-09 00:36:49 +02:00
|
|
|
extern BOOL allow_set_gamma DECLSPEC_HIDDEN;
|
2013-10-21 23:37:05 +02:00
|
|
|
extern BOOL allow_software_rendering DECLSPEC_HIDDEN;
|
2013-11-21 21:47:57 +01:00
|
|
|
extern BOOL disable_window_decorations DECLSPEC_HIDDEN;
|
2013-10-21 11:31:10 +02:00
|
|
|
extern HMODULE macdrv_module DECLSPEC_HIDDEN;
|
2013-07-02 08:25:32 +02:00
|
|
|
|
|
|
|
|
2013-02-25 05:53:21 +01:00
|
|
|
extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
|
|
|
|
|
2012-12-21 02:02:28 +01:00
|
|
|
static inline CGRect cgrect_from_rect(RECT rect)
|
|
|
|
{
|
2013-08-21 00:00:27 +02:00
|
|
|
return CGRectMake(rect.left, rect.top, max(0, rect.right - rect.left), max(0, rect.bottom - rect.top));
|
2012-12-21 02:02:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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-04-22 04:32:26 +02:00
|
|
|
extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
|
|
|
|
|
2012-12-21 02:02:07 +01:00
|
|
|
|
2013-01-07 21:43:21 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* Mac GDI driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern CGRect macdrv_get_desktop_rect(void) DECLSPEC_HIDDEN;
|
2013-02-18 02:28:34 +01:00
|
|
|
extern void macdrv_reset_device_metrics(void) DECLSPEC_HIDDEN;
|
2013-03-18 04:41:07 +01:00
|
|
|
extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
|
2013-01-07 21:43:21 +01:00
|
|
|
|
|
|
|
|
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-02-18 02:28:34 +01:00
|
|
|
WM_MACDRV_UPDATE_DESKTOP_RECT,
|
|
|
|
WM_MACDRV_RESET_DEVICE_METRICS,
|
|
|
|
WM_MACDRV_DISPLAYCHANGE,
|
2013-04-24 23:10:10 +02:00
|
|
|
WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS,
|
2013-01-15 03:23:58 +01:00
|
|
|
};
|
|
|
|
|
2013-01-21 07:07:58 +01:00
|
|
|
struct macdrv_thread_data
|
|
|
|
{
|
|
|
|
macdrv_event_queue queue;
|
2013-01-21 07:08:08 +01:00
|
|
|
const macdrv_event *current_event;
|
2013-05-07 10:00:55 +02:00
|
|
|
macdrv_window capture_window;
|
2013-02-04 00:20:11 +01:00
|
|
|
CFDataRef keyboard_layout_uchr;
|
|
|
|
CGEventSourceKeyboardType keyboard_type;
|
|
|
|
int iso_keyboard;
|
2013-02-04 00:20:26 +01:00
|
|
|
CGEventFlags last_modifiers;
|
|
|
|
UInt32 dead_key_state;
|
2013-02-06 11:37:04 +01:00
|
|
|
HKL active_keyboard_layout;
|
2013-02-04 00:20:11 +01:00
|
|
|
WORD keyc2vkey[128];
|
|
|
|
WORD keyc2scan[128];
|
2013-01-21 07:07:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern DWORD thread_data_tls_index DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern struct macdrv_thread_data *macdrv_init_thread_data(void) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
static inline struct macdrv_thread_data *macdrv_thread_data(void)
|
|
|
|
{
|
|
|
|
return TlsGetValue(thread_data_tls_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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-03-06 11:59:07 +01:00
|
|
|
int pixel_format; /* pixel format for GL */
|
|
|
|
macdrv_view gl_view; /* view for GL */
|
|
|
|
RECT gl_rect; /* GL view rectangle relative to whole_rect */
|
2013-01-15 03:24:02 +01:00
|
|
|
COLORREF color_key; /* color key for layered window; CLR_INVALID is not color keyed */
|
2013-10-08 09:21:21 +02:00
|
|
|
unsigned int on_screen : 1; /* is window ordered in? (minimized or not) */
|
|
|
|
unsigned int shaped : 1; /* is window using a custom region shape? */
|
|
|
|
unsigned int layered : 1; /* is window layered and with valid attributes? */
|
|
|
|
unsigned int ulw_layered : 1; /* has UpdateLayeredWindow() been called for window? */
|
|
|
|
unsigned int per_pixel_alpha : 1; /* is window using per-pixel alpha? */
|
|
|
|
unsigned int minimized : 1; /* is window minimized? */
|
2013-01-15 03:23:55 +01:00
|
|
|
struct window_surface *surface;
|
2013-06-04 11:59:45 +02:00
|
|
|
struct window_surface *unminimized_surface;
|
2013-01-07 21:44:44 +01:00
|
|
|
};
|
|
|
|
|
2013-03-06 11:59:07 +01:00
|
|
|
extern struct macdrv_win_data *get_win_data(HWND hwnd) DECLSPEC_HIDDEN;
|
|
|
|
extern void release_win_data(struct macdrv_win_data *data) DECLSPEC_HIDDEN;
|
|
|
|
extern macdrv_window macdrv_get_cocoa_window(HWND hwnd, BOOL require_on_screen) DECLSPEC_HIDDEN;
|
2013-01-15 03:23:55 +01:00
|
|
|
extern RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp) DECLSPEC_HIDDEN;
|
2013-09-26 00:10:50 +02:00
|
|
|
extern void activate_on_following_focus(void) DECLSPEC_HIDDEN;
|
2013-03-29 05:34:06 +01:00
|
|
|
extern struct window_surface *create_surface(macdrv_window window, const RECT *rect,
|
|
|
|
struct window_surface *old_surface, 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-04-04 21:26:13 +02:00
|
|
|
extern void surface_clip_to_visible_rect(struct window_surface *window_surface, const RECT *visible_rect) DECLSPEC_HIDDEN;
|
2013-01-07 21:44:44 +01:00
|
|
|
|
2013-04-04 01:56:25 +02:00
|
|
|
extern void macdrv_handle_event(const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-03-11 04:58:26 +01:00
|
|
|
|
2013-01-21 07:08:12 +01:00
|
|
|
extern void macdrv_window_close_requested(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-10-10 21:22:08 +02:00
|
|
|
extern void macdrv_window_frame_changed(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-01-27 23:19:48 +01:00
|
|
|
extern void macdrv_window_got_focus(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-01-27 23:19:53 +01:00
|
|
|
extern void macdrv_window_lost_focus(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-01-27 23:19:56 +01:00
|
|
|
extern void macdrv_app_deactivated(void) DECLSPEC_HIDDEN;
|
2013-04-04 01:56:55 +02:00
|
|
|
extern void macdrv_app_quit_requested(const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-09-30 17:29:23 +02:00
|
|
|
extern void macdrv_window_minimize_requested(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-02-04 00:20:07 +01:00
|
|
|
extern void macdrv_window_did_unminimize(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-10-08 09:21:34 +02:00
|
|
|
extern void macdrv_window_brought_forward(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-11-01 01:16:42 +01:00
|
|
|
extern void macdrv_window_resize_ended(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-09-18 20:00:37 +02:00
|
|
|
extern BOOL query_resize_start(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-10-08 09:21:29 +02:00
|
|
|
extern BOOL query_min_max_info(HWND hwnd) DECLSPEC_HIDDEN;
|
2013-01-21 07:08:12 +01:00
|
|
|
|
2013-01-27 23:19:37 +01:00
|
|
|
extern void macdrv_mouse_button(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-02-07 02:32:26 +01:00
|
|
|
extern void macdrv_mouse_moved(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-02-11 02:09:12 +01:00
|
|
|
extern void macdrv_mouse_scroll(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-06-20 02:09:18 +02:00
|
|
|
extern void macdrv_release_capture(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-01-27 23:19:37 +01:00
|
|
|
|
2013-02-04 00:20:11 +01:00
|
|
|
extern void macdrv_compute_keyboard_layout(struct macdrv_thread_data *thread_data) DECLSPEC_HIDDEN;
|
2013-02-04 00:20:15 +01:00
|
|
|
extern void macdrv_keyboard_changed(const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-02-04 00:20:18 +01:00
|
|
|
extern void macdrv_key_event(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-09-26 00:10:37 +02:00
|
|
|
extern void macdrv_hotkey_press(const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-11-20 16:30:36 +01:00
|
|
|
extern HKL macdrv_get_hkl_from_source(TISInputSourceRef input_source) DECLSPEC_HIDDEN;
|
2013-02-04 00:20:11 +01:00
|
|
|
|
2013-02-18 02:28:34 +01:00
|
|
|
extern void macdrv_displays_changed(const macdrv_event *event) DECLSPEC_HIDDEN;
|
|
|
|
|
2013-03-11 04:58:03 +01:00
|
|
|
extern void macdrv_clipboard_process_attach(void) DECLSPEC_HIDDEN;
|
2013-03-11 04:58:51 +01:00
|
|
|
extern BOOL query_pasteboard_data(HWND hwnd, CFStringRef type) DECLSPEC_HIDDEN;
|
2013-03-13 22:53:32 +01:00
|
|
|
extern const char *debugstr_format(UINT id) DECLSPEC_HIDDEN;
|
|
|
|
extern HANDLE macdrv_get_pasteboard_data(CFTypeRef pasteboard, UINT desired_format) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL CDECL macdrv_pasteboard_has_format(CFTypeRef pasteboard, UINT desired_format) DECLSPEC_HIDDEN;
|
|
|
|
extern CFArrayRef macdrv_copy_pasteboard_formats(CFTypeRef pasteboard) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern BOOL query_drag_operation(macdrv_query* query) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL query_drag_exited(macdrv_query* query) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL query_drag_drop(macdrv_query* query) DECLSPEC_HIDDEN;
|
2013-03-11 04:58:03 +01:00
|
|
|
|
2013-03-06 11:59:07 +01:00
|
|
|
extern struct opengl_funcs *macdrv_wine_get_wgl_driver(PHYSDEV dev, UINT version) DECLSPEC_HIDDEN;
|
|
|
|
extern void sync_gl_view(struct macdrv_win_data *data) DECLSPEC_HIDDEN;
|
|
|
|
extern void set_gl_view_parent(HWND hwnd, HWND parent) DECLSPEC_HIDDEN;
|
|
|
|
|
2013-03-18 04:40:44 +01:00
|
|
|
extern CGImageRef create_cgimage_from_icon_bitmaps(HDC hdc, HANDLE icon, HBITMAP hbmColor,
|
|
|
|
unsigned char *color_bits, int color_size, HBITMAP hbmMask,
|
|
|
|
unsigned char *mask_bits, int mask_size, int width,
|
|
|
|
int height, int istep) DECLSPEC_HIDDEN;
|
2013-03-18 04:40:54 +01:00
|
|
|
extern CGImageRef create_cgimage_from_icon(HANDLE icon, int width, int height) DECLSPEC_HIDDEN;
|
2013-03-18 04:40:49 +01:00
|
|
|
extern CFArrayRef create_app_icon_images(void) DECLSPEC_HIDDEN;
|
2013-03-18 04:40:44 +01:00
|
|
|
|
2013-09-06 05:23:52 +02:00
|
|
|
extern void macdrv_status_item_mouse_button(const macdrv_event *event) DECLSPEC_HIDDEN;
|
|
|
|
extern void macdrv_status_item_mouse_move(const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-03-18 04:40:54 +01:00
|
|
|
|
2013-04-22 04:32:26 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Mac IME driver
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern BOOL macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *key_state,
|
|
|
|
void *himc) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern void macdrv_im_set_text(const macdrv_event *event) DECLSPEC_HIDDEN;
|
2013-05-16 23:48:39 +02:00
|
|
|
extern BOOL query_ime_char_rect(macdrv_query* query) DECLSPEC_HIDDEN;
|
2013-04-22 04:32:26 +02:00
|
|
|
|
2012-12-21 02:02:07 +01:00
|
|
|
#endif /* __WINE_MACDRV_H */
|