Debian Codegraph @

gdk/quartz/gdkdisplay-quartz.c

raw
1 /* gdkdisplay-quartz.c
2 *
3 * Copyright (C) 2005 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 #include "config.h"
22
23 #include "gdk.h"
24 #include "gdkprivate-quartz.h"
25 #include "gdkscreen-quartz.h"
26
27 GdkWindow *
28 gdk_display_get_default_group (GdkDisplay *display)
29 {
30 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
31
32 /* FIXME: Implement */
33
34 return NULL;
35 }
36
37 void
38 _gdk_windowing_set_default_display (GdkDisplay *display)
39 {
40 g_assert (display == NULL || _gdk_display == display);
41 }
42
43 GdkDisplay *
44 gdk_display_open (const gchar *display_name)
45 {
46 if (_gdk_display != NULL)
47 return NULL;
48
49 /* Initialize application */
50 [NSApplication sharedApplication];
51
52 _gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
53
54 _gdk_visual_init ();
55
56 _gdk_screen = _gdk_screen_quartz_new ();
57
58 _gdk_windowing_window_init ();
59
60 _gdk_events_init ();
61 _gdk_input_init ();
62
63 #if 0
64 /* FIXME: Remove the #if 0 when we have these functions */
65 _gdk_dnd_init ();
66 #endif
67
68 g_signal_emit_by_name (gdk_display_manager_get (),
69 "display_opened", _gdk_display);
70
71 return _gdk_display;
72 }
73
74 const gchar *
75 gdk_display_get_name (GdkDisplay *display)
76 {
77 static gchar *display_name = NULL;
78
79 if (!display_name)
80 {
81 GDK_QUARTZ_ALLOC_POOL;
82 display_name = g_strdup ([[[NSHost currentHost] name] UTF8String]);
83 GDK_QUARTZ_RELEASE_POOL;
84 }
85
86 return display_name;
87 }
88
89 int
90 gdk_display_get_n_screens (GdkDisplay *display)
91 {
92 g_return_val_if_fail (GDK_IS_DISPLAY (display), 0);
93
94 return 1;
95 }
96
97 GdkScreen *
98 gdk_display_get_screen (GdkDisplay *display,
99 gint screen_num)
100 {
101 g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
102 g_return_val_if_fail (screen_num == 0, NULL);
103
104 return _gdk_screen;
105 }
106
107 GdkScreen *
108 gdk_display_get_default_screen (GdkDisplay *display)
109 {
110 return _gdk_screen;
111 }
112
113 void
114 gdk_display_beep (GdkDisplay *display)
115 {
116 g_return_if_fail (GDK_IS_DISPLAY (display));
117
118 NSBeep();
119 }
120
121 gboolean
122 gdk_display_supports_selection_notification (GdkDisplay *display)
123 {
124 g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
125
126 /* FIXME: Implement */
127 return FALSE;
128 }
129
130 gboolean
131 gdk_display_request_selection_notification (GdkDisplay *display,
132 GdkAtom selection)
133
134 {
135 /* FIXME: Implement */
136 return FALSE;
137 }
138
139 gboolean
140 gdk_display_supports_clipboard_persistence (GdkDisplay *display)
141 {
142 /* FIXME: Implement */
143 return FALSE;
144 }
145
146 gboolean
147 gdk_display_supports_shapes (GdkDisplay *display)
148 {
149 /* FIXME: Implement */
150 return FALSE;
151 }
152
153 gboolean
154 gdk_display_supports_input_shapes (GdkDisplay *display)
155 {
156 /* FIXME: Implement */
157 return FALSE;
158 }
159
160 void
161 gdk_display_store_clipboard (GdkDisplay *display,
162 GdkWindow *clipboard_window,
163 guint32 time_,
164 const GdkAtom *targets,
165 gint n_targets)
166 {
167 /* FIXME: Implement */
168 }
169
170
171 gboolean
172 gdk_display_supports_composite (GdkDisplay *display)
173 {
174 /* FIXME: Implement */
175 return FALSE;
176 }
177
178 gulong
179 _gdk_windowing_window_get_next_serial (GdkDisplay *display)
180 {
181 return 0;
182 }