]> Pileus Git - ~andy/gtk/blob - gdk/gdk.h
Remove gdk_*et_use_xshm() deprecated functions
[~andy/gtk] / gdk / gdk.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #ifndef __GDK_H__
28 #define __GDK_H__
29
30 #define __GDK_H_INSIDE__
31
32 #include <gdk/gdkapplaunchcontext.h>
33 #include <gdk/gdkcairo.h>
34 #include <gdk/gdkcolor.h>
35 #include <gdk/gdkcursor.h>
36 #include <gdk/gdkdevice.h>
37 #include <gdk/gdkdevicemanager.h>
38 #include <gdk/gdkdisplay.h>
39 #include <gdk/gdkdisplaymanager.h>
40 #include <gdk/gdkdnd.h>
41 #include <gdk/gdkdrawable.h>
42 #include <gdk/gdkenumtypes.h>
43 #include <gdk/gdkevents.h>
44 #include <gdk/gdkfont.h>
45 #include <gdk/gdkgc.h>
46 #include <gdk/gdkimage.h>
47 #include <gdk/gdkinput.h>
48 #include <gdk/gdkkeys.h>
49 #include <gdk/gdkpango.h>
50 #include <gdk/gdkpixbuf.h>
51 #include <gdk/gdkpixmap.h>
52 #include <gdk/gdkproperty.h>
53 #include <gdk/gdkregion.h>
54 #include <gdk/gdkrgb.h>
55 #include <gdk/gdkscreen.h>
56 #include <gdk/gdkselection.h>
57 #include <gdk/gdkspawn.h>
58 #include <gdk/gdktestutils.h>
59 #include <gdk/gdktypes.h>
60 #include <gdk/gdkvisual.h>
61 #include <gdk/gdkwindow.h>
62
63 #undef __GDK_H_INSIDE__
64
65 G_BEGIN_DECLS
66
67
68 /* Initialization, exit and events
69  */
70 #define   GDK_PRIORITY_EVENTS           (G_PRIORITY_DEFAULT)
71 void      gdk_enable_multidevice        (void);
72 void      gdk_parse_args                (gint           *argc,
73                                          gchar        ***argv);
74 void      gdk_init                      (gint           *argc,
75                                          gchar        ***argv);
76 gboolean  gdk_init_check                (gint           *argc,
77                                          gchar        ***argv);
78 void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
79 void gdk_pre_parse_libgtk_only          (void);
80
81 gchar*    gdk_set_locale                (void);
82
83 G_CONST_RETURN char *gdk_get_program_class (void);
84 void                 gdk_set_program_class (const char *program_class);
85
86 /* Push and pop error handlers for X errors
87  */
88 void      gdk_error_trap_push           (void);
89 gint      gdk_error_trap_pop            (void);
90
91 gchar*                    gdk_get_display               (void);
92 G_CONST_RETURN gchar*     gdk_get_display_arg_name      (void);
93
94 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
95 /* Used by gtk_input_add_full () */
96 gint gdk_input_add_full   (gint              source,
97                            GdkInputCondition condition,
98                            GdkInputFunction  function,
99                            gpointer          data,
100                            GDestroyNotify    destroy);
101 #endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
102 #ifndef GDK_DISABLE_DEPRECATED
103 gint gdk_input_add        (gint              source,
104                            GdkInputCondition condition,
105                            GdkInputFunction  function,
106                            gpointer          data);
107 void gdk_input_remove     (gint              tag);
108 #endif /* GDK_DISABLE_DEPRECATED */
109
110 #ifndef GDK_MULTIDEVICE_SAFE
111 GdkGrabStatus gdk_pointer_grab       (GdkWindow    *window,
112                                       gboolean      owner_events,
113                                       GdkEventMask  event_mask,
114                                       GdkWindow    *confine_to,
115                                       GdkCursor    *cursor,
116                                       guint32       time_);
117 GdkGrabStatus gdk_keyboard_grab      (GdkWindow    *window,
118                                       gboolean      owner_events,
119                                       guint32       time_);
120 #endif /* GDK_MULTIDEVICE_SAFE */
121
122 #ifndef GDK_MULTIHEAD_SAFE
123
124 #ifndef GDK_MULTIDEVICE_SAFE
125 void          gdk_pointer_ungrab     (guint32       time_);
126 void          gdk_keyboard_ungrab    (guint32       time_);
127 gboolean      gdk_pointer_is_grabbed (void);
128 #endif /* GDK_MULTIDEVICE_SAFE */
129
130 gint gdk_screen_width  (void) G_GNUC_CONST;
131 gint gdk_screen_height (void) G_GNUC_CONST;
132
133 gint gdk_screen_width_mm  (void) G_GNUC_CONST;
134 gint gdk_screen_height_mm (void) G_GNUC_CONST;
135
136 void gdk_beep (void);
137 #endif /* GDK_MULTIHEAD_SAFE */
138
139 void gdk_flush (void);
140
141 #ifndef GDK_MULTIHEAD_SAFE
142 void gdk_set_double_click_time             (guint       msec);
143 #endif
144
145 /* Rectangle utilities
146  */
147 gboolean gdk_rectangle_intersect (const GdkRectangle *src1,
148                                   const GdkRectangle *src2,
149                                   GdkRectangle       *dest);
150 void     gdk_rectangle_union     (const GdkRectangle *src1,
151                                   const GdkRectangle *src2,
152                                   GdkRectangle       *dest);
153
154 GType gdk_rectangle_get_type (void) G_GNUC_CONST;
155
156 #define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ())
157
158 /* Conversion functions between wide char and multibyte strings. 
159  */
160 #ifndef GDK_DISABLE_DEPRECATED
161 gchar     *gdk_wcstombs          (const GdkWChar   *src);
162 gint       gdk_mbstowcs          (GdkWChar         *dest,
163                                   const gchar      *src,
164                                   gint              dest_max);
165 #endif
166
167 /* Miscellaneous */
168 #ifndef GDK_MULTIHEAD_SAFE
169 gboolean gdk_event_send_client_message      (GdkEvent       *event,
170                                              GdkNativeWindow winid);
171 void     gdk_event_send_clientmessage_toall (GdkEvent  *event);
172 #endif
173 gboolean gdk_event_send_client_message_for_display (GdkDisplay *display,
174                                                     GdkEvent       *event,
175                                                     GdkNativeWindow winid);
176
177 void gdk_notify_startup_complete (void);
178
179 void gdk_notify_startup_complete_with_id (const gchar* startup_id);
180
181 /* Threading
182  */
183
184 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
185 GDKVAR GMutex *gdk_threads_mutex; /* private */
186 #endif
187
188 GDKVAR GCallback gdk_threads_lock;
189 GDKVAR GCallback gdk_threads_unlock;
190
191 void     gdk_threads_enter                    (void);
192 void     gdk_threads_leave                    (void);
193 void     gdk_threads_init                     (void);
194 void     gdk_threads_set_lock_functions       (GCallback enter_fn,
195                                                GCallback leave_fn);
196
197 guint    gdk_threads_add_idle_full            (gint           priority,
198                                                GSourceFunc    function,
199                                                gpointer       data,
200                                                GDestroyNotify notify);
201 guint    gdk_threads_add_idle                 (GSourceFunc    function,
202                                                gpointer       data);
203 guint    gdk_threads_add_timeout_full         (gint           priority,
204                                                guint          interval,
205                                                GSourceFunc    function,
206                                                gpointer       data,
207                                                GDestroyNotify notify);
208 guint    gdk_threads_add_timeout              (guint          interval,
209                                                GSourceFunc    function,
210                                                gpointer       data);
211 guint    gdk_threads_add_timeout_seconds_full (gint           priority,
212                                                guint          interval,
213                                                GSourceFunc    function,
214                                                gpointer       data,
215                                                GDestroyNotify notify);
216 guint    gdk_threads_add_timeout_seconds      (guint          interval,
217                                                GSourceFunc    function,
218                                                gpointer       data);
219
220 #ifdef  G_THREADS_ENABLED
221 #  define GDK_THREADS_ENTER()   G_STMT_START {  \
222       if (gdk_threads_lock)                     \
223         (*gdk_threads_lock) ();                 \
224    } G_STMT_END
225 #  define GDK_THREADS_LEAVE()   G_STMT_START {  \
226       if (gdk_threads_unlock)                   \
227         (*gdk_threads_unlock) ();               \
228    } G_STMT_END
229 #else   /* !G_THREADS_ENABLED */
230 #  define GDK_THREADS_ENTER()
231 #  define GDK_THREADS_LEAVE()
232 #endif  /* !G_THREADS_ENABLED */
233
234 G_END_DECLS
235
236
237 #endif /* __GDK_H__ */