Ardour  9.0-pre0-350-gf17a656217
gdkprivate-quartz.h
Go to the documentation of this file.
1 /* gdkwindow-quartz.c
2  *
3  * Copyright (C) 2005-2007 Imendio AB
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 #ifndef __GDK_PRIVATE_QUARTZ_H__
22 #define __GDK_PRIVATE_QUARTZ_H__
23 
24 #define GDK_QUARTZ_ALLOC_POOL NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
25 #define GDK_QUARTZ_RELEASE_POOL [pool release]
26 
27 #include <gdk/gdkprivate.h>
30 #include <gdk/gdkquartz.h>
31 
32 #include <gdk/gdk.h>
33 
34 #include "gdkinternals.h"
35 
36 #include "config.h"
37 
38 #define GDK_TYPE_GC_QUARTZ (_gdk_gc_quartz_get_type ())
39 #define GDK_GC_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_QUARTZ, GdkGCQuartz))
40 #define GDK_GC_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_QUARTZ, GdkGCQuartzClass))
41 #define GDK_IS_GC_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_QUARTZ))
42 #define GDK_IS_GC_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_QUARTZ))
43 #define GDK_GC_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_QUARTZ, GdkGCQuartzClass))
44 
45 #define GDK_DRAG_CONTEXT_PRIVATE(context) ((GdkDragContextPrivate *) GDK_DRAG_CONTEXT (context)->windowing_data)
46 
47 typedef struct _GdkCursorPrivate GdkCursorPrivate;
48 typedef struct _GdkGCQuartz GdkGCQuartz;
49 typedef struct _GdkGCQuartzClass GdkGCQuartzClass;
51 
53 {
55 
57  GdkFunction function;
60 
61  gboolean have_clip_region;
62  gboolean have_clip_mask;
63  CGImageRef clip_mask;
64 
65  gint line_width;
69 
70  CGFloat *dash_lengths;
71  gint dash_count;
72  CGFloat dash_phase;
73 
74  CGPatternRef ts_pattern;
76 
77  guint is_window : 1;
78 };
79 
81 {
83 };
84 
86 {
87  GObjectClass parent_class;
88 };
89 
91 {
93  NSCursor *nscursor;
94 };
95 
97 {
98  id <NSDraggingInfo> dragging_info;
99 };
100 
101 extern GdkDisplay *_gdk_display;
102 extern GdkScreen *_gdk_screen;
103 extern GdkWindow *_gdk_root;
104 
106 
107 #define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindowObject *)win)->impl))
108 
109 /* Initialization */
112 void _gdk_events_init (void);
113 void _gdk_visual_init (void);
114 void _gdk_input_init (void);
116 
117 /* GC */
118 typedef enum {
121  GDK_QUARTZ_CONTEXT_TEXT = 1 << 2
123 
126  GdkGCValues *values,
127  GdkGCValuesMask values_mask);
129  GdkDrawable *drawable,
130  CGContextRef context,
132 
133 /* Colormap */
135  guint32 pixel);
136 
137 /* Window */
139  GdkWindow *window);
141  gint gdk_y,
142  gint *ns_x,
143  gint *ns_y);
145  gint ns_y,
146  gint *gdk_x,
147  gint *gdk_y);
149  gint *x,
150  gint *y);
152  gint x,
153  gint y);
159  gint number);
160 
162  GdkRectangle *rect);
164  GdkRegion *region);
165 
167 
168 /* Events */
169 typedef enum {
172 
174  gboolean got_focus);
177 
180 
182 
183 /* Event loop */
187 
188 /* FIXME: image */
190  GdkImage *image,
191  gint src_x,
192  gint src_y,
193  gint dest_x,
194  gint dest_y,
195  gint width,
196  gint height);
197 
198 /* Keys */
200 gboolean _gdk_quartz_keys_is_modifier (guint keycode);
202 
203 /* Drawable */
205 
206 /* Geometry */
208  gint dx,
209  gint dy);
211  GdkGC *gc,
212  GdkRegion *area,
213  gint dx,
214  gint dy);
216  GdkRegion *area);
217 
218 /* Pixmap */
220 
221 #endif /* __GDK_PRIVATE_QUARTZ_H__ */
typedefG_BEGIN_DECLS struct _GdkDragContext GdkDragContext
Definition: gdkdnd.h:38
GdkEventMask
Definition: gdkevents.h:166
GdkEventType
Definition: gdkevents.h:117
typedefG_BEGIN_DECLS struct _GdkGCValues GdkGCValues
Definition: gdkgc.h:39
GdkJoinStyle
Definition: gdkgc.h:114
GdkFunction
Definition: gdkgc.h:89
GdkSubwindowMode
Definition: gdkgc.h:133
GdkLineStyle
Definition: gdkgc.h:126
GdkGCValuesMask
Definition: gdkgc.h:139
GdkCapStyle
Definition: gdkgc.h:49
GdkDragContext * _gdk_quartz_drag_source_context
void _gdk_windowing_update_window_sizes(GdkScreen *screen)
gboolean _gdk_quartz_gc_update_cg_context(GdkGC *gc, GdkDrawable *drawable, CGContextRef context, GdkQuartzContextValuesMask mask)
void _gdk_quartz_window_gdk_xy_to_xy(gint gdk_x, gint gdk_y, gint *ns_x, gint *ns_y)
void _gdk_events_init(void)
CGColorRef _gdk_quartz_colormap_get_cgcolor_from_pixel(GdkDrawable *drawable, guint32 pixel)
NSEvent * _gdk_quartz_event_loop_get_pending(void)
void _gdk_quartz_window_queue_translation(GdkWindow *window, GdkGC *gc, GdkRegion *area, gint dx, gint dy)
GType _gdk_gc_quartz_get_type(void)
GdkWindow * _gdk_root
void _gdk_quartz_event_loop_init(void)
void _gdk_quartz_events_update_focus_window(GdkWindow *new_window, gboolean got_focus)
GdkWindow * _gdk_quartz_window_find_child(GdkWindow *window, gint x, gint y)
GdkScreen * _gdk_screen
void _gdk_quartz_drawable_finish(GdkDrawable *drawable)
void _gdk_quartz_window_set_needs_display_in_region(GdkWindow *window, GdkRegion *region)
void _gdk_quartz_window_xy_to_gdk_xy(gint ns_x, gint ns_y, gint *gdk_x, gint *gdk_y)
GdkQuartzContextValuesMask
@ GDK_QUARTZ_CONTEXT_STROKE
@ GDK_QUARTZ_CONTEXT_FILL
@ GDK_QUARTZ_CONTEXT_TEXT
void _gdk_quartz_window_scroll(GdkWindow *window, gint dx, gint dy)
void _gdk_quartz_window_update_position(GdkWindow *window)
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers(void)
void _gdk_quartz_event_loop_release_event(NSEvent *event)
void _gdk_visual_init(void)
void _gdk_quartz_window_did_resign_main(GdkWindow *window)
void _gdk_quartz_window_did_become_main(GdkWindow *window)
GdkEventMask _gdk_quartz_events_get_current_event_mask(void)
void _gdk_input_init(void)
GdkDisplay * _gdk_display
GdkEventType _gdk_quartz_keys_event_type(NSEvent *event)
GdkGC * _gdk_quartz_gc_new(GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask)
void _gdk_quartz_events_break_all_grabs(guint32 time)
void _gdk_quartz_window_nspoint_to_gdk_xy(NSPoint point, gint *x, gint *y)
gboolean _gdk_quartz_event_loop_check_pending(void)
void _gdk_quartz_synthesize_null_key_event(GdkWindow *window)
void _gdk_quartz_events_send_map_event(GdkWindow *window)
void _gdk_quartz_window_attach_to_parent(GdkWindow *window)
void _gdk_quartz_window_debug_highlight(GdkWindow *window, gint number)
gboolean _gdk_quartz_window_queue_antiexpose(GdkWindow *window, GdkRegion *area)
GdkQuartzEventSubType
@ GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
void _gdk_quartz_window_set_needs_display_in_rect(GdkWindow *window, GdkRectangle *rect)
CGImageRef _gdk_pixmap_get_cgimage(GdkPixmap *pixmap)
void _gdk_windowing_window_init(void)
GdkImage * _gdk_quartz_image_copy_to_image(GdkDrawable *drawable, GdkImage *image, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height)
gboolean _gdk_quartz_keys_is_modifier(guint keycode)
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers(void)
gboolean _gdk_quartz_window_is_ancestor(GdkWindow *ancestor, GdkWindow *window)
void _gdk_quartz_window_detach_from_parent(GdkWindow *window)
GdkModifierType
Definition: gdktypes.h:127
GtkImagePixmapData pixmap
Definition: gtkimage.h:0
GtkImageImageData image
Definition: gtkimage.h:1
PBD::PropertyDescriptor< bool > region
id< NSDraggingInfo > dragging_info
gboolean have_clip_region
gboolean have_clip_mask
CGImageRef clip_mask
CGFloat * dash_lengths
GdkLineStyle line_style
GdkCapStyle cap_style
GdkJoinStyle join_style
void * ts_pattern_info
CGPatternRef ts_pattern
gboolean graphics_exposures
GdkSubwindowMode subwindow_mode
Definition: gdkgc.h:190
GObjectClass parent_class
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1