2005-11-22 10:03:32 +00:00
|
|
|
/* gdkwindow-quartz.c
|
|
|
|
*
|
2007-06-01 21:03:34 +00:00
|
|
|
* Copyright (C) 2005-2007 Imendio AB
|
2005-11-22 10:03:32 +00: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 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., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GDK_PRIVATE_QUARTZ_H__
|
|
|
|
#define __GDK_PRIVATE_QUARTZ_H__
|
|
|
|
|
|
|
|
#define GDK_QUARTZ_ALLOC_POOL NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
|
|
|
|
#define GDK_QUARTZ_RELEASE_POOL [pool release]
|
|
|
|
|
|
|
|
#include <gdk/gdkprivate.h>
|
|
|
|
#include <gdk/quartz/gdkwindow-quartz.h>
|
2010-06-27 08:32:12 +00:00
|
|
|
#include <gdk/quartz/gdkquartz.h>
|
2005-11-22 10:03:32 +00:00
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
|
|
|
|
#include "gdkinternals.h"
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2006-07-24 10:46:21 +00:00
|
|
|
|
2006-03-21 08:02:17 +00:00
|
|
|
#define GDK_DRAG_CONTEXT_PRIVATE(context) ((GdkDragContextPrivate *) GDK_DRAG_CONTEXT (context)->windowing_data)
|
|
|
|
|
2005-11-22 10:03:32 +00:00
|
|
|
typedef struct _GdkCursorPrivate GdkCursorPrivate;
|
2006-03-21 08:02:17 +00:00
|
|
|
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
|
2005-11-22 10:03:32 +00:00
|
|
|
|
|
|
|
struct _GdkVisualClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkCursorPrivate
|
|
|
|
{
|
|
|
|
GdkCursor cursor;
|
|
|
|
NSCursor *nscursor;
|
|
|
|
};
|
|
|
|
|
2006-03-21 08:02:17 +00:00
|
|
|
struct _GdkDragContextPrivate
|
|
|
|
{
|
|
|
|
id <NSDraggingInfo> dragging_info;
|
2010-06-29 11:10:44 +00:00
|
|
|
GdkDevice *device;
|
2006-03-21 08:02:17 +00:00
|
|
|
};
|
|
|
|
|
2005-11-22 10:03:32 +00:00
|
|
|
extern GdkDisplay *_gdk_display;
|
|
|
|
extern GdkScreen *_gdk_screen;
|
|
|
|
extern GdkWindow *_gdk_root;
|
|
|
|
|
2006-03-21 08:02:17 +00:00
|
|
|
extern GdkDragContext *_gdk_quartz_drag_source_context;
|
|
|
|
|
2010-12-06 13:13:40 +00:00
|
|
|
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindow *)win)->impl))
|
2009-01-07 13:08:02 +00:00
|
|
|
|
2005-11-22 10:03:32 +00:00
|
|
|
/* Initialization */
|
2009-10-26 08:20:28 +00:00
|
|
|
void _gdk_windowing_update_window_sizes (GdkScreen *screen);
|
2009-10-26 07:53:20 +00:00
|
|
|
void _gdk_windowing_window_init (void);
|
|
|
|
void _gdk_events_init (void);
|
2010-12-17 16:05:53 +00:00
|
|
|
void _gdk_quartz_visual_init (GdkScreen *screen);
|
2009-10-26 07:53:20 +00:00
|
|
|
void _gdk_input_init (void);
|
|
|
|
void _gdk_quartz_event_loop_init (void);
|
2005-11-22 10:03:32 +00:00
|
|
|
|
2007-04-06 21:12:48 +00:00
|
|
|
/* GC */
|
2006-09-21 17:05:33 +00:00
|
|
|
typedef enum {
|
|
|
|
GDK_QUARTZ_CONTEXT_STROKE = 1 << 0,
|
|
|
|
GDK_QUARTZ_CONTEXT_FILL = 1 << 1,
|
|
|
|
GDK_QUARTZ_CONTEXT_TEXT = 1 << 2
|
|
|
|
} GdkQuartzContextValuesMask;
|
|
|
|
|
2007-04-06 21:12:48 +00:00
|
|
|
/* Window */
|
2007-07-13 19:09:10 +00:00
|
|
|
gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor,
|
|
|
|
GdkWindow *window);
|
2009-10-25 20:36:56 +00:00
|
|
|
void _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x,
|
|
|
|
gint gdk_y,
|
|
|
|
gint *ns_x,
|
|
|
|
gint *ns_y);
|
|
|
|
void _gdk_quartz_window_xy_to_gdk_xy (gint ns_x,
|
|
|
|
gint ns_y,
|
|
|
|
gint *gdk_x,
|
|
|
|
gint *gdk_y);
|
|
|
|
void _gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point,
|
|
|
|
gint *x,
|
|
|
|
gint *y);
|
2007-05-28 20:42:51 +00:00
|
|
|
GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window,
|
|
|
|
gint x,
|
2010-05-25 22:38:44 +00:00
|
|
|
gint y,
|
|
|
|
gboolean get_toplevel);
|
2007-07-06 19:49:42 +00:00
|
|
|
void _gdk_quartz_window_attach_to_parent (GdkWindow *window);
|
|
|
|
void _gdk_quartz_window_detach_from_parent (GdkWindow *window);
|
2007-07-07 16:19:40 +00:00
|
|
|
void _gdk_quartz_window_did_become_main (GdkWindow *window);
|
|
|
|
void _gdk_quartz_window_did_resign_main (GdkWindow *window);
|
2008-03-31 13:15:15 +00:00
|
|
|
void _gdk_quartz_window_debug_highlight (GdkWindow *window,
|
|
|
|
gint number);
|
2007-04-06 21:12:48 +00:00
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
void _gdk_quartz_window_set_needs_display_in_region (GdkWindow *window,
|
2010-06-28 12:54:37 +00:00
|
|
|
cairo_region_t *region);
|
2009-09-20 13:27:14 +00:00
|
|
|
|
2009-10-26 08:20:28 +00:00
|
|
|
void _gdk_quartz_window_update_position (GdkWindow *window);
|
|
|
|
|
2007-04-06 21:12:48 +00:00
|
|
|
/* Events */
|
2008-02-24 17:45:29 +00:00
|
|
|
typedef enum {
|
2009-02-03 15:01:31 +00:00
|
|
|
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
|
2008-02-24 17:45:29 +00:00
|
|
|
} GdkQuartzEventSubType;
|
|
|
|
|
2007-07-13 19:09:10 +00:00
|
|
|
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
|
|
|
|
gboolean got_focus);
|
2009-01-16 19:34:56 +00:00
|
|
|
void _gdk_quartz_events_send_map_event (GdkWindow *window);
|
2007-04-06 21:12:48 +00:00
|
|
|
GdkEventMask _gdk_quartz_events_get_current_event_mask (void);
|
2006-08-15 20:13:13 +00:00
|
|
|
|
2010-01-03 14:27:53 +00:00
|
|
|
void _gdk_quartz_events_send_enter_notify_event (GdkWindow *window);
|
|
|
|
|
2007-04-06 21:12:48 +00:00
|
|
|
/* Event loop */
|
2007-12-10 19:00:23 +00:00
|
|
|
gboolean _gdk_quartz_event_loop_check_pending (void);
|
|
|
|
NSEvent * _gdk_quartz_event_loop_get_pending (void);
|
|
|
|
void _gdk_quartz_event_loop_release_event (NSEvent *event);
|
2007-04-06 21:12:48 +00:00
|
|
|
|
|
|
|
/* Keys */
|
|
|
|
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
|
|
|
|
gboolean _gdk_quartz_keys_is_modifier (guint keycode);
|
|
|
|
|
2008-06-27 17:06:06 +00:00
|
|
|
/* Geometry */
|
|
|
|
void _gdk_quartz_window_scroll (GdkWindow *window,
|
|
|
|
gint dx,
|
|
|
|
gint dy);
|
2010-07-24 08:52:37 +00:00
|
|
|
void _gdk_quartz_window_translate (GdkWindow *window,
|
|
|
|
cairo_region_t *area,
|
|
|
|
gint dx,
|
|
|
|
gint dy);
|
2009-01-07 13:08:02 +00:00
|
|
|
gboolean _gdk_quartz_window_queue_antiexpose (GdkWindow *window,
|
2010-06-28 12:54:37 +00:00
|
|
|
cairo_region_t *area);
|
2008-06-27 17:06:06 +00:00
|
|
|
|
2010-12-22 02:12:04 +00:00
|
|
|
void _gdk_quartz_window_set_startup_id (GdkWindow *window,
|
|
|
|
const gchar *startup_id);
|
|
|
|
void _gdk_quartz_window_register_dnd (GdkWindow *window);
|
2010-12-17 15:52:14 +00:00
|
|
|
GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window,
|
|
|
|
GdkDevice *device,
|
|
|
|
GList *targets);
|
|
|
|
|
2010-12-22 02:12:04 +00:00
|
|
|
|
2010-12-22 02:13:02 +00:00
|
|
|
void _gdk_quartz_display_sync (GdkDisplay *display);
|
|
|
|
void _gdk_quartz_display_flush (GdkDisplay *display);
|
|
|
|
GList * _gdk_quartz_display_list_devices (GdkDisplay *dpy);
|
|
|
|
|
2010-12-17 15:52:14 +00:00
|
|
|
GdkNativeWinodw _gdk_quartz_display_get_drag_get_protocol (GdkDisplay *display,
|
|
|
|
GdkNativeWindow *xid,
|
|
|
|
GdkDragProtocol *protocol,
|
|
|
|
guint version);
|
|
|
|
|
|
|
|
|
2010-12-22 02:13:02 +00:00
|
|
|
gboolean _gdk_quartz_display_send_client_message (GdkDisplay *display,
|
|
|
|
GdkEvent *event,
|
|
|
|
GdkNativeWindow winid);
|
|
|
|
void _gdk_quartz_display_add_client_message_filter (GdkDisplay *display,
|
|
|
|
GdkAtom message_type,
|
|
|
|
GdkFilterFunc func,
|
|
|
|
gpointer data);
|
|
|
|
|
2010-12-17 15:17:04 +00:00
|
|
|
GdkVisual * _gdk_quartz_screen_get_rgba_visual (GdkScreen *screen);
|
|
|
|
GdkVisual * _gdk_quartz_screen_get_system_visual (GdkScreen *screen);
|
|
|
|
gint _gdk_quartz_screen_visual_get_best_depth (GdkScreen *screen);
|
|
|
|
GdkVisualType _gdk_quartz_screen_visual_get_best_type (GdkScreen *screen);
|
|
|
|
GdkVisual * _gdk_quartz_screen_get_system_visual (GdkScreen *screen);
|
|
|
|
GdkVisual* _gdk_quartz_screen_visual_get_best (GdkScreen *screen);
|
|
|
|
GdkVisual* _gdk_quartz_screen_visual_get_best_with_depth (GdkScreen *screen,
|
|
|
|
gint depth);
|
|
|
|
GdkVisual* _gdk_quartz_screen_visual_get_best_with_type (GdkScreen *screen,
|
|
|
|
GdkVisualType visual_type);
|
|
|
|
GdkVisual* _gdk_quartz_screen_visual_get_best_with_both (GdkScreen *screen,
|
|
|
|
gint depth,
|
|
|
|
GdkVisualType visual_type);
|
|
|
|
void _gdk_quartz_screen_query_depths (GdkScreen *screen,
|
|
|
|
gint **depths,
|
|
|
|
gint *count);
|
|
|
|
void _gdk_quartz_screen_query_visual_types (GdkScreen *screen,
|
|
|
|
GdkVisualType **visual_types,
|
|
|
|
gint *count);
|
|
|
|
GList * _gdk_quartz_screen_list_visuals (GdkScreen *screen);
|
|
|
|
|
|
|
|
|
2010-12-17 14:50:21 +00:00
|
|
|
void _gdk_quartz_screen_broadcast_client_message (GdkScreen *screen,
|
|
|
|
GdkEvent *event);
|
|
|
|
gboolean _gdk_quartz_screen_get_setting (GdkScreen *screen,
|
|
|
|
const gchar *name,
|
|
|
|
GValue *value);
|
|
|
|
|
2010-12-22 02:13:02 +00:00
|
|
|
|
2005-11-22 10:03:32 +00:00
|
|
|
#endif /* __GDK_PRIVATE_QUARTZ_H__ */
|